3 Replies Latest reply on Jan 5, 2005 1:17 PM by gwichman

    Installing JBoss on Linux via service

    gwichman Newbie

      The getting started guide is pretty weak on how to setup JBoss as a service on Linux. I'm an experienced UNIX admin and i'm still having issues getting it to work. Thanks to doing searches in here i'm making progress but here is where i'm at..

      first downloaded j2sdk1.4.2_06 for linux as rpm and installed..
      added symbolic link /usr/bin/java -> /usr/java/j2sdk1.4.2_06/bin/java

      untar'd JBoss 4.0.1 to /usr/local/
      created symbolic link from /usr/local/jboss to /usr/local/jboss-4.0.1
      chown jboss.jboss on /usr/local/jboss directory structure
      created jboss user, group, and set password
      copied jboss_init_redhat.sh to /etc/init.d/jboss
      chkconfig --add jboss
      edited /etc/init.d/jboss and changed:
      1. added JBOSS_CONSOLE to /home/jboss/jboss.log
      2. added JAVA_HOME to /usr/java/j2sdk1.4.2_06/
      touch /home/jboss/jboss.log
      chmod 777 /home/jboss/jboss.log

      Those last two steps i did after noticing errors during startup that it couldn't write to JBOSS_CONSOLE. I looked in /home/jboss and found the file with 0 bytes with ownership root.root. Interesting.. the init script creates the file as root.root but then tries to write to it as user jboss. Kind of broken if u ask me..

      Anyways, i can start it find if i go to /usr/bin/jboss-4.0.1/bin and run.sh. I get no warnings, errors, or other exceptions. I see the microkernel note as i expect and can shut it down via ctrl-C. All is good..

      except..

      service jboss start produces different results. . I get some exceptions and never see the microkernel message..

      exceptions:

      18:17:26,207 INFO [STDOUT] Loading properties file: resourceName = '/org/exolab/castor/castor.properties' fileName = 'castor.properties'
      18:17:26,630 WARN [TrapEmitter] Error compiling monitoring manager #0
      java.net.BindException: Cannot assign requested address
      at java.net.PlainDatagramSocketImpl.bind(Native Method)
      at java.net.DatagramSocket.bind(DatagramSocket.java:368)
      at java.net.DatagramSocket.(DatagramSocket.java:210)
      at java.net.DatagramSocket.(DatagramSocket.java:261)
      at org.opennms.protocols.snmp.SnmpPortal.(SnmpPortal.java:256)
      at org.opennms.protocols.snmp.SnmpPortal.(SnmpPortal.java:227)
      at org.opennms.protocols.snmp.SnmpSession.(SnmpSession.java:747)


      (skipping some of it)

      18:17:26,765 INFO [SnmpAgentService] SNMP agent going active
      18:17:26,789 ERROR [TrapEmitter] SNMP send error for localhost/127.0.0.1:1162: <java.lang.NullPointerException>
      18:17:28,229 INFO [DefaultPartition] Initializing
      18:17:28,446 ERROR [JChannel] exception: java.lang.Exception: exception caused by UDP.start(): java.lang.Exception: UDP.createSockets(): cannot list on any port in range 0-1
      18:17:28,447 ERROR [ClusterPartition] Starting failed jboss:service=DefaultPartition
      ChannelException: java.lang.Exception: exception caused by UDP.start(): java.lang.Exception: UDP.createSockets(): cannot list on any port in range 0-1
      at org.jgroups.JChannel.connect(JChannel.java:328)
      at org.jboss.ha.framework.server.ClusterPartition.startService(ClusterPartition.java:297)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)


      (skipping some)

      18:17:28,451 WARN [ServiceController] Problem starting service jboss:service=DefaultPartition
      ChannelException: java.lang.Exception: exception caused by UDP.start(): java.lang.Exception: UDP.createSockets(): cannot list on any port in range 0-1
      at org.jgroups.JChannel.connect(JChannel.java:328)
      at org.jboss.ha.framework.server.ClusterPartition.startService(ClusterPartition.java:297)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
      at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)


      (skipping some)

      18:17:28,789 INFO [STDOUT] [ jacorb.home unset! Will use '.' ]
      18:17:28,789 INFO [STDOUT] [ File ./jacorb.properties for configuration jacorb not found ]
      18:17:29,134 INFO [interceptors] InterceptorManager started with 2 SIs, 2 CIs and 4 IORIs
      18:17:29,368 INFO [orb] ORB run
      18:17:29,532 INFO [CorbaNamingService] Naming: [IOR:000000000000002B49444C3A6F6D672E6F72672F43.....


      Thats it.. It seems to throw exceptions related to SNMP and UDP sockets. Errors i don't see if i run run.sh manually.

      Appreciate any thoughts/directions on what i'm missing. It would be even more helpful if the getting started guide actually got me started :)

      Thanks,
      Gerald





        • 1. Re: Installing JBoss on Linux via service
          gwichman Newbie

          Looks like it does eventually start up.. I let it wrong longer this time but there were more exceptions..

          18:36:25,991 ERROR [CorbaTransactionService] Cannot bind transaction factory in CORBA naming service:
          org.omg.CORBA.TRANSIENT: Retries exceeded, couldn't reconnect to 10.1.82.23:3528 vmcid: 0x0 minor code: 0 completed: No
          at org.jacorb.orb.iiop.ClientIIOPConnection.connect(Unknown Source)
          at org.jacorb.orb.giop.GIOPConnection.write(Unknown Source)
          at org.jacorb.orb.CDROutputStream.write(Unknown Source)


          (skip)

          18:36:25,995 ERROR [CorbaTransactionService] Starting failed jboss:service=CorbaTransaction
          java.lang.Exception: Cannot bind transaction factory in CORBA naming service:
          org.omg.CORBA.TRANSIENT: Retries exceeded, couldn't reconnect to 10.1.82.23:3528 vmcid: 0x0 minor code: 0 completed: No
          at org.jboss.tm.iiop.CorbaTransactionService.startService(CorbaTransactionService.java:144)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)


          (skip)

          18:36:25,998 WARN [ServiceController] Problem starting service jboss:service=CorbaTransaction
          java.lang.Exception: Cannot bind transaction factory in CORBA naming service:
          org.omg.CORBA.TRANSIENT: Retries exceeded, couldn't reconnect to 10.1.82.23:3528 vmcid: 0x0 minor code: 0 completed: No
          at org.jboss.tm.iiop.CorbaTransactionService.startService(CorbaTransactionService.java:144)
          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)


          (skip)


          18:36:27,313 INFO [MailService] Mail Service bound to java:/Mail
          18:36:28,316 WARN [ServiceController] Problem starting service jboss.remoting:service=Connector,transport=Socket
          java.net.BindException: Cannot assign requested address
          at java.net.PlainSocketImpl.socketBind(Native Method)
          at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
          at java.net.ServerSocket.bind(ServerSocket.java:318)
          at java.net.ServerSocket.(ServerSocket.java:185)


          (skip)

          18:36:28,347 ERROR [AsyncServerInvoker] AsynchServerInvoker could not be initialized:
          java.net.BindException: Cannot assign requested address
          at java.net.PlainSocketImpl.socketBind(Native Method)
          at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:331)
          at java.net.ServerSocket.bind(ServerSocket.java:318)


          (skip)

          18:36:28,351 WARN [ServiceController] Problem starting service jboss.remoting:service=Connector,transport=Async
          java.lang.reflect.InvocationTargetException
          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)


          (skip)

          18:36:37,631 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-8080
          18:36:37,944 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009
          18:36:37,950 INFO [JkMain] Jk running ID=0 time=0/204 config=null
          18:36:37,964 INFO [Server] JBoss (MX MicroKernel) [4.0.1 (build: CVSTag=JBoss_4_0_1 date=200412230944)] Started in 19m:37s:994ms


          finally started in 20 minutes!

          MBeans waiting for other MBeans:
          ObjectName: jboss.j2ee:jndiName=clustering/HTTPSession,service=EJB
          state: CREATED
          I Depend On: jboss:service=DefaultPartition
          jboss:service=invoker,type=jrmp

          Depends On Me: jboss:service=ClusteredHttpSession

          ObjectName: jboss:service=ClusteredHttpSession
          state: CREATED
          I Depend On: jboss.j2ee:jndiName=clustering/HTTPSession,service=EJB

          Depends On Me:
          ObjectName: jboss:service=DefaultPartition
          state: FAILED
          I Depend On:
          Depends On Me: jboss.j2ee:jndiName=clustering/HTTPSession,service=EJB
          jboss:service=HASessionState
          jboss:service=HAJNDI
          jboss.cache:service=InvalidationBridge,type=JavaGroups
          jboss.ha:service=HASingletonDeployer
          jboss:partition=DefaultPartition,service=FarmMember
          ChannelException: java.lang.Exception: exception caused by UDP.start(): java.lang.Exception: UDP.createSockets(): cannot list on any port in range 0-1
          ObjectName: jboss:service=HASessionState
          state: CREATED
          I Depend On: jboss:service=DefaultPartition

          Depends On Me:
          ObjectName: jboss:service=HAJNDI
          state: CREATED
          I Depend On: jboss:service=DefaultPartition

          Depends On Me:
          ObjectName: jboss.cache:service=InvalidationBridge,type=JavaGroups
          state: CREATED
          I Depend On: jboss:service=DefaultPartition
          jboss.cache:service=InvalidationManager


          This last section is slightly before the microkernel message.. the sense i'm getting here is there is some kind of cascading failure. I'm not sure what the DefaultPartition service is or why this occurs though. Again appreciate any pointers. I'll keep searching around and playing with it otherwise..

          • 2. Re: Installing JBoss on Linux via service
            Lothar Egger Newbie

            hi gerald

            ifaik the init_redhat script sets $JAVA to /usr/local/jdk.

            we had also some problems with jboss initscripts, try to print out all
            $JAVA_HOME, $JBOSS_HOME.... from the initscript.

            there is also a run.conf in jboss/bin/ ,
            run.sh reads the run.conf where you can set some of the $JBOSS_HOME..

            hth
            L

            • 3. Re: Installing JBoss on Linux via service
              gwichman Newbie

              Well i found one problem.. JAVA_HOME isn't set when the init script runs run.sh even though i have it set in the init script and did an export.

              After some further digging, i found run.conf in the jboss bin directory next to run.sh that has a place holder for setting JAVA_HOME. Gee it'd have been nice if the getting started guide had mentioned this file existing and recommended looking it over and setting it up. Apparently i'm supposed to know this though..