HOAB

History of a bug

Introscope & Unsupported major.minor version 52.0

Rédigé par gorki Aucun commentaire

Problem :

Launching a JVM with Introscope agent on a old JVM 1.7 result in : 

A problem occurred while attempting to create the delegate agent 
[IntroscopeAgent] Agent Unavailable 

Well, as the agent is heavily customized, removing customization was the first step. It starts. 
OK, a few lambda removing alter, I recompiled everything with Java 1.7 target.. And still the same message. 

Solution : 

After a hours ... 

Step 1 : 

  • Decompile
    • com.wily.introscope.agent.AgentShim
  • Add more logs, it confirms this is a class loading problem with major/minor version. I finally get the class name 

Step 2 : 

  • After checking X times my maven settings, I finally used : *
    • javap -v | grep version
    • to check if it was ok or not. 
  • and surprisingly, the generated class was OK ! 
  • but I used also assembly plugin 

Step 3 : 

  • The cause was that I recompile some classes of an old jar and rebuild it 
  • I tracked the faulty classes version in the different repositories  The root cause was that I installed in a local repository the old jar without the modified classes with the command : 
plaintext mvn install:install-file -DcreateChecksum=true -Dfile=./agent/wily/Agent.jar -DgroupId=com.ca.agent -DartifactId=javaagent -Dversion=10.0.7SP3 -Dpackaging=jar -DlocalRepositoryPath=local-maven-repo

which install it also after build in the global repository... 

And assembly plugin use in priority the global repository. 

Well I didn't take time to understand why maven do not use only my local repository for this jar. 

I just add : rm -rf ~/.m2/repository/com/ca/agent/sqlagent in the beginning of my install script  ! 

Well a few hours lost again here...

Fil RSS des articles