tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Romain Manni-Bucau (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OPENEJB-2131) could not load library
Date Tue, 12 Jul 2016 15:46:20 GMT

    [ https://issues.apache.org/jira/browse/OPENEJB-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15373108#comment-15373108
] 

Romain Manni-Bucau commented on OPENEJB-2131:
---------------------------------------------

Hi

first of all it is not really an openejb issue (neither a tomee one ;)) but more a log4j2
one.

That said if you have jansi in the path of your tests (can need to tune surefire system properties
if log4j is not able to find it in the classpath) it should work

> could not load library
> ----------------------
>
>                 Key: OPENEJB-2131
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-2131
>             Project: OpenEJB
>          Issue Type: Bug
>            Reporter: Pascal Kn├╝ppel
>            Priority: Critical
>
> I am somehow stuck with an UnsatisfiedLinkError I am not able to resolve. It showed up
out of the blue when initializing the open ejb context. It worked before I have no idea what
happened to justify this error....
> {code:title=OpenEjbTest.java|borderStyle=solid}
> public abstract class OpenEjbTest {
>     protected Context initialContext;
>     @EJB
>     protected OpenEjbTransactionCaller transactionCaller;
>     @Before
>     public void setUp() throws NamingException {
>         Properties p = new Properties();
>         p.put("log4j.rootLogger", "fatal,C");
>         p.put("log4j.category.OpenEJB", "error");
>         p.put("log4j.category.OpenEJB.options", "error");
>         p.put("log4j.category.OpenEJB.server", "error");
>         p.put("log4j.category.OpenEJB.startup", "error");
>         p.put("log4j.category.OpenEJB.startup.service", "error");
>         p.put("log4j.category.OpenEJB.startup.config", "error");
>         p.put("log4j.category.OpenEJB.hsql", "error");
>         p.put("log4j.category.CORBA-Adapter", "error");
>         p.put("log4j.category.Transaction", "error");
>         p.put("log4j.category.org.apache.activemq", "error");
>         p.put("log4j.category.org.apache.geronimo", "error");
>         p.put("log4j.category.openjpa", "error");
>         p.put("log4j.appender.C", "org.apache.log4j.ConsoleAppender");
>         p.put("log4j.appender.C.layout", "org.apache.log4j.SimpleLayout");
>         p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
>         initialContext = new InitialContext(p);
>         initialContext.bind("inject", this);// ***************the error line*****************
>     }
>     @After
>     public void cleanUp() throws NamingException {
>         initialContext.unbind("inject");
>         initialContext.close();
>     }
> }
> {code}
> {code:title=test.java.java|borderStyle=solid}
> @LocalClient
> public class test extends OpenEjbTest {
>     @Test
>     public void test() {
>         // when executing this empty test the error occurs
>     }
> }
> {code}
> {noformat}
> java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi32-1.8 in java.library.path,
no jansi-1.8 in java.library.path, no jansi in java.library.path, Native Library C:\Users\praktikant\AppData\Local\Temp\jansi-32-1.8.dll
already loaded in another classloader]
> 	at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:184)
> 	at org.fusesource.hawtjni.runtime.Library.load(Library.java:142)
> 	at org.fusesource.jansi.internal.Kernel32.<clinit>(Kernel32.java:37)
> 	at org.fusesource.jansi.WindowsAnsiOutputStream.<clinit>(WindowsAnsiOutputStream.java:52)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
> 	at org.apache.logging.log4j.core.appender.ConsoleAppender.getOutputStream(ConsoleAppender.java:204)
> 	at org.apache.logging.log4j.core.appender.ConsoleAppender.getManager(ConsoleAppender.java:178)
> 	at org.apache.logging.log4j.core.appender.ConsoleAppender.createDefaultAppenderForLayout(ConsoleAppender.java:109)
> 	at org.apache.logging.log4j.core.config.DefaultConfiguration.<init>(DefaultConfiguration.java:62)
> 	at org.apache.logging.log4j.core.LoggerContext.<init>(LoggerContext.java:70)
> 	at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:145)
> 	at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:70)
> 	at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:57)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:142)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:41)
> 	at org.apache.logging.log4j.LogManager.getContext(LogManager.java:175)
> 	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:426)
> 	at de.fiverx.backend.service.LadeRzZertifikatRessource.<clinit>(LadeRzZertifikatRessource.java:34)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:348)
> 	at org.apache.openejb.util.Classes.forName(Classes.java:64)
> 	at org.apache.openejb.config.rules.ValidationBase.loadClass(ValidationBase.java:151)
> 	at org.apache.openejb.config.rules.CheckMethods.check_unusedCreateMethods(CheckMethods.java:318)
> 	at org.apache.openejb.config.rules.CheckMethods.validate(CheckMethods.java:55)
> 	at org.apache.openejb.config.rules.ValidationBase.validate(ValidationBase.java:50)
> 	at org.apache.openejb.config.AppValidator.validate(AppValidator.java:101)
> 	at org.apache.openejb.config.ValidateModules.deploy(ValidateModules.java:38)
> 	at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:403)
> 	at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:971)
> 	at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:832)
> 	at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:546)
> 	at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:591)
> 	at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:459)
> 	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:438)
> 	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:150)
> 	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:67)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:298)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:278)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
> 	at org.apache.openejb.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:98)
> 	at org.apache.openejb.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:62)
> 	at org.apache.openejb.core.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:46)
> 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
> 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
> 	at javax.naming.InitialContext.init(InitialContext.java:244)
> 	at javax.naming.InitialContext.<init>(InitialContext.java:216)
> 	at de.fiverx.backend.openejbUtils.OpenEjbTest.setUp(OpenEjbTest.java:51)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> 	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:119)
> 	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
> 	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
> 	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:498)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
> ERROR - ERROR ... null:	Cannot validate jar: Could not load library. Reasons: [no jansi32-1.8
in java.library.path, no jansi-1.8 in java.library.path, no jansi in java.library.path, Native
Library C:\Users\praktikant\AppData\Local\Temp\jansi-32-1.8.dll already loaded in another
classloader]
> ERROR - Invalid AppModule(name=classpath.ear, path=classpath.ear)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message