java.lang.IllegalAccessError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • When consuming the `http:requester` MP built by the SDK in a test, the override HttpTransactionContext class by mule is not being picked up, provoking the following stack (it tries to access a method that hasn't the necessary visibility): {code:java}SEVERE: doSelect exception java.lang.IllegalAccessError: tried to access method com.ning.http.client.providers.grizzly.HttpTransactionContext.getAsyncHandler()Lcom/ning/http/client/AsyncHandler; from class org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy at org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getWorkManager(FlowWorkManagerIOStrategy.java:119) at org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getThreadPoolFor(FlowWorkManagerIOStrategy.java:90) at org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:69) at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:415) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:384) at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:348) at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:279) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571) at java.lang.Thread.run(Thread.java:745){code} Steps to reproduce: 1) Write an xml that uses the new http requester [1] 2) Write a test that extends `ExtensionFunctionalTestCase` and add `org.mule.extension.http.internal.HttpConnector.class` as a describer [2] 3) Use *ONLY* the dependency of the mule-module-http-ext [3] 4) Run the test Workaround: Add the following dependency to force the proper loading of overriden java classes {code:xml} <dependency> <groupId>org.mule.modules</groupId> <artifactId>mule-module-http</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency>{code} [1] {code:xml}<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:httpn="http://www.mulesoft.org/schema/mule/httpn" xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd http://www.mulesoft.org/schema/mule/httpn http://www.mulesoft.org/schema/mule/httpn/current/mule-httpn.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <httpn:request-config basePath="/basic-auth" followRedirects="true" enableCookies="true" name="simple-config" sendBodyMode="AUTO" requestStreamingMode="AUTO" parseResponse="true"> <httpn:request-connection protocol="HTTP" port="80" host="httpbin.org" usePersistentConnections="true" connectionIdleTimeout="30000" maxConnections="-1"/> <httpn:authentication> <httpn:basic-authentication password="#['passLP']" preemptive="true" username="#['userLP']"/> </httpn:authentication> </httpn:request-config> <flow initialState="started" name="testHttpDoLogin"> <processor-chain> <httpn:request path="/{aUser}/{aPass}" method="GET" config-ref="simple-config" key="ANY"> <httpn:request-builder> <httpn:simple-request-builder> <httpn:uri-params> <httpn:uri-param value="userLP" key="aUser"/> <httpn:uri-param value="passLP" key="aPass"/> </httpn:uri-params> </httpn:simple-request-builder> </httpn:request-builder> </httpn:request> </processor-chain> </flow> </mule>{code} [2] {code:java}public class OperationModuleWithConfigGlobalElementTestCase extends ExtensionFunctionalTestCase { @Override protected String getConfigFile() { return "operation-with-config-global-elements-module-flow.xml"; } @Override protected Class<?>[] getAnnotatedExtensionClasses() { return new Class<?>[] {org.mule.extension.http.internal.HttpConnector.class}; } @Override public int getTestTimeoutSecs() { return 10000000; } @Test public void testHttpDoLogin() throws Exception{ MuleEvent muleEvent = flowRunner("testHttpDoLogin").run(); assertThat(muleEvent.getMessage().getPayload(), Is.is("success with basic-authentication for user: userLP")); } }{code} [3] {code:xml} <dependency> <groupId>org.mule.modules</groupId> <artifactId>mule-module-http-ext</artifactId> <version>${project.version}</version> <scope>test</scope> </dependency>{code}
    via by Lautaro Fernandez,
    • java.lang.IllegalAccessError: tried to access method com.ning.http.client.providers.grizzly.HttpTransactionContext.getAsyncHandler()Lcom
    • ing/http/client/AsyncHandler; from class org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy at org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getWorkManager(FlowWorkManagerIOStrategy.java:119) at org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.getThreadPoolFor(FlowWorkManagerIOStrategy.java:90) at org.mule.runtime.module.http.internal.request.grizzly.FlowWorkManagerIOStrategy.executeIoEvent(FlowWorkManagerIOStrategy.java:69) at org.glassfish.grizzly.strategies.AbstractIOStrategy.executeIoEvent(AbstractIOStrategy.java:89) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeyEvents(SelectorRunner.java:415) at org.glassfish.grizzly.nio.SelectorRunner.iterateKeys(SelectorRunner.java:384) at org.glassfish.grizzly.nio.SelectorRunner.doSelect(SelectorRunner.java:348) at org.glassfish.grizzly.nio.SelectorRunner.run(SelectorRunner.java:279) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:591) at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:571)
    No Bugmate found.