Bonjour,

Eclipse Galileo 3.5.2
JBoss Tools 3.1
JBoss Seam 2.2.0 GA
Apache Tomcat 6.0.29
Plugin Sysdeo Tomcat pour Eclipse.

J'ai essayé divers tutos sans succès probant. Il y a toujours des différences avec ma config ou des infos incomplètes dans le tuto pour le débutant que je suis en ce domaine.

Ma tentative consiste à utiliser la fonction File / New / Seam Web Project des JBoss Tools dans Eclipse et de paramétrer ce nouveau projet pour le faire tourner sous Tomcat.
La possibilité est offerte dans l'enchaînement des fenêtres de création du projet mais ça ne fonctionne pas directement, il y a plein de corrections ou d'ajouts à faire, comme c'est d'ailleurs dit dans pas mal de tutos, réponses à des messages sur des forums...

Petit à petit, j'ai réussi à supprimer pas mal d'erreurs, notamment en ajoutant à la main des jar depuis jboss-seam/lib vers monProjet/WebContent/WEB-INF/lib.

Après mise à jour du contexte (clic droit sur le projet / Projet Tomcat / Mise à jour du contexte) et redémarrage de Tomcat, j'ai maintenant d'une part ce WARN :
log4j:WARN No appenders could be found for logger (org.ajax4jsf.renderkit.ChameleonRenderKitFactory).
log4j:WARN Please initialize the log4j system properly.
Et ces erreurs :
GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: entityManagerFactory
at org.jboss.seam.Component.newInstance(Component.java:2144)
...
Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named seamtomcat
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:56)
...
J'ai évidemment cherché sur le NET mais n'ai pas encore trouvé exactement comment résoudre ces problèmes.

Voici mes fichiers de config (mon projet s'appelle seamtomcat) :

1) seamtomcat/WebContent/META-INF/context.xml
Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="UTF-8"?>
 
<Context crossContext="true" 
    debug="5" 
    docBase="seamtomcat" 
    path="/seamtomcat" 
    reloadable="true">
 
    <Resource auth="Container" 
        driverClassName="com.mysql.jdbc.Driver" 
        maxActive="20" 
        maxIdle="10" 
        maxWait="-1" 
        name="seamtomcatDatasource" 
        password="***" 
        type="javax.sql.DataSource" 
        url="jdbc:mysql://localhost:3306/test" 
        username="root"/>
</Context>
2) seamtomcat/src/main/META-INF/persistence.xml
Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="UTF-8"?>
<!-- Persistence deployment descriptor for dev profile -->
<persistence xmlns="http://java.sun.com/xml/ns/persistence" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" 
             version="1.0">
 
   <persistence-unit name="seamtomcat" >
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>java:comp/env/jdbc/seamtomcatDatasource</jta-data-source>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="validate"/>
         <property name="hibernate.show_sql" value="true"/>
         <property name="hibernate.format_sql" value="true"/>
         <property name="hibernate.default_catalog" value="test"/>
         <property name="hibernate.default_schema" value="test"/>
         <!-- Only relevant if Seam is loading the persistence unit (Java SE bootstrap) -->
         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
      </properties>
   </persistence-unit>
 
</persistence>
3) seamtomcat/resources/seamtomcat-ds.xml
Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE datasources
    PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
    "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
<datasources>
 
   <local-tx-datasource>
      <jndi-name>seamtomcatDatasource</jndi-name>
      <use-java-context>true</use-java-context>
      <connection-url>jdbc:mysql://localhost:3306/test</connection-url>
      <driver-class>com.mysql.jdbc.Driver</driver-class>
      <user-name>root</user-name>
      <password>***</password>
   </local-tx-datasource>
 
</datasources>
4) seamtomcat/WebContent/WEB-INF/compoments.xml
Code XML : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://jboss.com/products/seam/components"
            xmlns:core="http://jboss.com/products/seam/core"
            xmlns:persistence="http://jboss.com/products/seam/persistence"
            xmlns:drools="http://jboss.com/products/seam/drools"
            xmlns:bpm="http://jboss.com/products/seam/bpm"
            xmlns:security="http://jboss.com/products/seam/security"
            xmlns:mail="http://jboss.com/products/seam/mail"
            xmlns:web="http://jboss.com/products/seam/web"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns:transaction="http://jboss.com/products/seam/transaction"
 
            xsi:schemaLocation=
                "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                 http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
                 http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                 http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
                 http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                 http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                 http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                 http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd
                 http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.2.xsd
                 ">
 
   <core:init />
 
   <core:manager concurrent-request-timeout="500"
                 conversation-timeout="120000"
                 conversation-id-parameter="cid"
                 parent-conversation-id-parameter="pid"/>
 
   <transaction:entity-transaction entity-manager="#{entityManager}" auto-create="true"/>
 
   <!-- Make sure this URL pattern is the same as that used by the Faces Servlet -->
   <web:hot-deploy-filter url-pattern="*.seam"/>
 
   <persistence:entity-manager-factory name="entityManagerFactory" auto-create="true"
                      persistence-unit-name="seamtomcat"/>
 
   <persistence:managed-persistence-context name="entityManager" auto-create="true"
                          entity-manager-factory="#{entityManagerFactory}"/>
 
   <drools:rule-base name="securityRules">
      <drools:rule-files><value>/security.drl</value></drools:rule-files>
   </drools:rule-base>
 
   <security:rule-based-permission-resolver security-rules="#{securityRules}"/>
 
   <security:identity authenticate-method="#{authenticator.authenticate}" remember-me="true"/>
 
   <event type="org.jboss.seam.security.notLoggedIn">
      <action execute="#{redirect.captureCurrentView}"/>
   </event>
   <event type="org.jboss.seam.security.loginSuccessful">
      <action execute="#{redirect.returnToCapturedView}"/>
   </event>
 
   <mail:mail-session host="localhost" port="25"/>
 
   <!-- For use with jBPM pageflow or process management -->
   <!--
   <bpm:jbpm>
      <bpm:process-definitions></bpm:process-definitions>
      <bpm:pageflow-definitions></bpm:pageflow-definitions>
   </bpm:jbpm>
   -->
 
</components>
Je continue de chercher mais si quelqu'un peut trouver plus rapidement ce qui cloche, il est le bienvenu !