4 Replies Latest reply on Feb 5, 2008 10:11 AM by jaikiran pai

    javax.naming.NoInitialContextException

    Karen Greene Newbie

      Hi,

      I am new to EJB and jboss and am trying to access the database using the entitymanager. From what I understand, I am suppossed to create a persistence.xml file in my META-INF directory. When I do this I get the error below. Does anyone know what the issue might be? I have also listed the persistence.xml below

      ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: persistence.units:ear=Veal.ear,jar=VealWatcher.jar,unitName=VealWatcherDB
      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=DefaultDS

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:ear=Veal.ear,jar=VealWatcher.jar,unitName=VealWatcherDB
      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=DefaultDS



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


      <persistence-unit name="VealWatcherDB">
      <jta-data-source>java:/DefaultDS</jta-data-source>

      <!--

      -->
      <!-- -->

      </persistence-unit>