Closed GoogleCodeExporter closed 9 years ago
What version of eclipse link do you use?
Is it reproduced in a basic eclipse link project?
For information, the relevant javamelody source files are:
-
https://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/mai
n/java/net/bull/javamelody/JpaPersistence.java
-
https://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/mai
n/java/net/bull/javamelody/JpaOverridePersistenceXmlClassLoader.java
Original comment by evernat@free.fr
on 19 Aug 2014 at 9:03
As a wild guess, the specific handling of ClassLoader and of
getResource("META-INF/persistence.xml") and
getResources("META-INF/persistence.xml") in javamelody
JpaOverridePersistenceXmlClassLoader or in Eclipse Link may be related to this
issue.
Original comment by evernat@free.fr
on 19 Aug 2014 at 9:03
We are using eclipse link 2.4, it is can be easily reproducible
Original comment by basilabr...@gmail.com
on 20 Aug 2014 at 1:41
Thanks for the info. It confirms the stack-trace indeed.
Do you have the source of a simple webapp project (using Maven if possible), to
reproduce the issue? Because I currently don't have one.
Of course, it would be even better if you find what is the cause and how to fix
it.
Original comment by evernat@free.fr
on 20 Aug 2014 at 5:29
[deleted comment]
This is due to eclipselink imitialization implementation which resolves content
of <provider> tag and requires to keep
org.eclipse.persistence.jpa.PersistenceProvider there. The workaround is wrap
the DataSource with Javamelody proxy programmatically and transfer to
persistence provider via the PersistenceUnitProperties.NON_JTA_DATASOURCE
property:
DataSource dataSourceProxy =
JdbcWrapper.SINGLETON.createDataSourceProxy("default", realDataSource);
Map<String, Object> props = new HashMap<String, Object>();
props.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, dataSourceProxy);
EntityManagerFactory factory =
Persistence.createEntityManagerFactory("default", props);
Original comment by Roman.Si...@gmail.com
on 23 Aug 2014 at 11:41
Thanks for the info Roman. But I am a bit lost.
For example, what is the goal to wrap the datasource in a proxy here and to
transfer it to the persistence provider? Just to have monitoring of sql
requests?
And what are we supposed to do with the following line:
EntityManagerFactory factory =
Persistence.createEntityManagerFactory("default", props);
Do you mean that if the monitored application uses that way, it will magically
work around the above exception?
Or the only solution to not have the above exception is to keep
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
in persistence.xml instead of
<provider>net.bull.javamelody.JpaPersistence</provider>
?
Original comment by evernat@free.fr
on 29 Aug 2014 at 11:31
There is no simple webapp project to reproduce the issue, and no info on what
may or may not workaround the issue.
So closing as invalid/incomplete.
Anyone is welcome to submit a simple project to reproduce the issue.
Original comment by evernat@free.fr
on 16 Nov 2014 at 4:22
Original issue reported on code.google.com by
basilabr...@gmail.com
on 19 Aug 2014 at 5:07