I added some libraries to my JavaEE project and then deploy the application works. I modified something and I got this error message in Eclipse:
Cannot Deploy ProjectName
deploy is failing=Error occurred during deployment: Keys cannot be duplicate.
Old value of this key property, nullwill be retained.
Please see server.log for more details.
java.lang.LinkageError: loader (instance of
org/glassfish/web/loader/WebappClassLoader):
attempted duplicate class definition for name:
"org/glassfish/web/loader/JdbcLeakPrevention"
loader (instance of org/glassfish/web/loader/WebappClassLoader): attempted duplicate
class definition for name: "org/glassfish/web/loader/JdbcLeakPrevention"
I made some research and I found out that it is not an Eclipse bug. I'm working with Kepler but I tested with Juno too. Got the same error message. I downloaded Glassfish 3.1.2.2 and the message gone.
Why am I getting this message?
I Had the same error. I stopped the GLassfish server and then I cleaned the project (Project -> Clean... ). Started the server and worked
In my Glassfish log file it says:
Application with name ws is already registered. Either specify that redeployment must be forced, or redeploy the application. Or if this is a new deployment, pick a different name
Following my logs instructions I deployed the app with --force
option:
asadmin deploy --force=true ws.war
and it worked. More info on deploy --force=true
I also had this issue, and I was also using the SVNKit library plus its dependencies so it looks like there is some kind of conflict there. I can get around it by cleaning out the osgi-cache folder & restarting glassfish, but I have to do this every time I want to deploy, so not a great solution.
Try to remove all the files under osgi-cache and generated directories. It worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With