Agent on IBM Websphere fails to connect to EM with "An error occurred while trying to connect to the Introscope Enterprise Manager."

Document ID : KB000046488
Last Modified Date : 14/02/2018
Show Technical Document Details

 Problem:

 APM Java Agent on IBM Websphere is unable to connect to the EM. The log shows the error  

[ERROR] [IntroscopeAgent.Agent] An error occurred while trying to connect to the Introscope Enterprise Manager. 


 Putting the agent in VERBOSE logging shows an exception similar to this:

[VERBOSE] [IntroscopeAgent.Agent]
java.lang.NoSuchMethodError: com/wily/introscope/agent/connection/CommandQueue.access$4(Lcom/wily/introscope/agent/connection/CommandQueue;I)V
at com.wily.introscope.agent.connection.CommandQueue$1.set(CommandQueue.java:164)
at com.wily.util.properties.hot.ConfigurationProperty.setValue(ConfigurationProperty.java:635)
at com.wily.util.properties.hot.ConfigurationProperty.setValueAndLog(ConfigurationProperty.java:593)

or

[DEBUG] [IntroscopeAgent.Agent] 

java.lang.NoSuchMethodError: com/wily/introscope/agent/connection/IServerFailoverPolicy.setAdditionalFailoverServers(Lcom/wily/isengard/api/ServerInstanceLocator;Lcom/wily/introscope/spec/server/beans/loadbalancing/AdvancedReconnectInfo;)V 

at com.wily.introscope.agent.connection.ConnectionThread.attemptAdvancedConnection(ConnectionThread.java:326) 

at com.wily.introscope.agent.connection.ConnectionThread.connect(ConnectionThread.java:454) 

at com.wily.introscope.agent.connection.ConnectionThread.run(ConnectionThread.java:69) 

at java.lang.Thread.run(Thread.java:804)

 

 Environment: 

 APM Agent on IBM Websphere being run by IBM Java (all versions)

 

 Cause:

 IBM Java can cache code using Class Sharing. This can result in errors such as this after an upgrade, when older versions of the same function call are cached by Java. Sometimes this cache can also store corrupt versions of the code, which will also cause a similar error.

 

 Solution:

 To clear the Class Sharing cache in IBM Java, the application itself has to be restarted with the IBM Java option -Xshareclasses:none or -Xshareclasses:reset, added to the JVM startup arguments. 

 -Xshareclasses:none starts the application without using the cache and shared classes. This can be a useful short-term solution to confirm that it is a cache related problem.

 -Xshareclasses:reset starts the application, with shared classes, then clears the cache and rebuilds it. This is the recommended solution to fix a problem with the cache.

Important: Note that each time the Agent is patched or upgraded on IBM Websphere, it is a good idea to clear the IBM Websphere cache via the reset option.

 

Additional Information:

https://www-01.ibm.com/support/knowledgecenter/SSYKE2_8.0.0/com.ibm.java.aix.80.doc/diag/appendixes/cmdline/Xshareclasses.html