2 Replies Latest reply on Mar 10, 2009 1:28 PM by bob.lyman

    JBoss 4.0.1sp1 + Apache2.2 + mod_proxy_ajp + mysql + hiberna

    bob.lyman Newbie

      I have an installation whereby we use Apache 2.2 as a proxy to two JBoss instances using mod_proxy_ajp and MySQL for the database server.

      Viewed as such:

      Apache2.2
      |
      |--->JBoss Instance 1 (JB1)--->Hibernate--->MySQL DB1
      |
      |--->JBoss Instance 2 (JB2)--->Hibernate--->MySQL DB2

      Apache serves the proxy just fine, but the problem I'm having is with JBoss, MySQL and Hibernate. Regardless of which instance is served first, the other instance will not recognize any datasources within it's mysql-ds.xml file.

      So if JB1 is called first then when JB2 is called it reports in the log file "[net.sf.connection.DataSourceConnectionProvider] Could not find datasource java:/DB2" even though the mysql-ds.xml file for both instances is exactly the same. and contains the connection info for both instances.

      Any help would be greatly appreciated

      Best regards,

      Bob Lyman
      Senior Consultant
      Buan Consulting

        • 1. Re: JBoss 4.0.1sp1 + Apache2.2 + mod_proxy_ajp + mysql + hib
          bob.lyman Newbie

          Ok,

          Figured it out. You need to bump the port numbers for the JMX Invokers on subsequent instances. Under Apache 1.3 and mod_jk this doesn't seem to be an issue, but with Apache 2.2 and mod_proxy / mod_proxy_ajp this causes a problem. See changes to jboss-service.xml below for an example.

          -Bob

          <!-- ==================================================================== -->
          <!-- Invokers to the JMX node -->
          <!-- ==================================================================== -->

          <!-- RMI/JRMP invoker -->

          44464447 <-- Was 4444 -->
          ${jboss.bind.address}
          <!--
          custom
          custom
          custom
          ssl-domain-name
          -->
          jboss:service=TransactionManager




          jboss:service=TransactionManager



          1
          300
          300
          60000
          ${jboss.bind.address}
          4447 <-- Was 4445 -->
          ${jboss.bind.address}
          0
          false

          <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager

          • 2. Re: JBoss 4.0.1sp1 + Apache2.2 + mod_proxy_ajp + mysql + hib
            bob.lyman Newbie

            Oops! Forgot to mark it as code for BB!


            <!-- ==================================================================== -->
             <!-- Invokers to the JMX node -->
             <!-- ==================================================================== -->
            
             <!-- RMI/JRMP invoker -->
             <mbean code="org.jboss.invocation.jrmp.server.JRMPInvoker"
             name="jboss:service=invoker,type=jrmp">
             <attribute name="RMIObjectPort">4446</attribute> <-- Was 4444 -->
             <attribute name="ServerAddress">${jboss.bind.address}</attribute>
             <!--
             <attribute name="RMIClientSocketFactory">custom</attribute>
             <attribute name="RMIServerSocketFactory">custom</attribute>
             <attribute name="RMIServerSocketAddr">custom</attribute>
             <attribute name="SecurityDomain">ssl-domain-name</attribute>
             -->
             <depends>jboss:service=TransactionManager</depends>
             </mbean>
            
             <mbean code="org.jboss.invocation.local.LocalInvoker"
             name="jboss:service=invoker,type=local">
            
             <depends>jboss:service=TransactionManager</depends>
             </mbean>
            
             <mbean code="org.jboss.invocation.pooled.server.PooledInvoker"
             name="jboss:service=invoker,type=pooled">
             <attribute name="NumAcceptThreads">1</attribute>
             <attribute name="MaxPoolSize">300</attribute>
             <attribute name="ClientMaxPoolSize">300</attribute>
             <attribute name="SocketTimeout">60000</attribute>
             <attribute name="ServerBindAddress">${jboss.bind.address}</attribute>
             <attribute name="ServerBindPort">4447</attribute> <-- Was 4445 -->
             <attribute name="ClientConnectAddress">${jboss.bind.address}</attribute>
             <attribute name="ClientConnectPort">0</attribute>
             <attribute name="EnableTcpNoDelay">false</attribute>
            
             <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
             </mbean>