7 Replies Latest reply on Jan 13, 2011 6:05 AM by williajd

    AnnotatedMessages (implementation not found)

    williajd

      Hi,


      I hope someone can help me get moving on this.


      I'm attempting to use Seam Persistence in a new CDI and JSF2 application and have hit a dead end. I started with a simple Weld and JSF 2 project created by the the maven archetype:


      mvn archetype:generate -DinteractiveMode=n -DarchetypeArtifactId=weld-jsf-servlet-minimal -DarchetypeGroupId=org.jboss.weld.archetypes -DarchetypeVersion=1.0.0-BETA1 -DgroupId=com.example -DartifactId=example-web



      After adding weld extensions and working my way through various missing dependencies I have got to the following pom.xml file:


      <?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.example</groupId>
          <artifactId>example-web</artifactId>
          <packaging>war</packaging>
          <name>example-web</name>
          <version>1.0.0-SNAPSHOT</version>
      
          <properties>
            <!--
               Explicitly declaring the source encoding eliminates the following message:
               [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
            -->
              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <!-- The version of Weld extensions in use -->
              <weld.extensions.version>1.0.0-CR2</weld.extensions.version>
              <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
          </properties>
      
          <repositories>
             <!-- Several key Java EE APIs and RIs are missing from the Maven Central Repository -->
             <!-- The goal is to eventually eliminate the reliance on the JBoss repository -->
              <repository>
                  <id>repository.jboss.org</id>
                  <name>JBoss Repository</name>
                  <url>http://repository.jboss.org/maven2</url>
              </repository>
              <repository>
                  <id>repository.jboss.org.nexus</id>
                  <name>JBoss Public Repository</name>
                  <url>https://repository.jboss.org/nexus/content/groups/public</url>
              </repository>
          </repositories>
      
          <dependencyManagement>
              <dependencies>
               <!-- Import scope will provide versions for dependencies below. -->
                  <dependency>
                      <groupId>org.jboss.weld</groupId>
                      <artifactId>weld-extensions-bom</artifactId>
                      <version>${weld.extensions.version}</version>
                      <type>pom</type>
                      <scope>import</scope>
                  </dependency>
              </dependencies>
          </dependencyManagement>
      
          <dependencies>
      
            <!-- Common to JEE and Servlet containers -->
              <dependency>
                  <groupId>javax.enterprise</groupId>
                  <artifactId>cdi-api</artifactId>
              </dependency>
      
              <dependency>
                  <groupId>javax.annotation</groupId>
                  <artifactId>jsr250-api</artifactId>
                  <scope>provided</scope>
              </dependency>
      
            <!-- JSF 2.0 API -->
              <dependency>
                  <groupId>javax.faces</groupId>
                  <artifactId>jsf-api</artifactId>
              </dependency>
      
            <!-- Optional, but pretty useful. -->
            <!--
               <dependency> <groupId>javax.servlet</groupId> <artifactId>jstl</artifactId> </dependency>
            -->
      
            <!-- Optional, but highly recommended. -->
              <dependency>
                  <groupId>org.testng</groupId>
                  <artifactId>testng</artifactId>
                  <version>5.10</version>
                  <scope>test</scope>
                  <classifier>jdk15</classifier>
              </dependency>
      
            <!-- Jetty/Tomcat-specific scopes and artifacts -->
      
            <!-- JSF 2.0 -->
              <dependency>
                  <groupId>javax.faces</groupId>
                  <artifactId>jsf-impl</artifactId>
                  <scope>runtime</scope>
              </dependency>
      
      
              <dependency>
                  <groupId>org.jboss.weld.servlet</groupId>
                  <artifactId>weld-servlet</artifactId>
                  <scope>runtime</scope>
              </dependency>
      
              <dependency>
                  <groupId>org.glassfish.web</groupId>
                  <artifactId>el-impl</artifactId>
                  <scope>runtime</scope>
                  <exclusions>
                      <exclusion>
                          <groupId>javax.el</groupId>
                          <artifactId>el-api</artifactId>
                      </exclusion>
                  </exclusions>
              </dependency>
            <!-- end Jetty/Tomcat-specific scopes and artifacts -->
      
            <!-- Bean Validation API (JSR 303) -->
              <dependency>
                  <groupId>javax.validation</groupId>
                  <artifactId>validation-api</artifactId>
              </dependency>
      
            <!-- Bean Validation Implementation -->
            <!-- Provides portable constraints such as @NotEmpty, @Email and @Url -->
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-validator</artifactId>
                  <version>4.0.0.GA</version>
              </dependency>
      
            <!-- New dependencies -->
              <dependency>
                  <groupId>org.hibernate</groupId>
                  <artifactId>hibernate-core</artifactId>
                  <version>3.5.6-Final</version>
              </dependency>
      
              <dependency>
                  <groupId>org.hibernate.javax.persistence</groupId>
                  <artifactId>hibernate-jpa-2.0-api</artifactId>
                  <version>1.0.0-CR-1</version>
              </dependency>
      
              <dependency>
                  <groupId>org.jboss.logging</groupId>
                  <artifactId>jboss-logging</artifactId>
                  <version>3.0.0.Beta4</version>
              </dependency>
      
              <dependency>
                  <groupId>org.jboss.seam.persistence</groupId>
                  <artifactId>seam-persistence-impl</artifactId>
                  <version>3.0.0.Beta1</version>
                  <exclusions>
                      <exclusion>
                          <artifactId>el-api</artifactId>
                          <groupId>javax.el</groupId>
                      </exclusion>
                  </exclusions>
              </dependency>
      
              <dependency>
                  <groupId>org.jboss.ejb3</groupId>
                  <artifactId>jboss-ejb3-api</artifactId>
              </dependency>
          </dependencies>
      
          <build>
              <finalName>example-web</finalName>
              <plugins>
               <!-- Compiler plugin enforces Java 1.5 compatibility -->
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-compiler-plugin</artifactId>
                      <configuration>
                          <source>1.5</source>
                          <target>1.5</target>
                      </configuration>
                  </plugin>
      
               <!-- Eclipse plugin - download source and JavaDoc jars automatically -->
                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-eclipse-plugin</artifactId>
                      <configuration>
                          <wtpversion>2.0</wtpversion>
                          <downloadSources>true</downloadSources>
                          <downloadJavadocs>true</downloadJavadocs>
                      </configuration>
                  </plugin>
      
               <!-- Embedded Jetty (jetty:run) -->
                  <plugin>
                      <groupId>org.mortbay.jetty</groupId>
                      <artifactId>maven-jetty-plugin</artifactId>
                      <configuration>
                     <!-- Delete this block to have Jetty run default port (8080) -->
                          <connectors>
                              <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                                  <port>9090</port>
                              </connector>
                          </connectors>
                     <!-- force friendly name instead of artifact name + version -->
                          <contextPath>${project.build.finalName}</contextPath>
                     <!-- Where the BeanManager is constructed. This is where you'll declare datasources. -->
                          <jettyEnvXml>${basedir}/src/test/resources/jetty-env.xml</jettyEnvXml>
                     <!-- This parameter will auto-deploy modified classes. -->
                     <!-- You can save changes in a file or class and refresh your browser to view the changes. -->
                          <scanIntervalSeconds>3</scanIntervalSeconds>
                      </configuration>
                  </plugin>
      
               <!-- Embedded Tomcat (package tomcat:run) -->
               <!-- Standalone Tomcat (package tomcat:deploy) -->
                  <plugin>
                      <groupId>org.codehaus.mojo</groupId>
                      <artifactId>tomcat-maven-plugin</artifactId>
                      <configuration>
                          <path>/${project.build.finalName}</path>
                     <!-- Embedded port -->
                          <port>9090</port>
                     <!--
                        The default authentication credentials for remote deployment are username "admin" with no password To
                        override credentials, define a server in settings.xml and activate it using the <server> element
                     -->
                          <url>http://localhost:8080/manager</url>
                      </configuration>
                  </plugin>
              </plugins>
          </build>
      </project>



      I am now getting an exception:



      org.jboss.weld.DefinitionException: java.lang.IllegalArgumentException: Invalid bundle interface org.jboss.weld.extensions.messages.AnnotatedMessages (implementation not found)
           at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:43)
           at org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl.fire(ProcessAnnotatedTypeImpl.java:41)
           at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:59)
           at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:86)
           at org.jboss.weld.bootstrap.BeanDeployment.deployBeans(BeanDeployment.java:134)
           at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:367)
           at org.jboss.weld.environment.servlet.Listener.contextInitialized(Listener.java:158)
           at org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:549)



      Unfortunately I can't work out where to go from here. I am running this on Tomcat 6.0.28 run within Netbeans and Jetty via the plugin in the pom file. I have posted a step by step of how I got to this point here.


      Please help!!


      James