| Author |
com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
|
Michel Legris
Greenhorn
Joined: Feb 21, 2012
Posts: 19
|
|
We are trying to make a **simple** hello World agent class but the agent cannot be initialized
ex:
ex: (the AgentClass)
The manifest look like this :
Manifest-Version: 1.0
Premain-Class: Com.MyAgent
Agent-Class: Com.MyAgent
Created-By: 1.6.0_06 (Sun Microsystems Inc.)
Note : I tried with premain, agentmain etc... any possible way and it's not working
We always get the error : com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
How the hell the loaded agent jar can be correctly initialized ??? I know there is many possible cause but we tried almost anything
Thanks
Michel
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Is the class in a package called Com? I don't see that in your class definition.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Michel Legris
Greenhorn
Joined: Feb 21, 2012
Posts: 19
|
|
Thanks Rob for trying to help.
the "com" was an error for the posted example (sorry my bad)
We finally found the problem....we need to restart the application (the one to "inject" the agent) or the old jar (from a previous compilation) will be used instead.
I was not really comfortable with java packaging and even java in general so I had to learn a little bit more to make it work
Thanks again
Michel
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
You're welcome.
|
 |
 |
|
|
subject: com.sun.tools.attach.AgentInitializationException: Agent JAR loaded but agent failed to initialize
|
|
|