14 Replies Latest reply on Jul 27, 2010 3:24 AM by daniele4

    Seam on  WebSphere 7. Strategy 1 doesn't work

    daniele4

      I'm trying to run my seam application on websphere. I'm following the Strategy 1 on official documentation and I got this exteption at start up:


      java.lang.RuntimeException: Could not create Component: org.jboss.seam.transaction.synchronizations
      ...


      Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: org.jboss.seam.transaction.synchronizations


      What's the problem?


      thanks in advance

        • 1. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
          daniele4
          I tried the example jee5\booking ( build with build-websphere7.xml )in jboss-seam-2.2.1.CR1. This example is configured in according with Strategy 2 (http://docs.jboss.org/seam/2.2.1.CR1/reference/en-US/html/websphere.html   40.3.2. Strategy 2) but it doesn' work.
          This is the exception:
          Caused by:
          org.jboss.seam.InstantiationException: Could not instantiate Seam component: org.jboss.seam.transaction.synchronizations
                  at java.lang.Throwable.<init>(Throwable.java:80)
                  at org.jboss.seam.InstantiationException.<init>(InstantiationException.java:18)
                  at org.jboss.seam.Component.newInstance(Component.java:2128)
                  at org.jboss.seam.Component.getInstance(Component.java:2021)
                  at org.jboss.seam.Component.getInstance(Component.java:2000)
                  at org.jboss.seam.Component.getInstance(Component.java:1994)
                  at org.jboss.seam.Component.getInstance(Component.java:1989)
                  at org.jboss.seam.transaction.AbstractUserTransaction.getSynchronizations(AbstractUserTransaction.java:79)
                  at org.jboss.seam.transaction.UTTransaction.commit(UTTransaction.java:48)
                  at org.jboss.seam.jsf.SeamPhaseListener.commitOrRollback(SeamPhaseListener.java:613)
                  ... 54 more
          Caused by:
          javax.naming.ConfigurationException: NamingManager.getURLContext cannot find the factory for this scheme: ejblocal

          Does anyone run the example on webspehre 7?

          • 2. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
            titou09

            Hi Daniele,


            I'm, the author of the chapter about Seam 2.2.1.X with WAS v7 in the manual and adptaed this sample app to make it run in WAS v7


            What version of WAS are you using? and what flavor (ND? single server? or the was test env from inside RAD?). We are using WAS v7.0.0.9 here and it works like a charm!


            In the sample app, When do you get the problem? at startup? when using a specific page/function?


            To use strategy 1, you have to add some line at the end of your web.xml file to reference the EJBSynchronisation bean, add a line in component.xml (jndi-name), create a file named seam-jndi.properties in your classpath and don't forget to add the interceptor classes in the ejb-jar.xml file if you use SFSB/SLSB ejb3 beans


            I will try to find some time to build and deploy the jee5\booking sample and see if it still work on my own WAS

            • 3. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
              titou09

              Just build the je55 sample for WAS from the current nightly build as explained in the doc chapter 40.5 and deployed it in WAS v7.0.0.9/linux. It works fine. Made a few hotel reservation in the name of Gavin..lol


              I followed exactly the instructions from chapter 40.5


              Q:
              When deploying, did you checked the Allow EJB reference targets to resolve
              automatically
              checkbox on the WAS console?


              I will correct some typos in the docs and remove the need to check Deploy enterprise beans as it is not necessary..

              • 4. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                daniele4

                Hi Denis,
                I was sure the problem was somethings in my configuration. I finally found the mistake, i forgot to add the seam-jndi.properties file!!!


                Now I'm trying to run two seam application on the same WAS, but i got a lot of problem! Are there other settings to do?!?


                The two applications include some ejb with the same name, is it a problem?


                thanks in advance


                • 5. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                  daniele4

                  I forgot to say that i used the stategy 2, now i'm trying the strategy 1.



                  I really hope is possibile run two seam application on the same WAS otherwise it is a big limitation!!


                  • 6. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                    daniele4

                    I just tryed the strategy 1 but i couldn't make it works! can i have your archive to try?!
                    What about extra config to run two application built with seam on the same server?


                    I hope you can help me Denis, i really dont know what to do!!


                    thank in advance

                    • 7. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                      titou09

                      hard for me to help you without any other information i couldn't make it works is quite vague...


                      Maybe you could send me your ear


                      And for your other question, yes we have half a dozen seam running in the same server in dev

                      • 8. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                        daniele4
                        When i start the booking example built with Stratege 1 i got this exception:

                        webapp        E com.ibm.ws.webcontainer.webapp.WebApp notifyServletContextCreated SRVE0283E: Exception caught while initializing context: {0}
                                                         java.lang.RuntimeException: Could not create Component: org.jboss.seam.transaction.synchronizations
                                at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1205)
                                at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1121)
                                at org.jboss.seam.init.Initialization.init(Initialization.java:740)
                                at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
                                at com.ibm.ws.webcontainer.webapp.WebApp.notifyServletContextCreated(WebApp.java:1681)
                                at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:374)
                                at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:299)
                                at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:100)
                                at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:166)
                                at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:731)
                                at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:616)
                                at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:376)
                                at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:668)
                                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1122)
                                at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1315)
                                at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:623)
                                at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:940)
                                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:725)
                                at com.ibm.ws.runtime.component.ApplicationMgrImpl$1.run(ApplicationMgrImpl.java:1266)
                                at com.ibm.ws.security.auth.ContextManagerImpl.runAs(ContextManagerImpl.java:4599)
                                at com.ibm.ws.security.auth.ContextManagerImpl.runAsSystem(ContextManagerImpl.java:4687)
                                at com.ibm.ws.security.core.SecurityContext.runAsSystem(SecurityContext.java:255)
                                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplicationDynamically(ApplicationMgrImpl.java:1271)
                                at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2043)
                                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:439)
                                at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
                                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:382)
                                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:653)
                                at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:615)
                                at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1177)
                                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                                at java.lang.reflect.Method.invoke(Method.java:600)
                                at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:37)
                                at sun.reflect.GeneratedMethodAccessor89.invoke(Unknown Source)
                                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
                                at java.lang.reflect.Method.invoke(Method.java:600)
                                at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:244)
                                at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1086)
                                at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:967)
                                at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:848)
                                at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:773)
                                at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1320)
                                at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
                                at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1213)
                                at com.ibm.ws.management.commands.AdminServiceCommands$InvokeCmd.execute(AdminServiceCommands.java:251)
                                at com.ibm.ws.console.core.mbean.MBeanHelper.invoke(MBeanHelper.java:239)
                                at com.ibm.ws.console.appdeployment.ApplicationDeploymentCollectionAction.execute(ApplicationDeploymentCollectionAction.java:564)
                                at org.apache.struts.action.RequestProcessor.processActionPerform(Unknown Source)
                                at org.apache.struts.action.RequestProcessor.process(Unknown Source)
                                at org.apache.struts.action.ActionServlet.process(Unknown Source)
                                at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
                                at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:104)
                                at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
                                at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
                                at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:341)
                                at org.apache.struts.action.RequestProcessor.doForward(Unknown Source)
                                at org.apache.struts.tiles.TilesRequestProcessor.doForward(Unknown Source)
                                at org.apache.struts.action.RequestProcessor.processForwardConfig(Unknown Source)
                                at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Unknown Source)
                                at com.ibm.isclite.container.controller.InformationController.processForwardConfig(InformationController.java:217)
                                at org.apache.struts.action.RequestProcessor.process(Unknown Source)
                                at org.apache.struts.action.ActionServlet.process(Unknown Source)
                                at org.apache.struts.action.ActionServlet.doPost(Unknown Source)
                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
                                at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1655)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
                                at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
                                at com.ibm.ws.console.core.servlet.WSCUrlFilter.setUpCommandAssistence(WSCUrlFilter.java:927)
                                at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:494)
                                at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:315)
                                at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
                                at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
                                at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
                                at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
                                at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
                                at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
                                at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
                                at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
                                at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
                                at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
                                at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
                                at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
                                at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1772)
                                at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
                                at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
                                at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
                                at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
                                at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
                                at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
                                at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
                                at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
                        Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: org.jboss.seam.transaction.synchronizations
                                at org.jboss.seam.Component.getJndiName(Component.java:451)
                                at org.jboss.seam.Component.<init>(Component.java:233)
                                at org.jboss.seam.Component.<init>(Component.java:205)
                                at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1189)
                                ... 102 more

                        yes i'd like send you my ear, what's your email?

                        I'm happy to ear the you have half a dozen seam running on the same server!! :-)
                        I want install the seam booking example (built with Strategy 1 or 2) twice on the same server with different context root. Do I need extra configuration?

                        thanks Denis




                        • 9. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                          titou09

                          seems clear to me. this is a deployment problem:



                          Caused by: java.lang.IllegalArgumentException: You must specify org.jboss.seam.core.init.jndiPattern or use @JndiName: org.jboss.seam.transaction.synchronizations

                          Is your component.xml file well formed?


                          Did you specified the correct value for jndiPattern  in component.xml?


                          Did you put a @JndiName annotation on all your SLSB/SFSB?


                          Did you add the lines in web.xml for EJBSyncrhonisation?


                          As for 2 apps it is the same as for any other 2 EJB3 apps in WebSphere .nothing special related to seam


                          I thing you need to train yourslef on WAS v7.0 and/or EJB3 in addition to seam...

                          • 10. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                            daniele4

                            Hi Denis,
                            you be right i need to train myself and i'll do it, but there a lot of things so step by step...


                            I found my mistake in configiguration about strategy 1. The probem was in component.xml i specified the jndipatter but i removed the jndi name...


                            Now I'm trying to run seam-booking twice, i have a problem about ambiguity on look up some ejb....


                             

                            • 11. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                              daniele4

                              I cant resolve the ambiguity on look up ejb!! how can enable the long binding for ejb on was?


                              • 12. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                                daniele4
                                I finally to be able to run 2 apps on the same websphere 7 using Strategy 2.

                                I enabled the property "com.ibm.websphere.ejbcontainer.disableShortDefaultBindings" on websphere  and i added a entry in web.xml for every ejb

                                <ejb-local-ref>
                                    <ejb-ref-name>ejblocal:Seam Booking/jboss-seam-jee5-booking.jar/BookingListAction</ejb-ref-name>
                                    <ejb-ref-type>Session</ejb-ref-type>
                                    <local>org.jboss.seam.example.booking.BookingList</local>
                                  </ejb-local-ref>
                                • 13. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                                  jigneshmpatel

                                  Just wondering all the strategy talks about integrating seam with Ejbs, in my new project I was thinking of using it with hibernate on WAS7. Can you point me for any documentation which talks about this?

                                  • 14. Re: Seam on  WebSphere 7. Strategy 1 doesn't work
                                    daniele4

                                    I followed this document http://docs.jboss.org/seam/snapshot/en-US/html/websphere.html; Strategy 2.
                                    You can start using the seambooking example!!