0
votes

enviornment : application server - jboss 5.x, JPA : eclipse link database : oracle11g i configured a datastore with jndi as /TESTDS and want to access this jndi in persistence.xml but getting error. i used syntax as

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

in persitence.xml....is this correct?

My oracle-ds.xml as

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
<xa-datasource>
<jndi-name>/TESTDS</jndi-name>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@a.b.c.d:1521/sid</xa-datasource-property>
<xa-datasource-property name="User">DBUSER</xa-datasource-property>
<xa-datasource-property name="Password">DBPASSWORD</xa-datasource-property>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle11g</type-mapping>
</metadata>
</xa-datasource>

and 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="TestPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:/TESTDS</jta-data-source>
<properties>
<property name="eclipselink.target-server" value="JBoss"/> 
<property name="eclipselink.allow-zero-id" value="true"/>
</properties>
</persistence-unit>
</persistence>

But getting error while deploying jar at jboss 5.x server.. Your help is much appreciated..

Error Message while deployment

00:51:03,830 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1112048510{vfszip:/home/jboss/jboss-5.1.0.GA/server/default/deploy/test.jar/}
00:51:03,842 INFO  [Ejb3DependenciesDeployer] Encountered deployment AbstractVFSDeploymentContext@1112048510{vfszip:/home/jboss/jboss-5.1.0.GA/server/default/deploy/test.jar/}
00:51:03,860 INFO  [JBossASKernel] Created KernelDeployment for: test.jar
00:51:03,861 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3
00:51:03,861 INFO  [JBossASKernel]   with dependencies:
00:51:03,861 INFO  [JBossASKernel]   and demands:
00:51:03,861 INFO  [JBossASKernel]      jboss.ejb:service=EJBTimerService
00:51:03,862 INFO  [JBossASKernel]      persistence.unit:unitName=#TestPU
00:51:03,862 INFO  [JBossASKernel]   and supplies:
00:51:03,862 INFO  [JBossASKernel]      jndi:TestStatelessSessionBean/local-test.ejb3.session.TestStatelessSessionLocal
00:51:03,862 INFO  [JBossASKernel]      Class:test.ejb3.session.TestStatelessSessionLocal
00:51:03,863 INFO  [JBossASKernel]      jndi:TestStatelessSessionBean/local
00:51:03,863 INFO  [JBossASKernel]      jndi:TestStatelessSessionBean/remote
00:51:03,863 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3) to KernelDeployment of: test.jar
00:51:03,864 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@3436ae59{name=jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
00:51:03,942 WARN  [HDScanner] Failed to process changes
org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3" is missing the following dependencies:
Dependency "<UNKNOWN jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=#TestPU' **")
Deployment "jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3_endpoint" is missing the following dependencies:
Dependency "jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")
Deployment "persistence.unit:unitName=#TestPU" is missing the following dependencies:
Dependency "jboss.jca:name=TESTDS,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=TESTDS,service=DataSourceBinding' **")

DEPLOYMENTS IN ERROR:
Deployment "jboss.jca:name=TESTDS,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=TESTDS,service=DataSourceBinding' **
Deployment "<UNKNOWN jboss.j2ee:jar=test.jar,name=TestStatelessSessionBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=#TestPU' **

    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
What error are you getting?JonK
@JonK ...Kindly again see question? i edited with error description while deploying test.jar at Jbossuser595014
I asked what error you were getting to prompt you to add the important information to the question - without it nobody could help. Personally I'm not a JBoss expert, but it looks like the issue lies with the TESTDS datasource.JonK
@JonK, hi, thankx for reply..yes it is something related to JNDI.When i change jndi-name from '/TESTDS' to 'TESTDS',than it is working fine and test.jar is getting deployed successfully..But i can't modify it in oracle-ds.xml because it is using in project elsewhere.i have to run my application using jndi-name '/TESTDS'. I can only modify persistence.xml.user595014
As I said before, I'm not a JBoss expert, I commented to prompt you to add important information to your question that would allow someone with enough knowledge of debugging JBoss deployment errors to help you. All I can do is take wild guesses at what may be wrong, which isn't helpful for you.JonK