11 Replies Latest reply on Feb 8, 2012 2:30 PM by Jose Alvarez de Lara

    UnsatisfiedResolutionException on create instance of CDIVelocityContext

    Jose Alvarez de Lara Novice

      Hi,

       

      Here is my code,

       

      @Stateful
      @ConversationScoped
      @Named
      public class SendMail {
      
          @Inject
          private Instance<MailMessage> mailMessage;
      
          @Inject
          private Instance<Session> session;
          
          @Inject
          private Instance<CDIVelocityContext> cDIVelocityContext;
          
          @Inject
          private ResourceProvider resourceProvider;
          
          @Inject
          private Messages messages;
          
          @Inject
          @Confirmed
          private Event<Person> sendMailConfirmedEventSrc;
          
          @Inject
          @Confirmed
          private Event<Exception> sendFailedExceptionEventSrc;
          
          private Person person;
          
          private String name;
          private String email;
      
          private boolean personValid;
          
          @Begin
          public void setPerson() {
              person = new Person(name, email);
              personValid = true;
          }
          
          @End
          public void cancel() {
              person = null;
          }
           
          @End
          public void sendHTMLVelocity() {
              try {
                  mailMessage.get()
                          .from("seam@test.test", "Seam Framework")
                          .to(person)
                          .subject("HTML Message from Seam Mail - " + java.util.UUID.randomUUID().toString())
                          .bodyHtml(new VelocityTemplate(resourceProvider.loadResourceStream("/META-INF/template.html.velocity"), cDIVelocityContext.get()))
                          .put("version", "Seam 3")
                          .importance(MessagePriority.HIGH)
                          .addAttachment(new URLAttachment("http://www.seamframework.org/themes/sfwkorg/img/seam_icon_large.png", "seamLogo.png", ContentDisposition.INLINE))
                          .send(session.get());
                  
                  sendMailConfirmedEventSrc.fire(person);
                  
              } catch(SendFailedException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              } catch(WeldException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              } catch(UnsatisfiedResolutionException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              } catch(RuntimeException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              }
          }
      
          @End
          public void sendHTMLwithAlternativeVelocity() {
              try {
                  mailMessage.get()
                          .from("seam@test.test", "Seam Framework")
                          .to(person.getEmail(), person.getName())
                          .subject("HTML+Text Message from Seam Mail - " + java.util.UUID.randomUUID().toString())
                          .put("version", "Seam 3")
                          .bodyHtmlTextAlt(
                                  new VelocityTemplate(resourceProvider.loadResourceStream("/META-INF/template.html.velocity"), cDIVelocityContext.get()),
                                  new VelocityTemplate(resourceProvider.loadResourceStream("/META-INF/template.text.velocity"), cDIVelocityContext.get()))
                          .importance(MessagePriority.LOW)
                          .deliveryReceipt("seam@jboss.org")
                          .readReceipt("seam@jboss.org")
                          .addAttachment("template.html.velocity", "text/html", ContentDisposition.ATTACHMENT, resourceProvider.loadResourceStream("/META-INF/template.html.velocity"))
                          .addAttachment(new URLAttachment("http://www.seamframework.org/themes/sfwkorg/img/seam_icon_large.png", "seamLogo.png", ContentDisposition.INLINE))
                          .send(session.get());
                  
                  sendMailConfirmedEventSrc.fire(person);
                  
              } catch(SendFailedException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              } catch(WeldException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              } catch(UnsatisfiedResolutionException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              } catch(RuntimeException e){
                  //sendFailedExceptionEventSrc.fire(e);
                  e.printStackTrace();
              }
          }
          
          public void onMailMessageComplete(@Observes(during = TransactionPhase.AFTER_SUCCESS) @Confirmed final Person person) {
              messages.info(new DefaultBundleKey("send_email_confirmed")).defaults("You have sent an email to {0}")
                      .params(person.getName());
          }
          
          public void onSendFailedException(@Observes(during = TransactionPhase.AFTER_SUCCESS) @Confirmed final Exception e) {
              messages.info(new DefaultBundleKey("send_email_exception")).defaults("Thrown exception {0}")
                      .params(e);
          }
          
          @Produces
          @Dependent
          public Person getPerson() {
              return person;
          }
      
          public boolean isPersonValid() {
              return personValid;
          }
      
          public void setPersonValid(boolean personValid) {
              this.personValid = personValid;
          }
      
          public String getName() {
              return name;
          }
      
          public void setName(final String name) {
              this.name = name;
          }
      
          public String getEmail() {
              return email;
          }
      
          public void setEmail(final String email) {
              this.email = email;
          }
      }
      

       

      When I run the webapp on JBoss AS 7.0.2.Final I get the following exception,

       

      ERROR [stderr] (http--127.0.0.1-8180-2) org.jboss.weld.exceptions.UnsatisfiedResolutionException: WELD-001308 Unable to resolve any beans for Types: [class org.jboss.seam.mail.templating.velocity.CDIVelocityContext]; Bindings: [@javax.enterprise.inject.Default()]
      

       

      I am not sure if it is a bug, but I have been googling and tried many things and I can't get it work.

       

      Regards,

      Jose

        • 1. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
          Cody Lerum Apprentice

          Is there a velocity dependancy in your project?

           

          https://github.com/seam/mail/blob/develop/impl/src/main/java/org/jboss/seam/mail/templating/velocity/package-info.java

           

          If unable to resolve org.apache.velocity.app.VelocityEngine then CDI won't be able to produce.

          • 2. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
            Jose Alvarez de Lara Novice

            Yes I have got it. Here are the velocity dependencies in my pom.xml file,

             

                 <dependency>

                   <groupId>org.apache.velocity</groupId>

                   <artifactId>velocity</artifactId>             

                   <scope>runtime</scope>

                 </dependency>

                

                 <dependency>

                     <groupId>commons-logging</groupId>

                     <artifactId>commons-logging</artifactId>

                     <version>1.1</version>

                 </dependency>

                

                 <dependency>

                  <groupId>velocity</groupId>

                  <artifactId>velocity</artifactId>

                  <version>1.5</version>

                  <scope>runtime</scope>

                </dependency>

             

            so it must be other dependency.

            • 3. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
              Cody Lerum Apprentice

              Try the velocity version that is defined in the seam-bom

               

              I think it is 1.7

              • 4. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                Jose Alvarez de Lara Novice

                Here is my pom.xml file,

                 

                 

                <?xml version="1.0" encoding="UTF-8"?>
                <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                  <modelVersion>4.0.0</modelVersion>
                  <groupId>com.example.project</groupId>
                  <artifactId>seam-mail</artifactId>
                  <version>1.0.0-SNAPSHOT</version>
                  <packaging>war</packaging>
                
                  <properties>
                        <seam.version>3.1.0.Final</seam.version>
                        <velocity.version>1.7</velocity.version>
                  </properties>
                
                  <dependencyManagement>
                    <dependencies>
                
                      <dependency>
                         <groupId>org.jboss.seam</groupId>
                         <artifactId>seam-bom</artifactId>
                         <version>${seam.version}</version>
                         <type>pom</type>
                         <scope>import</scope>
                     </dependency>
                
                    </dependencies>
                  </dependencyManagement>
                
                  <dependencies>
                
                    <dependency>
                      <groupId>org.jboss.solder</groupId>
                      <artifactId>solder-api</artifactId>
                    </dependency>
                
                    <dependency>
                      <groupId>org.jboss.solder</groupId>
                      <artifactId>solder-impl</artifactId>
                      <exclusions>
                          <exclusion>
                              <groupId>org.jboss.solder</groupId>
                              <artifactId>solder-api</artifactId>
                          </exclusion>
                      </exclusions>
                    </dependency>
                
                    <!--
                    <dependency>
                      <groupId>org.jboss.seam</groupId>
                      <artifactId>jboss-seam</artifactId>
                      <version>2.2.1.Final</version>
                    </dependency>
                    -->
                
                    <dependency>
                      <groupId>org.jboss.weld</groupId>
                      <artifactId>weld-core</artifactId>
                      <version>2.0.0.Alpha1</version>
                      <scope>provided</scope>
                      <exclusions>
                          <exclusion>
                              <groupId>com.google.guava</groupId>
                               <artifactId>guava</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.slf4j</groupId>
                            <artifactId>slf4j-api</artifactId>
                          </exclusion>
                      </exclusions>
                    </dependency>
                
                    <dependency>
                      <groupId>org.jboss.weld</groupId>
                      <artifactId>weld-api</artifactId>
                        <version>2.0.Alpha1</version>
                      <scope>provided</scope>
                      <exclusions>
                          <exclusion>
                              <groupId>javax.enterprise</groupId>
                              <artifactId>cdi-api</artifactId>
                          </exclusion>
                      </exclusions>
                    </dependency>
                
                    <dependency>
                      <groupId>org.jboss.seam.international</groupId>
                      <artifactId>seam-international</artifactId>
                      <exclusions>
                          <exclusion>
                              <groupId>org.jboss.solder</groupId>
                                <artifactId>solder-api</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.jboss.solder</groupId>
                                <artifactId>solder-impl</artifactId>
                          </exclusion>
                      </exclusions>
                    </dependency>
                
                    <dependency>
                        <groupId>javax.ejb</groupId>
                        <artifactId>ejb-api</artifactId>
                        <version>3.0</version>
                    </dependency>
                
                    <dependency>
                      <groupId>org.jboss.seam.faces</groupId>
                      <artifactId>seam-faces</artifactId>
                      <version>3.1.0.Final</version>
                      <scope>compile</scope>
                      <exclusions>
                          <exclusion>
                              <groupId>org.jboss.solder</groupId>
                                <artifactId>solder-api</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.jboss.solder</groupId>
                                <artifactId>solder-impl</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.jboss.seam.international</groupId>
                                <artifactId>seam-international-api</artifactId>
                          </exclusion>
                      </exclusions>
                    </dependency>
                
                    <dependency>
                      <groupId>javax.faces</groupId>
                      <artifactId>jsf-impl</artifactId>
                      <version>2.0.2-FCS</version>
                    </dependency>
                
                    <dependency>
                      <groupId>javax.faces</groupId>
                      <artifactId>jsf-api</artifactId>
                      <version>2.0</version>
                    </dependency>
                
                    <dependency>
                      <groupId>javax.enterprise</groupId>
                      <artifactId>cdi-api</artifactId>
                      <scope>provided</scope>
                    </dependency>
                
                    <dependency>
                       <groupId>javax.activation</groupId>
                       <artifactId>activation</artifactId>
                       <scope>provided</scope>
                    </dependency>
                
                    <dependency>
                       <groupId>com.google.guava</groupId>
                       <artifactId>guava</artifactId>
                       <version>r07</version>
                    </dependency>
                
                    <dependency>
                        <groupId>javax.validation</groupId>
                          <artifactId>validation-api</artifactId>
                    </dependency>
                
                      <dependency>
                          <groupId>com.ocpsoft</groupId>
                          <artifactId>ocpsoft-pretty-time</artifactId>
                      </dependency>
                
                      <dependency>
                          <groupId>com.ocpsoft</groupId>
                          <artifactId>prettyfaces-jsf2</artifactId>
                      </dependency>
                
                      <dependency>
                          <groupId>joda-time</groupId>
                          <artifactId>joda-time</artifactId>
                      </dependency>
                
                     <dependency>
                          <groupId>org.jboss.seam.mail</groupId>
                          <artifactId>seam-mail-core-impl</artifactId>
                          <version>3.0.0-SNAPSHOT</version>
                          <exclusions>
                          <exclusion>
                              <groupId>com.google.guava</groupId>
                               <artifactId>guava</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.jboss.seam.solder</groupId>
                               <artifactId>seam-solder</artifactId>
                          </exclusion>
                      </exclusions>
                     </dependency>
                
                     <dependency>
                          <groupId>org.jboss.seam.mail</groupId>
                          <artifactId>seam-mail-velocity-impl</artifactId>
                          <version>3.1.0-SNAPSHOT</version>
                     </dependency>
                
                   <!-- Velocity Deps -->
                
                     <dependency>
                       <groupId>org.apache.velocity</groupId>
                       <artifactId>velocity</artifactId>
                     </dependency>
                
                     <dependency>
                         <groupId>commons-logging</groupId>
                         <artifactId>commons-logging</artifactId>
                         <version>1.1</version>
                     </dependency>
                
                     <dependency>
                      <groupId>velocity</groupId>
                      <artifactId>velocity</artifactId>
                      <version>1.5</version>
                    </dependency>
                
                     <!-- end Velocity Deps -->
                
                      <dependency>
                        <groupId>javax.mail</groupId>
                        <artifactId>mail</artifactId>
                        <scope>provided</scope>
                      </dependency>
                
                      <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>slf4j-simple</artifactId>
                          <version>1.5.10</version>
                      </dependency>
                
                      <dependency>
                          <groupId>org.slf4j</groupId>
                          <artifactId>slf4j-api</artifactId>
                          <version>1.5.10</version>
                      </dependency>
                
                      <dependency>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                        <version>1.2.16</version>
                      </dependency>
                
                  </dependencies>
                  <repositories>
                    <repository>
                      <id>JBOSS_NEXUS</id>
                      <url>http://repository.jboss.org/nexus/content/groups/public</url>
                    </repository>
                  </repositories>
                  <build>
                    <finalName>seam-mail</finalName>
                    <plugins>
                      <plugin>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <version>2.3.2</version>
                        <configuration>
                          <source>1.6</source>
                          <target>1.6</target>
                        </configuration>
                      </plugin>
                      <plugin>
                        <artifactId>maven-war-plugin</artifactId>
                        <version>2.1.1</version>
                        <extensions>false</extensions>
                        <configuration>
                          <failOnMissingWebXml>false</failOnMissingWebXml>
                        </configuration>
                      </plugin>
                    </plugins>
                  </build>
                </project>
                

                 

                 

                Can you see anything wrong?

                 

                El mensaje fue editado por: José Alvarez de Lara

                • 5. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                  Cody Lerum Apprentice

                  Remove:

                   

                       <dependency>

                        <groupId>velocity</groupId>

                        <artifactId>velocity</artifactId>

                        <version>1.5</version>

                      </dependency>

                  • 6. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                    Jason Porter Master

                    I also have no idea why you have weld in there, which is also the wrong version (the 2.x branch will be for CDI 1.1). You're also not using the 3.1.0.Final versions of things. Trying to mix and match versions will cause problems. You're also excluding Solder from everything which will not work at runtime.

                    • 7. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                      Jose Alvarez de Lara Novice

                      I have removed the dependency and it still does not work.

                      Let me talk to Jason Porter, I think he can help me with the pom.xml file.

                       

                      Kind regards

                      Jose

                      • 8. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                        Jose Alvarez de Lara Novice

                        Yes I am agree with you. I think I am using wrong dependencies,

                        but I do not know how to put ordering in that file.

                         

                        I have removed the weld dependency from the pom.xml file and also removed

                        what Cody Lerum says but still does not work. What more have I to do?

                         

                        Regards,

                        Jose

                        • 9. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                          Jason Porter Master

                          Try

                           

                           

                          <?xml version="1.0" encoding="UTF-8"?>
                          <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                            <modelVersion>4.0.0</modelVersion>
                            <groupId>com.example.project</groupId>
                            <artifactId>seam-mail</artifactId>
                            <version>1.0.0-SNAPSHOT</version>
                            <packaging>war</packaging>
                          
                          
                            <properties>
                                  <seam.version>3.1.0.Final</seam.version>
                                  <velocity.version>1.7</velocity.version>
                            </properties>
                          
                          
                            <dependencyManagement>
                              <dependencies>
                          
                          
                                <dependency>
                                   <groupId>org.jboss.seam</groupId>
                                   <artifactId>seam-bom</artifactId>
                                   <version>${seam.version}</version>
                                   <type>pom</type>
                                   <scope>import</scope>
                               </dependency>
                          
                          
                              </dependencies>
                            </dependencyManagement>
                          
                          
                            <dependencies>
                          
                          
                              <!-- You don't need this unless you're using features in Solder in your code -->
                              <dependency>
                                <groupId>org.jboss.solder</groupId>
                                <artifactId>solder-api</artifactId>
                              </dependency>
                          
                          
                              <!-- You don't need this unless you're using features in Solder in your code -->
                              <dependency>
                                <groupId>org.jboss.solder</groupId>
                                <artifactId>solder-impl</artifactId>
                                <!-- Not sure why you're excluding this -->
                                <exclusions>
                                    <exclusion>
                                        <groupId>org.jboss.solder</groupId>
                                        <artifactId>solder-api</artifactId>
                                    </exclusion>
                                </exclusions>
                              </dependency>
                          
                          
                          
                          
                              <dependency>
                                <groupId>org.jboss.seam.international</groupId>
                                <artifactId>seam-international</artifactId>
                              </dependency>
                          
                          
                              <!-- You may want to use the one from the org.jboss.spec group -->
                              <dependency>
                                  <groupId>javax.ejb</groupId>
                                  <artifactId>ejb-api</artifactId>
                                  <version>3.0</version>
                                  <scope>provided</scope>
                              </dependency>
                          
                          
                              <dependency>
                                <groupId>org.jboss.seam.faces</groupId>
                                <artifactId>seam-faces</artifactId>
                              </dependency>
                          
                          
                              <dependency>
                                <groupId>javax.faces</groupId>
                                <artifactId>jsf-api</artifactId>
                                <version>2.0</version>
                                <scope>provided</scope>
                              </dependency>
                          
                          
                              <dependency>
                                <groupId>javax.enterprise</groupId>
                                <artifactId>cdi-api</artifactId>
                                <scope>provided</scope>
                              </dependency>
                          
                          
                              <dependency>
                                 <groupId>javax.activation</groupId>
                                 <artifactId>activation</artifactId>
                                 <scope>provided</scope>
                              </dependency>
                          
                          
                              <dependency>
                                 <groupId>com.google.guava</groupId>
                                 <artifactId>guava</artifactId>
                                 <version>r07</version>
                              </dependency>
                          
                          
                              <dependency>
                                  <groupId>javax.validation</groupId>
                                  <artifactId>validation-api</artifactId>
                                  <scope>provided</scope>
                              </dependency>
                          
                          
                                <dependency>
                                    <groupId>com.ocpsoft</groupId>
                                    <artifactId>ocpsoft-pretty-time</artifactId>
                                </dependency>
                          
                          
                                <dependency>
                                    <groupId>com.ocpsoft</groupId>
                                    <artifactId>prettyfaces-jsf2</artifactId>
                                </dependency>
                          
                          
                                <dependency>
                                    <groupId>joda-time</groupId>
                                    <artifactId>joda-time</artifactId>
                                </dependency>
                          
                          
                               <dependency>
                                    <groupId>org.jboss.seam.mail</groupId>
                                    <artifactId>seam-mail-core-impl</artifactId>
                                    <exclusions>
                                    <exclusion>
                                        <groupId>com.google.guava</groupId>
                                         <artifactId>guava</artifactId>
                                    </exclusion>
                                </exclusions>
                               </dependency>
                          
                          
                               <dependency>
                                    <groupId>org.jboss.seam.mail</groupId>
                                    <artifactId>seam-mail-velocity-impl</artifactId>
                               </dependency>
                          
                          
                             <!-- Velocity Deps -->
                          
                          
                               <dependency>
                                 <groupId>org.apache.velocity</groupId>
                                 <artifactId>velocity</artifactId>
                               </dependency>
                          
                          
                               <dependency>
                                   <groupId>commons-logging</groupId>
                                   <artifactId>commons-logging</artifactId>
                                   <version>1.1</version>
                               </dependency>
                          
                          
                               <dependency>
                                <groupId>velocity</groupId>
                                <artifactId>velocity</artifactId>
                                <version>${velocity.version}</version>
                              </dependency>
                          
                          
                               <!-- end Velocity Deps -->
                          
                          
                                <dependency>
                                  <groupId>javax.mail</groupId>
                                  <artifactId>mail</artifactId>
                                  <scope>provided</scope>
                                </dependency>
                          
                          
                                <!-- Are you using slf4j in your code? -->
                                <dependency>
                                    <groupId>org.slf4j</groupId>
                                    <artifactId>slf4j-simple</artifactId>
                                    <version>1.5.10</version>
                                </dependency>
                          
                          
                                <dependency>
                                    <groupId>org.slf4j</groupId>
                                    <artifactId>slf4j-api</artifactId>
                                    <version>1.5.10</version>
                                </dependency>
                          
                          
                                <!-- probably not needed -->
                                <dependency>
                                  <groupId>log4j</groupId>
                                  <artifactId>log4j</artifactId>
                                  <version>1.2.16</version>
                                </dependency>
                          
                          
                            </dependencies>
                            <repositories>
                              <repository>
                                <id>JBOSS_NEXUS</id>
                                <url>http://repository.jboss.org/nexus/content/groups/public</url>
                              </repository>
                            </repositories>
                            <build>
                              <finalName>seam-mail</finalName>
                              <plugins>
                                <plugin>
                                  <artifactId>maven-compiler-plugin</artifactId>
                                  <version>2.3.2</version>
                                  <configuration>
                                    <source>1.6</source>
                                    <target>1.6</target>
                                  </configuration>
                                </plugin>
                                <plugin>
                                  <artifactId>maven-war-plugin</artifactId>
                                  <version>2.1.1</version>
                                  <extensions>false</extensions>
                                  <configuration>
                                    <failOnMissingWebXml>false</failOnMissingWebXml>
                                  </configuration>
                                </plugin>
                              </plugins>
                            </build>
                          </project>
                          
                          

                           

                          EDIT: Of course if we need to do much more then this, it would be easier to give a URL to your project on github or something.

                          • 10. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                            Cody Lerum Apprentice

                            Missed this the first time too. There is no seam-mail-velocity-impl anymore

                             

                            This is all you should need for seam-mail with velocity support

                             

                             

                            <dependency>

                                      <groupId>org.jboss.seam.mail</groupId>

                                      <artifactId>seam-mail</artifactId>

                                      <scope>compile</scope>

                            </dependency>

                             

                             

                            <dependency>

                                      <groupId>org.jboss.seam.mail</groupId>

                                      <artifactId>seam-mail-api</artifactId>

                                      <scope>compile</scope>

                            </dependency>

                             

                             

                            <dependency>

                                      <groupId>org.apache.velocity</groupId>

                                      <artifactId>velocity</artifactId>

                                      <scope>compile</scope>

                            </dependency>

                            • 11. Re: UnsatisfiedResolutionException on create instance of CDIVelocityContext
                              Jose Alvarez de Lara Novice

                              Here is the pom.xml as it left including FreeMarker option,

                               

                              <?xml version="1.0" encoding="UTF-8"?>

                              <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"

                                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

                                <modelVersion>4.0.0</modelVersion>

                                <groupId>com.example.project</groupId>

                                <artifactId>seam-mail</artifactId>

                                <version>1.0.0-SNAPSHOT</version>

                                <packaging>war</packaging>

                               

                                <properties>

                                      <seam.version>3.1.0.Final</seam.version>

                                      <freemarker.version>2.3.18</freemarker.version>

                                      <velocity.version>1.7</velocity.version>

                                </properties>

                               

                                <dependencyManagement>

                                  <dependencies>

                               

                                    <dependency>

                                       <groupId>org.jboss.seam</groupId>

                                       <artifactId>seam-bom</artifactId>

                                       <version>${seam.version}</version>

                                       <type>pom</type>

                                       <scope>import</scope>

                                   </dependency>

                               

                                  </dependencies>

                                </dependencyManagement>

                               

                                <dependencies>

                                   

                                  <dependency>

                                    <groupId>org.jboss.solder</groupId>

                                    <artifactId>solder-api</artifactId>

                                  </dependency>

                                 

                                  <dependency>

                                    <groupId>org.jboss.solder</groupId>

                                    <artifactId>solder-impl</artifactId>

                                    <exclusions>

                                        <exclusion>

                                            <groupId>org.jboss.solder</groupId>

                                            <artifactId>solder-api</artifactId>

                                        </exclusion>

                                    </exclusions>

                                  </dependency>

                                 

                                  <dependency>

                                    <groupId>org.jboss.weld</groupId>

                                    <artifactId>weld-core</artifactId>

                                    <version>2.0.0.Alpha1</version>

                                    <scope>provided</scope>

                                    <exclusions>

                                        <exclusion>

                                            <groupId>com.google.guava</groupId>

                                             <artifactId>guava</artifactId>

                                        </exclusion>

                                        <exclusion>

                                            <groupId>org.slf4j</groupId>

                                          <artifactId>slf4j-api</artifactId>

                                        </exclusion>

                                    </exclusions>

                                  </dependency>

                               

                                  <dependency>

                                    <groupId>org.jboss.seam.international</groupId>

                                    <artifactId>seam-international</artifactId>

                                  </dependency>

                                 

                                  <dependency>

                                      <groupId>javax.ejb</groupId>

                                      <artifactId>ejb-api</artifactId>

                                      <version>3.0</version>

                                  </dependency>

                                 

                                  <dependency>

                                    <groupId>org.jboss.seam.faces</groupId>

                                    <artifactId>seam-faces</artifactId>

                                    <scope>compile</scope>

                                  </dependency>

                                 

                                  <dependency>

                                    <groupId>javax.faces</groupId>

                                    <artifactId>jsf-impl</artifactId>

                                    <version>2.0.2-FCS</version>

                                  </dependency>

                                   

                                  <dependency>

                                    <groupId>javax.faces</groupId>

                                    <artifactId>jsf-api</artifactId>

                                    <version>2.0</version>

                                  </dependency>

                                 

                                  <dependency>

                                    <groupId>javax.enterprise</groupId>

                                    <artifactId>cdi-api</artifactId>

                                    <scope>provided</scope>

                                  </dependency>

                                 

                                  <dependency>

                                     <groupId>javax.activation</groupId>

                                     <artifactId>activation</artifactId>

                                     <scope>provided</scope>

                                  </dependency>

                                

                                  <dependency>

                                     <groupId>com.google.guava</groupId>

                                     <artifactId>guava</artifactId>

                                     <version>r07</version>

                                  </dependency>

                                 

                                  <dependency>

                                      <groupId>javax.validation</groupId>

                                        <artifactId>validation-api</artifactId>

                                  </dependency>

                                 

                                    <dependency>

                                        <groupId>com.ocpsoft</groupId>

                                        <artifactId>ocpsoft-pretty-time</artifactId>

                                    </dependency>

                               

                                    <dependency>

                                        <groupId>com.ocpsoft</groupId>

                                        <artifactId>prettyfaces-jsf2</artifactId>

                                    </dependency>

                                   

                                    <dependency>

                                        <groupId>joda-time</groupId>

                                        <artifactId>joda-time</artifactId>

                                    </dependency>

                                         

                                   <dependency>

                                        <groupId>org.jboss.seam.mail</groupId>

                                        <artifactId>seam-mail</artifactId>

                                   </dependency>

                               

                                   <dependency>

                                        <groupId>org.jboss.seam.mail</groupId>

                                        <artifactId>seam-mail-api</artifactId>

                                   </dependency>

                               

                                   <dependency>

                                     <groupId>org.freemarker</groupId>

                                     <artifactId>freemarker</artifactId>

                                     <version>${freemarker.version}</version>

                                   </dependency>

                                       

                                   <dependency>

                                     <groupId>org.apache.velocity</groupId>

                                     <artifactId>velocity</artifactId>

                                   </dependency>

                                 

                                   <dependency>

                                     <groupId>javax.mail</groupId>

                                     <artifactId>mail</artifactId>

                                   </dependency>

                               

                                </dependencies>

                                <repositories>

                                  <repository>

                                    <id>JBOSS_NEXUS</id>

                                    <url>http://repository.jboss.org/nexus/content/groups/public</url>

                                  </repository>

                                </repositories>

                                <build>

                                  <finalName>seam-mail</finalName>

                                  <plugins>

                                    <plugin>

                                      <artifactId>maven-compiler-plugin</artifactId>

                                      <version>2.3.2</version>

                                      <configuration>

                                        <source>1.6</source>

                                        <target>1.6</target>

                                      </configuration>

                                    </plugin>

                                    <plugin>

                                      <artifactId>maven-war-plugin</artifactId>

                                      <version>2.1.1</version>

                                      <extensions>false</extensions>

                                      <configuration>

                                        <failOnMissingWebXml>false</failOnMissingWebXml>

                                      </configuration>

                                    </plugin>

                                  </plugins>

                                </build>

                              </project>

                               

                               

                              and at the end the webapp works fine.

                               

                              Thank you very much for your interesting and kindness.

                               

                              Thanks a lot,

                              Jose