4 Replies Latest reply on Nov 29, 2004 1:16 PM by abdenn

    BindException with NamingService

      I am trying to set up the cache invalidation service using the JMSCacheInvalidationBridge. I particularly want to juse the JMS invalidation bridge, because I want to be able to invalidate entity beans from Java Stored Procedures running in Oracle.

      Note: I am runing JBoss in the 'all' configuration.

      I bought the "JBoss AS Clustering" documentation from the JBoss website and faithfully followed the instructions in Chapter 8. This mainly means uncommenting the mbean section in cache-invalidation-service.xml.
      Although it is not documented, I have worked out that you need to comment out the JGCacheInvalidationBridge mbean section in cluster-service.xml if you are using the JMS one in cache-invalidation-service.xml.

      Having done this however, I still get an Exception in server.log during startup:

      ERROR [org.jboss.naming.NamingService] Could not start on port 1099
      java.net.BindException: Address already in use: JVM_Bind
      at java.net.PlainSocketImpl.socketBind(Native Method)
      ...

      At one point I did reinstall JBoss from the original distribution. Before that I was getting a similar error but the port was 1100. I think the only difference is the order that the services were getting loaded in.

      The most likely references to NamingService's I could find were in all/conf/jboss-service.xml and all/deploy/cluster-service.xml. The on one in cluster-service.xml is the HANamingService.
      Both of these services have "Port" attributes, which are set to 1099 in the former case and 1100 in the latter, so in theory there should be no clash.

      I can get rid of the Exception by setting the Port attribute in jboss-service.xml to -1, but I get errors further down the line from services that depend on this service.

      The only service that has been added as far as I can see is the JMS cache invalidation service. The only reference to a port number in cache-invalidation-service.xml is the atttribute ProviderUrl which is in reference to other nodes in a cluster.

      Is it possible this bridge is locking up port 1099?

      The otther odd thing is that I can't telnet to port 1099 once the server has started. So although it reports a BindException, it doesn't look like port 1099 actually gets used by anything.

      Confused

        • 1. Re: BindException with NamingService

          As off this morning the I no longer get a BindException when I restart JBoss. The only explanation I can think of is the fact that I rebooted. I'm running Windows 2000, so this kind of makes sense to me.

          My problems aren't over though, I now get a new exception,

          2004-03-29 11:47:16,269 ERROR [org.jboss.cache.invalidation.bridges.JMSCacheInvalidationBridge] Starting failed
          javax.naming.NameNotFoundException: ConnectionFactory not bound
          at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)


          Looking cache-invalidation-service.xml I see the following attribute for the JMSCacheInvalidationBridge mbean,

          <attribute name="ConnectionFactoryName">java:/ConnectionFactory</attribute>


          Do I need to change this to something else?

          • 2. Re: BindException with NamingService

             

            <mbean code="org.jboss.cache.invalidation.bridges.JMSCacheInvalidationBridge"
             name="jboss.cache:service=InvalidationBridge,type=JMS">
             <depends>jboss.cache:service=InvalidationManager</depends>
             <depends>jboss.mq.destination:service=Topic,name=JMSCacheInvalidationBridge</depends>
             <attribute name="InvalidationManager">jboss.cache:service=InvalidationManager</attribute>
             <attribute name="ConnectionFactoryName">java:/ConnectionFactory</attribute>
             <attribute name="TopicName">topic/JMSCacheInvalidationBridge</attribute>
             <attribute name="PropagationMode">1</attribute>
             </mbean>


            After further experimenation I've found that the ConnectionFactoryName attribute is correct. I can look it up in JNDI with a client, and if I touch the cache-invalidation-service.xml file to redeploy it, the cache invalidation bridge is installed properly and I can send messages to it.
            However I still get the "ConnectionFactory not bound" exception on startup, and the cache invalidation service does not deploy without manual intervention.

            I suppose I need to define another "depends" element in the above mbean declaration. Can anyone suggest what this mbean needs to depend upon in order for it to deploy only when ConnectionFactory is bound?

            • 3. Re: BindException with NamingService
              starksm64

              This is the same problem as raised in your other post:

              http://www.jboss.org/index.html?module=bb&op=viewtopic&t=47712

              where the solution was to add a dependency on the service providing the java:/ConnectionFactory binding:

              <depends>jboss.mq:service=InvocationLayer,type=JVM</depends>
              


              • 4. Re: BindException with NamingService
                abdenn

                I installed jboss4 RC1. I am getting this error:

                12:36:41,890 ERROR [NamingService] Could not start on port 1099
                java.net.BindException: Address already in use: JVM_Bind
                at java.net.PlainSocketImpl.socketBind(Native Method)
                at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
                at java.net.ServerSocket.bind(ServerSocket.java:318)


                I didn't change any configuration file. Basically, I unziped the file, I run the batch file to start jboss.

                Any idea how to fix this?

                Info: JDK 1.4.2, Windows XP Prof

                Thanks