4 Replies Latest reply on Oct 10, 2017 6:03 AM by Yair Shkedi

    can't configure jms on wildfly 10

    Yair Shkedi Newbie

      Hi all,

      I am upgrading jboss 4.02 to wildfly 10.

      I am trying to configure the jms in my server.

      I configured it in the standalone.xml in the following shape. as I saw in the wildfly 10 guide: Messaging configuration - WildFly 10 - Project Documentation Editor :

       

      <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">

      <server name="default">

      <http-connector name="http-connector"

      socket-binding="http"

      endpoint="http-acceptor" />

      <http-connector name="http-connector-throughput"

      socket-binding="http"

      endpoint="http-acceptor-throughput">

      <param name="batch-delay"

         value="50"/>

      </http-connector>

      <in-vm-connector name="in-vm"

      server-id="0"/>

      <connection-factory name="InVmConnectionFactory"

      connectors="in-vm"

      entries="java:/ConnectionFactory" />

      <pooled-connection-factory name="activemq-ra"

      transaction="xa"

      connectors="in-vm"

      entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory"/>

       

      <jms-topic name="queue/activities"

         entries="queue/activities java:jboss/exported/queue/activities" />

         </server>

      </subsystem>

       

      in my code I have the lines:

       

             Properties props = new Properties();

              props.setProperty("java:global/java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");

              props.setProperty("java:global/java.naming.factory.url.pkgs", "org.jboss.naming");

              props.setProperty("java:global/java.naming.provider.url", url_);

       

              Context context = new InitialContext(props);

       

              TopicConnectionFactory tcf = (TopicConnectionFactory) context.lookup("java:jboss/DefaultJMSConnectionFactory");

              conn = tcf.createTopicConnection();

              topic = (Topic) context.lookup(name_);

       

              session = conn.createTopicSession(false, TopicSession.AUTO_ACKNOWLEDGE);

       

      but in the bold line, I got the following exception:

      javax.jms.JMSException: Failed to create session factory

      The trace I get is:

       

      2017-10-09 13:44:09,658 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.PoolByCri] (default task-24) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Failed to create session factory

      at org.apache.activemq.artemis.ra.ActiveMQRAManagedConnection.setup(ActiveMQRAManagedConnection.java:796)

      at org.apache.activemq.artemis.ra.ActiveMQRAManagedConnection.<init>(ActiveMQRAManagedConnection.java:163)

      at org.apache.activemq.artemis.ra.ActiveMQRAManagedConnectionFactory.createManagedConnection(ActiveMQRAManagedConnectionFactory.java:149)

      at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1319)

      at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:496)

      at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:626)

      at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:598)

      at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.getManagedConnection(AbstractConnectionManager.java:590)

      at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.getManagedConnection(TxConnectionManagerImpl.java:429)

      at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:747)

      at org.apache.activemq.artemis.ra.ActiveMQRASessionFactoryImpl.allocateConnection(ActiveMQRASessionFactoryImpl.java:853)

      at org.apache.activemq.artemis.ra.ActiveMQRASessionFactoryImpl.createTopicSession(ActiveMQRASessionFactoryImpl.java:367)

      at com.xor.genesis.core.jms.clients.CGOSender.initializeSender(CGOSender.java:47)

      at com.xor.genesis.core.jms.clients.CGOSender.<init>(CGOSender.java:29)

      at com.xor.genesis.core.jms.clients.InitMDBMessageSender.sendActivityMessage(InitMDBMessageSender.java:72)

      at com.xor.genesis.core.commands.dispatchers.CGOAbstractCommandsHandler.saveCommandInUserActivity(CGOAbstractCommandsHandler.java:134)

      at com.xor.genesis.core.commands.dispatchers.CGOAbstractCommandsDispatcher.dispatchCommand(CGOAbstractCommandsDispatcher.java:146)

      at com.xor.genesis.dispatchers.commandsDispatcher.CommandsDispatcherExecutor.dispatchCommand(CommandsDispatcherExecutor.java:61)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

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

      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.delegateInterception(Jsr299BindingsInterceptor.java:70)

      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:80)

      at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)

      at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

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

      at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)

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

      at org.jboss.as.jpa.interceptor.SBInvocationInterceptor.processInvocation(SBInvocationInterceptor.java:47)

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

      at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)

      at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)

      at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)

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

      at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)

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

      at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

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

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

      at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)

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

      at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)

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

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:263)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.supports(CMTTxInterceptor.java:374)

      at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:243)

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

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

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

      at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)

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

      at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)

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

      at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)

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

      at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)

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

      at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

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

      at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)

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

      at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

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

      at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

      at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)

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

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

      at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)

      at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

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

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

      at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:195)

      at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)

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

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

      at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

      at com.xor.genesis.dispatchers.commandsDispatcher.CommandsDispatcherLocal$$$view140.dispatchCommand(Unknown Source)

      at com.xor.genesis.cgo.controllers.commands.CommandsController.executeCommand(CommandsController.java:132)

      at com.xor.genesis.cgo.controllers.commands.queries.CGOQueryCommandsController.execute(CGOQueryCommandsController.java:62)

      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)

      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)

      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1198)

      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:416)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

      at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:81)

      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

      at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:265)

      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchToPath(ServletInitialHandler.java:200)

      at io.undertow.servlet.spec.RequestDispatcherImpl.forwardImpl(RequestDispatcherImpl.java:193)

      at io.undertow.servlet.spec.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:106)

      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1087)

      at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:400)

      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)

      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1198)

      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:416)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)

      at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)

      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)

      at com.xor.genesis.core.utils.ParamFilter.doFilter(ParamFilter.java:35)

      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

      at com.xor.genesis.cgo.filters.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:54)

      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

      at com.xor.genesis.cgo.filters.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:139)

      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

      at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:391)

      at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60)

      at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

      at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

      at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

      at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

      at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

      at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

      at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

      at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

      at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

      at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

      at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

      at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:284)

      at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:263)

      at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

      at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:174)

      at io.undertow.server.Connectors.executeRootHandler(Connectors.java:202)

      at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:793)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

      Caused by: javax.jms.JMSException: Failed to create session factory

      at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:727)

      at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createXATopicConnection(ActiveMQConnectionFactory.java:343)

      at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createXATopicConnection(ActiveMQConnectionFactory.java:339)

      at org.apache.activemq.artemis.ra.ActiveMQRAManagedConnection.setup(ActiveMQRAManagedConnection.java:757)

      ... 147 more

      Caused by: ActiveMQNotConnectedException[errorType=NOT_CONNECTED message=AMQ119007: Cannot connect to server(s). Tried with all available servers.]

      at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:777)

      at org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory.createConnectionInternal(ActiveMQConnectionFactory.java:724)

      ... 150 more

       

      if I change the java:jboss/DefaultJMSConnectionFactory value to be ConnectionFactory, I got same exception in the line

      tcf.createTopicConnection();

       

      It is seem that from some reason, the server is not defined/started, but I write exactly in the guide and it is not mentined that should add more things.

      please help me to solve the issue.

       

      Thanks,

        • 1. Re: can't configure jms on wildfly 10
          Miroslav Novak Master

          There is most likely some problem in the config. Messaging subsystem is configured by default in standalone-full.xml and standalone-full-ha.xml. Could you try to use those files? - "sh standalone.sh -c standalone-full-ha.xml"

          • 2. Re: can't configure jms on wildfly 10
            Yair Shkedi Newbie

            Thanks on your replay!

            I am not understanding, I saw in the guide that I can config it on standalone.xml?

            I make the config exactly like in the wildfly guide that I assume that there is no mistake there.

             

            Basically I am new on wildfly, if I am using the standalone-full, should I move all my custimition that I did in standalone file to standalone full file?

            should I started the server (I do it via eclipse) in other way when I am using standalone full?

             

            something that I thin about, should I bring activeMQ and start it by myself, or is it built in wildfly?

            Thanks again on your help, I will try it and see if there is improvement.

             

            Thanks,

            • 3. Re: can't configure jms on wildfly 10
              Miroslav Novak Master

              The problems you see are following. In the first case you're using connection factory "java:jboss/DefaultJMSConnectionFactory" created by Artemis Resource Adapter. It's using "in-vm-acceptor" but this one is not defined. This CF is used mostly in EJBs, Servlets and MDBs and needs further configuration in ejb subsystem as it's done in standalone-full.xml and standalone-full-ha.xml.

               

              In case of "java:/ConnectionFactory" it's simple JMS connection factory and fails again because of missing "in-vm-acceptor". I recommend to simply use "java:jboss/DefaultJMSConnectionFactory" and switch to standalone-full.xml. Configuring messaging-activemq subsystem from scratch is not simple task. It's much better to use prepared configuration.

              • 4. Re: can't configure jms on wildfly 10
                Yair Shkedi Newbie

                Thanks again that you are trying to help me!

                 

                this is from the wildfly guide line

                element to the xml or by using the following CLI operation: You can see thddsdsגגגגdddddat it is not mandatory yo use the standalone-full.xml, basiaclly u can add the activemq module to the standalone and it is enough. Also, I looked for the in-vm-acceptor in the standalone-full file but also there it is not exist. I am not sure that this is the root cause of the issuedy: Arial, Helvetica, FreeSans, sans-serif;">Required Extension

                The configuration options discussed in this section assume that the the org.wildfly.extension.messaging-activemq extension is present in your configuration. This extension is not included in the standard standalone.xml and standalone-ha.xml configurations included in the WildFly distribution. It is, however, included with the standalone-full.xml and standalone-full-ha.xml configurations.

                You can add the extension to a configuration without it either by adding an <extension module="org.wildfly.extension.messaging-activemq"/> element to the xml or by using the following CLI operation:

                 

                From some reason, the

                                <http-acceptor name="http-acceptor" http-listener="default"/>

                                <http-acceptor name="http-acceptor-throughput" http-listener="default">

                                    <param name="batch-delay" value="50"/>

                                    <param name="direct-deliver" value="false"/>

                                </http-acceptor>

                                <in-vm-acceptor name="in-vm" server-id="0"/>

                 

                is missing from the guideline.

                Thanks on your help, becouse of u I overcomed on the issue.