4 Replies Latest reply on Mar 7, 2016 2:54 PM by fatbob73

    Need help writing a message to HornetQ. Failed to instantiate InitialContextFactory.

    fatbob73 Newbie

      I'm trying to publish a message to a HornetQ instance running on a WildFly 9.02 server from my web service which is running on the same instance of my WildFly server.

       

      Here is my code:

       

      public void writeToQueue() {
          Integer NUM_OF_MESSAGES = 10;
      
          String CONNECTION_FACTORY = "jms/RemoteConnectionFactory";
          String DESTINATION = "jms/queue/test";
          String DEFAULT_USERNAME = "jmsuser";
          String DEFAULT_PASSWORD = "frog1mcg";
          String INITIAL_CONTEXT_FACTORY = "org.jboss.naming.remote.client.InitialContextFactory";
          String PROVIDER_URL = "http-remoting://localhost:8180";
      
          final StringBuilder msg = new StringBuilder();
      
          msg.append("A message by WildFly Cookbook");
      
          ConnectionFactory connectionFactory = null;
          Connection connection = null;
          Session session = null;
          MessageProducer producer = null;
          MessageConsumer consumer = null;
          Destination destination = null;
          TextMessage message = null;
          Context context = null;
      
          try {
              // Set up the context for the JNDI lookup
              final Properties env = new Properties();
              env.put(Context.INITIAL_CONTEXT_FACTORY, INITIAL_CONTEXT_FACTORY);
              env.put(Context.PROVIDER_URL, System.getProperty(Context.PROVIDER_URL, PROVIDER_URL));
              env.put(Context.SECURITY_PRINCIPAL, System.getProperty("username", DEFAULT_USERNAME));
              env.put(Context.SECURITY_CREDENTIALS, System.getProperty("password", DEFAULT_PASSWORD));
              context = new InitialContext(env);
      
              String connectionFactoryString = System.getProperty("connection.factory", CONNECTION_FACTORY);
      
              connectionFactory = (ConnectionFactory) context.lookup(connectionFactoryString);
      
              String destinationString = System.getProperty("destination", DESTINATION);
      
              destination = (Destination) context.lookup(destinationString);
      
              // Create the JMS connection, session, producer, and consumer
              connection = connectionFactory.createConnection(System.getProperty("username", DEFAULT_USERNAME), System.getProperty("password", DEFAULT_PASSWORD));
              session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
              producer = session.createProducer(destination);
              connection.start();
      
              log.info("Sending messages with content: " + msg.toString());
      
              // Send the specified number of messages
              for (int i = 0; i < NUM_OF_MESSAGES; i++) {
                  message = session.createTextMessage(i+msg.toString());
                  producer.send(message);
                  log.info("\t\tSending messages with content ["+i+"]: " + msg.toString());
                  Thread.sleep(1000);
              }
      
          } catch (Exception e) {
              e.printStackTrace();
          } finally {
              if (context != null) {
                  context.close();
              }
      
              // closing the connection takes care of the session, producer, and consumer
              if (connection != null) {
                  connection.close();
              }
          }
      }
      
      
      

       

      Here is the error that I get:

       

      15:28:24,825 ERROR [stderr] (default task-2) javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.oword-ear.ear.oword-ejb.jar:main" from Service Module Loader [Root exception is java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory from [Module "deployment.oword-ear.ear.oword-ejb.jar:main" from Service Module Loader]]

       

      15:28:24,834 ERROR [stderr] (default task-2)     at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:118)

       

      15:28:24,840 ERROR [stderr] (default task-2)     at org.jboss.as.naming.InitialContext.init(InitialContext.java:99)

       

      15:28:24,845 ERROR [stderr] (default task-2)     at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source)

       

      15:28:24,849 ERROR [stderr] (default task-2)     at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:89)

       

      15:28:24,853 ERROR [stderr] (default task-2)     at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:43)

       

      15:28:24,857 ERROR [stderr] (default task-2)     at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)

       

      15:28:24,860 ERROR [stderr] (default task-2)     at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)

       

      15:28:24,863 ERROR [stderr] (default task-2)     at javax.naming.InitialContext.init(Unknown Source)

       

      15:28:24,866 ERROR [stderr] (default task-2)     at javax.naming.InitialContext.<init>(Unknown Source)

       

      15:28:24,869 ERROR [stderr] (default task-2)     at ca.mcgill.muhc.oword.OwordBean.writeToQueue(OwordBean.java:2824)

       

      15:28:24,872 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       

      15:28:24,875 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

       

      15:28:24,878 ERROR [stderr] (default task-2)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

       

      15:28:24,881 ERROR [stderr] (default task-2)     at java.lang.reflect.Method.invoke(Unknown Source)

       

      15:28:24,885 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

       

      15:28:24,888 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,891 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

       

      15:28:24,894 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)

       

      15:28:24,898 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)

       

      15:28:24,901 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

       

      15:28:24,906 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,912 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

       

      15:28:24,916 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,920 ERROR [stderr] (default task-2)     at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

       

      15:28:24,923 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,927 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:103)

       

      15:28:24,930 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:58)

       

      15:28:24,933 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,936 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

       

      15:28:24,940 ERROR [stderr] (default task-2)     at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)

       

      15:28:24,943 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

       

      15:28:24,946 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,949 ERROR [stderr] (default task-2)     at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

       

      15:28:24,953 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,956 ERROR [stderr] (default task-2)     at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

       

      15:28:24,959 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,962 ERROR [stderr] (default task-2)     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

       

      15:28:24,965 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

       

      15:28:24,968 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,971 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59)

       

      15:28:24,975 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,978 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

       

      15:28:24,981 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,984 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)

       

      15:28:24,987 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,990 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)

       

      15:28:24,994 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:24,997 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

       

      15:28:25,000 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:25,004 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)

       

      15:28:25,007 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:25,010 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

       

      15:28:25,013 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:25,016 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)

       

      15:28:25,019 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:25,023 ERROR [stderr] (default task-2)     at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

       

      15:28:25,026 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:25,029 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

       

      15:28:25,032 ERROR [stderr] (default task-2)     at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)

       

      15:28:25,036 ERROR [stderr] (default task-2)     at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

       

      15:28:25,040 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:25,045 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

       

      15:28:25,049 ERROR [stderr] (default task-2)     at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

       

      15:28:25,054 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:28:25,057 ERROR [stderr] (default task-2)     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

       

      15:28:25,060 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)

       

      15:28:25,063 ERROR [stderr] (default task-2)     at org.jboss.as.webservices.invocation.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:135)

       

      15:28:25,066 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.JBossWSInvoker.performInvocation(JBossWSInvoker.java:185)

       

      15:28:25,069 ERROR [stderr] (default task-2)     at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)

       

      15:28:25,072 ERROR [stderr] (default task-2)     at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)

       

      15:28:25,075 ERROR [stderr] (default task-2)     at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:69)

       

      15:28:25,078 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:151)

       

      15:28:25,081 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)

       

      15:28:25,085 ERROR [stderr] (default task-2)     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

       

      15:28:25,088 ERROR [stderr] (default task-2)     at java.util.concurrent.FutureTask.run(Unknown Source)

       

      15:28:25,091 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)

       

      15:28:25,095 ERROR [stderr] (default task-2)     at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

       

      15:28:25,098 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)

       

      15:28:25,101 ERROR [stderr] (default task-2)     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)

       

      15:28:25,104 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

       

      15:28:25,107 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)

       

      15:28:25,110 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:111)

       

      15:28:25,114 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:136)

       

      15:28:25,117 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)

       

      15:28:25,120 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)

       

      15:28:25,123 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)

       

      15:28:25,126 ERROR [stderr] (default task-2)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

       

      15:28:25,129 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)

       

      15:28:25,132 ERROR [stderr] (default task-2)     at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)

       

      15:28:25,135 ERROR [stderr] (default task-2)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

       

      15:28:25,138 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

       

      15:28:25,141 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

       

      15:28:25,145 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

       

      15:28:25,148 ERROR [stderr] (default task-2)     at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

       

      15:28:25,152 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:28:25,155 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

       

      15:28:25,160 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

       

      15:28:25,163 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:28:25,166 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

       

      15:28:25,169 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

       

      15:28:25,172 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

       

      15:28:25,176 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

       

      15:28:25,179 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

       

      15:28:25,182 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

       

      15:28:25,185 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:28:25,188 ERROR [stderr] (default task-2)     at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

       

      15:28:25,192 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:28:25,195 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:28:25,198 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

       

      15:28:25,201 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

       

      15:28:25,204 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

       

      15:28:25,208 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

       

      15:28:25,211 ERROR [stderr] (default task-2)     at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

       

      15:28:25,214 ERROR [stderr] (default task-2)     at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

       

      15:28:25,217 ERROR [stderr] (default task-2)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

       

      15:28:25,220 ERROR [stderr] (default task-2)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

       

      15:28:25,222 ERROR [stderr] (default task-2)     at java.lang.Thread.run(Unknown Source)

       

      15:28:25,226 ERROR [stderr] (default task-2) Caused by: java.lang.ClassNotFoundException: org.jboss.naming.remote.client.InitialContextFactory from [Module "deployment.oword-ear.ear.oword-ejb.jar:main" from Service Module Loader]

       

      15:28:25,229 ERROR [stderr] (default task-2)     at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205)

       

      15:28:25,233 ERROR [stderr] (default task-2)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455)

       

      15:28:25,236 ERROR [stderr] (default task-2)     at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404)

       

      15:28:25,239 ERROR [stderr] (default task-2)     at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385)

       

      15:28:25,242 ERROR [stderr] (default task-2)     at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130)

       

      15:28:25,245 ERROR [stderr] (default task-2)     at java.lang.Class.forName0(Native Method)

       

      15:28:25,248 ERROR [stderr] (default task-2)     at java.lang.Class.forName(Unknown Source)

       

      15:28:25,251 ERROR [stderr] (default task-2)     at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:113)

       

      15:28:25,255 ERROR [stderr] (default task-2)     ... 116 more

       

       

      I've also tried this InitialContext without any aruguments (line 31 on the above code):

       

      context = new InitialContext();
      
      

       

      That gives me a different error on line 35 on the above code:

       

      15:13:44,276 INFO  [ca.mcgill.muhc.oword.OwordBean] (default task-2) Attempting to acquire connection factory "jms/RemoteConnectionFactory"

      15:13:48,879 ERROR [stderr] (default task-2) javax.naming.NameNotFoundException: jms/RemoteConnectionFactory -- service jboss.naming.context.java.jms.RemoteConnectionFactory

       

      15:13:48,884 ERROR [stderr] (default task-2)     at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)

       

      15:13:48,891 ERROR [stderr] (default task-2)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)

       

      15:13:48,894 ERROR [stderr] (default task-2)     at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)

       

      15:13:48,898 ERROR [stderr] (default task-2)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)

       

      15:13:48,901 ERROR [stderr] (default task-2)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)

       

      15:13:48,905 ERROR [stderr] (default task-2)     at javax.naming.InitialContext.lookup(Unknown Source)

       

      15:13:48,909 ERROR [stderr] (default task-2)     at javax.naming.InitialContext.lookup(Unknown Source)

       

      15:13:48,913 ERROR [stderr] (default task-2)     at ca.mcgill.muhc.oword.OwordBean.writeToQueue(OwordBean.java:2829)

       

      15:13:48,916 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

       

      15:13:48,919 ERROR [stderr] (default task-2)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

       

      15:13:48,922 ERROR [stderr] (default task-2)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

       

      15:13:48,927 ERROR [stderr] (default task-2)     at java.lang.reflect.Method.invoke(Unknown Source)

       

      15:13:48,931 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

       

      15:13:48,935 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:48,938 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

       

      15:13:48,942 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)

       

      15:13:48,947 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)

       

      15:13:48,950 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

       

      15:13:48,954 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:48,959 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

       

      15:13:48,965 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:48,972 ERROR [stderr] (default task-2)     at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

       

      15:13:48,976 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:48,981 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:103)

       

      15:13:48,988 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:58)

       

      15:13:48,992 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:48,995 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

       

      15:13:48,998 ERROR [stderr] (default task-2)     at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)

       

      15:13:49,002 ERROR [stderr] (default task-2)     at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

       

      15:13:49,008 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,012 ERROR [stderr] (default task-2)     at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

       

      15:13:49,016 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,021 ERROR [stderr] (default task-2)     at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

       

      15:13:49,026 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,031 ERROR [stderr] (default task-2)     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

       

      15:13:49,036 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

       

      15:13:49,041 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,044 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59)

       

      15:13:49,048 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,051 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

       

      15:13:49,057 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,060 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)

       

      15:13:49,064 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,068 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)

       

      15:13:49,073 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,079 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

       

      15:13:49,084 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,092 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)

       

      15:13:49,098 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,103 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

       

      15:13:49,109 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,115 ERROR [stderr] (default task-2)     at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)

       

      15:13:49,119 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,125 ERROR [stderr] (default task-2)     at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

       

      15:13:49,130 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,134 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

       

      15:13:49,139 ERROR [stderr] (default task-2)     at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)

       

      15:13:49,145 ERROR [stderr] (default task-2)     at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

       

      15:13:49,149 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,154 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

       

      15:13:49,159 ERROR [stderr] (default task-2)     at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

       

      15:13:49,163 ERROR [stderr] (default task-2)     at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

       

      15:13:49,167 ERROR [stderr] (default task-2)     at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

       

      15:13:49,172 ERROR [stderr] (default task-2)     at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)

       

      15:13:49,176 ERROR [stderr] (default task-2)     at org.jboss.as.webservices.invocation.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:135)

       

      15:13:49,179 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.JBossWSInvoker.performInvocation(JBossWSInvoker.java:185)

       

      15:13:49,183 ERROR [stderr] (default task-2)     at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)

       

      15:13:49,186 ERROR [stderr] (default task-2)     at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)

       

      15:13:49,191 ERROR [stderr] (default task-2)     at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:69)

       

      15:13:49,195 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:151)

       

      15:13:49,199 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)

       

      15:13:49,210 ERROR [stderr] (default task-2)     at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

       

      15:13:49,214 ERROR [stderr] (default task-2)     at java.util.concurrent.FutureTask.run(Unknown Source)

       

      15:13:49,218 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)

       

      15:13:49,223 ERROR [stderr] (default task-2)     at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

       

      15:13:49,226 ERROR [stderr] (default task-2)     at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)

       

      15:13:49,231 ERROR [stderr] (default task-2)     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)

       

      15:13:49,235 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

       

      15:13:49,238 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)

       

      15:13:49,242 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:111)

       

      15:13:49,248 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:136)

       

      15:13:49,253 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)

       

      15:13:49,258 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)

       

      15:13:49,263 ERROR [stderr] (default task-2)     at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)

       

      15:13:49,268 ERROR [stderr] (default task-2)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

       

      15:13:49,272 ERROR [stderr] (default task-2)     at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)

       

      15:13:49,278 ERROR [stderr] (default task-2)     at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)

       

      15:13:49,283 ERROR [stderr] (default task-2)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

       

      15:13:49,286 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

       

      15:13:49,289 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

       

      15:13:49,293 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

       

      15:13:49,297 ERROR [stderr] (default task-2)     at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

       

      15:13:49,300 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:13:49,304 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

       

      15:13:49,308 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

       

      15:13:49,312 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:13:49,315 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

       

      15:13:49,319 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

       

      15:13:49,325 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

       

      15:13:49,329 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

       

      15:13:49,332 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

       

      15:13:49,335 ERROR [stderr] (default task-2)     at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

       

      15:13:49,341 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:13:49,345 ERROR [stderr] (default task-2)     at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

       

      15:13:49,349 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:13:49,353 ERROR [stderr] (default task-2)     at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

       

      15:13:49,358 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

       

      15:13:49,361 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

       

      15:13:49,365 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

       

      15:13:49,368 ERROR [stderr] (default task-2)     at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

       

      15:13:49,375 ERROR [stderr] (default task-2)     at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

       

      15:13:49,379 ERROR [stderr] (default task-2)     at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

       

      15:13:49,382 ERROR [stderr] (default task-2)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

       

      15:13:49,386 ERROR [stderr] (default task-2)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

       

      15:13:49,391 ERROR [stderr] (default task-2)     at java.lang.Thread.run(Unknown Source)

       

      What am I doing wrong here? Any suggestions are greatly appreciated.

       

      Thanks!

        • 1. Re: Need help writing a message to HornetQ. Failed to instantiate InitialContextFactory.
          Justin Bertram Master

          If your client is in the same JVM as the broker then you certainly don't need to specify JNDI properties (as you did in your first example).  Using a blank InitialContext() is the proper way to go (as you did in your second example).  However, you shouldn't be using "jms/RemoteConnectionFactory" for a local client because, as the name suggests, it is for remote clients.  Try using "java:/ConnectionFactory" instead.

          • 2. Re: Need help writing a message to HornetQ. Failed to instantiate InitialContextFactory.
            fatbob73 Newbie

            Thanks for the help Justin.

             

            That did the trick. However I'm now getting a new error when I try to do a lookup on the destination:

             

            destination = (Destination) context.lookup(destinationString);
            

             

            I get the following error:

             

            21:50:06,341 ERROR [stderr] (default task-2) javax.naming.NameNotFoundException: jms/queue/test -- service jboss.naming.context.java.jms.queue.test

             

            21:50:06,357 ERROR [stderr] (default task-2)    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)

             

            21:50:06,360 ERROR [stderr] (default task-2)    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)

             

            21:50:06,363 ERROR [stderr] (default task-2)    at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)

             

            21:50:06,366 ERROR [stderr] (default task-2)    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)

             

            21:50:06,370 ERROR [stderr] (default task-2)    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)

             

            21:50:06,373 ERROR [stderr] (default task-2)    at javax.naming.InitialContext.lookup(Unknown Source)

             

            21:50:06,376 ERROR [stderr] (default task-2)    at javax.naming.InitialContext.lookup(Unknown Source)

             

            21:50:06,379 ERROR [stderr] (default task-2)    at ca.mcgill.muhc.oword.OwordBean.writeToQueue(OwordBean.java:2835)

             

            21:50:06,382 ERROR [stderr] (default task-2)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

             

            21:50:06,385 ERROR [stderr] (default task-2)    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

             

            21:50:06,388 ERROR [stderr] (default task-2)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

             

            21:50:06,391 ERROR [stderr] (default task-2)    at java.lang.reflect.Method.invoke(Unknown Source)

             

            21:50:06,394 ERROR [stderr] (default task-2)    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

             

            21:50:06,397 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,400 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

             

            21:50:06,403 ERROR [stderr] (default task-2)    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)

             

            21:50:06,406 ERROR [stderr] (default task-2)    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)

             

            21:50:06,409 ERROR [stderr] (default task-2)    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

             

            21:50:06,412 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,415 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

             

            21:50:06,418 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,421 ERROR [stderr] (default task-2)    at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

             

            21:50:06,424 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,427 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:103)

             

            21:50:06,430 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:58)

             

            21:50:06,433 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,436 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

             

            21:50:06,439 ERROR [stderr] (default task-2)    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)

             

            21:50:06,442 ERROR [stderr] (default task-2)    at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

             

            21:50:06,445 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,448 ERROR [stderr] (default task-2)    at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

             

            21:50:06,452 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,455 ERROR [stderr] (default task-2)    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

             

            21:50:06,458 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,461 ERROR [stderr] (default task-2)    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

             

            21:50:06,464 ERROR [stderr] (default task-2)    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

             

            21:50:06,467 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,470 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.component.interceptors.NonPooledEJBComponentInstanceAssociatingInterceptor.processInvocation(NonPooledEJBComponentInstanceAssociatingInterceptor.java:59)

             

            21:50:06,474 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,477 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

             

            21:50:06,480 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,483 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)

             

            21:50:06,486 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,489 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)

             

            21:50:06,492 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,495 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

             

            21:50:06,498 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,501 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)

             

            21:50:06,504 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,507 ERROR [stderr] (default task-2)    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

             

            21:50:06,510 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,513 ERROR [stderr] (default task-2)    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)

             

            21:50:06,516 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,519 ERROR [stderr] (default task-2)    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

             

            21:50:06,522 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,525 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

             

            21:50:06,528 ERROR [stderr] (default task-2)    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:634)

             

            21:50:06,531 ERROR [stderr] (default task-2)    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

             

            21:50:06,534 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,537 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

             

            21:50:06,540 ERROR [stderr] (default task-2)    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

             

            21:50:06,543 ERROR [stderr] (default task-2)    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)

             

            21:50:06,546 ERROR [stderr] (default task-2)    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

             

            21:50:06,549 ERROR [stderr] (default task-2)    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)

             

            21:50:06,552 ERROR [stderr] (default task-2)    at org.jboss.as.webservices.invocation.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:135)

             

            21:50:06,556 ERROR [stderr] (default task-2)    at org.jboss.wsf.stack.cxf.JBossWSInvoker.performInvocation(JBossWSInvoker.java:185)

             

            21:50:06,559 ERROR [stderr] (default task-2)    at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:97)

             

            21:50:06,562 ERROR [stderr] (default task-2)    at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:232)

             

            21:50:06,565 ERROR [stderr] (default task-2)    at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:69)

             

            21:50:06,568 ERROR [stderr] (default task-2)    at org.jboss.wsf.stack.cxf.JBossWSInvoker.invoke(JBossWSInvoker.java:151)

             

            21:50:06,571 ERROR [stderr] (default task-2)    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59)

             

            21:50:06,574 ERROR [stderr] (default task-2)    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

             

            21:50:06,577 ERROR [stderr] (default task-2)    at java.util.concurrent.FutureTask.run(Unknown Source)

             

            21:50:06,580 ERROR [stderr] (default task-2)    at org.apache.cxf.interceptor.ServiceInvokerInterceptor$2.run(ServiceInvokerInterceptor.java:126)

             

            21:50:06,583 ERROR [stderr] (default task-2)    at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

             

            21:50:06,586 ERROR [stderr] (default task-2)    at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:131)

             

            21:50:06,589 ERROR [stderr] (default task-2)    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)

             

            21:50:06,592 ERROR [stderr] (default task-2)    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)

             

            21:50:06,595 ERROR [stderr] (default task-2)    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)

             

            21:50:06,598 ERROR [stderr] (default task-2)    at org.jboss.wsf.stack.cxf.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:111)

             

            21:50:06,601 ERROR [stderr] (default task-2)    at org.jboss.wsf.stack.cxf.transport.ServletHelper.callRequestHandler(ServletHelper.java:136)

             

            21:50:06,604 ERROR [stderr] (default task-2)    at org.jboss.wsf.stack.cxf.CXFServletExt.invoke(CXFServletExt.java:88)

             

            21:50:06,608 ERROR [stderr] (default task-2)    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)

             

            21:50:06,611 ERROR [stderr] (default task-2)    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)

             

            21:50:06,614 ERROR [stderr] (default task-2)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)

             

            21:50:06,617 ERROR [stderr] (default task-2)    at org.jboss.wsf.stack.cxf.CXFServletExt.service(CXFServletExt.java:136)

             

            21:50:06,621 ERROR [stderr] (default task-2)    at org.jboss.wsf.spi.deployment.WSFServlet.service(WSFServlet.java:140)

             

            21:50:06,624 ERROR [stderr] (default task-2)    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

             

            21:50:06,627 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86)

             

            21:50:06,630 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

             

            21:50:06,633 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

             

            21:50:06,636 ERROR [stderr] (default task-2)    at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

             

            21:50:06,639 ERROR [stderr] (default task-2)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

             

            21:50:06,642 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

             

            21:50:06,645 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

             

            21:50:06,648 ERROR [stderr] (default task-2)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

             

            21:50:06,653 ERROR [stderr] (default task-2)    at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

             

            21:50:06,657 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

             

            21:50:06,661 ERROR [stderr] (default task-2)    at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)

             

            21:50:06,665 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72)

             

            21:50:06,669 ERROR [stderr] (default task-2)    at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

             

            21:50:06,672 ERROR [stderr] (default task-2)    at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)

             

            21:50:06,675 ERROR [stderr] (default task-2)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

             

            21:50:06,678 ERROR [stderr] (default task-2)    at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

             

            21:50:06,681 ERROR [stderr] (default task-2)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

             

            21:50:06,684 ERROR [stderr] (default task-2)    at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

             

            21:50:06,687 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282)

             

            21:50:06,690 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261)

             

            21:50:06,693 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:80)

             

            21:50:06,696 ERROR [stderr] (default task-2)    at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:172)

             

            21:50:06,699 ERROR [stderr] (default task-2)    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

             

            21:50:06,702 ERROR [stderr] (default task-2)    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

             

            21:50:06,705 ERROR [stderr] (default task-2)    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

             

            21:50:06,708 ERROR [stderr] (default task-2)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

             

            21:50:06,711 ERROR [stderr] (default task-2)    at java.lang.Thread.run(Unknown Source)

            • 3. Re: Need help writing a message to HornetQ. Failed to instantiate InitialContextFactory.
              Justin Bertram Master

              The error indicates that the JNDI string you're using for your lookup is incorrect.  Can you paste the configuration XML for the destination?

              • 4. Re: Need help writing a message to HornetQ. Failed to instantiate InitialContextFactory.
                fatbob73 Newbie

                I got it, I was using "jms/queue/test" instead I should be using "queue/test".


                Thanks for your help Justin!