Glassfish 4 deployment error

galovics picture galovics · Oct 30, 2013 · Viewed 14.2k times · Source

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?

Answer

Catalin Ciolocoiu picture Catalin Ciolocoiu · Apr 7, 2015

I Had the same error. I stopped the GLassfish server and then I cleaned the project (Project -> Clean... ). Started the server and worked