8 Replies Latest reply on Aug 20, 2012 11:16 PM by johanvermeij

    Failed JMS Environment: ConnectionFactory

    oosie

      I'm trying to use JMS in a clustered JBoss AS 7 environment. I'm using JBoss AS 7.1.1.Final in order to achieve this.

       

      I followed the instructions as described in the following document: https://docs.jboss.org/author/display/AS71/AS7+Cluster+Howto

       

      I have one master and three slaves defined. I can start-up the master and when I start-up the slaves, the correctly authenticate to the master. So far, so good.

       

      The documentation doesn't cover any specifics regarding JMS configuration in a cluster. It'll be best efforts from this point on.

       

      I'm using the InitialContext approach (with an emtpy Environment) in order to get the ConnectionFactory:

       

      new InitialContext(new Properties()).lookup("java:/ConnectionFactory");

       

      However, when trying to deploy my application I get the following exception:

       

      An error occurred while trying to set up!: com.icesoft.net.messaging.MessageServiceException: javax.naming.NameNotFoundException: ConnectionFactory -- service jboss.naming.context.java.ConnectionFactory

       

      When starting up the JBoss instances I see the following in the logs as well:

       

      [Server:server-three-node1] JBAS014775:    New missing/unsatisfied dependencies:

      [Server:server-three-node1]        service jboss.binding.jacorb (missing) dependents: [service jboss.jacorb.orb-service]

      [Server:server-three-node1]        service jboss.binding.jacorb-ssl (missing) dependents: [service jboss.jacorb.orb-service]
      [Server:server-three-node1]        service jboss.binding.messaging (missing) dependents: [service jboss.messaging.default]

      [Server:server-three-node1]        service jboss.binding.messaging-throughput (missing) dependents: [service jboss.messaging.default]

       

      The server-three-node1 is defined according to the document:

       

      <server name="server-three-node1" group="other-server-group" auto-start="true">

          <socket-bindings port-offset="250"/>

      </server>

       

      The other-server-group is defined as default:

       

      <server-group name="other-server-group" profile="full-ha">

          <jvm name="default">

              <heap size="64m" max-size="512m"/>

          </jvm>

          <socket-binding-group ref="ha-sockets"/>

      </server-group>

       

      Now I noticed that the ha-sockets socket-binding-group lacked declarations for the jacorb, jacorb-ssl, messaging and messaging-throughput ports. But switching to full-ha-sockets didn't help. I'm still getting the JBAS014775 message in the logs and I still can't lookup the ConnectionFactory.

       

      What am I missing?

       

      Thanks,

      Jack...

        • 1. Re: Failed JMS Environment: ConnectionFactory
          ranga033

          Try using full-ha-sockets in other-server-group, worked for me. You have mentioned you tried already..Are you getting the same error ?

          • 2. Re: Failed JMS Environment: ConnectionFactory
            oosie

            As switching to full-ha-sockets for the other-server-group worked for you, I decided to start from scratch again with JBoss AS 7.1.1.Final and use full-ha-sockets off the bat. Currently, I don't see the error anymore. But now I'm getting the following exception:

             

            [Server:node1-server-three] 16:43:14,590 ERROR [org.hornetq.core.protocol.core.impl.HornetQPacketHandler] (Old I/O server worker (parentId: 4720458, [id: 0x0048074a, node1.o-net.domain/192.168.2.211:5695])) Failed to create session : HornetQException[errorCode=105 message=Unable to validate user: HORNETQ.CLUSTER.ADMIN.USER]

            [Server:node1-server-three]     at org.hornetq.core.security.impl.SecurityStoreImpl.authenticate(SecurityStoreImpl.java:126) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.server.impl.HornetQServerImpl.createSession(HornetQServerImpl.java:807) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handleCreateSession(HornetQPacketHandler.java:187) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.protocol.core.impl.HornetQPacketHandler.handlePacket(HornetQPacketHandler.java:85) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.protocol.core.impl.ChannelImpl.handlePacket(ChannelImpl.java:508) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.doBufferReceived(RemotingConnectionImpl.java:556) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.protocol.core.impl.RemotingConnectionImpl.bufferReceived(RemotingConnectionImpl.java:517) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.remoting.server.impl.RemotingServiceImpl$DelegatingBufferHandler.bufferReceived(RemotingServiceImpl.java:533) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.remoting.impl.netty.HornetQChannelHandler.messageReceived(HornetQChannelHandler.java:73) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.StaticChannelPipeline$StaticChannelHandlerContext.sendUpstream(StaticChannelPipeline.java:534) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:287) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.decode(HornetQFrameDecoder2.java:169) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.hornetq.core.remoting.impl.netty.HornetQFrameDecoder2.messageReceived(HornetQFrameDecoder2.java:134) [hornetq-core-2.2.13.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:372) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.StaticChannelPipeline.sendUpstream(StaticChannelPipeline.java:367) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.channel.socket.oio.OioWorker.run(OioWorker.java:100) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at org.jboss.netty.util.VirtualExecutorService$ChildExecutorRunnable.run(VirtualExecutorService.java:181) [netty-3.2.6.Final.jar:]

            [Server:node1-server-three]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]

            [Server:node1-server-three]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]

            [Server:node1-server-three]     at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]

            • 3. Re: Failed JMS Environment: ConnectionFactory
              jbertram
              • 4. Re: Failed JMS Environment: ConnectionFactory
                johanvermeij

                Hi Justin

                 

                I am testing JBoss 7.1.1 clustering

                 

                The master comes up ok.

                 

                When I start a slave I get:

                06:46:13,368 ERROR [org.hornetq.core.protocol.core.impl.HornetQPacketHandler] (Old I/O server worker (parentId: 1201539476, [id: 0x479e0994, /192.168.2.4:5695])) Failed to create session : HornetQException[errorCode=105 message=Unable to validate user: HORNETQ.CLUSTER.ADMIN.USER]

                 

                 

                From my master:domain.xml


                <subsystem xmlns="urn:jboss:domain:messaging:1.1">

                <hornetq-server>

                <persistence-enabled>true</persistence-enabled>

                <!--cluster-user>DEFAULT_CLUSTER_USER</cluster-user-->

                <!--cluster-password>DEFAULT_CLUSTER_PASSWORD</cluster-password-->

                <journal-file-size>102400</journal-file-size>

                <journal-min-files>2</journal-min-files>

                 

                What do I insert for DEFAULT_CLUSTER_USER and DEFAULT_CLUSTER_PASSWORD ?

                 

                The slave has no domain.xml

                Where do I put the user id and password to allow connecting to the master ?

                 

                An example of master:domain.xml and slave:host.xml would be appreciated

                 

                Maybe I am completely on the wrong track.

                Clustering works fine with 7.1.0

                • 5. Re: Failed JMS Environment: ConnectionFactory
                  jbertram

                  The master comes up ok.

                   

                  When I start a slave I get:

                  06:46:13,368 ERROR [org.hornetq.core.protocol.core.impl.HornetQPacketHandler] (Old I/O server worker (parentId: 1201539476, [id: 0x479e0994, /192.168.2.4:5695])) Failed to create session : HornetQException[errorCode=105 message=Unable to validate user: HORNETQ.CLUSTER.ADMIN.USER]

                  This indicates that the <cluster-user> and <cluster-password> for the master and slave are either different from each other or they are using the default credentials.

                   

                  What do I insert for DEFAULT_CLUSTER_USER and DEFAULT_CLUSTER_PASSWORD ?

                  You can put whatever you want in there as long as you don't use "HORNETQ.CLUSTER.ADMIN.USER" and "CHANGE ME!!" respectively as those are the defaults.  As noted elsewhere, the default credentials will be rejected.

                  • 6. Re: Failed JMS Environment: ConnectionFactory
                    johanvermeij

                    Just after I posted the reply I found that through the management console hornetq security can be turned off

                     

                    This updates the domain.xml

                    <security-enabled>false</security-enabled>

                     

                    That is good enough for me because I am only testing.

                     

                    The last thing I am stuck on is the connection to Oracle

                    The master can see the database but the slaves cannot.

                    I use 2 slaves and both return this error after startup (at the very bottom of the log):

                     

                    JBAS014775:New missing/unsatisfied dependencies:

                    service jboss.jdbc-driver.o14 (missing) dependents: [service jboss.data-source.java:jboss/datasources/CapitalDS]

                     

                    Maybe you have seen this before but don't spend time on it if you haven't, I will work my way through it.

                     

                    /usr/share/JBoss/jboss-as-7.1.1.Final/modules/com/oracle/o14/main/module.xml contains:

                     

                    <module xmlns="urn:jboss:module:1.0" name="com.oracle.o14">

                      <resources>

                        <resource-root path="ojdbc6_g.jar"/>

                            <!-- Insert resources here -->

                      </resources>

                      <dependencies>

                         <module name="javax.api"/>

                         <module name="javax.transaction.api"/>

                      </dependencies>

                    </module>

                     

                    btw: I had to copy modules/org/hibernate/infinispan from 7.1.0 to 7.1.1, maybe that is related

                     

                    Thank you

                    • 7. Re: Failed JMS Environment: ConnectionFactory
                      jbertram

                      Now you're completely off the topic of this thread.  Please open another.

                       

                      To be clear, AS 7.1 didn't have any integration with HornetQ security so turning HornetQ security off in 7.1.1 basically makes it behave like 7.1.

                      • 8. Re: Failed JMS Environment: ConnectionFactory
                        johanvermeij

                        I have no problem placing cluster-user and password in master:domain.xml

                         

                                <subsystem xmlns="urn:jboss:domain:messaging:1.1">
                                    <hornetq-server>
                                        <persistence-enabled>true</persistence-enabled>
                                        <cluster-user>admin</cluster-user>
                                        <cluster-password>password</cluster-password>

                         

                        Question is: where do I put the corresponding entry on the slave ?

                         

                        The only thing I can think of is in host.xml since there is no domain.xml on slaves