0 Replies Latest reply on Nov 16, 2011 9:54 AM by Alexander Koledzhikov

    Resource injection and osgi

    Alexander Koledzhikov Newbie

      I have a class which uses a resource injection to obtain a datasource. When I package it in an osgi jar and try to deploy said jar, I get the following exception:

       

      [Server:server-one] 15:23:49,523 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."EntityEJBTest.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."EntityEJBTest.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "EntityEJBTest.jar"

      [Server:server-one]     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.Alpha2-SNAPSHOT.jar:7.1.0.Alpha2-SNAPSHOT]

      [Server:server-one]     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

      [Server:server-one]     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

      [Server:server-one]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_27]

      [Server:server-one]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_27]

      [Server:server-one]     at java.lang.Thread.run(Thread.java:662) [:1.6.0_27]

      [Server:server-one] Caused by: java.lang.NullPointerException

      [Server:server-one]     at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.isEnvEntryType(ResourceInjectionAnnotationParsingProcessor.java:295)

      [Server:server-one]     at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.process(ResourceInjectionAnnotationParsingProcessor.java:225)

      [Server:server-one]     at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.processFieldResource(ResourceInjectionAnnotationParsingProcessor.java:185)

      [Server:server-one]     at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.deploy(ResourceInjectionAnnotationParsingProcessor.java:147)

      [Server:server-one]     at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.Alpha2-SNAPSHOT.jar:7.1.0.Alpha2-SNAPSHOT]

       

      If I package exactly the same content in an non-osgi jar, it deploys normally. Could it be that my manifest is missing something? I'm generating it using the maven-bundle-plugin and do not add any custom entries.

      Also, could the problem possibly be related to

      https://issues.jboss.org/browse/AS7-202 or https://issues.jboss.org/browse/AS7-1601?

      Thanks in advance!