12 Replies Latest reply on Apr 21, 2008 11:03 AM by Balvindar Dhaliwal

    Weblogic 10.0 MP1 and Seam 2.0.1 GA

    Balvindar Dhaliwal Newbie

      Hi,


      I am trying the seam jee5/booking example on Weblogic 10 MP1 and Seam 2.0.1GA. I have followed the guide lines presented in Chapter 27, Seam on Weblogic. I have downloaded the jboss fixes and applied them. I managed to initially get to work bar session bean to session bean injection.


      However, now when I autodeploy it, I get the following exception:



      java.lang.NoClassDefFound
      Error: org/jboss/seam/jsf/SeamPhaseListener : javax/faces/event/PhaseListener.
      java.lang.NoClassDefFoundError: org/jboss/seam/jsf/SeamPhaseListener : javax/fac
      es/event/PhaseListener
             


      Where should I place the jboss-seam.jar, so that the class loader picks it up. Also on a side note, for seam 2.0.1GA, if I change SessionBeanInterceptor, how would I rebuild seam (I tried rebuilding from jboss-seam-2.0.1.GA dir using ant but I got loads of errors.


      Please advise.


      Thanks,
      B. Dhaliwal

        • 1. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
          Jay Balunas Novice

          Hi Balvindar,


          If it is only during auto-deployment then you need to restart the server as discussed in the docs.  For some reason weblogic does like auto-deploying EJB3 apps (sometimes it works, sometimes it doesn't).  It typically shows itself with errors like this.


          If that is not the case where do you have the jboss-seam.jar now? 


          Rebuilding seam should just be running ant at the base of the distribution, but we would need to see the errors you are getting. 


          Thanks,
          Jay

          • 2. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
            Balvindar Dhaliwal Newbie

            Hi Jay,


            Thanks for the reply. Actually it is not just auto-deployment, it occurs when I try from Weblogic console as well. I have already tried what you suggested but the same error occurs again. The ant build creates an ear file, jboss-seam.jar resides in:


            C:/jboss-seam-2.0.1GA/examples/jee5/booking/exploded-archives/jboss-seam-jee5.ear;


            C:/jboss-seam-2.0.1GA/examples/jee5/booking/exploded-archives/jboss-seam-jee5.war/WEB-INF/lib


            Please advise where the jboss-seam.jar should reside. I have also managed to get hold of patch CR327275 which means I no longer have to strip out the TimerService beans fom the jar.


            Thanks in advance,
            Balvindar.

            • 3. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
              Jay Balunas Novice

              Do you mean when you deploy using the web console?  If that is the case it is basically the same as autodeploy.  Does a restart fix the issue, and the app is accessible?


              Those locations for the jar file look correct.


              What I meant for the ant build was about your side note.  If you run ant in the root distribution directory it should build seam with whatever changes you made to the src tree.


              As for CR327275 there is another issue that users have reported that BEA is working on.  See JBSEAM-2592 for details.

              • 4. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                Balvindar Dhaliwal Newbie

                Jay,


                I have deployed the ear both ways, and it does not make a difference:


                1) copy from jee5/booking/dist folder to weblogic domain/autodeploy folder.


                2) using weblogic web console, install deployment and then start it.


                I have also done the following from Chapter 27,



                When using the @DOMAIN/autodeploy directory as described in this chapter you may see NoClassDefFound exceptions. If you see this try restarting the Weblogic server. If you still see it remove the auto-deployed EAR/WAR files, restart the server, and redeploy. We could not find a specific reason for this, but others seem to be having this issue as well.

                Could my wl classpath be corrupted?


                The jboss-seam.jar resides in


                C:/jboss-seam-2.0.1.GA/examples/jee5/booking/exploded-archives/jboss-seam-jee5.ear;



                I have tried both sun jdk and bea jrocket 1.5.0.11 wl domains.


                Can I place the jboss-seam.jar in another place, so the SeamPhaseListener gets picked? Or any other change in config?


                Thanks,
                Balvindar

                • 5. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                  Jay Balunas Novice

                  Hi Balvindar,


                  You could try putting the jar in:


                  jboss-seam-jee5.ear/lib
                  



                  You should try having it in both locations (where it is now, and the one above), and only in the /lib if that does not work.


                  Also can you verify that there is not another version of JSF on the classpath?


                  Also can you post your weblogic.xml file?


                  Thanks,
                  Jay

                  • 6. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                    Balvindar Dhaliwal Newbie

                    Hi Jay,


                    I added jboss-seam.jar to jboss-seam-jee5.ear/lib. That produced the same error. I was unable to remove jboss-seam.jar from jboss-seam-jee5.ear. I also added it to jboss-seam-jee5.war/WEB-INF/lib. Again this produced the same error.


                    I am not using any other implementations of JSF.
                    I am using the configs provided in the jee5/booking example, I do not have a weblogic.xml. I have a weblogic application xml.



                    
                    weblogic-application.xml:
                    
                    
                    <?xml version="1.0" encoding="ISO-8859-1"?>
                    
                    <weblogic-application>
                    
                         <prefer-application-packages>
                    
                              <package-name>antlr.*</package-name>
                    
                         </prefer-application-packages>
                    
                    </weblogic-application>
                    
                    
                    



                    build.xml:


                    
                     <!-- Naming -->
                    
                        <property name="Name"                   value="The Java EE 5 Example for WLS 10 MP1"/>
                    
                        <property name="example.name"           value="jboss-seam-jee5"/>
                    
                    
                        <!-- resources -->
                    
                        <property name="resources.dir" value="resources" />
                    
                        <property name="dist.dir" value="dist" />
                    
                        <property name="exploded-archives.dir" value="exploded-archives" />
                    
                           
                    
                        <!-- Libraries to include -->
                    
                        <property name="seam.ui.lib"    value="true"/>
                    
                        <property name="seam.debug.lib" value="true"/>
                    
                        <property name="facelets.lib"   value="true"/>
                    
                        <property name="richfaces.lib"   value="true"/>
                    
                        <!-- add libs for oc4j (broken classloading) -->
                    
                        <!--
                    
                        <property name="jbpm.lib" value="true"/>
                    
                        <property name="drools.lib" value="true"/>
                    
                        <property name="quartz.lib" value="true" />
                    
                        <property name="search.lib" value="true" />
                    
                        <property name="dbunit.lib" value="true" />
                    
                        <property name="jboss-embedded-api.lib" value="true" />
                    
                        -->
                    
                      
                    
                        <import file="../../build.xml"/>
                    
                    
                        <fileset id="war.lib.extras" dir="${seam.dir}">
                    
                             
                    
                         <include name="lib/jsf-api.jar"/>
                    
                          <include name="lib/jsf-impl.jar"/>
                    
                          <include name="lib/richfaces-api.jar"/>
                    
                             <include name="lib/jboss-seam.jar"/>
                    
                    
                        </fileset>
                    
                    
                        
                    
                        <fileset id="ear.lib.extras" dir="${seam.dir}">
                    
                             <!-- Seam deps -->
                    
                             <include name="lib/javassist.jar"/>
                    
                             <include name="lib/dom4j.jar" />
                    
                             
                    
                             <!-- Hibernate and deps -->
                    
                          <include name="lib/hibernate.jar"/>
                    
                          <include name="lib/hibernate-commons-annotations.jar"/>
                    
                          <include name="lib/hibernate-annotations.jar"/>
                    
                          <include name="lib/hibernate-entitymanager.jar"/>
                    
                          <include name="lib/hibernate-validator.jar"/>
                    
                          <include name="lib/jboss-common-core.jar" />
                    
                          <include name="lib/cglib.jar"/>
                    
                          <include name="lib/asm.jar"/>
                    
                          <include name="lib/antlr.jar" />
                    
                          <include name="lib/commons-logging.jar" />
                    
                          <include name="lib/commons-collections.jar" />
                    
                          <include name="lib/log4j.jar" />
                    
                          <include name="lib/concurrent.jar"/>
                    
                          <include name="lib/jboss-seam.jar"/>
                    
                          
                    
                    
                        </fileset>
                    
                    
                        <!-- weblogic dependent resources -->
                    
                        <fileset id="ear.resources" dir="${resources.dir}">
                    
                            <include name="META-INF/application.xml" />
                    
                            <include name="META-INF/weblogic-application.xml" />
                    
                            <include name="META-INF/jboss-app.xml" />
                    
                            <include name="META-INF/*-service.xml" />
                    
                            <include name="META-INF/*-xmbean.xml" />
                    
                            <include name="treecache.xml" />
                    
                            <include name="*.jpdl.xml" />
                    
                            <exclude name=".gpd.*" />
                    
                            <include name="*.cfg.xml" />
                    
                            <include name="*.xsd" />
                    
                    <exclude name=".gpd.*" />
                    
                            
                    
                              
                    
                        </fileset>
                    
                    
                           
                    
                    </project>
                    
                    
                    
                    
                    



                    Please advise.


                    Thanks,
                    Balvindar

                    • 7. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                      Jay Balunas Novice

                      The error sounds like for some reason the jsf api code is not found.  I do not think that it is the seam class.


                      Try moving:


                      <include name="lib/jsf-api.jar"/>
                      



                      into the root the EAR instead of up in the WAR, if that does not do it try the lib of the EAR.  The classes in the WAR may not be accessible to the application classloader.  When you try this make sure to revert the other jar changes that you made.


                      The documentation has not been updated since the patch from BEA was released.  This is planned.

                      • 8. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                        Balvindar Dhaliwal Newbie

                        Hi Jay,


                        Thanks, your suggestion worked!!!


                        I copied lib/jsf-api.jar to the ear/lib dir and that did the trick.


                        The next issue I have is when I try to make a booking, it complains about:


                        
                        javax.el.ELException: /main.xhtml @22,94 value="#{hotelSearch.searchString}": javax.ejb.EJBTransactionRolledbackException: EJB Exception: ; nested exception is: java.lang.IllegalArgumentException: could not set field value: hotelBooking.user
                        
                        





                        Will the SessionBeanInterceptor fix this? Also, when I run ant (1.6.5) from c:/jboss-seam-2.0.1.GA, I get lots of errors. What ant command should I run in this directory?


                        
                        ...
                        
                        [artifact:dependencies] Downloading: quartz/quartz/1.6.0/quartz-1.6.0.jar from c
                        
                        entral
                        
                        [artifact:dependencies] An error has occurred while processing the Maven artifac
                        
                        t tasks.
                        
                        [artifact:dependencies]  Diagnosis:
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies] Unable to resolve artifact: Missing:
                        
                        [artifact:dependencies] ----------
                        
                        [artifact:dependencies] 1) jboss:jboss-jmx:jar:4.2.0.GA
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Try downloading the file manually from the project web
                        
                        site.
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Then, install it using the command:
                        
                        [artifact:dependencies]       mvn install:install-file -DgroupId=jboss -Dartifac
                        
                        tId=jboss-jmx -Dversion=4.2.0.GA -Dpackaging=jar -Dfile=/path/to/file
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Alternatively, if you host your own repository you can
                        
                         deploy the file there:
                        
                        [artifact:dependencies]       mvn deploy:deploy-file -DgroupId=jboss -DartifactI
                        
                        d=jboss-jmx -Dversion=4.2.0.GA -Dpackaging=jar -Dfile=/path/to/file -Durl=[url]
                        
                        -DrepositoryId=[id]
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Path to dependency:
                        
                        [artifact:dependencies]         1) org.jboss.seam:jboss-seam:ejb:2.0.1.GA
                        
                        [artifact:dependencies]         2) jboss:jboss-jmx:jar:4.2.0.GA
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies] 2) log4j:log4j:jar:1.2.14
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Try downloading the file manually from the project web
                        
                        site.
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Then, install it using the command:
                        
                        [artifact:dependencies]       mvn install:install-file -DgroupId=log4j -Dartifac
                        
                        tId=log4j -Dversion=1.2.14 -Dpackaging=jar -Dfile=/path/to/file
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Alternatively, if you host your own repository you can
                        
                         deploy the file there:
                        
                        [artifact:dependencies]       mvn deploy:deploy-file -DgroupId=log4j -DartifactI
                        
                        d=log4j -Dversion=1.2.14 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Drepo
                        
                        sitoryId=[id]
                        
                        
                        ...
                        
                        
                        [artifact:dependencies]
                        
                        [artifact:dependencies]   Path to dependency:
                        
                        [artifact:dependencies]         1) org.jboss.seam:jboss-seam:ejb:2.0.1.GA
                        
                        [artifact:dependencies]         2) log4j:log4j:jar:1.2.14
                        
                        
                        ...
                        
                        
                          Then, install it using the command:
                        
                              mvn install:install-file -DgroupId=dom4j -DartifactId=dom4j -Dversion=1.6.
                        
                        1-jboss -Dpackaging=jar -Dfile=/path/to/file
                        
                        
                          Alternatively, if you host your own repository you can deploy the file there:
                        
                        
                              mvn deploy:deploy-file -DgroupId=dom4j -DartifactId=dom4j -Dversion=1.6.1-
                        
                        jboss -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
                        
                        
                          Path to dependency:
                        
                                1) org.jboss.seam:jboss-seam:ejb:2.0.1.GA
                        
                                2) dom4j:dom4j:jar:1.6.1-jboss
                        
                        
                        38) javax.servlet.jsp:jsp-api:jar:2.1
                        
                        
                          Try downloading the file manually from the project website.
                        
                        
                          Then, install it using the command:
                        
                              mvn install:install-file -DgroupId=javax.servlet.jsp -DartifactId=jsp-api
                        
                        -Dversion=2.1 -Dpackaging=jar -Dfile=/path/to/file
                        
                        
                          Alternatively, if you host your own repository you can deploy the file there:
                        
                        
                              mvn deploy:deploy-file -DgroupId=javax.servlet.jsp -DartifactId=jsp-api -D
                        
                        version=2.1 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
                        
                        
                        
                          Path to dependency:
                        
                                1) org.jboss.seam:jboss-seam:ejb:2.0.1.GA
                        
                                2) javax.servlet.jsp:jsp-api:jar:2.1
                        
                        
                        39) org.buni.meldware:meldware-mailapi:jar:1.0M8
                        
                        
                          Try downloading the file manually from the project website.
                        
                        
                          Then, install it using the command:
                        
                              mvn install:install-file -DgroupId=org.buni.meldware -DartifactId=meldware
                        
                        -mailapi -Dversion=1.0M8 -Dpackaging=jar -Dfile=/path/to/file
                        
                        
                          Alternatively, if you host your own repository you can deploy the file there:
                        
                        
                              mvn deploy:deploy-file -DgroupId=org.buni.meldware -DartifactId=meldware-m
                        
                        ailapi -Dversion=1.0M8 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -Dreposi
                        
                        toryId=[id]
                        
                        
                          Path to dependency:
                        
                                1) org.jboss.seam:jboss-seam:ejb:2.0.1.GA
                        
                                2) org.buni.meldware:meldware-mailapi:jar:1.0M8
                        
                        
                        40) quartz:quartz:jar:1.6.0
                        
                        
                          Try downloading the file manually from the project website.
                        
                        
                          Then, install it using the command:
                        
                              mvn install:install-file -DgroupId=quartz -DartifactId=quartz -Dversion=1.
                        
                        6.0 -Dpackaging=jar -Dfile=/path/to/file
                        
                        
                          Alternatively, if you host your own repository you can deploy the file there:
                        
                        
                              mvn deploy:deploy-file -DgroupId=quartz -DartifactId=quartz -Dversion=1.6.
                        
                        0 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
                        
                        
                          Path to dependency:
                        
                                1) org.jboss.seam:jboss-seam:ejb:2.0.1.GA
                        
                                2) quartz:quartz:jar:1.6.0
                        
                        
                        ----------
                        
                        40 required artifacts are missing.
                        
                        
                        for artifact:
                        
                          org.jboss.seam:jboss-seam:ejb:2.0.1.GA
                        
                        
                        from the specified remote repositories:
                        
                          central (http://repo1.maven.org/maven2),
                        
                          repository.jboss.org (http://repository.jboss.org/maven2),
                        
                          snapshots.jboss.org (http://snapshots.jboss.org/maven2)
                        
                        
                        
                        Total time: 15 seconds
                        
                        C:\jboss-seam-2.0.1_b\jboss-seam-2.0.1.GA>
                        
                        



                        Please advise on problem injecting a session bean into another session bean(ie injecting user into hotelBooking). Also how to correctly run build using ant to include the SessionBeanInterceptor changes.


                        Also I will try to get hold of patch CR363182 from BEA.


                        Thanks in advance,
                        Balvindar



                        • 9. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                          Jay Balunas Novice

                          Yup - the SessionBeanInterceptor issued discussed in the jira below.  The patch there will fix this. JBSEAM-2592


                          That is slated to be fixed in the 2.1 release.


                          As for your build errors are you behind a firewall, or offline?  The errors all look like maven can't get to the dependencies.  Have you made any modifications to the build scripts?

                          • 10. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                            Balvindar Dhaliwal Newbie

                            Hi Jay,


                            I have not made any changes to the root build.xml. I am working behind a firewall. Is it possible to download a version of Seam with the SessionBeanInterceptor fix, or a way to build seam behind a firewall?


                            At the moment, it is working  with openjpa, I will try to turn on hibernate in the persistence.xml.



                            Please advise.


                            Thanks,
                            Balvindar.


                            • 11. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                              Jay Balunas Novice

                              Take a look at the main maven site http://maven.apache.org/.  There are ways to configure maven to work with proxies, and port settings to get around firewalls.


                              That is probably the best bet.


                              -Jay

                              • 12. Re: Weblogic 10.0 MP1 and Seam 2.0.1 GA
                                Balvindar Dhaliwal Newbie

                                Hi Jay,


                                I managed to include SessionBeanInterceptor changes and jee5/booking works fine, incl. session bean injection.


                                Thanks very much for your help.


                                Regards,
                                Balvindar