11 Replies Latest reply on Apr 10, 2008 12:09 AM by pmuir

    Issue with JMS Connection Factory on OC4J

    rwfuller

      Hi,


      I am using Seam 2.0.1.GA on OC4J.  I have a Seam Component and am injecting the following components.


          @In
          private QueueConnection queueConnection;
          @In
          private QueueSender myQueueSender;   
      



      This is in my components.xml


      <jms:queue-connection name="queueConnection" auto-create="true" queue-connection-factory-jndi-name="jms/MyCF" />
      <jms:managed-queue-sender name="myQueueSender" auto-create="true" queue-jndi-name="jms/MyQueue" />



      I have debugged into the Seam code and the creation of the QueueConnection object works great, but Seam is having an issue creating the QueueSender object.  I noticed in the ManagedQueueSender class, it uses the QueueConnection class to lookup the connection factory.  Inside this class, it assumes you are using UIL2ConnectionFactory, which since I am not using JBoss is the problem.  So it looks like I need the ability to override this for QueueSender as I can for the QueueConnection class.  If you need more information let me know.


      Thanks,
      Wayne




        • 1. Re: Issue with JMS Connection Factory on OC4J
          jbalunas.jbalunas.jboss.org

          What version of OC4J (10 or 11) are you using?


          Could you post the errors that you are seeing?  This will help others that are seeing the issue.


          Baring any comments from experts could you create a Jira for this with the Platform interop component.  We'll look at it more.


          Thanks,


          Jay

          • 2. Re: Issue with JMS Connection Factory on OC4J
            jbalunas.jbalunas.jboss.org

            ok - from what I see in the code QueueConnection.instance() is returning the component lookup of the QueueConnection. 


            return (javax.jms.QueueConnection) Component.getInstance(QueueConnection.class);
            



            This is used by the queueSender which in turn is used by the ManagedQueueSender that you reference above.  This mean that it should be returning the same instance that you are configuring in the components.xml:


            <jms:queue-connection name="queueConnection" auto-create="true" queue-connection-factory-jndi-name="jms/MyCF" />
            



            and because you are setting the queue-connection-factory-jndi-name it should be using what ever is set there. 


            When the app initializes do you see more than one queueConnection component initialized? 


            Seeing your error, and other details should help sort this out.


            Thanks
            Jay

            • 3. Re: Issue with JMS Connection Factory on OC4J
              rwfuller

              Thanks Jay for looking at this.


              Here is the stack trace:




              Caused by: javax.ejb.EJBTransactionRolledbackException: java.lang.RuntimeException: exception invoking: init; nested exception is: java.lang.RuntimeException: exception invoking: init
              
                   at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:84)
              
                   at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:93)
              
                   at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
              
                   at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
              
                   at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52)
              
              



              Then later down


              Caused by: java.lang.RuntimeException: exception invoking: init^M
                      at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:135)^M
                      at org.jboss.seam.Component.callComponentMethod(Component.java:2082)^M
                      at org.jboss.seam.Component.callCreateMethod(Component.java:2005)^M
                      at org.jboss.seam.Component.newInstance(Component.java:1976)^M
                      at org.jboss.seam.Component.getInstance(Component.java:1873)^M
                      at org.jboss.seam.Component.getInstance(Component.java:1840)^M
                      at org.jboss.seam.Component.getInstance(Component.java:1819)^M
                      at org.jboss.seam.Component.getInstance(Component.java:1814)^M
                      at org.jboss.seam.jms.QueueConnection.instance(QueueConnection.java:75)^M
                      at org.jboss.seam.jms.QueueSession.create(QueueSession.java:38)^M
                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)^M
                      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)^M
                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)^M
                      at java.lang.reflect.Method.invoke(Method.java:597)^M



              and then finally



              Caused by: javax.naming.NameNotFoundException: UIL2ConnectionFactory not found
              
                   at com.evermind.server.rmi.RMIServerContext.lookup(RMIServerContext.java:207)
              
                   at com.evermind.server.ApplicationContext.unprivileged_lookup(ApplicationContext.java:254)
              
                   at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:194)
              
                   at javax.naming.InitialContext.lookup(InitialContext.java:392)
              
                   at org.jboss.seam.jms.QueueConnection.getQueueConnectionFactory(QueueConnection.java:64)
              
                   at org.jboss.seam.jms.QueueConnection.init(QueueConnection.java:51)
              
                   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:597)
              
                   at org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
              
                   at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
              
                   ... 196 more
              
              



              • 4. Re: Issue with JMS Connection Factory on OC4J
                rwfuller

                I am using OC4J 11.

                • 5. Re: Issue with JMS Connection Factory on OC4J
                  rwfuller

                  When my server starts I see my queueConnection component and jboss's queueConnection component created.  I will open up a JIRA ticket.

                  • 6. Re: Issue with JMS Connection Factory on OC4J
                    rwfuller
                    • 7. Re: Issue with JMS Connection Factory on OC4J
                      shane.bryzak

                      Set a breakpoint in QueueConnection.init() and make sure that your queueConnectionFactoryJndiName property is correctly set.  From the stack trace you posted it looks like it isn't.

                      • 8. Re: Issue with JMS Connection Factory on OC4J
                        rwfuller

                        I did and that is why I am saying the injection of QueueConnection works, which is my configured component.  The jndi name for that component is correct.  But for some reason the QueueSession which is used by ManagedQueueSender does not use my component when I injected QueueSender, but the preconfigured default JBoss QueueConnection component.


                        During startup there are two QueueConnection components created, one is my custom Component and the other is the JBoss default component.

                        • 9. Re: Issue with JMS Connection Factory on OC4J
                          mkelly

                          I think I'm getting something similar


                          Using Seam 2.0.1GA on JEAP4.3


                          I have a Seam component with the following :



                          @In(create=true) QueueSession queueSession;
                          @In QueueSender registrationQueueSender;



                          In components.xml I have :



                          <jms:managed-queue-sender auto-create="true" name="registrationQueueSender" queue-jndi-name="queue/registrationQueue"/>
                          <jms:queue-connection queue-connection-factory-jndi-name="java:/JmsXA"/>



                          But on starting up the app the following stack trace is shown - I was getting the stack trace posted above until I added <jms:queue-connection> to components.xml



                          10:12:08,078 INFO  [Contexts] starting up: registration
                          10:12:10,953 ERROR [ContainerBase] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
                          java.lang.RuntimeException: exception invoking: create
                                  at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:135)
                                  at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
                                  at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
                                  at org.jboss.seam.Component.newInstance(Component.java:1976)
                                  at org.jboss.seam.Component.getInstance(Component.java:1873)
                                  at org.jboss.seam.Component.getInstance(Component.java:1840)
                                  at org.jboss.seam.Component.getInstanceInAllNamespaces(Component.java:2182)
                                  at org.jboss.seam.Component.getValueToInject(Component.java:2134)
                                  at org.jboss.seam.Component.injectAttributes(Component.java:1598)
                                  at org.jboss.seam.Component.inject(Component.java:1416)
                                  at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:45)
                                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                                  at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:42)
                                  at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
                                  at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
                                  at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
                                  at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
                                  at com.ivident.help.register.Registration_$$_javassist_1.register(Registration_$$_javassist_1.java)
                                  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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                                  at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
                                  at org.jboss.seam.Component.callComponentMethod(Component.java:2082)
                                  at org.jboss.seam.Component.callCreateMethod(Component.java:2005)
                                  at org.jboss.seam.Component.newInstance(Component.java:1976)
                                  at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
                                  at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
                                  at org.jboss.seam.contexts.ServletLifecycle.endInitialization(ServletLifecycle.java:95)
                                  at org.jboss.seam.init.Initialization.init(Initialization.java:583)
                                  at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
                                  at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854)
                                  at org.apache.catalina.core.StandardContext.start(StandardContext.java:4352)
                                  at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:752)
                                  at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:732)
                                  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
                                  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 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
                                  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.apache.catalina.core.StandardContext.init(StandardContext.java:5300)
                                  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 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
                                  at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
                                  at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
                                  at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
                                  at org.jboss.web.WebModule.startModule(WebModule.java:83)
                                  at org.jboss.web.WebModule.startService(WebModule.java:61)
                                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                                  at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                  at java.lang.reflect.Method.invoke(Method.java:585)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
                                  at $Proxy0.start(Unknown Source)
                                  at org.jboss.system.ServiceController.start(ServiceController.java:417)
                                  at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                  at java.lang.reflect.Method.invoke(Method.java:585)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                  at $Proxy44.start(Unknown Source)
                                  at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
                                  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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                  at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
                                  at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
                                  at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
                                  at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
                                  at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                  at $Proxy45.start(Unknown Source)
                                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
                                  at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
                                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
                                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
                                  at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
                                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                                  at java.lang.reflect.Method.invoke(Method.java:585)
                                  at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
                                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
                                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
                                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
                                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
                                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
                                  at $Proxy9.deploy(Unknown Source)
                                  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
                                  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
                                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
                                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
                                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
                          Caused by: javax.naming.NameNotFoundException: registrationQueue not bound
                                  at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
                                  at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
                                  at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
                                  at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
                                  at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
                                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
                                  at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
                                  at javax.naming.InitialContext.lookup(InitialContext.java:351)
                                  at org.jboss.seam.jms.ManagedQueueSender.getQueue(ManagedQueueSender.java:45)
                                  at org.jboss.seam.jms.ManagedQueueSender.create(ManagedQueueSender.java:51)
                                  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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                                  at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
                                  ... 121 more
                          10:12:11,328 ERROR [StandardContext] Error listenerStart
                          10:12:11,359 ERROR [StandardContext] Context [/help] startup failed due to previous errors



                          Is this issue related to the one posted above?  Or is there a current solution?


                          Many thanks
                          Mike






                          • 10. Re: Issue with JMS Connection Factory on OC4J
                            rwfuller

                            Yes, it is very similar except that it appears you do not have your queue defined in JNDI because of this exception.



                            Caused by: javax.naming.NameNotFoundException: registrationQueue not bound
                                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
                                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
                                    at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
                                    at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
                                    at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
                                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
                                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
                                    at javax.naming.InitialContext.lookup(InitialContext.java:351)
                                    at org.jboss.seam.jms.ManagedQueueSender.getQueue(ManagedQueueSender.java:45)
                                    at org.jboss.seam.jms.ManagedQueueSender.create(ManagedQueueSender.java:51)
                                    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 org.jboss.seam.util.Reflections.invoke(Reflections.java:21)
                                    at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:125)
                                    ... 121 more
                            



                            If you fix that issue, then you will more than likely get the same issue that I am seeing.

                            • 11. Re: Issue with JMS Connection Factory on OC4J
                              pmuir

                              Try using

                              <jms:queue-connection auto-create="true" queue-connection-factory-jndi-name="jms/MyCF" />

                              - with your line you are configuring the wrong instance of the QueueConnection.