0 Replies Latest reply on Jun 10, 2012 8:39 AM by Varun Jain

    issue in oracle data source configuration

    Varun Jain Newbie

      Hi

       

        I have a simple Jsf+Jpa app in Eclipse indigo. I am using Oracle 10d database and want to run the app on JBoss-5.0.0 GA. I have added oracle-ds.xml , xa-oracle-ds.xml file in C:\servers\jboss-5.0.0.GA\server\default\deploy and added application-policy in login-config.xml file, but I am still getting the below exception

       

      Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'

      17:34:52,883 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=OracleDS' to JNDI name 'java:OracleDS'

      17:34:53,008 INFO  [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=XAOracleDS' to JNDI name 'java:XAOracleDS'

      17:34:53,054 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#JsfJpa

      17:34:53,210 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=#JsfJpa state=Create

       

       

      java.lang.NullPointerException

                at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.createInputStreamForUnconvertableURL(PersistenceUnitProcessor.java:284)

                at oracle.toplink.essentials.ejb.cmp3.persistence.PersistenceUnitProcessor.createInputStreamForFileInPersistenceUnit(PersistenceUnitProcessor.java:239)

                at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.getORMXMLFileNames(EntityManagerSetupImpl.java:613)

                at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.buildPersistentClassSetFromXMLDocuments(EntityManagerSetupImpl.java:116)

       

       

      Please find my persistence.xml

       

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

      <persistence version="1.0" 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">

       

       

      <persistence-unit name="JsfJpa" transaction-type="RESOURCE_LOCAL">

       

       

       

       

       

      <provider>oracle.toplink.essentials.PersistenceProvider</provider>

      <!-- <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider> -->

      <non-jta-data-source>java:/OracleDS</non-jta-data-source>

       

                   <class>entity.Customer</class>

                  

      <properties>

       

      <property name="toplink.jdbc.url" value="jdbc:oracle:thin:@localhost:1521:orcl"/>

      <property name="toplink.jdbc.user" value="System"/>

      <property name="toplink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>

      <property name="toplink.jdbc.password" value="danbrown"/>

      <property name="toplink.ddl-generation" value="create-tables"/>

      <property name="toplink.jdbc.read-connections.max" value="1"/>

      <property name="toplink.jdbc.read-connections.min" value="1"/>

      <property name="toplink.jdbc.write-connections.max" value="1"/>

      <property name="toplink.jdbc.write-connections.min" value="1"/>

      <property name="toplink.logging.level" value="SEVERE" />

      </properties>   

      </persistence-unit>

       

      </persistence>

       

      My oracle-ds.xml

      <datasources>

        <no-tx-datasource>

          <jndi-name>OracleDS</jndi-name>

                <use-java-context>true</use-java-context>

          <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>

          <driver-class>oracle.jdbc.OracleDriver</driver-class>

          <user-name>System</user-name>

          <password>danbrown</password>

          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

            <metadata>

               <type-mapping>Oracle9i</type-mapping>

            </metadata>

        </no-tx-datasource>

      </datasources>

       

      My xa-oracle-ds.xml

       

      <datasources>

        <xa-datasource>

          <jndi-name>XAOracleDS</jndi-name>

          <use-java-context>true</use-java-context>

          <track-connection-by-tx>true</track-connection-by-tx>

                <isSameRM-override-value>false</isSameRM-override-value>

          <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>

          <xa-datasource-property name="URL">jdbc:oracle:thin:@localhost:1521:orcl</xa-datasource-property>

          <xa-datasource-property name="User">System</xa-datasource-property>

          <xa-datasource-property name="Password">danbrown</xa-datasource-property>

          <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>

          <no-tx-separate-pools/>

            <metadata>

              <type-mapping>Oracle9i</type-mapping>

            </metadata>

        </xa-datasource>

      </datasources>

       

       

      addition in login-config.xml

       

       

       

      <application-policy name = "OracleDbRealm">

         <authentication>

            <login-module code = 

        "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">

               <module-option name = "principal">sa</module-option>

               <module-option name = "userName">sa</module-option>

               <module-option name = "password"></module-option>

               <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=OracleDS</module-option>

            </login-module>

         </authentication>

      </application-policy>