5 Replies Latest reply on Nov 1, 2012 7:12 PM by sfcoy

    Jboss7 integration with CommonJ

    jboss7_newbie

      I am trying to integrate Commonj with Jboss 7.2.0.Alpha1-SNAPSHOT.I have placed jbosscommonj-1.0.sar in standalone\deplpyments folder and on starting the server see the below error in the log.Can anybody help me with this.

       

      12:32:07,174 WARN  [net.sf.jbosscommonj.workmanager.WorkManagerService] (MSC service thread 1-5) Starting failed net.sf.jbosscommonj.workmanager:service=WorkManagerService: javax.naming.NameNotFoundException: java:worker

          at org.jboss.as.naming.InitialContext.findContext(InitialContext.java:198)

          at org.jboss.as.naming.InitialContext.createSubcontext(InitialContext.java:181)

          at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:353)

          at javax.naming.InitialContext.createSubcontext(InitialContext.java:464) [rt.jar:1.6.0_33]

          at net.sf.jbosscommonj.workmanager.WorkManagerService.bind(WorkManagerService.java:115)

          at net.sf.jbosscommonj.workmanager.WorkManagerService.startService(WorkManagerService.java:31)

          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:250)

          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:158)

          at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:229)

          at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:154)

          at org.jboss.system.ServiceMBeanSupport.postRegister(ServiceMBeanSupport.java:364)

          at com.sun.jmx.mbeanserver.MBeanSupport.postRegister(MBeanSupport.java:192) [rt.jar:1.6.0_33]

          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.postRegisterInvoke(DefaultMBeanServerInterceptor.java:1035) [rt.jar:1.6.0_33]

          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:974) [rt.jar:1.6.0_33]

          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917) [rt.jar:1.6.0_33]

          at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312) [rt.jar:1.6.0_33]

          at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482) [rt.jar:1.6.0_33]

          at org.jboss.as.jmx.PluggableMBeanServerImpl$TcclMBeanServer.registerMBean(PluggableMBeanServerImpl.java:526) [jboss-as-jmx-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]

          at org.jboss.as.jmx.PluggableMBeanServerImpl.registerMBean(PluggableMBeanServerImpl.java:294) [jboss-as-jmx-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]

          at org.jboss.as.jmx.MBeanRegistrationService.start(MBeanRegistrationService.java:90) [jboss-as-jmx-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]y

       

      12:32:07,180 ERROR [net.sf.jbosscommonj.workmanager.WorkManagerService] (MSC service thread 1-5) javax.naming.NameNotFoundException: java:worker

      12:32:07,174 WARN  [net.sf.jbosscommonj.timermanager.TimerManagerService] (MSC service thread 1-6) Starting failed net.sf.jbosscommonj.timermanager:service=TimerManagerService: javax.naming.NameNotFoundException: java:timer

          at org.jboss.as.naming.InitialContext.findContext(InitialContext.java:198)

          at org.jboss.as.naming.InitialContext.createSubcontext(InitialContext.java:181)

          at org.jboss.as.naming.NamingContext.createSubcontext(NamingContext.java:353)

          at javax.naming.InitialContext.createSubcontext(InitialContext.java:464) [rt.jar:1.6.0_33]

          at net.sf.jbosscommonj.timermanager.TimerManagerService.bind(TimerManagerService.java:118)

          at net.sf.jbosscommonj.timermanager.TimerManagerService.startService(TimerManagerService.java:31)

          at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:250)

          at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:158)

       

      I had ClassNotFoundExceptions before but I managed to get past them.An earlier post  - https://community.jboss.org/message/632355 was very helpful.

        • 1. Re: Jboss7 integration with CommonJ
          jboss7_newbie

          Forgot to add what I have in my META-INF\jboss-service.xml.Here it is -

           

          <?xml version="1.0" encoding="UTF-8"?>

          <server>

              <mbean code="net.sf.jbosscommonj.timermanager.TimerManagerService" name="net.sf.jbosscommonj.timermanager:service=TimerManagerService">

                  <attribute name="JNDIName">java:timer/timer</attribute>

                  <attribute name="MinThreads">15</attribute>

                  <attribute name="MaxThreads">5</attribute>

                  <attribute name="QueueLength">10</attribute>       

              </mbean>

              <mbean code="net.sf.jbosscommonj.workmanager.WorkManagerService" name="net.sf.jbosscommonj.workmanager:service=WorkManagerService">

                  <attribute name="JNDIName">java:worker/worker</attribute>

                  <attribute name="MinThreads">15</attribute>

                  <attribute name="MaxThreads">5</attribute>

                  <attribute name="QueueLength">10</attribute>

              </mbean>

          </server>

          • 2. Re: Jboss7 integration with CommonJ
            sfcoy

            You might want to have a look at Extending AS 7.

             

            I think that the JNDI names that you're using above are not in the right form for JBoss 7 BTW.

            • 3. Re: Jboss7 integration with CommonJ
              jboss7_newbie

              Thank you for replying.I did try using different JNDI names after reading upon on the JNDI namespaces for JBoss7.

              If I give java:/timer/timer or java:jboss/timer/timer then I get the error -

              12:28:17,913 WARN  [net.sf.jbosscommonj.workmanager.WorkManagerService] (MSC service thread 1-12) Starting failed net.sf.jbosscommonj.workmanager:service=WorkManagerService: java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only

               

              If I try java:comp/env/timer/timer or java:module/env/timer/timer then I get the error -

              12:29:59,947 WARN  [net.sf.jbosscommonj.timermanager.TimerManagerService] (MSC service thread 1-6) Starting failed net.sf.jbosscommonj.timermanager:service=TimerManagerService: javax.naming.NameNotFoundException: java:comp

               

              12:31:19,804 WARN  [net.sf.jbosscommonj.workmanager.WorkManagerService] (MSC service thread 1-3) Starting failed net.sf.jbosscommonj.workmanager:service=WorkManagerService: javax.naming.NameNotFoundException: java:module

               

              I'll look into Jboss7 extensions as well.

              • 4. Re: Jboss7 integration with CommonJ
                jboss7_newbie

                Could anybody help me with this please - java:global/timer/timer also results in -  "Naming context is read-only error."

                if I run the CLI command - [standalone@localhost:9999 /] /subsystem=naming:jndi-view

                I get the response  -

                "jbosscommonj.sar" => {

                     "java:app" => {

                         "AppName" => {

                             "class-name" => "java.lang.String",

                             "value" => "jbosscommonj.sar"

                         },

                         "env" => {

                             "class-name" => "org.jboss.as.naming.NamingContext",

                             "value" => "env"

                         }

                     },

                     "modules" => undefined

                }

                 

                So I tried 'java:app/env/timer/timer' which results in javax.naming.NameNotFoundException: java:app.

                I have activemq queues and connection factories defined in standalone.xml and I noticed that the classname for 'env' comes as "org.jboss.as.naming.NamingContext"(shown above), whereas for 'jms' it is 'javax.naming.Context'.

                Should I doing somethingesle? Please let me know.

                • 5. Re: Jboss7 integration with CommonJ
                  sfcoy

                  The reason I pointed you at Extending AS 7 is because I think that you will have to implement this as an extension/subsystem.