4 Replies Latest reply on Nov 11, 2007 9:59 PM by Vicky Kak

    Errors Migrating no-tx-datasource from 4.0.5 to 4.2.2

    jantzen Newbie

      Hi All,

      I'm trying to run a couple applications in 4.2.2. These work fine in 4.05., but I'm seeing errors at startup now:

      --- MBeans waiting for other MBeans ---
      ObjectName: persistence.units:ear=DatabaseImport.ear,jar=DatabaseImport.jar,unitName=MediaWikiDBImporterRole
       State: FAILED
       Reason: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
       I Depend On:
       jboss.jca:service=DataSourceBinding,name=MediaWikiDBImporterRoleDS
      
      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:ear=DatabaseImport.ear,jar=DatabaseImport.jar,unitName=MediaWikiDBImporterRole
       State: FAILED
       Reason: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
       I Depend On:
       jboss.jca:service=DataSourceBinding,name=MediaWikiDBImporterRoleDS
      
      


      Here's my MySQL DS file:


      <?xml version="1.0" encoding="UTF-8"?>
      
      <datasources>
      
       <no-tx-datasource>
       <jndi-name>MediaWikiDBImporterRoleDS</jndi-name>
       <connection-url>jdbc:mysql://localhost:3306/MediaWikiDB</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>username</user-name>
       <password>password</password>
       </no-tx-datasource>
      
      </datasources>
      
      


      And here's my persistence.xml:
       <persistence-unit name="MediaWikiDBImporterRole">
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <!-- FIXME this should be non-jta-data-source but can't due to a JBoss bug http://jira.jboss.com/jira/browse/EJBTHREE-433 -->
       <jta-data-source>java:/MediaWikiDBImporterRoleDS</jta-data-source>
       <properties>
       <property name="jboss.entity.manager.factory.jndi.name" value="java:/PersistenceUnits/MediaWikiDBImporterRole"/>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
       <property name="hibernate.show_sql" value="false" />
       <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider"/>
       </properties>
       </persistence-unit>
      


      In 4.0.5 I had to make this a jta-data-source as that bug alludes to. In 4.2.2 it won't work either as jta or non-jta. Any ideas?

      Thanks.