1 2 3 4 Previous Next 46 Replies Latest reply on Oct 31, 2006 12:49 PM by gavin.king Go to original post
      • 15. Re: Step-by-Step Seam Getting Started Guide
        lowecg2004

        The last exception was caused because application.xml is not being copied either.

        • 16. Re: Step-by-Step Seam Getting Started Guide
          wondermike

          Hi, maybe that's a clue to locate the error, because the same error

          java.lang.RuntimeException: Interceptor class not found: org.jboss.seam.ejb.SeamInterceptor
          happens here after I do the following:

          Goto Preferences --> J2EE Module Dependencies of project "sample"
          uncheck JAR/Module "jboss-seam.jar" and "jbpm-3.1.1.jar" / Project "sample"
          Press OK and Redeploy

          After that all the rest fails (deploy ejb, deploy war).
          I guess eclipse is messing up settings that are pre-configured by seam-gen.
          When I go to the preferences again, the items above are checked again, magically.
          HTH
          cu - Michael

          • 17. Re: Step-by-Step Seam Getting Started Guide

             

            The last exception was caused because application.xml is not being copied either.


            If you're on WinXP and ejb-jar.xml and application.xml aren't being overwritten when running "seam scaffold-wtp-project" or "seam new-wtp-project" it's likely that you are not refreshing your eclipse folders before trying to publish the app. This was a problem for me and something that's quite easy to overlook.

            But, the ant task has explicit flags to overwrite these files, so I'm pretty sure that is the case. If you refresh the eclipse folders and still don't pick-up the file changes, what version of Ant are you using? Maybe older versions don't recognize the "overwrite" file copy flag.

            James

            • 18. Re: Step-by-Step Seam Getting Started Guide

               

              "aozoren" wrote:
              More findings..

              1. seam.sh is missing one more parameter (shown below)

              if [ "${seamtask}" = new-wtp-project ]
              then
              ant new-wtp-project -Dproject.name=${projectname}
              fi

              2. Using "new-wtp-project" parameter actually works and creates correct ejb-jar.xml like below..

              <ejb-jar>
              <assembly-descriptor>
              <interceptor-binding>
              <ejb-name>*</ejb-name>
              <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
              </interceptor-binding>
              </assembly-descriptor>
              </ejb-jar>

              Using "scaffold-wtp-project" does not work since it creates the ejb-jar.xml below..

              <?xml version="1.0" encoding="UTF-8"?>
              <ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
              <display-name>
              sampleEJB</display-name>
              </ejb-jar>

              That needs to be corrected I believe..

              3. After fixing the problem #2, sample project successfully deployed but gave the error below..

              02:23:01,632 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=sampleEJB.jar
              java.lang.RuntimeException: Interceptor class not found: org.jboss.seam.ejb.SeamInterceptor

              Checking the web.xml (of sample) revealed what is below..

              <?xml version="1.0" encoding="UTF-8"?>
              <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
              <display-name>
              sampleWeb</display-name>
              <welcome-file-list>
              <welcome-file>index.html</welcome-file>
              <welcome-file>index.htm</welcome-file>
              <welcome-file>index.jsp</welcome-file>
              <welcome-file>default.html</welcome-file>
              <welcome-file>default.htm</welcome-file>
              <welcome-file>default.jsp</welcome-file>
              </welcome-file-list>
              </web-app>

              However, the blank project had the correct web.xml shown below..

              <?xml version="1.0" ?>
              <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
              version="2.4">

              <listener>
              <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
              </listener>

              <listener>
              <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
              </listener>

              <context-param>
              <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
              <param-value>client</param-value>
              </context-param>

              <context-param>
              <param-name>facelets.DEVELOPMENT</param-name>
              <param-value>true</param-value>
              </context-param>

              <context-param>
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
              <param-value>.xhtml</param-value>
              </context-param>


              <filter>
              <filter-name>Seam Exception Filter</filter-name>
              <filter-class>org.jboss.seam.servlet.SeamExceptionFilter</filter-class>
              </filter>

              <filter>
              <filter-name>Seam Redirect Filter</filter-name>
              <filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
              </filter>

              <filter-mapping>
              <filter-name>Seam Exception Filter</filter-name>
              <url-pattern>/*</url-pattern>
              </filter-mapping>

              <filter-mapping>
              <filter-name>Seam Redirect Filter</filter-name>
              <url-pattern>*.seam</url-pattern>
              </filter-mapping>

              <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
              </servlet>

              <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.seam</url-pattern>
              </servlet-mapping>
              </web-app>

              However correcting this problem got me the error below..

              02:44:45,210 ERROR [[/sampleWeb]] Error configuring application listener of class org.jboss.seam.servlet.SeamListener
              java.lang.ClassNotFoundException: org.jboss.seam.servlet.SeamListener

              So I compared the classpath of both web apps (blank and sample)..

              blank had "JBOSS 4.0" library group, sample did not.
              blank had 5 jars under "Web App Libraries", sample none.

              It is no wonder sample project does not work at all..

              4. I don't understand why in image http://wiki.jboss.org/wiki/attach?page=JBossSeamGettingStartedGuideStep4%2Ffigure-4.7.png, sampleEJB project does not show the error indicator (red cross). At this point it generated the incorrect ejb-jar.xml and it must show the error indicator.

              Later the error indicator is visible in image http://wiki.jboss.org/wiki/attach?page=JBossSeamGettingStartedGuideStep5%2Ffigure-5.5.png. So was there an error or not?

              Red cross magically disappears in image http://wiki.jboss.org/wiki/attach?page=JBossSeamGettingStartedGuideStep5%2Ffigure-5.7.png.



              I am baffled.. Why on earth this seam-gen thingy creates a perfect sample project for some people yet does not work for me..

              Maybe it is the late hour.. I need to check everything with fresh eyes in the morning.. :)


              I think I figured out what's going on here. seam.sh did not have the correct call to ant for creating a new sample WTP project. I fixed seam-gen.zip and put it back out on the wiki. Please download and retry. I also added your suggested change to the template.ftl and page.ftl. Hopefully, your pain and sorrow will end here.

              http://wiki.jboss.org/wiki/attach?page=JBossSEAMGen%2Fseam-gen.zip

              James

              • 19. Re: Step-by-Step Seam Getting Started Guide
                lowecg2004

                Okay - after installing the new version of seam-gen and refreshing the 3 projects in eclipse, running seam.sh for scaffold-wtp-project generation now works.

                Thank you for the tutorial!

                • 20. Re: Step-by-Step Seam Getting Started Guide
                  wondermike

                  Another thing, I changed the example in order to use mysql, this works, but as soon as I include an import.sql file, it will be executed twice. I've put it in the sample project --> Folder 'EarContent'.
                  It's a bit disturbing, because data with autogenerated id's will become inserted twice, others will produce ugly errors in the log.

                  Following the log, it seems that it results from two hibernate sessions (the jbpm session and the ejb3 session). Both of them find the import.sql and execute it.
                  Isn't there any way to specify the behaviour of import.sql file in the property files in order to make it execute only once?
                  In other words, what's the correct method of initializing a database with correct values? Do I have to use <database-object/> for initializing data?

                  Greetings - Michael

                  • 21. Re: Step-by-Step Seam Getting Started Guide

                    The latest version of seam-gen is looking for a src directory that is nowhere to be found.

                    C:\jboss\seam\seam-gen>seam scaffold-wtp-project myseam
                    Buildfile: build.xml
                    
                    create-folders-wtp:
                     [echo] Creating Project Folders ...
                     [mkdir] Created dir: C:\workspace\myseam
                     [mkdir] Created dir: C:\workspace\myseamEJB
                     [mkdir] Created dir: C:\workspace\myseamWeb
                    
                    file-copy-wtp:
                     [echo] Copying project jars and resources ...
                     [copy] Copying 25 files to C:\workspace\myseam\lib
                    
                    BUILD FAILED
                    C:\jboss\seam\seam-gen\build.xml:71: C:\jboss\seam\seam-gen\src not found.
                    
                    Total time: 1 second
                    C:\jboss\seam\seam-gen>
                    


                    • 22. Re: Step-by-Step Seam Getting Started Guide

                      It looks like the missing src directory is supposed to be empty, so I just created it. Also, I had troubles when I was not running seam-gen in the seam-gen subdirectory of the unpacked seam distribution (I had another copy I was messing with that wasn't under a seam distribution).

                      • 23. Re: Step-by-Step Seam Getting Started Guide
                        bjk002

                        Just a quick note:

                        when attempting #5 exec. "seam scaffold-wtp-project sample" you get an error the "src" not found You need to add an "src" folder to your seam-gen dir, then try again, works just fine.

                        • 24. Re: Step-by-Step Seam Getting Started Guide
                          bjk002

                           

                          16:43:05,104 ERROR [MainDeployer] Could not create deployment: file:/C:/Program Files/JBoss/jboss-4.0.4.GA/server/defaul
                          t/tmp/deploy/tmp37422jboss-seam-booking.ear-contents/jboss-seam-booking.jar
                          org.jboss.deployment.DeploymentException: expected one enterprise-beans tag
                           at org.jboss.metadata.MetaData.getUniqueChild(MetaData.java:113)
                           at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(ApplicationMetaData.java:371)
                           at org.jboss.metadata.XmlFileLoader.load(XmlFileLoader.java:166)
                           at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:541)
                           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.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:99)
                           at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.jav
                          a:180)
                          


                          Anyone else experiencing this on the latest fix?

                          • 25. Re: Step-by-Step Seam Getting Started Guide

                             

                            "chuckadams" wrote:
                            The latest version of seam-gen is looking for a src directory that is nowhere to be found.


                            This issue has been fixed in the latest seam-gen.zip. Thanks for pointing this out.

                            James

                            • 26. Re: Step-by-Step Seam Getting Started Guide
                              yvo

                               

                              "bjk002" wrote:
                              16:43:05,104 ERROR [MainDeployer] Could not create deployment: file:/C:/Program Files/JBoss/jboss-4.0.4.GA/server/defaul
                              t/tmp/deploy/tmp37422jboss-seam-booking.ear-contents/jboss-seam-booking.jar
                              org.jboss.deployment.DeploymentException: expected one enterprise-beans tag
                               [...]
                              


                              Anyone else experiencing this on the latest fix?

                              I have the same problem with the example "booking" (http://labs.jboss.com/portal/jbossseam/gettingstarted)

                              13:22:21,826 ERROR [MainDeployer] Could not create deployment: file:/home/yvo/outils/jboss/jboss-4.0.4.GA-jems/server/default/tmp/deploy/tmp19224jboss-seam-booking.ear-contents/jboss-seam-booking.jar
                              org.jboss.deployment.DeploymentException: expected one enterprise-beans tag
                               at org.jboss.metadata.MetaData.getUniqueChild(MetaData.java:113)
                              

                              Is there a fix for that or something to correct ?

                              • 27. Re: Step-by-Step Seam Getting Started Guide
                                karakal

                                I have this error with Eclipse 3.2, Jboss 4.0.4GA, the newest version of Seam and seam-gen:

                                11:45:08,510 ERROR [MainDeployer] Could not initialise deployment: file:/home/lah/jboss-4.0.4.GA/server/default/deploy/sample.ear
                                org.jboss.deployment.DeploymentException: Failed to find module file: jboss-seam.jar

                                What is wrong here?

                                • 28. Re: Step-by-Step Seam Getting Started Guide
                                  japplicoon

                                   

                                  "karakal" wrote:

                                  11:45:08,510 ERROR [MainDeployer] Could not initialise deployment: file:/home/lah/jboss-4.0.4.GA/server/default/deploy/sample.ear
                                  org.jboss.deployment.DeploymentException: Failed to find module file: jboss-seam.jar


                                  I got the same error. There is no jboss-seam.jar included in sample.ear, but in the project I see it in sample/lib and sample's build.xml should include it in the ear.
                                  BTW, in the screenshots after running seam-gen for the scaffold project, the generated build.properties is shown in eclipse. Where do I find it? My sample's build.properties looks as before, with just the jboss.home set.

                                  Thank you for a hint!


                                  • 29. Re: Step-by-Step Seam Getting Started Guide
                                    shundavid

                                    I'm getting the same errors as all you guys. I've downloaded the new seam-gen.zip file. I've unchecked the dependencies you said so. And still nothing!

                                    What's going on with you jboss people? neither this seam-gen nor the Reverse Engineer tool works.