Error on instrumenting Weblogic Server with APM Agent Client 1.16.0

I am trying to instrument application running on Weblogic 12.2. My APM client jar is 1.16.0.jar. It is able to connect to APM server as I can see the below line in the log

2020-06-27 13:50:11.749 [elastic-apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthCh
ecker - Elastic APM server is available: { "build_date": "2020-05-28T14:42:11Z", "build_sha": "0102a80acd
2c83e4ab9cce93dc630b877e3063e7", "version": "7.7.1"}

After that I am getting the below exception (omitted some stacktraces) :

2020-06-27 13:50:19.015 [main] INFO co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - com.contrasts
ecurity.thirdparty.org.apache.log4j.Category refers to a missing class
java.lang.IllegalStateException: Cannot resolve type description for com.contrastsecurity.thirdparty.org.ap
ache.log4j.Category
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:159
)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$DescriptionStrategy$Default$2.a
pply(AgentBuilder.java:3509)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.do
Transform(AgentBuilder.java:10300)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10263)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.ac
cess$1600(AgentBuilder.java:10029)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10648)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10595)
        at java.security.AccessController.doPrivileged(Native Method)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10186)
        at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
        at com.contrastsecurity.agent.i.a.b(Log4jInitializationTask.java:30)
        at com.contrastsecurity.agent.ContrastAgent.a(ContrastAgent.java:267)
        at com.contrastsecurity.agent.ContrastAgent.setup(ContrastAgent.java:225)
        at com.contrastsecurity.agent.ContrastLoaderAgent.premain(ContrastLoaderAgent.java:77)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
        at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
2020-06-27 13:50:19.984 [main] INFO co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - com.contrasts
ecurity.thirdparty.org.slf4j.ILoggerFactory refers to a missing class
java.lang.IllegalStateException: Cannot resolve type description for com.contrastsecurity.thirdparty.org.sl
f4j.ILoggerFactory
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:159
)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$DescriptionStrategy$Default$2.a
pply(AgentBuilder.java:3509)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.do
Transform(AgentBuilder.java:10300)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10263)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.ac
cess$1600(AgentBuilder.java:10029)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10648)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10595)
        at java.security.AccessController.doPrivileged(Native Method)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10186)
        at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
        at com.contrastsecurity.thirdparty.org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:75)
        at com.contrastsecurity.agent.reloadable.ReloadableBeanManager.<clinit>(ReloadableBeanManager.java:
71)
        at com.contrastsecurity.agent.reloadable.a.register(ReloadableBean.java:19)
        at com.contrastsecurity.agent.reloadable.a.<init>(ReloadableBean.java:15)
        at com.contrastsecurity.agent.config.d.<init>(CachingConfigProvider.java:51)
        at com.contrastsecurity.agent.config.d.a(CachingConfigProvider.java:153)
        at com.contrastsecurity.agent.config.h.<init>(Config.java:264)
        at com.contrastsecurity.agent.config.h.<init>(Config.java:190)
        at com.contrastsecurity.agent.config.h$a.g(Config.java:186)
        at com.contrastsecurity.agent.config.h.b(Config.java:280)
        at com.contrastsecurity.agent.Contrast.<clinit>(Contrast.java:33)
        at com.contrastsecurity.agent.i.a.b(Log4jInitializationTask.java:35)
        at com.contrastsecurity.agent.ContrastAgent.a(ContrastAgent.java:267)
        at com.contrastsecurity.agent.ContrastAgent.setup(ContrastAgent.java:225)
        at com.contrastsecurity.agent.ContrastLoaderAgent.premain(ContrastLoaderAgent.java:77)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
        at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
2020-06-27 13:50:19.998 [main] INFO co.elastic.apm.agent.bci.bytebuddy.ErrorLoggingListener - com.contrasts
ecurity.thirdparty.org.slf4j.spi.LoggerFactoryBinder refers to a missing class
java.lang.IllegalStateException: Cannot resolve type description for com.contrastsecurity.thirdparty.org.sl
f4j.spi.LoggerFactoryBinder
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:159
)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$DescriptionStrategy$Default$2.a
pply(AgentBuilder.java:3509)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.do
Transform(AgentBuilder.java:10300)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10263)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.ac
cess$1600(AgentBuilder.java:10029)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10648)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10595)
        at java.security.AccessController.doPrivileged(Native Method)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10186)
        at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
        at com.contrastsecurity.thirdparty.org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
        at com.contrastsecurity.thirdparty.org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java
:108)
        at com.contrastsecurity.thirdparty.org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302
)
        at com.contrastsecurity.thirdparty.org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
        at com.contrastsecurity.thirdparty.org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:288)
        at com.contrastsecurity.agent.reloadable.ReloadableBeanManager.<clinit>(ReloadableBeanManager.java:
71)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.do
Transform(AgentBuilder.java:10300)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10263)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.ac
cess$1600(AgentBuilder.java:10029)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10648)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$Le
gacyVmDispatcher.run(AgentBuilder.java:10595)
        at java.security.AccessController.doPrivileged(Native Method)
        at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.tr
ansform(AgentBuilder.java:10186)
        at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
        at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
        at com.contrastsecurity.agent.plugins.rasp.oscommand.a.a(ContrastOSCommandExecutionDispatcherImpl_F
actory.java:30)
        at com.contrastsecurity.agent.plugins.rasp.oscommand.a.get(ContrastOSCommandExecutionDispatcherImpl
_Factory.java:1)
        at com.contrastsecurity.agent.plugins.rasp.oscommand.d.a(OSCommandModule_ProvideOsCommandExecutionD
ispatcherFactory.java:29)
        at com.contrastsecurity.agent.plugins.rasp.oscommand.d.get(OSCommandModule_ProvideOsCommandExecutio
nDispatcherFactory.java:1)
        at com.contrastsecurity.agent.plugins.rasp.l.n(DaggerProtectComponent.java:1464)
        at com.contrastsecurity.agent.plugins.rasp.RaspPlugin.d(RaspPlugin.java:645)
        at com.contrastsecurity.agent.plugins.rasp.RaspPlugin.onContrastEngineReady(RaspPlugin.java:589)
        at com.contrastsecurity.agent.startup.h.a(PluginInitializeTask.java:107)
        at com.contrastsecurity.agent.ContrastEngine.start(ContrastEngine.java:265)
        at com.contrastsecurity.agent.ContrastAgent.a(ContrastAgent.java:275)
        at com.contrastsecurity.agent.ContrastAgent.setup(ContrastAgent.java:225)
        at com.contrastsecurity.agent.ContrastLoaderAgent.premain(ContrastLoaderAgent.java:77)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:386)
        at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:401)
[Contrast] Sat Jun 27 13:50:36 GST 2020 Logging security messages to /weblogic/.contrast/security.log
[Contrast] Sat Jun 27 13:51:54 GST 2020 Starting JVM [93999ms]

Looks like some jar for contrastsecurity package is missing. Please guide on what needs to be added/configured? Am I missing something?

Thanks for reporting.

This is an INFO message, so not necessarily it indicates a real problem, only that our agent fails to instrument the Contrast Security agent, which shouldn't have functional implications.
In any case, I added the contrastsecurity package to the exclusion list so that you don't get these.
Please try out this snapshot build and see if everything works as expected.

Thanks.

Thanks @Eyal_Koren. Even with the INFO message, the instrumentation works just fine. Thanks for providing the snapshot build, will verify and confirm

1 Like