Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » WebSphere Application Server 7.0.0.7 Local JNDI Name(JTA DataSource Reference Local JDNI Name Error)
icon13.gif  WebSphere Application Server 7.0.0.7 Local JNDI Name [message #529638] Mon, 26 April 2010 15:28 Go to next message
FlÃ?¡vio Stutz is currently offline FlÃ?¡vio StutzFriend
Messages: 1
Registered: July 2009
Junior Member
On my persistence.xml I can't reference a jta datasource through local JNDI names. When running on WAS 7.0.0.7 I got the following exception:

Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unsupported use of GenericConnection. A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.
Error Code: 0

The JPA specifications do not require implementations to include data sources referenced through local JNDI names.

Is this a limitation of EclipseLink?!?

Thank you!
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #529903 is a reply to message #529638] Tue, 27 April 2010 15:46 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Hello,

Can you provide more information on the error though (the stack) and how you are defining your datasource?
From what you've posted, it sounds like you are trying to have the JPA provider use a datasource that will not have been created yet according to Websphere - this might be a Websphere problem with the order it is using to create/resolve the datasource, not neccessarily EclipseLink.
Best Regards,
Chris
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #924369 is a reply to message #529638] Wed, 26 September 2012 19:46 Go to previous messageGo to next message
sri b is currently offline sri bFriend
Messages: 1
Registered: September 2012
Junior Member
Hi Stutz,

Did you find a solution to this problem.

I am seeing the same issue with WAS 8.0 and EclipseLink implementation for JPA.

[EL Info]: 2012-09-26 15:35:18.947--UnitOfWork(182500629)--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unsupported use of GenericConnection. A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.
Error Code: 0
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #930657 is a reply to message #924369] Tue, 02 October 2012 14:15 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Please include your full exception stack trace, and your persistence.xml file.

We do test WebSphere 7 and 8 nightly, and do not encounter this error. When do you encounter the error, and are you doing anything different than normal?


James : Wiki : Book : Blog : Twitter
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #939405 is a reply to message #930657] Wed, 10 October 2012 18:31 Go to previous messageGo to next message
Gerardo Arroyo is currently offline Gerardo ArroyoFriend
Messages: 5
Registered: October 2012
Junior Member
Hi!

I am having the same error on WebSphere 7.0.0.11; if I replace eclipseLink for openJPA and works; but I need to use eclipseLink.

The stacktrace is:

Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unsupported use of GenericConnection. A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.

The persistence.xml is:
<persistence-unit name="PruebaJNDIPU" transaction-type="JTA">
<!-- <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>-->
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:comp/env/jdbc/test</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-database" value="Oracle"/>
<property name="eclipselink.target-server" value="WebSphere"/>
<property name="eclipselink.logging.level" value="FINEST"/>
</properties>
</persistence-unit>

and the resource-ref
<resource-ref>
<description>Primary database</description>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
</resource-ref>

Best regards
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #939430 is a reply to message #939405] Wed, 10 October 2012 18:58 Go to previous messageGo to next message
Chris Delahunt is currently offline Chris DelahuntFriend
Messages: 1389
Registered: July 2009
Senior Member
Can you post the full exception stack trace for the error? It will help to figure out when the connection is obtained and why it might be incorrect.

Best Regards,
Chris
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #939439 is a reply to message #939430] Wed, 10 October 2012 19:06 Go to previous messageGo to next message
Gerardo Arroyo is currently offline Gerardo ArroyoFriend
Messages: 5
Registered: October 2012
Junior Member
Thanks!!

The full stack trace is:
[10/10/12 13:11:55:924 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.892--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--Begin predeploying Persistence Unit PruebaJNDIPU; session file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/_PruebaJNDIPU; state Initial; factoryCount 0
[10/10/12 13:11:55:925 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.925--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.orm.throw.exceptions; default value=true
[10/10/12 13:11:55:925 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.925--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.weaving.changetracking; default value=true
[10/10/12 13:11:55:925 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.925--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.weaving.lazy; default value=true
[10/10/12 13:11:55:926 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.926--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.weaving.eager; default value=false
[10/10/12 13:11:55:926 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.926--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.weaving.fetchgroups; default value=true
[10/10/12 13:11:55:926 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.926--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.weaving.internal; default value=true
[10/10/12 13:11:55:928 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.928--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.multitenant.tenants-share-emf; default value=true
[10/10/12 13:11:55:928 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:55.928--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--property=eclipselink.multitenant.tenants-share-cache; default value=false
[10/10/12 13:11:55:976 CST] 0000001d SystemOut O [EL Finer]: 2012-10-10 13:11:55.972--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--Searching for default mapping file in file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/ (There is no English translation for this message.)
[10/10/12 13:11:55:985 CST] 0000001d SystemOut O [EL Finer]: 2012-10-10 13:11:55.985--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--Searching for default mapping file in file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/ (There is no English translation for this message.)
[10/10/12 13:11:56:355 CST] 0000001d SystemOut O [EL Config]: 2012-10-10 13:11:56.355--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--The access type for the persistent class [class com.lola.Bitacora] is set to [FIELD].
[10/10/12 13:11:56:426 CST] 0000001d SystemOut O [EL Config]: 2012-10-10 13:11:56.426--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--The alias name for the entity class [class com.lola.Bitacora] is being defaulted to: Bitacora.
[10/10/12 13:11:56:514 CST] 0000001d SystemOut O [EL Finer]: 2012-10-10 13:11:56.514--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--Class [com.lola.Bitacora] registered to be processed by weaver.
[10/10/12 13:11:56:526 CST] 0000001d SystemOut O [EL Finest]: 2012-10-10 13:11:56.525--ServerSession(471669789)--Thread(Thread[WebContainer : 2,5,main])--End predeploying Persistence Unit PruebaJNDIPU; session file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/_PruebaJNDIPU; state Predeployed; factoryCount 1
[10/10/12 13:11:56:539 CST] 0000001d webapp I com.ibm.ws.webcontainer.webapp.WebGroupImpl WebGroup SRVE0169I: Loading Web Module: PruebaJNDI.war.

At this point I call a simple getResultList...
---
[10/10/12 13:12:11:017 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.016--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Begin predeploying Persistence Unit PruebaJNDIPU; session file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/_PruebaJNDIPU; state Predeployed; factoryCount 1
[10/10/12 13:12:11:017 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.017--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--End predeploying Persistence Unit PruebaJNDIPU; session file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/_PruebaJNDIPU; state Predeployed; factoryCount 2
[10/10/12 13:12:11:022 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.022--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Begin deploying Persistence Unit PruebaJNDIPU; session file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/_PruebaJNDIPU; state Predeployed; factoryCount 2
[10/10/12 13:12:11:024 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.024--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Begin weaver class transformer processing class [com.lola.Bitacora].
[10/10/12 13:12:11:062 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.062--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Weaved persistence (PersistenceEntity) [com.lola.Bitacora].
[10/10/12 13:12:11:062 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.062--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Weaved change tracking (ChangeTracker) [com.lola.Bitacora].
[10/10/12 13:12:11:062 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.062--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Weaved fetch groups (FetchGroupTracker) [com.lola.Bitacora].
[10/10/12 13:12:11:063 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.063--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--End weaver class transformer processing class [com.lola.Bitacora].
[10/10/12 13:12:11:094 CST] 00000024 SystemOut O [EL Finer]: 2012-10-10 13:12:11.094--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Could not initialize Validation Factory. Encountered following exception: java.lang.NoClassDefFoundError: javax.validation.ValidatorFactory
[10/10/12 13:12:11:099 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.099--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--property=eclipselink.target-server; value=WebSphere; translated value=org.eclipse.persistence.platform.server.was.WebSpherePlatform
[10/10/12 13:12:11:099 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.099--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
[10/10/12 13:12:11:100 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.099--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--property=eclipselink.logging.level; value=FINEST; translated value=FINEST
[10/10/12 13:12:11:100 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.1--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--property=eclipselink.target-database; value=Oracle; translated value=org.eclipse.persistence.platform.database.OraclePlatform
[10/10/12 13:12:11:142 CST] 00000024 SystemOut O [EL Info]: 2012-10-10 13:12:11.142--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--EclipseLink, version: Eclipse Persistence Services - 2.4.0.v20120608-r11652
[10/10/12 13:12:11:161 CST] 00000024 SystemOut O [EL Config]: 2012-10-10 13:12:11.16--ServerSession(471669789)--Connection(391649112)--Thread(Thread[WebContainer : 8,5,main])--connecting(DatabaseLogin(
platform=>OraclePlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
[10/10/12 13:12:11:161 CST] 00000024 SystemOut O [EL Config]: 2012-10-10 13:12:11.161--ServerSession(471669789)--Connection(753216741)--Thread(Thread[WebContainer : 8,5,main])--Connected:
User:
Database: Generic Component Context DataSource Version: Generic Component Context DataSource : java:comp/env/jdbc/orasigicerPrueba
Driver: Generic Component Context DataSource Version: Generic Component Context DataSource : java:comp/env/jdbc/orasigicerPrueba
[10/10/12 13:12:11:161 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.161--ServerSession(471669789)--Connection(131074)--Thread(Thread[WebContainer : 8,5,main])--Connection acquired from connection pool [read].
[10/10/12 13:12:11:162 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:11.162--ServerSession(471669789)--Connection(131074)--Thread(Thread[WebContainer : 8,5,main])--Connection released to connection pool [read].
[10/10/12 13:12:11:162 CST] 00000024 SystemOut O [EL Config]: 2012-10-10 13:12:11.162--ServerSession(471669789)--Connection(1687446676)--Thread(Thread[WebContainer : 8,5,main])--connecting(DatabaseLogin(
platform=>OraclePlatform
user name=> ""
connector=>JNDIConnector datasource name=>null
))
[10/10/12 13:12:11:162 CST] 00000024 SystemOut O [EL Config]: 2012-10-10 13:12:11.162--ServerSession(471669789)--Connection(2040691106)--Thread(Thread[WebContainer : 8,5,main])--Connected:
User:
Database: Generic Component Context DataSource Version: Generic Component Context DataSource : java:comp/env/jdbc/orasigicerPrueba
Driver: Generic Component Context DataSource Version: Generic Component Context DataSource : java:comp/env/jdbc/orasigicerPrueba
[10/10/12 13:12:12:033 CST] 00000024 SystemOut O [EL Info]: 2012-10-10 13:12:12.033--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/_PruebaJNDIPU login successful
[10/10/12 13:12:12:093 CST] 00000024 SystemOut O [EL Finer]: 2012-10-10 13:12:12.093--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--Canonical Metamodel class [com.lola.Bitacora_] not found during initialization.
[10/10/12 13:12:12:093 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.093--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--End deploying Persistence Unit PruebaJNDIPU; session file:/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/orionNode01Cell/PruebaJNDI_war.ear/PruebaJNDI.war/WEB-INF/classes/_PruebaJNDIPU; state Deployed; factoryCount 2
[10/10/12 13:12:12:153 CST] 00000024 SystemOut O [EL Finer]: 2012-10-10 13:12:12.153--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--client acquired: 583475911
[10/10/12 13:12:12:174 CST] 00000024 SystemOut O [EL Finer]: 2012-10-10 13:12:12.174--ClientSession(583475911)--Thread(Thread[WebContainer : 8,5,main])--acquire unit of work: 1798728502
[10/10/12 13:12:12:175 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.175--UnitOfWork(1798728502)--Thread(Thread[WebContainer : 8,5,main])--Execute query ReadAllQuery(referenceClass=Bitacora sql="SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA")
[10/10/12 13:12:12:180 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.18--ServerSession(471669789)--Connection(1972008330)--Thread(Thread[WebContainer : 8,5,main])--Connection acquired from connection pool [read].
[10/10/12 13:12:12:181 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.181--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--reconnecting to external connection pool
[10/10/12 13:12:12:181 CST] 00000024 SystemOut O [EL Fine]: 2012-10-10 13:12:12.181--ServerSession(471669789)--Connection(1544248331)--Thread(Thread[WebContainer : 8,5,main])--SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA
[10/10/12 13:12:12:181 CST] 00000024 SystemOut O [EL Fine]: 2012-10-10 13:12:12.181--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--SELECT 1 FROM DUAL
[10/10/12 13:12:12:182 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.182--ServerSession(471669789)--Connection(1972008330)--Thread(Thread[WebContainer : 8,5,main])--Connection released to connection pool [read].
[10/10/12 13:12:12:187 CST] 00000024 SystemOut O [EL Info]: 2012-10-10 13:12:12.182--UnitOfWork(1798728502)--Thread(Thread[WebContainer : 8,5,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unsupported use of GenericConnection. A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.
Error Code: 0
Call: SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA
Query: ReadAllQuery(referenceClass=Bitacora sql="SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA").
[10/10/12 13:12:12:187 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.187--ServerSession(471669789)--Connection(1925870282)--Thread(Thread[WebContainer : 8,5,main])--Connection acquired from connection pool [read].
[10/10/12 13:12:12:187 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.187--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--reconnecting to external connection pool
[10/10/12 13:12:12:188 CST] 00000024 SystemOut O [EL Fine]: 2012-10-10 13:12:12.187--ServerSession(471669789)--Connection(497819052)--Thread(Thread[WebContainer : 8,5,main])--SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA
[10/10/12 13:12:12:188 CST] 00000024 SystemOut O [EL Fine]: 2012-10-10 13:12:12.188--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--SELECT 1 FROM DUAL
[10/10/12 13:12:12:188 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:12.188--ServerSession(471669789)--Connection(1925870282)--Thread(Thread[WebContainer : 8,5,main])--Connection released to connection pool [read].
[10/10/12 13:12:12:188 CST] 00000024 SystemOut O [EL Info]: 2012-10-10 13:12:12.188--UnitOfWork(1798728502)--Thread(Thread[WebContainer : 8,5,main])--Communication failure detected when attempting to perform read query outside of a transaction. Attempting to retry query. Error was: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Unsupported use of GenericConnection. A GenericConnection is provided during application start when creating an EntityManagerFactory for a persistence unit which has configured one of its datasource to be in the component naming context; java:comp/env. During application start, the component naming context will not exist, and the correct datasource cannot be determined. When the persistence unit is used, the proper datasource and connection will be obtained and used.
Error Code: 0
Call: SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA
Query: ReadAllQuery(referenceClass=Bitacora sql="SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA").
[10/10/12 13:12:17:189 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:17.189--ServerSession(471669789)--Connection(1687315602)--Thread(Thread[WebContainer : 8,5,main])--Connection acquired from connection pool [read].
[10/10/12 13:12:17:189 CST] 00000024 SystemOut O [EL Finest]: 2012-10-10 13:12:17.189--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--reconnecting to external connection pool
[10/10/12 13:12:17:189 CST] 00000024 SystemOut O [EL Fine]: 2012-10-10 13:12:17.189--ServerSession(471669789)--Connection(353768726)--Thread(Thread[WebContainer : 8,5,main])--SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA
[10/10/12 13:12:17:190 CST] 00000024 SystemOut O [EL Fine]: 2012-10-10 13:12:17.189--ServerSession(471669789)--Thread(Thread[WebContainer : 8,5,main])--SELECT 1 FROM DUAL




Best regards
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #939470 is a reply to message #939439] Wed, 10 October 2012 19:46 Go to previous messageGo to next message
Gerardo Arroyo is currently offline Gerardo ArroyoFriend
Messages: 5
Registered: October 2012
Junior Member
Also the log shows:
Call: SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA
Query: ReadAllQuery(referenceClass=Bitacora sql="SELECT ID_BITACORA, DES_ACTIVIDAD, FEC_REGISTRO, USR_REGISTRO FROM USRSIGIDES.BITACORA")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.processExceptionForCommError(DatabaseAccessor.java:1501)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:638)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:537)
at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:1800)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:566)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:207)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:264)
at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:648)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2681)
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2634)
at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:420)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1149)
at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:852)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1108)
at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:392)
at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1196)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2875)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1602)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1672)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:640)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5473)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1638)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1672)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:640)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5473)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1638)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1672)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:640)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5473)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1638)
at org.eclipse.persistence.internal.sessions.AbstractSession.retryQuery(AbstractSession.java:1672)
at org.eclipse.persistence.sessions.server.ClientSession.retryQuery(ClientSession.java:640)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.retryQuery(UnitOfWorkImpl.java:5473)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1638)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1584)
at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1549)
at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:231)
at org.eclipse.persistence.internal.jpa.QueryImpl.getResultList(QueryImpl.java:411)
Re: WebSphere Application Server 7.0.0.7 Local JNDI Name [message #939738 is a reply to message #939470] Thu, 11 October 2012 02:25 Go to previous message
Gerardo Arroyo is currently offline Gerardo ArroyoFriend
Messages: 5
Registered: October 2012
Junior Member
It is working now;

the trick is the property: javax.persistence.jtaDataSource
It should match the jta-data-source value.

The example below.


<persistence-unit name="PruebaJNDIPU" transaction-type="JTA">

<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>java:comp/env/jdbc/myTest</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="eclipselink.target-database" value="Oracle"/>
<property name="eclipselink.target-server" value="WebSphere"/>
<property name="eclipselink.logging.level" value="FINEST"/>
<property name="javax.persistence.jtaDataSource" value="java:comp/env/jdbc/myTest" />
</properties>
</persistence-unit>
Previous Topic:XML-less JPA in JSE with EclipseLink
Next Topic:Unmarshalling through eclipselink moxy and jaxb
Goto Forum:
  


Current Time: Wed Apr 24 18:22:38 GMT 2024

Powered by FUDForum. Page generated in 0.03800 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top