2 Replies Latest reply on Sep 8, 2014 12:41 PM by Eduardo Martins

    Can't get Connection Factory in Appclient

    Günther Grill Newbie

      Hi,

       

      I have the following program (just an lightweight example for testing):

       

      import javax.annotation.Resource;  
      import javax.jms.ConnectionFactory;  
      
      public class Main {  
      
      @Resource(lookup = "java:comp/DefaultJMSConnectionFactory")  
      private static ConnectionFactory connectionFactory;  
      
      public static void main(String args[]) {  
              System.out.println("Injected ConnectionFactory: " + connectionFactory);  
          }  
      }  
      
      

       

      Then i package this into a executable jar (attached) and execute it with the following command:

       

      wildfly-8.0.0.Final/bin/appclient.bat myjms.jar

       

      The resulting error is:

       

      08:10:54,073 INFO  [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final

      08:10:54,160 INFO  [org.jboss.msc] (main) JBoss MSC version 1.2.0.Final

      08:10:54,218 INFO  [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.0.0.Final "WildFly" starting

      08:10:54,924 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 20) JBAS013171: Activating Security Subsystem

      08:10:54,925 INFO  [org.jboss.as.jacorb] (ServerService Thread Pool -- 16) JBAS016300: Activating JacORB Subsystem

      08:10:54,925 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 19) JBAS011800: Activating Naming Subsystem

      08:10:54,927 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 22) JBAS015537: Activating WebServices Extension

      08:10:54,928 INFO  [org.jboss.as.security] (MSC service thread 1-13) JBAS013170: Current PicketBox version=4.0.20.Final

      08:10:54,939 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (IronJacamar 1.1.3.Final)

      08:10:54,952 INFO  [org.jboss.as.naming] (MSC service thread 1-12) JBAS011802: Starting Naming Service

      08:10:54,953 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 13) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      08:10:54,956 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-5) JBAS010417: Started Driver service with driver-name = h2

      08:10:55,103 WARN  [jacorb.codeset] (MSC service thread 1-10) Warning - unknown codeset (Cp1252) - defaulting to ISO-8859-1

      08:10:55,110 INFO  [org.jboss.as.jacorb] (MSC service thread 1-10) JBAS016330: CORBA ORB Service started

      08:10:55,185 INFO  [org.jboss.as.jacorb] (MSC service thread 1-1) JBAS016328: CORBA Naming Service started

      08:10:55,217 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.0.0.Final "WildFly" started in 1474ms - Started 103 of 105 services (8 services are lazy, passive or on-demand)

      08:10:55,228 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-12) JBAS015876: Starting deployment of "myjms.jar" (runtime-name: "myjms.jar")

      08:10:55,416 ERROR [org.jboss.as.controller.management-operation] (Thread-42) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "myjms.jar")]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.myjms.myjms.env.\"org.myjms.Main\".connectionFactory is missing [jboss.naming.context.java.module.myjms.myjms.DefaultJMSConnectionFactory]"]}

      08:10:55,418 ERROR [org.jboss.as.server] (Thread-42) JBAS015870: Deploy of deployment "myjms.jar" was rolled back with the following failure message:{"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.module.myjms.myjms.env.\"org.myjms.Main\".connectionFactory is missing [jboss.naming.context.java.module.myjms.myjms.DefaultJMSConnectionFactory]"]}

      08:10:55,422 ERROR [org.jboss.as.appclient.logging] (Thread-49) JBAS013201: InterruptedException running app client main: java.lang.InterruptedException

              at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:996) [rt.jar:1.7.0_67]

              at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303) [rt.jar:1.7.0_67]

              at java.util.concurrent.CountDownLatch.await(CountDownLatch.java:236) [rt.jar:1.7.0_67]

              at org.jboss.as.appclient.service.ApplicationClientStartService$1.run(ApplicationClientStartService.java:108)

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]

       

      08:10:55,431 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-6) JBAS010418: Stopped Driver service with driver-name = h2

      08:10:55,445 INFO  [org.hibernate.validator.internal.util.Version] (MSC service thread 1-3) HV000001: Hibernate Validator 5.0.3.Final

      08:10:55,477 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-14) JBAS015877: Stopped deployment myjms.jar (runtime-name: myjms.jar) in 58ms

      08:10:55,479 INFO  [org.jboss.as.controller] (Thread-42) JBAS014774: Service status report

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.deployment.unit."myjms.jar".component.AppClientComponent.CREATE (missing) dependents: [service jboss.deployment.unit."myjms.jar".component.AppClientComponent.START]

            service jboss.deployment.unit."myjms.jar".component.AppClientComponent.JndiBindingsService (missing) dependents: [service jboss.deployment.unit."myjms.jar".jndiDependencyService]

            service jboss.deployment.unit."myjms.jar".jndiDependencyService (missing) dependents: [service jboss.deployment.unit."myjms.jar".component.AppClientComponent.START]

            service jboss.naming.context.java.app.myjms.env (missing) dependents: [service jboss.deployment.unit."myjms.jar".jndiDependencyService]

            service jboss.naming.context.java.module.myjms.myjms.DefaultJMSConnectionFactory (missing) dependents: [service jboss.naming.context.java.module.myjms.myjms.env."org.myjms.Main".connectionFactory]

            service jboss.naming.context.java.module.myjms.myjms.env (missing) dependents: [service jboss.deployment.unit."myjms.jar".jndiDependencyService]

            service jboss.naming.context.java.module.myjms.myjms.env."org.myjms.Main".connectionFactory (missing) dependents: [service jboss.deployment.unit."myjms.jar".jndiDependencyService, service jboss.deployment.unit."myjms.jar".component.AppClientComponent.START]

      08:10:55,480 INFO  [org.jboss.as] (MSC service thread 1-12) JBAS015950: WildFly 8.0.0.Final "WildFly" stopped in 46ms

       

       

       

      Can any one help me with this issue? What is wrong with my little program?