0 Replies Latest reply on Feb 19, 2009 1:07 PM by Eugeniy Nikolaev

    Could not find any META-INF persistence.xml file in the classpath

    Eugeniy Nikolaev Newbie

      Upgrade Seam-project from:



      Unchaged:



      • Eclipse SDK Version: 3.4.0

      • Java version: 1.5.0 11 , Sun Microsystems Inc.

      • WAR Seam-project

      • Oracle



      Changed:


      from:



      1. API - jboss-seam-2.1.0.BETA1

      2. IDE - JBossTools-3.0.0.Alpha1-ALL-win32

      3. Server - JBoss AS 4.2.3.GA



      to:



      1. API - jboss-seam-2.1.1.GA

      2. IDE - JBossTools-ALL-win32-3.0.0.CR2-R200901280154

      3. Server - JBoss AS 5.0.0.GA



      And now has error with Seam-component persistence:entity-manager-factory. - Invisibled persistence.xml for this component.



      ...
      13:40:55,453 INFO  [Component] Component: securityRules, scope: APPLICATION, type: JAVA_BEAN, class: org.jboss.seam.drools.RuleBase
      13:40:55,453 INFO  [Contexts] starting up: probe_1EntityManagerFactory
      13:40:55,515 INFO  [Version] Hibernate Annotations 3.4.0.GA
      13:40:56,063 INFO  [Environment] Hibernate 3.3.1.GA
      13:40:56,079 INFO  [Environment] hibernate.properties not found
      13:40:56,079 INFO  [Environment] Bytecode provider name : javassist
      13:40:56,079 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
      13:40:56,157 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA
      13:40:56,172 INFO  [Version] Hibernate EntityManager 3.4.0.GA
      13:40:56,204 INFO  [Ejb3Configuration] Could not find any META-INF/persistence.xml file in the classpath
      13:40:56,204 ERROR [[/probe_1]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      org.jboss.seam.InstantiationException: Could not instantiate Seam component: probe_1EntityManagerFactory
              at org.jboss.seam.Component.newInstance(Component.java:2106)
              at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
      ...
      Caused by: javax.persistence.PersistenceException: No Persistence provider for EntityManager named probe_1Datasource
      ...



      - error viewed after creating New - Seam Project from the IDE, manually deploy datasource to the to server, and start server. Most simplest project...


      I seek infomoration in the forums, in the JIRA, but unsuccess...


      Listing files:



      components.xml:
      
      ...
      <persistence:managed-persistence-context name="entityManager"
                                           auto-create="true"
                                           entity-manager-factory="#{probe_1EntityManagerFactory}"/>
      
      <persistence:entity-manager-factory name="probe_1EntityManagerFactory"
                         persistence-unit-name="probe_1Datasource"/>
      ...



      persistence.xml:
      
      ...
      <persistence-unit name="probe_1Datasource" transaction-type="JTA">
            <provider>org.hibernate.ejb.HibernatePersistence</provider>
            <jta-data-source>java:/probe_1Datasource</jta-data-source>
            <properties>
               <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/>
               <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
               <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
               <property name="hibernate.show_sql" value="true"/>
               <property name="hibernate.format_sql" value="true"/>
               <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
            </properties>
         </persistence-unit>
      ...



      probe_1-ds.xml:
      
      ...
      <datasources>
         <local-tx-datasource>
            <jndi-name>probe_1Datasource</jndi-name>
            <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>
            <driver-class>oracle.jdbc.OracleDriver</driver-class>
            <user-name>concreteusername</user-name>
            <password>concretepassword</password>
         </local-tx-datasource>
      ...//skiped comments
      </datasources>