1 2 3 Previous Next 35 Replies Latest reply on Jan 2, 2008 3:12 AM by marx3

    Seam 2.0.0.0GA + Maven2 doesn`t work...

    Bartosz Jamroz Newbie

      First, this is how I did build my application with Seam 1.2.1.GA

      Main pom.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <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.blstream.inquisitor</groupId>
       <artifactId>Inquisitor</artifactId>
       <packaging>pom</packaging>
       <version>1.0-SNAPSHOT</version>
       <name>Inquisitor</name>
       <repositories>
       <repository>
       <id>JBossMaven2Repository</id>
       <name>JBoss Maven2 Repository</name>
       <url>http://repository.jboss.com/maven2</url>
       </repository>
       </repositories>
       <dependencyManagement>
       <dependencies>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-seam</artifactId>
       <version>1.2.1.GA</version>
       </dependency>
       </dependencies>
       </dependencyManagement>
       <build>
       <plugins>
       <plugin>
       <artifactId>maven-compiler-plugin</artifactId>
       <configuration>
       <fileName>ear/target/Inquisitor.ear</fileName>
       <source>1.5</source>
       <target>1.5</target>
       </configuration>
       </plugin>
       </plugins>
       </build>
       <modules>
       <module>webapp</module>
       <module>ejb3</module>
       <module>ear</module>
       </modules>
      </project>
      


      Ear
      <?xml version="1.0"?><project>
       <parent>
       <artifactId>Inquisitor</artifactId>
       <groupId>com.blstream.inquisitor</groupId>
       <version>1.0-SNAPSHOT</version>
       </parent>
       <modelVersion>4.0.0</modelVersion>
       <groupId>com.blstream.inquisitor</groupId>
       <artifactId>ear</artifactId>
       <packaging>ear</packaging>
       <name>Inquisitor::${artifactId}</name>
       <version>${pom.parent.version}</version>
       <dependencies>
       <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>
       <scope>test</scope>
       </dependency>
       <dependency>
       <groupId>com.blstream.inquisitor</groupId>
       <artifactId>ejb3</artifactId>
       <version>${pom.parent.version}</version>
       <type>ejb</type>
       </dependency>
       <dependency>
       <groupId>com.blstream.inquisitor</groupId>
       <artifactId>webapp</artifactId>
       <version>${pom.parent.version}</version>
       <type>war</type>
       </dependency>
       </dependencies>
       <build>
       <plugins>
       <plugin>
       <artifactId>maven-ear-plugin</artifactId>
       <configuration>
       <modules>
       <ejbModule>
       <groupId>com.blstream.inquisitor</groupId>
       <artifactId>ejb3</artifactId>
       </ejbModule>
       <javaModule>
       <groupId>jboss</groupId>
       <artifactId>jboss-seam</artifactId>
       <includeInApplicationXml>true</includeInApplicationXml>
       </javaModule>
       <webModule>
       <groupId>com.blstream.inquisitor</groupId>
       <artifactId>webapp</artifactId>
       <contextRoot>inquisitor</contextRoot>
       </webModule>
       </modules>
       </configuration>
       </plugin>
       </plugins>
       <finalName>Inquisitor</finalName>
       </build>
      </project>
      


      War
      <?xml version="1.0"?><project>
       <parent>
       <artifactId>Inquisitor</artifactId>
       <groupId>com.blstream.inquisitor</groupId>
       <version>1.0-SNAPSHOT</version>
       </parent>
       <modelVersion>4.0.0</modelVersion>
       <groupId>com.blstream.inquisitor</groupId>
       <artifactId>webapp</artifactId>
       <packaging>war</packaging>
       <name>Inquisitor::${artifactId}</name>
       <version>${pom.parent.version}</version>
       <build>
       <finalName>webapp</finalName>
       </build>
       <repositories>
       <repository>
       <id>JBossMaven2Repository</id>
       <name>JBoss Maven2 Repository</name>
       <url>http://repository.jboss.com/maven2</url>
       </repository>
       </repositories>
       <dependencies>
       <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>
       <scope>test</scope>
       </dependency>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-seam-ui</artifactId>
       <version>1.2.1.GA</version>
       </dependency>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-seam-debug</artifactId>
       <version>1.2.1.GA</version>
       </dependency>
       <dependency>
       <groupId>com.sun.facelets</groupId>
       <artifactId>jsf-facelets</artifactId>
       <version>1.1.11</version>
       </dependency>
       </dependencies>
      </project>
      


      Ejb3 jar
      <?xml version="1.0"?><project>
       <parent>
       <artifactId>Inquisitor</artifactId>
       <groupId>com.blstream.inquisitor</groupId>
       <version>1.0-SNAPSHOT</version>
       </parent>
       <modelVersion>4.0.0</modelVersion>
       <groupId>com.blstream.inquisitor</groupId>
       <artifactId>ejb3</artifactId>
       <packaging>ejb</packaging>
       <name>Inquisitor::${artifactId}</name>
       <version>${pom.parent.version}</version>
       <repositories>
       <repository>
       <id>JBossMaven2Repository</id>
       <name>JBoss Maven2 Repository</name>
       <url>http://repository.jboss.com/maven2</url>
       </repository>
       </repositories>
       <build>
       <finalName>ejb3</finalName>
       </build>
       <modules>
       <javaModule>jboss-seam-1.2.1.GA</javaModule>
       </modules>
       <dependencies>
       <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>3.8.1</version>
       <scope>test</scope>
       </dependency>
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-seam</artifactId>
       </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>
       </dependency>
       <dependency>
       <groupId>javax.persistence</groupId>
       <artifactId>persistence-api</artifactId>
       <version>1.0</version>
       </dependency>
       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-validator</artifactId>
       <version>3.0.0.GA</version>
       </dependency>
       </dependencies>
      </project>
      


      So with pom`s setted as above I could easyly build and deploy my application. But the problem is when I want to migrate to Seam 2.0.0.GA. To do that I simply change versions and groupId for modules. New libs are downloaded and package is build, but it`s impossible to deploy it (I`m using JBoss 4.2.2).

      The problem is that pom`s setted up for jboss-seam, jboss-seam-ui and jboss-seam-debug are hmmmm wrong.

      When building application with version 2.0.0.GA of Seam, maven is building ear which helds most of the libs but it also packs up the same libs into the war ! That makes it impossible to deploy - as far as I think. Maybe new pom`s work when building single war file, but not when trying to build an ear,

      Oh and I have a question, why there are so many depencies in 2.0.0.GA ?

      1.2.1.GA
      <?xml version="1.0" encoding="UTF-8"?><project>
       <modelVersion>4.0.0</modelVersion>
       <groupId>jboss</groupId>
       <artifactId>jboss-seam</artifactId>
       <version>1.2.1.GA</version>
      </project>
      


      2.0.0.GA
      <?xml version="1.0" encoding="UTF-8"?>
      <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>org.jboss.seam</groupId>
       <artifactId>jboss-seam</artifactId>
       <parent>
       <groupId>org.jboss.seam</groupId>
       <artifactId>parent</artifactId>
       <version>2.0.0.GA</version>
       </parent>
      
       <!--
       * Dependencies marked optional are provide optional features of Seam, not necessarily included in JBoss AS
       -->
      
       <dependencies>
       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-annotations</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-validator</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-search</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.hibernate</groupId>
       <artifactId>hibernate-entitymanager</artifactId>
       <scope>runtime</scope>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>javassist</artifactId>
       </dependency>
      
       <dependency>
       <groupId>dom4j</groupId>
       <artifactId>dom4j</artifactId>
       </dependency>
      
       <dependency>
       <groupId>javax.portlet</groupId>
       <artifactId>portlet-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.mail</groupId>
       <artifactId>mail</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.xml.ws</groupId>
       <artifactId>jaxws-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.jws</groupId>
       <artifactId>jsr181-api</artifactId>
       <scope>runtime</scope>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.faces</groupId>
       <artifactId>jsf-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.servlet.jsp</groupId>
       <artifactId>jsp-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.ejb</groupId>
       <artifactId>ejb-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>com.octo.captcha</groupId>
       <artifactId>jcaptcha-all</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.xml.soap</groupId>
       <artifactId>saaj-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.jms</groupId>
       <artifactId>jms</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.annotation</groupId>
       <artifactId>jsr250-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.transaction</groupId>
       <artifactId>jta</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>groovy</groupId>
       <artifactId>groovy-all</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.el</groupId>
       <artifactId>el-api</artifactId>
       </dependency>
      
       <dependency>
       <groupId>javax.persistence</groupId>
       <artifactId>persistence-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>antlr</groupId>
       <artifactId>antlr</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.apache.ant</groupId>
       <artifactId>ant-antlr</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-cache</artifactId>
       <optional>true</optional>
       </dependency>
      
       <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-system</artifactId>
       <optional>true</optional>
       </dependency>
      
       <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
       <dependency>
       <groupId>jboss</groupId>
       <artifactId>jboss-jmx</artifactId>
       <optional>true</optional>
       </dependency>
      
       <!-- This is actually a dep of jboss-cache, but it doesn't declare it -->
       <dependency>
       <groupId>jgroups</groupId>
       <artifactId>jgroups</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.buni.meldware</groupId>
       <artifactId>meldware-mailjmx</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.buni.meldware</groupId>
       <artifactId>meldware-mailapi</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.drools</groupId>
       <artifactId>drools-core</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.drools</groupId>
       <artifactId>drools-compiler</artifactId>
       <optional>true</optional>
       </dependency>
      
       <!-- Surefire can't cope with such a new version of testng, so we have to specify it
       here, otherwise ui build fails -->
       <dependency>
       <groupId>org.testng</groupId>
       <artifactId>testng</artifactId>
       <version>5.6</version>
       <optional>true</optional>
       <exclusions>
       <exclusion>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       </exclusion>
       </exclusions>
       </dependency>
      
       <dependency>
       <groupId>org.dbunit</groupId>
       <artifactId>dbunit</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.jbpm</groupId>
       <artifactId>jbpm-jpdl</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.jboss.seam</groupId>
       <artifactId>jboss-el</artifactId>
       </dependency>
      
       <dependency>
       <groupId>org.jboss.embedded</groupId>
       <artifactId>jboss-embedded-api</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>quartz</groupId>
       <artifactId>quartz</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>javax.faces</groupId>
       <artifactId>jsf-impl</artifactId>
       <optional>true</optional>
       </dependency>
      
       <dependency>
       <groupId>org.tuckey</groupId>
       <artifactId>urlrewritefilter</artifactId>
       <optional>true</optional>
       <scope>runtime</scope>
       </dependency>
      
       </dependencies>
      
      </project>
      


        • 1. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
          Todd Bush Newbie

          Howdy,

          After three days of working, I finally have my Seam 2.0 project building and deploying to JBoss 4.2.2 using maven 2. I still don't have the unit tests working (the do work in Eclipse using the testng plugin). Anyway, I hope this helps...

          I'm only including the dependencies.

          EJB - some of the exclusions are there to avoid conflicts with the jars in JBoss 4.2.2. ${seam.version} is defined in another pom.

           <dependencies>
          
           <dependency>
           <groupId>jboss</groupId>
           <artifactId>javassist</artifactId>
           <version>3.4.ga</version>
           <scope>test</scope>
           </dependency>
          
           <dependency><!-- required to boot jboss embedded -->
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-embedded-api</artifactId>
           <version>${seam.version}</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency><!-- required to boot jboss embedded -->
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-deployers</artifactId>
           <version>${seam.version}</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-embedded-all</artifactId>
           <version>${seam.version}</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>thirdparty-all</artifactId>
           <version>${seam.version}</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency>
           <groupId>commons-lang</groupId>
           <artifactId>commons-lang</artifactId>
           <version>2.2</version>
           </dependency>
          
           <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-annotations</artifactId>
           <version>3.3.0.ga</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-entitymanager</artifactId>
           <version>3.3.1.ga</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam</artifactId>
           <version>${seam.version}</version>
           <scope>provided</scope>
           <exclusions>
           <exclusion>
           <groupId>javax.el</groupId>
           <artifactId>el-api</artifactId>
           </exclusion>
           <exclusion>
           <groupId>dom4j</groupId>
           <artifactId>dom4j</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam-ui</artifactId>
           <version>${seam.version}</version>
           <exclusions>
           <exclusion>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam</artifactId>
           </exclusion>
           <exclusion>
           <groupId>javax.el</groupId>
           <artifactId>el-api</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam-debug</artifactId>
           <version>${seam.version}</version>
           <exclusions>
           <exclusion>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam</artifactId>
           </exclusion>
           <exclusion>
           <groupId>javax.el</groupId>
           <artifactId>el-api</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam-remoting</artifactId>
           <version>${seam.version}</version>
           <exclusions>
           <exclusion>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-el</artifactId>
           <version>${seam.version}</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency>
           <groupId>com.lowagie</groupId>
           <artifactId>itext</artifactId>
           <version>2.0.1</version>
           <scope>provided</scope>
           </dependency>
          
           <dependency>
           <groupId>log4j</groupId>
           <artifactId>log4j</artifactId>
           <version>1.2.14</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.testng</groupId>
           <artifactId>testng</artifactId>
           <version>5.5</version>
           <classifier>jdk15</classifier>
           <scope>test</scope>
           </dependency>
          
           </dependencies>
          
          


          Web - I left out the dependency to my EJB above.

           <dependencies>
          
           <dependency>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate-validator</artifactId>
           <version>3.0.0.GA</version>
           <exclusions>
           <exclusion>
           <groupId>org.hibernate</groupId>
           <artifactId>hibernate</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
          
           <dependency>
           <groupId>opensymphony</groupId>
           <artifactId>oscache</artifactId>
           <version>2.3.2</version>
           </dependency>
          
           <dependency>
           <groupId>richfaces</groupId>
           <artifactId>richfaces-api</artifactId>
           <version>3.1.2.GA</version>
           </dependency>
          
           <dependency>
           <groupId>richfaces</groupId>
           <artifactId>richfaces-impl</artifactId>
           <version>3.1.2.GA</version>
           </dependency>
          
           <dependency>
           <groupId>richfaces</groupId>
           <artifactId>richfaces-ui</artifactId>
           <version>3.1.2.GA</version>
           </dependency>
          
           <dependency> <!-- needed for richfaces -->
           <groupId>commons-collections</groupId>
           <artifactId>commons-collections</artifactId>
           <version>3.2</version>
           </dependency>
          
           <dependency>
           <groupId>com.sun.facelets</groupId>
           <artifactId>jsf-facelets</artifactId>
           <version>1.1.14</version>
           </dependency>
          
           <dependency>
           <groupId>org.apache.myfaces.tomahawk</groupId>
           <artifactId>tomahawk</artifactId>
           <version>1.1.6</version>
           <exclusions>
           <exclusion>
           <artifactId>commons-lang</artifactId>
           <groupId>commons-lang</groupId>
           </exclusion>
           <exclusion>
           <artifactId>commons-collections</artifactId>
           <groupId>commons-collections</groupId>
           </exclusion>
           </exclusions>
           </dependency>
          
           <dependency>
           <groupId>javax.faces</groupId>
           <artifactId>jsf-api</artifactId>
           <version>1.2</version>
           <scope>provided</scope>
           </dependency>
          
           </dependencies>
          
          


          EAR:

           <dependencies>
           <dependency>
           <groupId>dom4j</groupId>
           <artifactId>dom4j</artifactId>
           <version>1.6.1</version>
           <scope>provided</scope>
           </dependency>
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-seam</artifactId>
           <version>${seam.version}</version>
           <exclusions>
           <exclusion>
           <groupId>javax.el</groupId>
           <artifactId>el-api</artifactId>
           </exclusion>
           <exclusion>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-el</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
          
           <dependency>
           <groupId>org.jboss.seam</groupId>
           <artifactId>jboss-el</artifactId>
           <version>${seam.version}</version>
           <exclusions>
           <exclusion>
           <groupId>javax.el</groupId>
           <artifactId>el-api</artifactId>
           </exclusion>
           </exclusions>
           </dependency>
          
          
           <dependency>
           <groupId>com.emeds</groupId>
           <artifactId>ejb</artifactId>
           <version>${pom.parent.version}</version>
           <type>jar</type>
           </dependency>
          
           <dependency>
           <groupId>javax.persistence</groupId>
           <artifactId>persistence-api</artifactId>
           <version>1.0</version>
           </dependency>
          
           <dependency>
           <groupId>com.lowagie</groupId>
           <artifactId>itext</artifactId>
           <version>2.0.1</version>
           </dependency>
           </dependencies>
          
          


          I know there is some duplication in the dependencies, mostly due to not cleaning things up yet. Please, if anyone see something wrong or can suggest a better way of doing things; let me know.

          Thanks.


          • 2. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
            Todd Bush Newbie

            PS. I also had to copy into $JAVA_HOME/server/lib the following JARs.

            hibernate-search:jar
            hibernate-commons-annotations:jar
            lucene-core:jar

            (the last two are dependencies of the first).

            • 3. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
              Bartosz Jamroz Newbie

              Thanks for your feedback. I`ll try to mix your pom`s with mine and see what will came ;)

              But still, migrating to seam 2.0.0.GA on maven shouldn`t be so problematic as it is now..

              • 4. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                Pete Muir Master

                This is the first iteration of Maven support in Seam, so we need your feedback to get it better for the next releases.

                An example using maven will go a long way to helping I hope.

                Seam 1.2 didn't support Maven, so thats just a basic POM generated by Maven, Seam 2 does (so has a lot of dependencies).

                • 5. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                  Bartosz Jamroz Newbie

                  I`ll try to help with that feedback !

                  So when I manage to make my application run, I`ll post my pom`s as an example how I did it.

                  • 6. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                    Bradley Smith Master

                    There's been some research into Seam + Maven 2 unit testing in this thread.

                    http://www.jboss.com/index.html?module=bb&op=viewtopic&t=122406&postdays=0&postorder=asc&start=0

                    Transitive dependencies suck - anytime you put an exclusion into your pom you're fixing a problem due to this so-called feature of maven2. (IMHO)



                    • 7. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                      Pete Muir Master

                      I think this is because people don't use the optional flag properly. My rule is anything that anything which will only be used by 95% or greater of the people consuming your artifacts shouldn't be optional.

                      Please, if you are having to use exclusions with Seam poms, post here or create a jira issue.

                      • 8. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                        Bartosz Jamroz Newbie

                        I`ve managed to deal with building Seam 2.0 application without exclusions.

                        main project pom

                        <?xml version="1.0" encoding="UTF-8"?>
                        <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.blstream.inquisitor</groupId>
                         <artifactId>Inquisitor</artifactId>
                         <packaging>pom</packaging>
                         <version>1.0-SNAPSHOT</version>
                         <name>Inquisitor</name>
                         <repositories>
                         <repository>
                         <id>JBossMaven2Repository</id>
                         <name>JBoss Maven2 Repository</name>
                         <url>http://repository.jboss.com/maven2</url>
                         </repository>
                         </repositories>
                         <dependencyManagement>
                         <dependencies>
                         <dependency>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-seam</artifactId>
                         <version>2.0.0.GA</version>
                         </dependency>
                         </dependencies>
                         </dependencyManagement>
                         <build>
                         <plugins>
                         <plugin>
                         <artifactId>maven-compiler-plugin</artifactId>
                         <configuration>
                         <fileName>ear/target/Inquisitor.ear</fileName>
                         <source>1.5</source>
                         <target>1.5</target>
                         </configuration>
                         </plugin>
                         </plugins>
                         </build>
                         <modules>
                         <module>webapp</module>
                         <module>ejb3</module>
                         <module>ear</module>
                         </modules>
                        </project>
                        


                        war
                        <?xml version="1.0"?><project>
                         <parent>
                         <artifactId>Inquisitor</artifactId>
                         <groupId>com.blstream.inquisitor</groupId>
                         <version>1.0-SNAPSHOT</version>
                         </parent>
                         <modelVersion>4.0.0</modelVersion>
                         <groupId>com.blstream.inquisitor</groupId>
                         <artifactId>webapp</artifactId>
                         <packaging>war</packaging>
                         <name>Inquisitor::${artifactId}</name>
                         <version>${pom.parent.version}</version>
                         <build>
                         <finalName>webapp</finalName>
                         </build>
                         <repositories>
                         <repository>
                         <id>JBossMaven2Repository</id>
                         <name>JBoss Maven2 Repository</name>
                         <url>http://repository.jboss.com/maven2</url>
                         </repository>
                         </repositories>
                         <dependencies>
                         <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>
                         </dependencies>
                        </project>
                        


                        EJB
                        <?xml version="1.0"?><project>
                         <parent>
                         <artifactId>Inquisitor</artifactId>
                         <groupId>com.blstream.inquisitor</groupId>
                         <version>1.0-SNAPSHOT</version>
                         </parent>
                         <modelVersion>4.0.0</modelVersion>
                         <groupId>com.blstream.inquisitor</groupId>
                         <artifactId>ejb3</artifactId>
                         <packaging>ejb</packaging>
                         <name>Inquisitor::${artifactId}</name>
                         <version>${pom.parent.version}</version>
                         <repositories>
                         <repository>
                         <id>JBossMaven2Repository</id>
                         <name>JBoss Maven2 Repository</name>
                         <url>http://repository.jboss.com/maven2</url>
                         </repository>
                         </repositories>
                         <build>
                         <finalName>ejb3</finalName>
                         </build>
                         <modules>
                         <javaModule>jboss-seam-2.0.0.GA</javaModule>
                         <javaModule>jboss-el-2.0.0.GA</javaModule>
                         </modules>
                         <dependencies>
                         <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</artifactId>
                         </dependency>
                         <dependency>
                         <groupId>org.jboss.javaee</groupId>
                         <artifactId>jboss-ejb-api</artifactId>
                         <version>3.0.0.20070913080910</version>
                         </dependency>
                         <dependency>
                         <groupId>javax.persistence</groupId>
                         <artifactId>persistence-api</artifactId>
                         <version>1.0</version>
                         </dependency>
                         <dependency>
                         <groupId>org.hibernate</groupId>
                         <artifactId>hibernate-validator</artifactId>
                         <version>3.0.0.GA</version>
                         </dependency>
                         </dependencies>
                        </project>
                        


                        EAR
                        <?xml version="1.0"?><project>
                         <parent>
                         <artifactId>Inquisitor</artifactId>
                         <groupId>com.blstream.inquisitor</groupId>
                         <version>1.0-SNAPSHOT</version>
                         </parent>
                         <modelVersion>4.0.0</modelVersion>
                         <groupId>com.blstream.inquisitor</groupId>
                         <artifactId>ear</artifactId>
                         <packaging>ear</packaging>
                         <name>Inquisitor::${artifactId}</name>
                         <version>${pom.parent.version}</version>
                         <dependencies>
                         <dependency>
                         <groupId>junit</groupId>
                         <artifactId>junit</artifactId>
                         <version>3.8.1</version>
                         <scope>test</scope>
                         </dependency>
                         <dependency>
                         <groupId>com.blstream.inquisitor</groupId>
                         <artifactId>ejb3</artifactId>
                         <version>${pom.parent.version}</version>
                         <type>ejb</type>
                         </dependency>
                         <dependency>
                         <groupId>com.blstream.inquisitor</groupId>
                         <artifactId>webapp</artifactId>
                         <version>${pom.parent.version}</version>
                         <type>war</type>
                         </dependency>
                         </dependencies>
                         <build>
                         <plugins>
                         <plugin>
                         <artifactId>maven-ear-plugin</artifactId>
                         <configuration>
                         <modules>
                         <ejbModule>
                         <groupId>com.blstream.inquisitor</groupId>
                         <artifactId>ejb3</artifactId>
                         </ejbModule>
                         <javaModule>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-seam</artifactId>
                         <includeInApplicationXml>true</includeInApplicationXml>
                         </javaModule>
                         <javaModule>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>jboss-el</artifactId>
                         <includeInApplicationXml>true</includeInApplicationXml>
                         </javaModule>
                         <webModule>
                         <groupId>com.blstream.inquisitor</groupId>
                         <artifactId>webapp</artifactId>
                         <contextRoot>inquisitor</contextRoot>
                         </webModule>
                         </modules>
                         </configuration>
                         </plugin>
                         </plugins>
                         <finalName>Inquisitor</finalName>
                         </build>
                        </project>
                        



                        So now application builds and deploys smoothly but I`ve encountered another problem. There are no seam components which I`ve created in ANY scope.

                        Example:

                        questioncategory.xml
                        <html xmlns="http://www.w3.org/1999/xhtml"
                         xmlns:ui="http://java.sun.com/jsf/facelets"
                         xmlns:h="http://java.sun.com/jsf/html"
                         xmlns:f="http://java.sun.com/jsf/core"
                         xmlns:s="http://jboss.com/products/seam/taglib">
                         <body>
                        
                         <h:form>
                         <h:inputText value="#{QuestionCategory.categoryName}" required="true"/>
                         <h:outputText value="categoryList is null" rendered="#{questionCategoryList == null}"/><br/>
                         <h:outputText value="categoryList rowCount = 0" rendered="#{questionCategoryList.size == 0}"/><br/>
                         <h:outputText value="Available categoryList: " rendered="#{questionCategoryList.size > 0}"/><br/>
                         <h:commandButton type="submit" value="Add new category" action="#{QuestionCategoryController.addCategory}"/><br/>
                         <h:dataTable var="cat" value="#{questionCategoryList}">
                         <h:column>
                         <h:outputText value="[ #{cat.categoryName} ]"/>
                         </h:column>
                         <h:column>
                         <h:outputText value=" - [ #{cat.created} ]"><s:convertDateTime pattern="MM/dd/yyyy"/></h:outputText>
                         </h:column>
                         <h:column>
                         <s:link value="remove" action="#{QuestionCategoryController.removeCategory}"/>
                         </h:column>
                         <h:column>
                         <s:link value="select" action="#{QuestionCategoryController.selectCategory(cat)}"/>
                         </h:column>
                         </h:dataTable>
                         </h:form>
                        
                         <ui:debug hotkey="d"/>
                        
                         </body>
                        </html>
                        


                        QuestionCategoryController
                        @Stateful
                        @Scope(ScopeType.SESSION)
                        @Name("QuestionCategoryController")
                        public class QuestionCategoryControllerBean implements QuestionCategoryController {
                        
                         @Logger
                         private Log log;
                        
                         @In(create = true)
                         private QuestionCategoryManager questionCategoryManager;
                        
                         @DataModel
                         private List<QuestionCategory> questionCategoryList;
                        
                         @In(create = true)
                         @DataModelSelection
                         private QuestionCategory questionCategory;
                        
                         public void addCategory() {
                         log.info("Adding category [#{questionCategory.categoryName}]");
                         questionCategoryManager.addCategory(questionCategory);
                         getAllQuestionsCategories();
                         }
                        
                         public void removeCategory() {
                         questionCategoryList.remove(questionCategory);
                         questionCategoryManager.removeCategory(questionCategory);
                         questionCategory = null;
                         getAllQuestionsCategories();
                         }
                        
                         public void selectCategory(QuestionCategory category) {
                         questionCategory = category;
                         }
                        
                         @Factory(value="questionCategoryList")
                         public void getAllQuestionsCategories() {
                         questionCategoryList = questionCategoryManager.getAllQuestionCategories();
                         }
                        
                         @Remove @Destroy
                         public void destroy() {}
                        
                        }
                        


                        QuestionCategory entity
                        @Entity
                        @Scope(ScopeType.EVENT)
                        @Name("questionCategory")
                        @Table(name="QuestionCategories")
                        public class QuestionCategory implements Serializable {
                        
                         @Id @GeneratedValue
                         private Long id;
                        
                         @NotNull @Length(min=3, max=100)
                         private String categoryName;
                        
                         @OneToMany
                         private List<Question> questionList;
                        
                         @Temporal(value = TemporalType.TIMESTAMP)
                         private Date created;
                        
                         @Override
                         public boolean equals(Object obj) {
                         if (!(obj instanceof QuestionCategory) || this.id == null) {
                         return false;
                         }
                        
                         return this.id.equals(((QuestionCategory)obj).getId());
                         }
                        
                         public QuestionCategory() {
                         this.questionList = new ArrayList<Question>();
                         }
                        
                         public QuestionCategory(String categoryName) {
                         this.categoryName = categoryName;
                         this.questionList = new ArrayList<Question>();
                         }
                        
                         public Long getId() {
                         return id;
                         }
                        
                         public void setId(Long id) {
                         this.id = id;
                         }
                        
                         public String getCategoryName() {
                         return categoryName;
                         }
                        
                         public void setCategoryName(String categoryName) {
                         this.categoryName = categoryName;
                         }
                        
                         public List<Question> getQuestionList() {
                         return questionList;
                         }
                        
                         public void setQuestionList(List<Question> questionList) {
                         this.questionList = questionList;
                         }
                        
                         public Date getCreated() {
                         return created;
                         }
                        
                         public void setCreated(Date created) {
                         this.created = created;
                         }
                        }
                        


                        ...I don`t have to say that this code works on Seam 1.2.1 -_- ?

                        • 9. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                          Bradley Smith Master

                          Here's one difference between my poms for an ear and yours.

                          In the parent pom, it's my experience that I should generally build the ejb jar(s) before the webapp war(s) - often the webapp(s) depend on the ejb(s) (mainly for custom converters).

                           <modules>
                           <module>ejb</module>
                           <module>webapp</module>
                           <module>ear</module>
                           </modules>
                          


                          Also, presumably, you've put a seam.properties file in ${PROJECT_HOME}/ejb/src/main/resources - there have been times in a new project when I haven't done this and run into the same problem. After you've checked that, my guess is it's time to double check the jndiPattern in your webapp's components.xml file.

                          Good Luck

                          • 10. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                            Bartosz Jamroz Newbie

                            I`ve doublechecked everything and it seems to be allright. Seam.properties is where it should be, jndi name is allso correct.

                            jmx-console

                            +- Inquisitor (class: org.jnp.interfaces.NamingContext)
                             | +- PollManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- local (proxy: $Proxy205 implements interface com.blstream.inquisitor.ejb3.interfaces.PollManager,interface org.jboss.ejb3.JBossProxy)
                             | +- EjbSynchronizations (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- UploadManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- local (proxy: $Proxy202 implements interface com.blstream.inquisitor.ejb3.interfaces.UploadManager,interface org.jboss.ejb3.JBossProxy)
                             | +- OutcomeManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- local (proxy: $Proxy190 implements interface com.blstream.inquisitor.ejb3.interfaces.OutcomeManager,interface org.jboss.ejb3.JBossProxy)
                             | +- QuestionTypeManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- QuestionCategoryControllerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- PropertiesManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- TestManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- local (proxy: $Proxy208 implements interface com.blstream.inquisitor.ejb3.interfaces.TestManager,interface org.jboss.ejb3.JBossProxy)
                             | +- GroupManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- local (proxy: $Proxy197 implements interface com.blstream.inquisitor.ejb3.interfaces.GroupManager,interface org.jboss.ejb3.JBossProxy)
                             | +- AnswerControllerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- QuestionControllerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- QuestionCategoryManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- QuestionManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- UserManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- local (proxy: $Proxy194 implements interface com.blstream.inquisitor.ejb3.interfaces.UserManager,interface org.jboss.ejb3.JBossProxy)
                             | +- AnswerManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                             | +- TimerServiceDispatcher (class: org.jnp.interfaces.NamingContext)
                             | | +- local (proxy: $Proxy215 implements interface org.jboss.seam.async.LocalTimerServiceDispatcher,interface org.jboss.ejb3.JBossProxy)
                             | +- PictureManagerBean (class: org.jnp.interfaces.NamingContext)
                             | | +- localStatefulProxyFactory (class: org.jboss.ejb3.stateful.StatefulLocalProxyFactory)
                             | | +- local (class: java.lang.Object)
                            


                            But still, Seam doesn`t see any components which I`ve created ;/

                            • 11. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                              Bartosz Jamroz Newbie

                              Is it important in what package in the jar i keep my components ?

                              ex. ejb3/src/main/java/actions or ejb3/src/main/java/com/mycompany/sth/crap/ ?

                              • 12. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                                Pete Muir Master

                                Can you see Seam components being loaded in the startup log?

                                • 13. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                                  Bartosz Jamroz Newbie

                                  Components build in Seam, yes. Every Seam component which I create - no.

                                  What is strange is that everythings loads correctly on 1.2.1.

                                  • 14. Re: Seam 2.0.0.0GA + Maven2 doesn`t work...
                                    Pete Muir Master

                                    Do you have seam.properties in the jar?

                                    1 2 3 Previous Next