Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-3152

Cannot deploy OSGI bundle with @Resource injection

    XMLWordPrintable

Details

    Description

      I cannot deploy OSGI bundle with defined datasource. This is the error stack:

      [root@Testserver bin]# ./standalone.sh 
      =========================================================================
      
        JBoss Bootstrap Environment
      
        JBOSS_HOME: /opt/jboss-as-7.1.0.CR1b
      
        JAVA: /opt/jdk1.7.0_01/bin/java
      
        JAVA_OPTS: -server -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
      
      =========================================================================
      
      17:15:59,245 INFO  [org.jboss.modules] JBoss Modules version 1.1.0.CR6
      17:15:59,603 INFO  [org.jboss.msc] JBoss MSC version 1.0.1.GA
      17:15:59,664 INFO  [org.jboss.as] JBoss AS 7.1.0.CR1b "Flux Capacitor" starting
      17:16:01,027 INFO  [org.jboss.as] Creating http management service using  socket-binding (management-http)
      17:16:01,028 INFO  [org.xnio] XNIO Version 3.0.0.CR7
      17:16:01,041 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.0.CR7
      17:16:01,055 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.0.CR8
      17:16:01,074 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
      17:16:01,132 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 26) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
      17:16:01,166 INFO  [org.jboss.as.clustering] (ServerService Thread Pool -- 30) JBAS010300: Activating Infinispan subsystem.
      17:16:01,168 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011910: Activating OSGi Subsystem
      17:16:01,198 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) Activating Security Subsystem
      17:16:01,219 INFO  [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.6.Final)
      17:16:01,251 INFO  [org.jboss.as.security] (MSC service thread 1-3) Picketbox version=4.0.6.Beta2
      17:16:01,425 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-4) JBossOSGi Framework Core - 1.1.0
      17:16:01,460 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
      17:16:01,492 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /10.10.10.6:4447
      17:16:01,411 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
      17:16:01,616 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Starting Naming Service
      17:16:01,617 INFO  [org.jboss.as.jaxr] (MSC service thread 1-1) Binding JAXR ConnectionFactory: java:jboss/jaxr/ConnectionFactory
      17:16:01,662 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]
      17:16:01,727 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: system.bundle:0.0.0
      17:16:01,823 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.0.GA
      17:16:01,881 INFO  [org.apache.coyote.http11.Http11AprProtocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http--10.10.10.6-8080
      17:16:02,209 WARN  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011918: Found OSGi bundle in modules hierarchy: /opt/jboss-as-7.1.0.CR1b/modules/org/jboss/netty/main/netty-3.2.5.Final.jar
      17:16:02,419 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-4) Install bundle: org.apache.felix.metatype:1.0.4
      17:16:02,456 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-4) Install bundle: jbosgi-webconsole:1.0.6
      17:16:02,511 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: org.apache.aries.jmx:0.3.0
      17:16:02,592 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: org.apache.felix.configadmin:1.2.8
      17:16:02,612 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: jboss-as-osgi-configadmin:7.1.0.CR1b
      17:16:02,640 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: javax.transaction.api:0.0.0
      17:16:02,674 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: jboss-osgi-jmx:1.0.10
      17:16:03,423 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: stilts-stomplet-server-bundle:0.1.20
      17:16:03,425 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: org.apache.felix.scr:1.6.0
      17:16:03,534 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: org.apache.felix.log:1.0.0
      17:16:03,543 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: org.apache.aries.util:0.3.0
      17:16:03,788 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: jbosgi-webapp:1.0.5
      17:16:03,790 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: javax.servlet.api:0.0.0
      17:16:03,950 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: jboss-osgi-xerces:2.9.1.SP7
      17:16:04,030 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-4) Install bundle: org.jboss.netty:3.2.5.Final
      17:16:04,093 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: jbosgi-blueprint:1.0.3
      17:16:04,107 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: jboss-osgi-logging:1.0.0
      17:16:04,109 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: javax.api:0.0.0
      17:16:04,164 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-3) Install bundle: org.apache.felix.webconsole:3.1.6.SP1
      17:16:04,389 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-1) Install bundle: org.apache.felix.eventadmin:1.2.6
      17:16:04,482 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Starting deployment of "SH_15-1.0-SNAPSHOT.jar"
      17:16:04,497 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory /opt/jboss-as-7.1.0.CR1b/standalone/deployments
      17:16:04,571 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-2) Install bundle: jbosgi-http:1.0.5
      17:16:04,592 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) Listening on /10.10.10.6:9999
      17:16:04,802 INFO  [org.jboss.osgi.framework.internal.BundleManager] (MSC service thread 1-4) Install bundle: osgi.cmpn:4.2.0.200908310645
      17:16:04,873 INFO  [org.jboss.osgi.framework.internal.StartLevelPlugin] (MSC service thread 1-4) Starting bundles for start level: 1
      17:16:04,892 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named SessionHandle in deployment unit deployment "SH_15-1.0-SNAPSHOT.jar" are as follows:
      
      	java:global/SH_15-1.0-SNAPSHOT/SessionHandle!com.SH_15.SessionHandle
      	java:app/SH_15-1.0-SNAPSHOT/SessionHandle!com.SH_15.SessionHandle
      	java:module/SessionHandle!com.SH_15.SessionHandle
      	java:global/SH_15-1.0-SNAPSHOT/SessionHandle
      	java:app/SH_15-1.0-SNAPSHOT/SessionHandle
      	java:module/SessionHandle
      
      17:16:05,351 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: jboss-osgi-logging:1.0.0
      17:16:05,438 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: jboss-as-osgi-configadmin:7.1.0.CR1b
      17:16:05,479 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.apache.felix.log:1.0.0
      17:16:05,507 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.apache.felix.configadmin:1.2.8
      17:16:05,508 INFO  [org.jboss.osgi.framework.internal.StartLevelPlugin] (MSC service thread 1-4) Starting bundles for start level: 2
      17:16:05,558 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.apache.felix.scr:1.6.0
      17:16:05,637 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.jboss.netty:3.2.5.Final
      17:16:05,707 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.apache.felix.eventadmin:1.2.6
      17:16:05,896 INFO  [org.eclipse.jetty.util.log] (CM Configuration Updater (ManagedService Update: pid=org.ops4j.pax.web)) jetty-7.x.y-SNAPSHOT
      17:16:05,966 INFO  [org.eclipse.jetty.util.log] (CM Configuration Updater (ManagedService Update: pid=org.ops4j.pax.web)) Started NIOSocketConnectorWrapper@0.0.0.0:8090
      17:16:05,980 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: jbosgi-http:1.0.5
      17:16:06,037 INFO  [org.projectodd.stilts.stomplet.bundle.StompletServerActivator] (MSC service thread 1-4) start: BundleContext[stilts-stomplet-server-bundle:0.1.20]
      17:16:06,050 INFO  [org.projectodd.stilts.stomplet.bundle.StompletServerActivator] (MSC service thread 1-4) adding transaction manager: com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate@7e8c37b3
      17:16:06,054 INFO  [org.projectodd.stilts.stomplet.server.StompletServer] (MSC service thread 1-4) STOMPLET_SERVER start()
      17:16:06,054 ERROR [org.projectodd.stilts.conduit.ConduitServer] (MSC service thread 1-4) CONDUIT_SERVER.start com.arjuna.ats.jbossatx.jta.TransactionManagerDelegate@7e8c37b3
      17:16:06,127 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: stilts-stomplet-server-bundle:0.1.20
      17:16:06,228 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: jboss-osgi-jmx:1.0.10
      17:16:06,240 INFO  [org.apache.aries.jmx] (Thread-64) Starting JMX OSGi agent
      17:16:06,259 INFO  [org.apache.aries.jmx] (Thread-64) Registering MBean with ObjectName [osgi.compendium:service=cm,version=1.3] for service with service.id [13]
      17:16:06,271 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.apache.aries.jmx:0.3.0
      17:16:06,377 INFO  [org.apache.aries.jmx] (Thread-64) Registering org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer org.jboss.as.jmx.PluggableMBeanServerImpl@4a272157 with name osgi.compendium:service=cm,version=1.3
      17:16:06,377 INFO  [org.apache.aries.jmx] (Thread-64) Registering org.osgi.jmx.framework.PackageStateMBean to MBeanServer org.jboss.as.jmx.PluggableMBeanServerImpl@4a272157 with name osgi.core:type=packageState,version=1.5
      17:16:06,378 INFO  [org.apache.aries.jmx] (Thread-64) Registering org.osgi.jmx.framework.ServiceStateMBean to MBeanServer org.jboss.as.jmx.PluggableMBeanServerImpl@4a272157 with name osgi.core:type=serviceState,version=1.5
      17:16:06,409 INFO  [org.apache.aries.jmx] (Thread-64) Registering org.osgi.jmx.framework.BundleStateMBean to MBeanServer org.jboss.as.jmx.PluggableMBeanServerImpl@4a272157 with name osgi.core:type=bundleState,version=1.5
      17:16:06,411 INFO  [org.apache.aries.jmx] (Thread-64) Registering org.osgi.jmx.framework.FrameworkMBean to MBeanServer org.jboss.as.jmx.PluggableMBeanServerImpl@4a272157 with name osgi.core:type=framework,version=1.5
      17:16:06,638 INFO  [org.eclipse.jetty.util.log] (MSC service thread 1-4) started HttpServiceContext{httpContext=org.apache.felix.webconsole.internal.servlet.OsgiManagerHttpContext@108b0d7d}
      17:16:06,686 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.apache.felix.webconsole:3.1.6.SP1
      17:16:06,703 INFO  [org.eclipse.jetty.util.log] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) stopped HttpServiceContext{httpContext=org.apache.felix.webconsole.internal.servlet.OsgiManagerHttpContext@108b0d7d}
      17:16:06,705 INFO  [org.eclipse.jetty.util.log] (CM Configuration Updater (ManagedService Update: pid=org.apache.felix.webconsole.internal.servlet.OsgiManager)) started HttpServiceContext{httpContext=org.apache.felix.webconsole.internal.servlet.OsgiManagerHttpContext@7903d594}
      17:16:06,763 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: org.apache.felix.metatype:1.0.4
      17:16:06,764 INFO  [org.jboss.osgi.framework.internal.StartLevelPlugin] (MSC service thread 1-4) Starting bundles for start level: 3
      17:16:06,876 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: jbosgi-blueprint:1.0.3
      17:16:06,975 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: jbosgi-webapp:1.0.5
      17:16:07,156 INFO  [org.jboss.osgi.framework.internal.HostBundleState] (MSC service thread 1-4) Bundle started: jboss-osgi-xerces:2.9.1.SP7
      17:16:07,158 INFO  [org.jboss.osgi.framework.internal.FrameworkActive] (MSC service thread 1-4) OSGi Framework started
      17:16:07,375 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS018559: Deployed "SH_15-1.0-SNAPSHOT.jar"
      17:16:07,379 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
      JBAS014775:    New missing/unsatisfied dependencies:
            service jboss.jdbc-driver._ojdbc6_jar (missing) dependents: [service jboss.data-source.java:/Oracle] 
      
      17:16:07,385 ERROR [org.jboss.as] (Controller Boot Thread) JBoss AS 7.1.0.CR1b "Flux Capacitor" started (with errors) in 8372ms - Started 160 of 234 services (3 services failed or missing dependencies, 69 services are passive or on-demand)
      17:16:07,392 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "_ojdbc6.jar"
      17:16:07,619 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)
      17:16:07,654 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-4) JBAS010400: Bound data source [java:/Oracle]
      17:16:07,725 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "_ojdbc6.jar"
      17:16:07,725 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
      JBAS014776:    Newly corrected services:
            service jboss.jdbc-driver._ojdbc6_jar (no longer required)
      
      17:16:29,174 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) Stopped deployment SH_15-1.0-SNAPSHOT.jar in 20ms
      17:16:29,188 INFO  [org.jboss.as.server] (HttpManagementService-threads - 1) JBAS018558: Undeployed "SH_15-1.0-SNAPSHOT.jar"
      17:16:29,188 INFO  [org.jboss.as.server.deployment.repository.impl] (HttpManagementService-threads - 1) JBAS014901: Content removed from location /opt/jboss-as-7.1.0.CR1b/standalone/data/content/95/13516bb68ff3a569140babc910dcf21b0b2f24/content
      17:17:18,856 INFO  [org.jboss.as.server.deployment.repository.impl] (HttpManagementService-threads - 1) JBAS014900: Content added at location /opt/jboss-as-7.1.0.CR1b/standalone/data/content/c6/30f0ab7b40ff39918a61ff080d09e135dd59a1/content
      17:17:22,032 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "test-1.0-SNAPSHOT.jar"
      17:17:22,041 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."test-1.0-SNAPSHOT.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test-1.0-SNAPSHOT.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "test-1.0-SNAPSHOT.jar"
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0_01]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0_01]
      	at java.lang.Thread.run(Thread.java:722) [:1.7.0_01]
      Caused by: java.lang.NullPointerException
      	at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.isEnvEntryType(ResourceInjectionAnnotationParsingProcessor.java:296)
      	at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.process(ResourceInjectionAnnotationParsingProcessor.java:227)
      	at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.processFieldResource(ResourceInjectionAnnotationParsingProcessor.java:184)
      	at org.jboss.as.ee.component.deployers.ResourceInjectionAnnotationParsingProcessor.deploy(ResourceInjectionAnnotationParsingProcessor.java:146)
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]
      	... 5 more
      
      17:17:22,045 INFO  [org.jboss.as.server] (HttpManagementService-threads - 1) JBAS015856: Undeploy of deployment "test-1.0-SNAPSHOT.jar" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"test-1.0-SNAPSHOT.jar\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"test-1.0-SNAPSHOT.jar\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"test-1.0-SNAPSHOT.jar\""}}
      17:17:22,121 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Stopped deployment test-1.0-SNAPSHOT.jar in 75ms
      17:17:22,122 INFO  [org.jboss.as.controller] (HttpManagementService-threads - 1) JBAS014774: Service status report
      JBAS014777:   Services which failed to start:      service jboss.deployment.unit."test-1.0-SNAPSHOT.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."test-1.0-SNAPSHOT.jar".POST_MODULE: Failed to process phase POST_MODULE of deployment "test-1.0-SNAPSHOT.jar"
      

      This is the source code of the OSGI bundle that I have tested:

      package test;
      
      import javax.activation.DataSource;
      import javax.annotation.Resource;
      
      public class NewClass {
          
             @Resource(name="java:/Oracle")
             public DataSource ds;
          
      }
      

      Attachments

        Issue Links

          Activity

            People

              tdiesler@redhat.com Thomas Diesler
              rcbandit_jira Peter Penzov (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: