I have developed a custom cloud connector for Mule. I have developed it in IntelliJ using Maven. I generated code from a 3rd party WSDL using Axis2 and XMLBeans. I have developed test cases that pass and show the expected results after interacting with the web service. "mvn clean package" successfully passes all tests and builds the site.
The problem I am having is using it in anypoint building out a Mule project. I have added the Axis2 1.6.3 libs to the classpath root of the jvm created by Anypoint when launching the application. When I submit a request that interacts with my connector, I get the following error:
Message : null (java.lang.ExceptionInInitializerError). Message payload is of type: String Type : org.mule.api.MessagingException Code : MULE_ERROR--2 JavaDoc : http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html Payload : Testing ******************************************************************************** Exception stack is: 1. null (java.lang.NullPointerException) org.apache.axiom.locator.DefaultOMMetaFactoryLocator:72 (null) 2. null (java.lang.ExceptionInInitializerError) org.apache.axis2.description.AxisDescription:72 (null) 3. null (java.lang.ExceptionInInitializerError). Message payload is of type: String (org.mule.api.MessagingException)
org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor:32 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html) ******************************************************************************** Root Exception stack trace: java.lang.NullPointerException at org.apache.axiom.locator.DefaultOMMetaFactoryLocator.(DefaultOMMetaFactoryLocator.java:72)
Looking at DefaultOMMetaFactoryLocator, for axiom-api1.2.14, I see the following at line 72:
Enumeration e = classLoader.getResources(ImplementationFactory.DESCRIPTOR_RESOURCE);
The static reference is to an axiom.xml file. I have tried adding the file manually but continue to get the null pointer error. This code is used by the generated code to make a connection via the client but not impacted by my code directly. Is there something I am missing with being able to use Axis2 within a Cloud Connector in Mule ESB? Why would it work in the maven test but not in anypoint?
Additional Info:
Axis2 1.6.3 Axiom* 1.2.14 Mule ESB 3.7
The error indicates that Axiom is loaded by the bootstrap classloader of the JVM. I doubt that doing this is the recommended way to deploy things on Anypoint.