9 Replies Latest reply on May 6, 2007 8:30 AM by chipschoch

    Calling messaging from webapp in same vm as messaging

    chipschoch

      JBossAS 4.2.0.CR2, JBM 1.2.0.SP!

      Has anyone been successful in making a JBM connection from a webapp that is running in the same VM as JBM? I have been trying every combination of jar files, class loader scoping and physical contortions that I can think of and with each permutation I get a different exception. The latest is my webapp is not specifying any scoped classloader and I am including jboss-messaging.jar and jboss-remoting.jar in my .ear file. I get the following:

      java.lang.NullPointerException
       at org.jboss.jms.client.container.FailoverValveInterceptor.invoke(FailoverValveInterceptor.java:86)
       at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate$createSessionDelegate_6052335267724906805.invokeNext(ClientConnectionDelegate$createSessionDelegate_6052335267724906805.java)
       at org.jboss.jms.client.container.ClosedInterceptor.invoke(ClosedInterceptor.java:171)
       at org.jboss.aop.advice.PerInstanceInterceptor.invoke(PerInstanceInterceptor.java:105)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate$createSessionDelegate_6052335267724906805.invokeNext(ClientConnectionDelegate$createSessionDelegate_6052335267724906805.java)
       at org.jboss.jms.client.container.ExceptionInterceptor.invoke(ExceptionInterceptor.java:71)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate$createSessionDelegate_6052335267724906805.invokeNext(ClientConnectionDelegate$createSessionDelegate_6052335267724906805.java)
       at org.jboss.jms.client.container.ClientLogInterceptor.invoke(ClientLogInterceptor.java:107)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate$createSessionDelegate_6052335267724906805.invokeNext(ClientConnectionDelegate$createSessionDelegate_6052335267724906805.java)
       at org.jboss.jms.client.delegate.ClientConnectionDelegate.createSessionDelegate(ClientConnectionDelegate.java)
       at org.jboss.jms.client.JBossConnection.createSessionInternal(JBossConnection.java:269)
       at org.jboss.jms.client.JBossConnection.createSession(JBossConnection.java:91)
       at com.eLynx.Messaging.MessageSender.initialize(MessageSender.java:164)
       at com.eLynx.Messaging.MessageSender.<init>(MessageSender.java:76)
       at com.eLynx.BPM.Process.ProcessManager.signal(ProcessManager.java:434)
       at com.eLynx.Controller.USign.USignWebappController.eSignSubmit(USignWebappController.java:424)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at com.eLynx.Dispatch.XmlDispatcher.dispatch(XmlDispatcher.java:161)
       at com.eLynx.Dispatch.XmlDispatcher.dispatch(XmlDispatcher.java:81)
       at com.eLynx.Servlet.XmlWebappServlet.doPost(XmlWebappServlet.java:119)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
       at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
       at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:447)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)


      Why I should get a null pointer exception when I am simply trying to create a jms session is beyond me.

      I have spent the last week trying to get this in a configuration that will work and am starting to think I may have made a mistake by pushing our organization to standardize on JBoss and JBM as our core platform.


        • 1. Re: Calling messaging from webapp in same vm as messaging
          timfox

          Chip-

          If you installed JBM as per the install script and specified the classloading domain in jboss-web.xml as per http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration then this should work.

          You should not have jboss-messaging.jar and jboss-remoting.jar in your ear.

          As already mentioned in another thread of yours, we know that configuring scoping can be fiddly and problematic which is why we are eliminating this altogether for 1.2.0.SP2.

          • 2. Re: Calling messaging from webapp in same vm as messaging
            timfox

            Also please remember we have limited resources and a small team that works their butts off 7 days a week to give you a product for free.

            Any free support you get on this forum is because we care but we don't get paid to do this.

            Thanks

            • 3. Re: Calling messaging from webapp in same vm as messaging
              chipschoch

              Tim,
              I appreciate your efforts and I apologize for the way my post sounded. Part of my frustration is I had a configuration working and cannot seem to get back to it. I can't remember what I did to get it going in the first place (4.0.5.GA, JBM 1.0.1.GA).

              I am just moving ahead with 4.2.0CR2 and JBM1.2SP1 configuration. Much of my chagrin is I am new to aop and when I see exceptions in aspectized classes my eyeballs glaze over trying to figure it out.

              Again, sorry if I sounded unappreciative.

              The reason I put jboss-messaging.jar and jboss-remoting.jar in my ear is that when I put jboss-messaging-client.jar in it I got other exceptions. I am still searching for that elusive combination.

              • 4. Re: Calling messaging from webapp in same vm as messaging
                timfox

                No problem-

                If you add a JIRA task, assign it to 1.2.0.SP2, either Clebert or I will take a look.

                • 5. Re: Calling messaging from webapp in same vm as messaging
                  chipschoch

                  I have my webapp scoped as per the directions:

                  My jboss-app.xml

                  <jboss-app>
                   <loader-repository>
                   com.eLynx:loader=ImplementationsWebapp
                   <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                   </loader-repository>
                  </jboss-app>
                  

                  The problem that arises when I include jboss-messaging-client.jar in my .ear file and try to deploy it. When my servlet init is called I am initializing PojoCache. In the code, when it tries to get a reference to the PojoCacheMBean it throws:
                  java.lang.IllegalArgumentException: interface org.jboss.mx.util.MBeanProxyInstance is not visible from class loader
                   at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
                   at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
                   at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:395)
                   at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:349)
                   at org.jboss.mx.util.MBeanProxyExt.create(MBeanProxyExt.java:324)
                   at com.eLynx.Cache.CacheManager.initialize(CacheManager.java:77)
                  


                  calling code:

                  m_cache = (PojoCacheMBean) MBeanProxyExt.create (PojoCacheMBean.class,
                  "jboss.cache:service=eLynxPojoCache",
                   server);
                  


                  Because org.jboss.mx.util.MBeanProxyInstance is included in jboss-messaging-client.jar. That is why I removed it and tried adding jboss-messagin.jar and jboss-remoting.jar


                  • 6. Re: Calling messaging from webapp in same vm as messaging
                    timfox
                    • 7. Re: Calling messaging from webapp in same vm as messaging
                      chipschoch

                      I managed to find that elusive combo that works.

                      1. JBossAS 4.2.0.CR2

                      2. JBM 1.2.SP1

                      3. Copy jboss-messaging.jar and jboss-remoting.jar from jboss-messaging.sar into server/messaging/lib

                      4. restart server

                      5. Do not include jboss-messaging-client.jar in .ear

                      Everbody plays nice now.

                      • 8. Re: Calling messaging from webapp in same vm as messaging
                        timfox

                        Glad to hear it :)

                        BTW Are you deploying JBM scoped?

                        • 9. Re: Calling messaging from webapp in same vm as messaging
                          chipschoch

                          Yes.

                          <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
                           <loader-repository-config>java2ParentDelegation=false</loader-repository-config>
                           </loader-repository>