New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lack of Jpa statistics (depending on installation procedure) #750
Comments
Can you give the source of a simple project to reproduce the issue? |
Any news? |
It looks quite difficult to extract a simple project from the project I work on... Can I try something simpler before that? As a first step, maybe I could activate some debug logs with log4j that could give you a direction to check? (on some specific packages: JavaMelody and Jpa initialisation) |
I have read again this issue carefully.
I don't know exactly what you mean by "case JavaMelody jars", but if it is putting the 2 javamelody jar files in the tomcat/lib directory, then you should know that it is not recommended and not really supported.
It's good if it works that way because it seems that it's the standard procedure for javamelody (ie include the 2 javamelody jar files in the war of the webapp and copy the war in tomcat/webapps). So what is the problem in fact? |
I copied the jars to the tomcat/webapps//WEB-INF/lib directory. The reason is that I tried to use JavaMelody on a application before we can upgrade it to a new version with JavaMelody embedded in the war. I misinterpreted the doc and thought we could install the jars in the directory deployed from the war (instead of the war). So I understand this is not really supported too.
If we don't restart tomcat but just undeploy / deploy the application instead, then we have the Jpa problem. So it's a matter of doing the right procedure. Thank you |
In fact, EclipseLink does not want that By the way, I have seen that eclipselink-2.7.0.jar contains the classes of a JPA API. So I suggest, that you don't add another JPA API dependency in your webapp by yourself (having 2 JPA API may influence JPA loading and persistence). So, given that EclipseLink doesn't cooperate much for injecting the javamelody persistence provider and given that the JPA monitoring works when restarting tomcat, that's enough for me given that I probably can't do better. |
What steps will reproduce the problem?
For an application using EclipseLink Jpa, install JavaMelody, either with the jars, or already included in the application war.
What is the expected output? What do you see instead?
The monitoring page should display the "Statistics Jpa" block, and on some installations it doesn't.
Note that the logs should display the second line, and on theses installations it doesn't:
Procedure to activate the Jpa statistics in case they are not - case JavaMelody jars
stop Tomcat, suppress javamelody and jrobin jars, start tomcat, wait for application start (at least Jpa initialisation), add the jars (do not add them before...), restart Tomcat
Just restarting Tomcat doesn't change the situation.
Procedure to activate the Jpa statistics in case it's not - case embedded in war (web.xml)
stop Tomcat, copy the application war in webapps, start tomcat
(do not undeploy the war, or delete the deployed directory)
Application setup
The application uses 4 EntityManagerFactory (javax.persistence):
In the case JavaMelody is embedded in the application war, here is web.xml:
applicationContext.xml:
What version of the product are you using? On what application server, JDK, operating system?
Ubuntu Xenial 16.04 Lts
openjdk 1.8.0_171
Tomcat 8.0.37
EclipseLink Jpa 2.7.0
JavaMelody 1.71.0
Did I miss something?
Thanks a lot for JavaMelody!
The text was updated successfully, but these errors were encountered: