Conflict between JavaAgent and Mulesoft Gateway

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

Conflict Between JavaAgent and Mulesoft Gateway

Workflow:
1. Create an account with Mulesoft Cloud Platform
2. Install API Mule Gateway 2.2.0 on the Linux
3. In the wrapper.conf file, modify the following :

wrapper.java.additional.15=-javaagent:/opt/wily/Agent.jar
wrapper.java.additional.16=-Dcom.wily.introscope.agentProfile=/opt/wily/core/config/IntroscopeAgent.profile

wrapper.java.additional.17=-Danypoint.platform.client_id=XXXXX
wrapper.java.additional.18=-Danypoint.platform.client_secret=XXXXX

4. Put some dummy apps under /apps folder
5. Register the Linux Server with Mulesoft Cloud Platform and it updates the wrapper.conf file.
6. Start the gateway
7. Result:

The Mule gateway registers on-startup with the Mulesoft management layer, either Mulesoft Cloud or Anypoint On-Prem. From the content of the mule_ee.log on the gateway, it appears that the registration completes successfully, then, within the space of 60 mins, disconnects. Analysis from the Mulesoft engineering team is pointing to a class loading conflict.

WARN  2016-11-30 02:55:15,332 [grizzly-ahc-kernel(2) SelectorRunner] org.glassfish.grizzly.ProcessorExecutor: GRIZZLY0029: Error during Processor execution. Connection=TCPNIOConnection{localSocketAddress={/192.168.181.128:43410}, peerSocketAddress={mule-manager.anypoint.mulesoft.com/52.201.174.72:443}} ioEvent=CLOSED processor=org.glassfish.grizzly.filterchain.DefaultFilterChain@2a1f5521
java.lang.NullPointerException
    at com.ning.http.client.providers.grizzly.GrizzlyAsyncHttpProvider$AsyncHttpClientEventFilter.exceptionOccurred(GrizzlyAsyncHttpProvider.java:1200) ~[?:?]
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.throwChain(DefaultFilterChain.java:478) ~[?:?]
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:158) ~[?:?]
    at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:111) ~[?:?]
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561) ~[?:?]
    at org.glassfish.grizzly.nio.NIOConnection.preClose(NIOConnection.java:825) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOConnection.preClose(TCPNIOConnection.java:97) ~[?:?]
    at org.glassfish.grizzly.nio.NIOConnection.terminate0(NIOConnection.java:549) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOConnection.terminate0(TCPNIOConnection.java:292) ~[?:?]
    at org.glassfish.grizzly.nio.NIOConnection$3.completed(NIOConnection.java:513) ~[?:?]
    at org.glassfish.grizzly.nio.NIOConnection$3.completed(NIOConnection.java:509) ~[?:?]
    at org.glassfish.grizzly.asyncqueue.AsyncWriteQueueRecord.notifyCompleteAndRecycle(AsyncWriteQueueRecord.java:162) ~[?:?]
    at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:275) ~[?:?]
    at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:170) ~[?:?]
    at org.glassfish.grizzly.nio.AbstractNIOAsyncQueueWriter.write(AbstractNIOAsyncQueueWriter.java:70) ~[?:?]
    at org.glassfish.grizzly.AbstractWriter.write(AbstractWriter.java:76) ~[?:?]
    at org.glassfish.grizzly.nio.NIOConnection.closeGracefully0(NIOConnection.java:508) ~[?:?]
    at org.glassfish.grizzly.nio.NIOConnection.closeSilently(NIOConnection.java:484) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler$EnableReadHandler.onError(TCPNIOConnectorHandler.java:353) ~[?:?]
    at org.glassfish.grizzly.ProcessorExecutor.error(ProcessorExecutor.java:167) ~[?:?]
    at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:98) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler.onConnectedAsync(TCPNIOConnectorHandler.java:221) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOConnectorHandler$1.connected(TCPNIOConnectorHandler.java:154) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOConnection.onConnect(TCPNIOConnection.java:258) ~[?:?]
    at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:552) ~[?:?]
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112) ~[?:?]
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117) ~[?:?]
    at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.executeIoEvent(WorkerThreadIOStrategy.java:103) ~[?:?]
    at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) ~[?:?]
    at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:414) ~[?:?]
    at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:383) ~[?:?]
    at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:347) ~[?:?]
    at org.glassfish.grizzly.nio.SelectorRunner.run(Unknown Source) ~[?:?]
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(Unknown Source) ~[?:?]
    at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(Unknown Source) ~[?:?]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
ERROR 2016-11-30 02:55:15,657 [pool-6-thread-2] com.mulesoft.analytics.AnalyticsRunnable: Error processing analytics: already closed
java.lang.IllegalAccessError: already closed
    at org.mapdb.EngineWrapper$1.get(EngineWrapper.java:472) ~[?:?]
    at org.mapdb.EngineWrapper.get(EngineWrapper.java:58) ~[?:?]
    at org.mapdb.Atomic$Long.get(Atomic.java:315) ~[?:?]
    at org.mapdb.Queues$SimpleQueue.peek(Queues.java:111) ~[?:?]
    at org.mapdb.Queues$SimpleQueue.isEmpty(Queues.java:287) ~[?:?]
    at com.mulesoft.analytics.AnalyticsRunnable.run(AnalyticsRunnable.java:49) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) ~[?:1.8.0_102]
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source) ~[?:1.8.0_102]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) ~[?:1.8.0_102]
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) ~[?:1.8.0_102]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_102]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_102]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]

Environment:
Mulesoft gateway 2.1.1RHEL 6.6, Oracle JVM 8u102, 64bitIntroscope Agent 10.2
Resolution:

1) Upgrade to Agent 10.3

2) Disable Agent AutoEntryPoint detection feature.
Open the core\config\IntroscopeAgent.profile , set introscope.agent.deep.entrypoint.enabled=false

What do you lose by setting “introscope.agent.deep.entrypoint.enabled=false” ?

In scenarios where there is Frontends tracing for your application, and you are already seeing Frontend nodes in metrics /traces then “Automatic Entry Points” has limited value. This 10.2 feature tries to figure out Frontends when there is none

Additional Information:

Deploy Mulesoft fieldpack available from Marketplace: http://marketplace.ca.com/shop/ca/?cat=29