2 Replies Latest reply on Jan 1, 2009 2:56 AM by zilbi

    EJB3 deployment problem - javax.naming.NoInitialContextExcep

    zilbi

      Hi,

      i was trying to add a second ejb jar to my existing ear and i keep on failing on:


      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


      before, i was having a single ejb jar, with a single war; file all wrapped inside an single ear. everything was perfect.
      but when i'm adding the second ejb jar with the following persistence.xml
      <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="MyDataBase">
      
       <provider>org.hibernate.ejb.HibernatePersistence</provider>
       <jta-data-source>java:/MyDatasource</jta-data-source>
      
       <properties>
       <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
       </properties>
      
       </persistence-unit>
      </persistence>
      


      i keep getting the the error above, but only for the new ejb jar. the original ejb jar works fine.

      i have tried to replace the data-source name to a different name that the one used by my first ejb jar, but the same result.

      of course the persistence-unit name is different in the two persistence.xml files.

      what am i doing wrong, it is a mystery for me?

      your help is appreciated,
      zilbi