14 Replies Latest reply on Jan 11, 2008 5:21 PM by Gordon DuQuesnay

    Developing with Seam 2 and deploying on WebSphere

    eeckmann Newbie

      What is the best way to develop applications using Seam 2.0 and be able to deploy them on WebSphere 6.1? I'd like to test using an embedded WebSphere Test Environment in the IDE.

        • 1. Re: Developing with Seam 2 and deploying on WebSphere
          Joshua Jackson Master

          Use JPA Hibernate and use Java Bean for the business logic component.

          • 2. Re: Developing with Seam 2 and deploying on WebSphere
            Gary Pinkham Newbie

             

            "thejavafreak" wrote:
            Use JPA Hibernate and use Java Bean for the business logic component.


            Just to make sure I understand.. This is basically what you get if you create a new seam project as a WAR?



            • 4. Re: Developing with Seam 2 and deploying on WebSphere
              Ian Ian Newbie

              You could using the EJB3 pack for WebSphere, but you may run into other problems. That's where I'm at - I can't get past those other problems.

              Anybody got it working with the EJB3 pack on WebSphere?

              • 5. Re: Developing with Seam 2 and deploying on WebSphere
                Jack Parker Newbie

                There appears to be some incompatibility (namely a missing getELContext() method) between the JSF library supplied by IBM with Websphere and the JSF 1.2 RI version utilised by Seam:

                Here is the stacktrace:

                Uncaught exception thrown in one of the service methods of the servlet: Faces Servlet. Exception thrown : java.lang.NoSuchMethodError: javax/faces/context/FacesContext.javax/el/ELContext;

                By manipulating the class loading sequence we can ensure that Seam uses the JSF 1.2 RI bundled in the war, however a different exception is thrown, this time a ClassCastException.

                Here is the PARENT_LAST classloader stacktrace:

                Exception caught while initializing context
                javax.faces.FacesException: java.lang.ClassCastException: org.jboss.seam.jsf.SeamApplicationFactory incompatible with javax.faces.application.ApplicationFactory

                Has anyone reproduced this problem, and are there any suggestions for how it might be addressed?

                • 6. Re: Developing with Seam 2 and deploying on WebSphere
                  Pete Muir Master

                  Yes, Websphere comes with JSF 1.1, not 1.2.

                  Did you follow the instructions for deploying to websphere discussed in the jpa/hibernate2 examples?

                  • 7. Re: Developing with Seam 2 and deploying on WebSphere
                    Techie Exchange Newbie

                    Hi,

                    "pete.muir@jboss.org" wrote:
                    Yes, Websphere comes with JSF 1.1, not 1.2.

                    Did you follow the instructions for deploying to websphere discussed in the jpa/hibernate2 examples?


                    I tried to deploy JPA example (target:Websphere) build and deployed on WAS 6.1 express. I just did exactly how it was guided in read-me file of JPA example.
                    First i got:


                    java.lang.ClassCastException:
                    org.jboss.seam.jsf.SeamApplication11 incompatible with com.sun.faces.application.ApplicationImpl at com.ibm.ws.jsf.configuration.FacesConfigParser.createFacesFactories
                    (FacesConfigParser.java:1019)
                    at com.ibm.ws.jsf.configuration.FacesConfigParser.initializeConfiguration FacesConfigParser.java:354)
                    at com.ibm.ws.jsf.util.FacesConfigUtil._parseJSFConfiguration (FacesConfigUtil.java:128)
                    


                    then I installed latest fix pack, as recommended here:
                    http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg1PK47367

                    Again i re-deployed the same JPA example and now i'm getting:

                    [04.01.08 11:46:46:281 CET] 00000021 ExceptionFilt E org.jboss.seam.log.JDKProvider error exception root cause
                    [04.01.08 11:46:46:281 CET] 00000021 WebApp E [Servlet Error]-[Faces Servlet]: java.lang.NoSuchMethodError: org/jboss/seam/ui/component/UISeamCommandBase.getValueExpression(Ljava/lang/String;)Ljavax/el/ValueExpression;
                     at org.jboss.seam.ui.component.UISeamCommandBase.getUrl(UISeamCommandBase.java:86)
                     at org.jboss.seam.ui.renderkit.LinkRendererBase.doEncodeBegin(LinkRendererBase.java:26)
                     at org.jboss.seam.ui.util.cdk.RendererBase.encodeBegin(RendererBase.java:79)
                     at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:717)
                     at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:242)
                     at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
                     at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
                     at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594)
                     at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
                     at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
                     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
                     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
                     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:118)
                     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
                     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
                     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
                     at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
                     at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
                     at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
                     at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
                     at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
                     at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
                     at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
                     at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
                     at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
                     at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
                     at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
                     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:766)
                     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:674)
                     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
                     at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
                     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3276)
                     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
                     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
                     at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
                     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
                     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
                     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
                     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:263)
                     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
                     at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
                     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:136)
                     at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
                     at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
                     at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
                     at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
                    


                    I know there was some JAR incompatibility but how can i find it?

                    If you say WAS has only JSF 1.1, then how could JPA example worked for you.

                    Eventhough i tried all tricks by replacing IBM JSF libs / el-api, impl jars etc., but no success yet.

                    My customers are very impressed on Seam so i have to run atleast a live Seam example as "Proof of Technology".

                    Please help me.

                    Thanks

                    • 8. Re: Developing with Seam 2 and deploying on WebSphere
                      Pete Muir Master

                      Are you sure you did

                      From the "Enterprise Applications" list select: "jboss-seam-jpa" --> "Manager Modules" --> "jboss-seam-jpa.war" --> "Classes loaded with application class loader first", and then Apply


                      • 9. Re: Developing with Seam 2 and deploying on WebSphere
                        Techie Exchange Newbie

                        Hi,
                        I got it working now!!

                        Seems to be some old corrupted war file (in temp/cache), I removed it completely and made a fresh deployment, that worked.

                        Now I deployed my own application (made with Seam+Spring+POJO+JPA) on Websphere. It seems to be a RichFaces was not loaded (no styles/panels) also no exceptions. I try to find solution in RichFaces forum.

                        If that works I share my experiences here and blog it.

                        Thanks for your support.

                        Techieexchange

                        • 10. Re: Developing with Seam 2 and deploying on WebSphere
                          Jay Balunas Master

                          Hello,

                          I'm working on porting and documenting seam applications to various containers.

                          WebSphere is my next target as described here http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117061#4117061

                          My plan is to get to it next week and I'll post info as I have it.

                          Thanks for your investigation and comments though it will help get this started :)

                          -Jay

                          • 11. Re: Developing with Seam 2 and deploying on WebSphere
                            Gordon DuQuesnay Newbie

                            After deploying the JPA example from Seam 2.0 GA to WAS 6.1 and testing that it worked. I used seam gen to generate a war project and tried to modify it to build the JPA example. After a couple days of fighting with it, it is finally working i.e. deploys and runs on WAS 6.1. We plan to use this project as the foundation for developing our apps.

                            If it would help anyone I'd be happy to zip it up and email on request.

                            • 12. Re: Developing with Seam 2 and deploying on WebSphere
                              Gordon DuQuesnay Newbie

                              Oh! I almost forgot. One issue I ran into was that the version of the hibernate entitiymanager that is included in Seam 2.0 GA chokes when deployed on a WAS 6.1 server that has spaces in its install path (e.g. the space in "program files\ibm\etc") I had to download version 3.3.2 beta1 and build from source (no binary available yet)

                              • 13. Re: Developing with Seam 2 and deploying on WebSphere
                                Jay Balunas Master

                                Hello,

                                I would certainly appreciate a copy of the zip file of your working application (jbalunas_at_jboss.org). I'm curious what you needed to do differently than the JPA example.

                                I posted on the other websphere topic (linked above) that I started working on the websphere support and document.

                                The env I'm using is Websphere 6.1 with the latest EJB3 feature pack. With that config there was some changes needed to the JPA example. I believe some of those were caused by the EJB3 feature pack, but I am not sure.

                                It sounds like you do not have EJB3 requirements for your app like the poster in the other forum topic. Is that true?

                                Thanks,
                                Jay

                                • 14. Re: Developing with Seam 2 and deploying on WebSphere
                                  Gordon DuQuesnay Newbie

                                  Other than switching out the entitymanager, which I had to do for the JPA example to work anyway. Heres what I had to do (or at least what I can remember):



                                  * Copy sources, resources(resources-websphere61 actually) etc into the corresponding folders of the seamgen generated project
                                  * Copy the jars from exploded-archives-websphere61\jboss-seam-jpa.war\WEB-INF\lib into the project's lib folder
                                  * modify the build.xml to include these in the war (the hard part)


                                  >It sounds like you do not have EJB3 requirements for your app like the poster in the other forum topic. Is that true?

                                  That is correct. But the JPA example uses Seam POJOs. So I wouldn't have used it as a starting point for EJB3.

                                  I will zip up the project and send it (minus the lib folder to keep down the size - but let me know if you want to see it and I'll send it).

                                  Regards,

                                  Gordon