Hello Chris,
Thanks for
quick reply.
The
application is build using EJB3. The application
is getting EntityManager using Annotation @PersistenceContext(unitName
= "BgPU") in stateless bean. We are using below
persistence.xml
in our application and datasource is configured in WebSphere. There are
no explicit
properties set in persistence.xml. The same application is working on
Glassfish.
<?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="BgPU">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/BgDS</jta-data-source>
<class>………………..</class>
<class>………………..</class>
</persistence-unit>
</persistence>
Thanks &
Regards,
Atish
Hello Atish,
The error indicates that there is no URL and no classname for the
driver- it is
attempting to use a DefaultConnector which
creates
connections itself instead of obtaining them from a datasource.
How are you obtaining the EntityManager and its factory, and could you
have
overridden these settings by passing in null for these properties? As
the
login occurs only once, are you sure you are using the same persistence
unit
with the same settings when reading as when writing? What are the
settings used in the persistence.xml?
Best Regards,
Chris
On 28/09/2010 7:23 AM, Atish Potdar wrote:
Hi Group,
I have configured
datasource in WebSphere to connect
to DB2 and using it in my J2EE application. The same datasource has
been
configured in Persistence,xml. When I run the application then it can
read and
display the data but when I tried to create or update records then it
throws
following error. Can any body please advice on this?
Thanks in advance.
Error Log:
[9/28/10 16:10:18:265
IST]
0000001c SystemOut O [EL Severe]: 2010-09-28
16:10:18.265--ServerSession(164956629)--Local Exception Stack:
Exception
[EclipseLink-4021]
(Eclipse Persistence Services - 2.0.0.v20090725-r4721):
org.eclipse.persistence.exceptions.DatabaseException
Exception Description:
Unable to
acquire a connection from driver [null], user [null] and URL [null].
Verify that you have set the expected driver class and URL. Check your
login, persistence.xml or sessions.xml resource. The jdbc.driver
property
should be set to a class that is compatible with your database platform
at
org.eclipse.persistence.exceptions.DatabaseException.unableToAcquireConnectionFromDriverException(DatabaseException.java:375)
at
org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:90)
at
org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at
org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:584)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:231)
at
org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:263)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:135)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:187)
at
org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:175)
at
com.fundamo.core.DefaultEntityManagerResolver.setEntityManager(DefaultEntityManagerResolver.java:44)
…………
……….
Thanks & Regards,
Atish
-**************Nihilent***************
" *** All information contained in this communication is confidential, proprietary, privileged
and is intended for the addressees only. If youhave received this E-mail in error please notify
mail administrator by telephone on +91-20-39846100 or E-mail the sender by replying to
this message, and then delete this E-mail and other copies of it from your computer system.
Any unauthorized dissemination,publication, transfer or use of the contents of this communication,
with or without modifications is punishable under the relevant law.
Nihilent has scanned this mail with current virus checking technologies. However, Nihilent makes no
representations or warranties to the effect that this communication is virus-free.
Nihilent reserves the right to monitor all E-mail communications through its Corporate Network. *** "
*************************************************************************-
|
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users