-
15. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
w17chm4n Nov 15, 2007 2:12 PM (in response to w17chm4n)Yes I have.
As I said in my last post, my application builds, deploys and runs smoothly when using Seam 1.2.1.
Everything changes when I make pom modifications (building app with maven) to use Seam 2.0. -
16. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
pmuir Nov 15, 2007 4:08 PM (in response to w17chm4n)Yes, I understand that. What I'm trying to do is walk you through *why* your components might not be found in your new deployment scenario.
So, post the output of ls -R on your exploded deployed structure. -
17. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
w17chm4n Nov 15, 2007 4:17 PM (in response to w17chm4n)Sure as soon as I get back to work on monday :]
-
18. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
bmc Nov 16, 2007 10:56 AM (in response to w17chm4n)w17chm4n - I had just the same problem. In my case it was becouse of jboss-seam.jar library in my war/web-inf/lib folder.
The fix is quite simple - add this strings into your war`s pom.xml:
org.jboss.seam
jboss-seam
${seam-version}
provided -
19. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
bmc Nov 16, 2007 10:56 AM (in response to w17chm4n)cute bbcode by the way ;)
-
20. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
w17chm4n Nov 19, 2007 3:02 AM (in response to w17chm4n)bmc you were right, that really was the problem. Thanks !
-
21. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
leandro3.marinho Nov 28, 2007 3:28 PM (in response to w17chm4n)w17chm4n,
the tag s:validateAll or s:validate is working in your project?
I'm trying use Seam2 with Maven2 and this tag is not working. -
22. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
w17chm4n Nov 29, 2007 6:16 AM (in response to w17chm4n)I haven`t used it, but I can check it out.
-
23. WAR only: Seam 2.0.0.0GA + Maven2 doesn`t work...
jsolderitsch Dec 12, 2007 2:21 PM (in response to w17chm4n)I have followed I think the advice that has been given in this thread but I am in a simpler situation -- only one pom for a single war deployment.
I copied in dependencies from the examples I have seen in this thread and gotten mvn install to produce a war file.
When I go to deploy it, JBoss shows:14:14:37,619 INFO [TomcatDeployer] deploy, ctxPath=/TestSeam, warUrl=.../tmp/deploy/tmp57916TestSeam-exp.war/ 14:14:37,930 ERROR [[/TestSeam]] Exception starting filter Seam Filter java.lang.ClassCastException: org.jboss.seam.servlet.SeamFilter at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:255) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3722)
My dependency section of the pom looks like:<dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam</artifactId> <version>2.0.0.GA</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-debug</artifactId> <version>2.0.0.GA</version> </dependency> <dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-ui</artifactId> <version>2.0.0.GA</version> </dependency> <dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-el</artifactId> <version>2.0.0.GA</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <version>1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId> <version>1.2_04-p02</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> <version>1.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>3.0.0.GA</version> <scope>provided</scope> </dependency> <dependency> <!--<groupId>jboss</groupId>--> <groupId>org.jboss.javaee</groupId> <artifactId>jboss-ejb-api</artifactId> <!--<version>4.2.1.GA</version>--> <version>3.0.0.20070913080910</version> <scope>provided</scope> </dependency>
Can anyone see what I am doing wrong. Seam and maven newbie!
The code I am adapting came out of seam-gen so the java class code is all generated stuff from seam-gen. -
24. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
jsolderitsch Dec 12, 2007 3:27 PM (in response to w17chm4n)I am looking at the contents of the lib folder in WEB_INF in my war, comparing what I have when I let maven generate it and what I have when I use the ant build produced by seam-gen.
In the ant-built lib folder I see:antlr-runtime.jar
commons-beanutils.jar
commons-digester.jar
drools-compiler.jar
drools-core.jar
jboss-el.jar
jboss-seam-debug.jar
jboss-seam-ioc.jar
jboss-seam-mail.jar
jboss-seam-pdf.jar
jboss-seam-remoting.jar
jboss-seam-ui.jar
jboss-seam.jar
jbpm-jpdl.jar
jsf-facelets.jar
mvel14.jar
richfaces-api.jar
richfaces-impl.jar
richfaces-ui.jar
In the maven built one I seecommons-beanutils-1.7.0.jar
dom4j-1.6.1-jboss.jar
javassist-3.3.ga.jar
jboss-el-2.0.0.GA.jar
jboss-seam-2.0.0.GA.jar
jboss-seam-debug-2.0.0.GA.jar
jboss-seam-remoting-2.0.0.GA.jar
jboss-seam-ui-2.0.0.GA.jar
jsf-facelets-1.1.14.jar
servlet-api-2.5.jar
I seem to be getting the seam stuff ok, but the presence and absence of the other jars is mysterious -- to me at least.
How do I get the set produced by maven to be closer to that produced by ant? The war built with ant works, the one with maven does not. -
25. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
jsolderitsch Dec 12, 2007 6:03 PM (in response to w17chm4n)I am trying to relate what I learned in this thread to what I read here:
http://www.michaelyuan.com/blog/2007/10/02/jboss-seam-project-setup-with-maven/
This article provides a pom.xml example for a simple war deploy that includes a reference to a parent pom that is defined by jboss-seam.
The example was created in October, before 2.0.0GA. I can't seem to understand the syntax I need to include in my own pom.xml to properly refer to the Seam parent. Will this parent pom be downloaded as part of my mvn install process? Or do I need to locate my own project in a folder in which I copy the root.pom as pom.xml? I notice that seam-gen itself creates local copies of various poms in the classes/poms folder. So I have a local example but the process of either nesting my project to use the proper packaging pom or the maven fetch of the parent from the jboss repo is unclear.
I am trying to overcome some dependency issues that perhaps using a parent tag, properly formatted, would help me. -
26. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
jsolderitsch Dec 12, 2007 10:46 PM (in response to w17chm4n)I switched to Yuan's approach and after adding a few dependencies, I got maven to create a war. But the war still fails to deploy. I now see a different message:
22:17:46,925 INFO [TomcatDeployer] deploy, ctxPath=/TestSeam, warUrl=.../tmp/deploy/tmp24620TestSeam-exp.war/ 22:17:47,661 ERROR [STDERR] javax.faces.FacesException: org.jboss.seam.jsf.SeamApplicationFactory 22:17:47,661 ERROR [STDERR] at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:569) 22:17:47,661 ERROR [STDERR] at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:448) 22:17:47,661 ERROR [STDERR] at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:249)
and later:22:17:47,683 ERROR [[/TestSeam]] Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener javax.faces.FacesException: org.jboss.seam.jsf.SeamApplicationFactory at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:569) at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:448) at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:249)
The pom I ended up using looks like:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.gestalt.afmstt.modernization.testseammaven</groupId> <artifactId>TestMaven</artifactId> <packaging>war</packaging> <version>1.0-SNAPSHOT</version> <name>TestMaven Webapp</name> <parent> <groupId>org.jboss.seam</groupId> <artifactId>root</artifactId> <version>2.0.0.GA</version> </parent> <repositories> <repository> <id>repository.jboss.org</id> <name>JBoss Repository</name> <url>http://repository.jboss.org/maven2</url> </repository> </repositories> <dependencies> <dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam</artifactId> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-el</artifactId> <exclusions> <exclusion> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.jboss.seam</groupId> <artifactId>jboss-seam-ui</artifactId> </dependency> <dependency> <groupId>com.sun.facelets</groupId> <artifactId>jsf-facelets</artifactId> </dependency> <dependency> <groupId>javax.persistence</groupId> <artifactId>persistence-api</artifactId> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> </dependency> <dependency> <groupId>javax.ejb</groupId> <artifactId>ejb-api</artifactId> </dependency> <dependency> <groupId>javax.jws</groupId> <artifactId>jsr181-api</artifactId> <exclusions> <exclusion> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> </exclusion> </exclusions> </dependency> </dependencies> <build> <finalName>TestSeam</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.5</source> <target>1.5</target> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>jboss-maven-plugin</artifactId> <configuration> <jbossHome>/usr/local/jboss-4.2.2.GA</jbossHome> <port>8080</port> </configuration> </plugin> </plugins> </build> </project>
The set of jar files included in the war's lib folder is different:
antlr-2.7.6.jar
asm-1.5.3.jar
asm-attrs-1.5.3.jar
cglib-2.1_3.jar
commons-beanutils-1.7.0.jar
dom4j-1.6.1-jboss.jar
ejb-api-3.0.jar
el-api-1.0.jar
hibernate-3.2.4.sp1.jar
hibernate-validator-3.0.0.GA.jar
javassist-3.3.ga.jar
jboss-el-2.0.0.GA.jar
jboss-seam-2.0.0.GA.jar
jboss-seam-ui-2.0.0.GA.jar
jsf-api-1.2_04-p02.jar
jsf-facelets-1.1.14.jar
jsr181-api-1.0-MR1.jar
jta-1.0.1B.jar
persistence-api-1.0.jar
The one that has the javax.faces.FacesException in it is the jsf-api jar. I do NOT declare a dependency for this in my pom and yet it is included. Why?
Hope someone has the patience to look through this and set me straight. -
27. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
jsolderitsch Dec 12, 2007 11:28 PM (in response to w17chm4n)I tweaked the pom to have some explicit dependencies with a provided scope:
<dependency> <groupId>javax.faces</groupId> <artifactId>jsf-api</artifactId> <scope>provided</scope> </dependency> <dependency> <groupId>javax.el</groupId> <artifactId>el-api</artifactId> <scope>provided</scope> </dependency>
thereby eliminating an included library jar and now I get a different error:23:14:28,452 ERROR [[/TestSeam]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener java.lang.RuntimeException: Could not create Component: org.jboss.seam.security.identity at org.jboss.seam.init.Initialization.addComponent(Initialization.java:976) at org.jboss.seam.init.Initialization.installComponents(Initialization.java:903) at org.jboss.seam.init.Initialization.init(Initialization.java:548) at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4361) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770) 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:296) 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:5312) 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:296) 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.deploy(MainDeployer.java:819) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782) at sun.reflect.GeneratedMethodAccessor20.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:610) 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: java.lang.IllegalArgumentException: no such setter method: org.jboss.seam.security.Identity.securityRules at org.jboss.seam.util.Reflections.getSetterMethod(Reflections.java:236) at org.jboss.seam.Component.initInitializers(Component.java:466) at org.jboss.seam.Component.<init>(Component.java:263) at org.jboss.seam.Component.<init>(Component.java:216) at org.jboss.seam.init.Initialization.addComponent(Initialization.java:961) ... 92 more
I think I am getting closer. The Identity class is inside the main Seam jar. Do I need a Drools jar? I have one in the ant-produced war file that works for me? -
28. Success! Re: Seam 2.0.0GA + Maven2 doesn`t work...
jsolderitsch Dec 13, 2007 9:18 AM (in response to w17chm4n)The last post mentioned the inclusion of drools.
Turns out that was part of the answer -- I went to the Seam root.pom and lifted the drools clauses from there (minus the version info) and that got me past the identity problem.
Then, since the seam-gen project depends on RichFaces, I had to include dependencies for this -- again I went to the root Seam pom and copied and pasted, minus the version.
Then it turned out that I had some dependencies that I added to allow maven to compile my code or that were derived from other included dependencies that I had to exclude from the deployable war file. Otherwise I was seeing JBoss exceptions in the console.
Adding explicit dependencies in my pom.xml for these WITH<scope>provided</scope>
elements did the trick there.
And lo and behold, the web app actually worked!
Two remaining glitches.
My app uses a MySQL datasource. This *-ds.xml file is included in the maven project in the resources folder. The war file that is produced then has this file in the classes folder within WEB-INF. JBoss does not seem to find it there -- I had to make a copy and put that in the server deploy folder manually. Can maven be taught to do that?
And I would love to have the war file actually deployed to my JBoss instance by maven itself. Is this possible? I may need to do some ant runner tricks I guess. -
29. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
pmuir Dec 18, 2007 1:35 PM (in response to w17chm4n)You should be able to use cargo for this, unfortunately it doesn't support JBoss 4.2 yet. So yes, some embedded ant script is probably best.
Not sure about the -ds.xml file (I'm sure maven can do this though). Maybe ask on the maven users list.