8 Replies Latest reply on May 29, 2012 7:50 AM by rukia

    Oracle datasource configuration with jboss 5.1

    rukia Newbie

      Posts: 2
        
       
      [Post New]posted Today 15:43:55 

       

       

       

      Quote  Edit     

      Hello,

      Actuallly i am unable to configure correctly a new oracle datasource, i spent a week trying to make it work but no way!!

      I need to define a new oracle datasource, i am using Oracle 11g , Jboss 5.1

      My oracle-ds.xml
      [code=java]
      [b]<?xml version="1.0" encoding="UTF-8"?>
      <datasources>
      <local-tx-datasource>
      <jndi-name>OracleDS</jndi-name>
      <use-java-context>false</use-java-context>
      <!--<connection-url>jdbc:oracle:thin:@localhost:1521:iamsaas</connection-url> -->
      <connection-url>jdbc:oracle:thin:@localhost:1521:iamsaas</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>ADMIAMSAAS</user-name>
      <password>iamsaas</password>

      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <min-pool-size>5</min-pool-size>
      <max-pool-size>200</max-pool-size>
      <idle-timeout-minutes>5</idle-timeout-minutes>
      <blocking-timeout-millis>10000</blocking-timeout-millis>

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


      </local-tx-datasource>
      </datasources>[/b][color=red] [/color]
      [/code]

      My persistence.xml
      [code=java]
      <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="IAMPersistance" transaction-type="JTA">
           <jta-data-source>java:/OracleDS</jta-data-source>

               <properties>
                <property name="hibernate.hbm2ddl.auto" value="update"/>
               </properties>

        </persistence-unit>
      </persistence>  [color=red] [/color]
      [/code]

      when i deploy my ejb project on jboss i get these errors,

      [b]2012-05-24 15:37:07,908 INFO [org.jboss.jpa.deployment.PersistenceUnitDeployment] (main) Starting persistence unit persistence.unit:unitName=#IAMPersistance
      2012-05-24 15:37:07,908 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=persistence.unit:unitName=#IAMPersistance state=Create
      javax.naming.NameNotFoundException: OracleDS not bound[/b][color=red] [/color]


      [b]DEPLOYMENTS MISSING DEPENDENCIES:
         Deployment "jboss.j2ee:jar=IAMPersistence2.jar,name=RequestBean,service=EJB3" is missing the following dependencies:
           Dependency "<UNKNOWN jboss.j2ee:jar=IAMPersistence2.jar,name=RequestBean,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=#IAMPersistance' **")
         Deployment "jboss.j2ee:jar=IAMPersistence2.jar,name=RequestBean,service=EJB3_endpoint" is missing the following dependencies:
           Dependency "jboss.j2ee:jar=IAMPersistence2.jar,name=RequestBean,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")

      DEPLOYMENTS IN ERROR:
         Deployment "<UNKNOWN jboss.j2ee:jar=IAMPersistence2.jar,name=RequestBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=#IAMPersistance' **
         Deployment "persistence.unit:unitName=#IAMPersistance" is in error due to the following reason(s): javax.naming.NameNotFoundException: OracleDS not bound[/b][color=red] [/color]


      but in the JMX console i can see my beans!

      Please can anyone help me, i really need it :s ???

        • 1. Re: Oracle datasource configuration with jboss 5.1
          Wolf-Dieter Fink Master

          Do you copy the ojdbc6.jar to the correct location?

           

          I would recommend to start with a fresh instance and add the -ds.xml and the driver and look to the log whether it is deployed correct.

          It will make it easier to find the problem if you do it step by step.

          • 2. Re: Oracle datasource configuration with jboss 5.1
            rukia Newbie

            i added the ojdbc14.jar beacause i'm using the oracle 11g and i put it on server->default->lib but i still get the error!

            So i don't know what i can do else !

            • 3. Re: Oracle datasource configuration with jboss 5.1
              Wolf-Dieter Fink Master

              ojdbc14.jar is for Java 1.4 I recommend to use ojdbc6.jar if you use Java1.6.

               

              Do you try a fresh server installation only with the jar and the ds file? Could you check whether this works and if not attach the logfile.

              • 4. Re: Oracle datasource configuration with jboss 5.1
                rukia Newbie

                Yes i tried but nothing change !

                I am using Oracle 11g with jboss5.1

                I got this error

                 

                2012-05-25 13:21:43,798 INFO  [org.jboss.jpa.deployment.PersistenceUnitDeployment] (main) Starting persistence unit persistence.unit:unitName=#TEST

                2012-05-25 13:21:43,798 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=persistence.unit:unitName=#TESTstate=Create

                javax.naming.NameNotFoundException: OracleDS not bound

                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)

                    at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)

                    at org.jnp.server.NamingServer.getObject(NamingServer.java:785)

                    at org.jnp.server.NamingServer.lookup(NamingServer.java:443)

                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:726)

                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:686)

                    at javax.naming.InitialContext.lookup(InitialContext.java:392)

                    at org.jboss.jpa.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:111)

                    at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:275)

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    at java.lang.reflect.Method.invoke(Method.java:597)

                    at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)

                    at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)

                    at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)

                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)

                    at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)

                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)

                    at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)

                    at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)

                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)

                    at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)

                    at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)

                    at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)

                    at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)

                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)

                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)

                    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)

                    at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)

                    at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

                    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

                    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)

                    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

                    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

                    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

                    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

                    at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)

                    at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

                    at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

                    at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

                    at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

                    at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

                    at org.jboss.Main.boot(Main.java:221)

                    at org.jboss.Main$1.run(Main.java:556)

                 

                2012-05-25 13:22:09,314 INFO  [com.sun.jersey.server.impl.application.WebApplicationImpl] (main) Initiating Jersey application, version 'Jersey: 1.1.5.1 03/10/2010 02:33 PM'

                2012-05-25 13:22:09,783 ERROR [org.jboss.system.server.profileservice.ProfileServiceBootstrap] (main) Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

                 

                 

                 

                My 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="TEST"> 

                    <provider>org.hibernate.ejb.HibernatePersistence</provider>

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

                    <properties> 

                     <!-- property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/-->

                    <property name="hibernate.hbm2ddl.auto"  value="create-drop"/> 

                    </properties> 

                    </persistence-unit> 

                                </persistence>

                 

                my oracle-ds.xml

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

                <datasources>

                <local-tx-datasource>

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

                    <use-java-context>false</use-java-context>

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

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

                    <user-name>USER</user-name>

                    <password>passwd</password>

                 

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

                    <min-pool-size>5</min-pool-size>

                    <max-pool-size>100</max-pool-size>

                 

                    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->

                    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->

                    <!-- Checks the Oracle error codes and messages for fatal errors -->

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

                    <!-- sql to call when connection is created

                     <new-connection-sql>some arbitrary sql</new-connection-sql>

                    -->

                 

                    <!-- sql to call on an existing pooled connection when it is obtained from pool - the OracleValidConnectionChecker is prefered

                     <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>

                    -->

                 

                    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

                    <metadata>

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

                    </metadata>

                 

                </local-tx-datasource>

                 

                </datasources>

                • 5. Re: Oracle datasource configuration with jboss 5.1
                  Wolf-Dieter Fink Master

                  Please attach the logfile instad of posting a part of it. I suppose there are problems before the error.

                  • 7. Re: Oracle datasource configuration with jboss 5.1
                    Wolf-Dieter Fink Master

                    You should remove "java:/" from your persistence.xml or change the ds definision <use-java-context>true</use-java-context>.

                    • 8. Re: Oracle datasource configuration with jboss 5.1
                      rukia Newbie

                      Thanks a lot for your replies and your help...it serves me well!

                      Thanks again