Skip to content

Instantly share code, notes, and snippets.

View gnodet's full-sized avatar

Guillaume Nodet gnodet

  • Red Hat
  • Caen, France
View GitHub Profile
protected static ThreadLocal<Map<String,?>> params;
public static void setParams(Map<String, ?> params) {
AbstractKarafLoginModule.params.set(params);
}
diff --git a/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/Config.java b/jaas/config/src/main/java/org/apache/karaf/jaas/co
index ad2b067..7af2bfd 100644
--- a/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/Config.java
+++ b/jaas/config/src/main/java/org/apache/karaf/jaas/config/impl/Config.java
@@ -76,6 +76,7 @@ public class Config implements JaasRealm {
AppConfigurationEntry[] entries = new AppConfigurationEntry[modules.length];
for (int i = 0; i < modules.length; i++) {
Map<String,Object> options = new HashMap<String,Object>();
+ options.put(BundleContext.class.getName(), bundleContext);
if (modules[i].getOptions() != null) {
<!-- Allow the use of system properties -->
<ext:property-placeholder placeholder-prefix="$[" placeholder-suffix="]"/>
<!-- Property place holder -->
<cm:property-placeholder persistent-id="org.apache.karaf.management">
<cm:default-properties>
<cm:property name="rmiRegistryPort" value="1099"/>
<cm:property name="jmxRealm" value="karaf"/>
<cm:property name="serviceUrl" value="service:jmx:rmi:///jndi/rmi://localhost:1099/karaf-$[karaf.name]"/>
<cm:property name="daemon" value="true"/>
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.apache.karaf.archetypes.CommandArchetypeTest
/Users/gnodet/.m2/repository
[ maven embedder INFO] ------------------------------------------------------------------------
[ maven embedder INFO] Building Archetype Manager
[ maven embedder INFO] task-segment: [archetype:generate]
[ maven embedder INFO] ------------------------------------------------------------------------
[ maven embedder INFO] Searching repository for plugin with prefix: 'archetype'.
-------------------------------------------------------------------------------
Test set: org.apache.karaf.archetypes.CommandArchetypeTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.958 sec <<< FAILURE!
testCommand(org.apache.karaf.archetypes.CommandArchetypeTest) Time elapsed: 0.949 sec <<< ERROR!
org.apache.maven.lifecycle.LifecycleExecutionException: The plugin 'org.apache.maven.plugins:maven-archetype-plugin' does not exist or no valid version could be found
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.verifyPlugin(DefaultLifecycleExecutor.java:1303)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1542)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:511)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:482)
diff --git a/archetypes/command/src/main/resources/archetype-resources/pom.xml b/archetypes/command/src/main/resources/archetype-resource
index 7543b7d..0603ca3 100644
--- a/archetypes/command/src/main/resources/archetype-resources/pom.xml
+++ b/archetypes/command/src/main/resources/archetype-resources/pom.xml
@@ -56,6 +56,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
+ <version>2.1.0</version>^M
<extensions>true</extensions>
private static final SecurityManagerEx sm = new SecurityManagerEx();
private transient Class[] classContext = sm.getThrowableContext(this);
==============
private static final SecurityManagerEx sm;
static {
try {
private static final SecurityManagerEx sm;
static {
SecurityManagerEx tmp = null;
try {
tmp = new SecurityManagerEx();
} catch (Throwable t) {
}
sm = tmp;
}
diff --git a/exception/src/main/java/java/lang/Exception.java b/exception/src/main/java/java/lang/Exception.java
index db67518..6ed84ea 100644
--- a/exception/src/main/java/java/lang/Exception.java
+++ b/exception/src/main/java/java/lang/Exception.java
@@ -30,7 +30,7 @@ package java.lang;
public class Exception extends Throwable {
private static final long serialVersionUID = -3387516993124229948L;
- private transient Class[] classContext = sm.getThrowableContext(this);
+ private transient Class[] classContext = getSm().getThrowableContext(this);
javax.security.auth.login.LoginException: org.jasypt.exceptions.AlreadyInitializedException: Encryption entity already initialized
at org.jasypt.digest.StandardByteDigester.setAlgorithm(StandardByteDigester.java:318)
at org.jasypt.digest.StandardStringDigester.setAlgorithm(StandardStringDigester.java:343)
at org.jasypt.util.password.ConfigurablePasswordEncryptor.setAlgorithm(ConfigurablePasswordEncryptor.java:121)
at org.apache.karaf.jaas.jasypt.impl.JasyptEncryption.setAlgorithm(JasyptEncryption.java:47)
at org.apache.karaf.jaas.modules.AbstractKarafLoginModule.checkPassword(AbstractKarafLoginModule.java:154)
at org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.login(PropertiesLoginModule.java:146)
at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)