4 Replies Latest reply on Jun 6, 2013 8:54 AM by lehnerj

    Module getClassLoader().getResource doesn't find folder name but folder content

    lehnerj

      Dear JBoss Community,

       

      we upgraded from JBoss 7.1.1.Final to EAP 6.1.0 Final and encountered the following problem:

       

      We want to read some stub data from <JBOSS_HOME>/modules/de/example/main/folder/ but getClassLoader().getResource("folder") returns null, this worked in JBoss 7.1.1.Final and in JBoss EAP 6.1.0.Beta1.

       

      Can you please help us, solving this problem?

       

      Environment: Windows 7, Java JDK 7_21, 64 Bit

       

      Prior to EAP 6.1.0 Final an ..index file was automatically created in <jboss_home>/modules/de/example/main, this file is now missing.

      If I add it manually it doesn't help either.

       

      Please see the maven project attached to reproduce the problem.

       

      Output JBoss 7.1.1.Final & EAP 6.1.0.Beta1:

      ERROR [stderr 71] (MSC service thread 1-15) file: /D:/std/tools/jboss-as-7.1.1.Final/modules/de/example/main/./example.properties

      ERROR [stderr 71] (MSC service thread 1-15) file in folder: /D:/std/tools/jboss-as-7.1.1.Final/modules/de/example/main/./folder/example.json

      ERROR [stderr 71] (MSC service thread 1-15) folder: /D:/std/tools/jboss-as-7.1.1.Final/modules/de/example/main/./folder/   <<< Folder is correctly read

       

      Output JBoss EAP 6.1.0.Final

      ERROR [stderr] (ServerService Thread Pool -- 59) file: /D:/std/tools/jboss-eap-6.1/modules/de/example/main/./example.properties

      ERROR [stderr] (ServerService Thread Pool -- 59) file in folder: /D:/std/tools/jboss-eap-6.1/modules/de/example/main/./folder/example.json

      ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 59) MSC000001: Failed to start service jboss.deployment.subunit."example-ear.ear"."example-ejb-1.0.jar".component.ExampleBean.START: org.jboss.msc.service.StartException in service jboss.deployment.subunit."example-ear.ear"."example-ejb-1.0.jar".component.ExampleBean.START: java.lang.IllegalStateException: JBAS011048: Erstellung der Komponenteninstanz fehlgeschlagen

      at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_21]

      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21]

      at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_21]

      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]

      at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]

      at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

      Caused by: java.lang.IllegalStateException: JBAS011048: Erstellung der Komponenteninstanz fehlgeschlagen

      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:85) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:126)

      at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:141)

      at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      ... 7 more

      Caused by: javax.ejb.EJBException: java.lang.NullPointerException

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:165)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:250)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:344)

      at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

      at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      ... 11 more

      Caused by: java.lang.NullPointerException

      at de.example.ExampleBean.init(ExampleBean.java:20)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_21]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_21]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_21]

      at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_21]

      at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:73)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

      at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:248)

      ... 20 more

       

      Thanks in advance.

       

      Best regards

       

      Josef