JNDI can acquire and not datasource.   -WLS JDBC, 10.3

Now I have problems connecting to the database for my EJB entities.

I use Jdev 11 r1, ADF Faces, EJB3.0, Oracle database 10g. I have my WLS connection to the database server, and the application connects to it, when it is run with the server integrated into Jdeveloper. When I deploy my application for the server (I created a JDBC connection to the database with the name jndi jdbc/DatabaseDevDS), I get way below.

I have my persistence.xml

< name of persistence - unit = "Company" >
<>provider
org.eclipse.persistence.jpa.PersistenceProvider
< / provider >
< jta-data-source >
Java: / app/jdbc/jdbc/DatabaseDevDS
< / jta-data-source >

ERROR:

Caused by: Exception EclipseLink-7060 (Eclipse - 1.0.1 persistence Services (Build 20080905)): org.eclipse.persistence
.exceptions. ValidationException
Description of the exception: could not acquire data source Java: / app/jdbc/jdbc/DatabaseDevDS.
Inner exception: javax.naming.NameNotFoundException: while trying to search/app/jdbc/jdbc/DatabaseDevDS/app/ejb/E
JB.jar #SessionEJB. ; rest the name "/ app/jdbc/jdbc/DatabaseDevDS.
at org.eclipse.persistence.exceptions.ValidationException.cannotAcquireDataSource(ValidationException.java:429)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:123)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:94)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:164)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connectInternal (DatasourceAccessor.java:32
4)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.connectInternal(DatabaseAccessor.java:264)
at org.eclipse.persistence.internal.databaseaccess.DatasourceAccessor.connect(DatasourceAccessor.java:407)
at org.eclipse.persistence.sessions.server.ConnectionPool.buildConnection(ConnectionPool.java:130)
at org.eclipse.persistence.sessions.server.ExternalConnectionPool.startUp(ExternalConnectionPool.java:110)
at org.eclipse.persistence.sessions.server.ServerSession.connect(ServerSession.java:500)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.login(DatabaseSessionImpl.java:606)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login (EntityManagerFactoryProvider.java:211
)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:246)
... more than 97
Caused by: javax.naming.NameNotFoundException: while trying to get/app/jdbc/jdbc/DatabaseDevDS in /app/ejb/EJB.jar#Se
ssionEJB. ; rest the name "/ app/jdbc/jdbc/DatabaseDevDS.
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:380)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:135)
at javax.naming.InitialContext.lookup(InitialContext.java:396)
at org.eclipse.persistence.sessions.JNDIConnector.connect(JNDIConnector.java:117)
... more than 108

Dan,
Hi, thank your for use EclipseLink as EJB 3.0 JPA provider.
The appearance of your JNDI name (* java: / app/jdbc/jdbc/DatabaseDevDS *)-(Note: il y a un double «* jdbc *») as opposed to a global brand (* DatabaseDevDS *) in your persistence.xml JPA - it seems that you are using a broad application data source and not a source of data globally extensive set directly on your WebLogic Server.

If this is the case, for a broad application datasource on Oracle WebLogic server please see the tutorial following the 3 steps to prepare your application to use app level datasources.
The application following business base tutorial using EclipseLink as the APP provider described workaround to use a source of data application when it is deployed on WebLogic 10.3 using the normal + the < jta-data-source > + element and the overriding javax.persistence.jtaDataSource property, until the bug of WLS Server base followed by EclipseLink bug # 246126 in. [http://bugs.eclipse.org/246126] is fixed soon.
Reference
[http://wiki.eclipse.org/EclipseLink/Examples/JPA/WLS_AppScoped_DataSource]
related to
[http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#Application_Scoped_Datasource_Setup]

Persistence.XML suggested additional changes:
(1) adds a reference to the WebLogic Platform
+ < property name = value "eclipselink.target - server" = "WebLogic_10" / >.

(2) make sure you really set your datasource scope application (tutorial 3 steps above) with a double ' * jdbc. "
* "" java: / app/jdbc/jdbc/DatabaseDevDS "*"
and didn't really say "+ java: / app/jdbc/DatabaseDevDS +" which is usually standard

See
[http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#Persistence.xml]
and an EclipseLink open source example that uses a globally set the datasource in an application tutorial WebLogic Web using EclipseLink JPA provider
[http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/ejbModule/META-INF/persistence.xml]

In addition, an additional workaround would be globally set the source of data on your integrated WebLogic Server and reference as described in...
[http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial#Global_Scoped_Datasource_Setup]

I hope this helps.
For any other TopLink, EclipseLink questions you can also post on the next TopLink forum or EclipseLink related forums

TopLink/Eclipselink
[f [48]
EclipseLink
[https://dev.eclipse.org/mailman/listinfo/eclipselink-users]
[http://www.eclipse.org/newsportal/thread.php?group=eclipse.rt.eclipselink]
[http://www.nabble.com/EclipseLink-f26430.html]

Shay, thanks for pointing the tutorial to EclipseLink.

Thank you
/Michael att eclipselink.org

Tags: Java

Similar Questions

Maybe you are looking for