Adobe AEM 6.2, customer component to call external webservice throws NullPointerException jaxb.Utils.getFieldXJTA(



Below is the question asked by my colleague on stack exchange but, I thought I would post here too. We are not able to call an external web service. 


I am facing exact same issue that has been asked in this question: here.

I am writing a custom component for AEM 6.2 which will call an external web service and get some data. I followed the tutorial they had on here. I have unit tested my code and works fine, but when I deploy the component inside AEM, it gives me NullPointerException at this line of my code(getPort!):

MyService service = new MyService_Service().getMyServicePort();

I used maven, cxf-codegen-plugin, to generate client code.

The question that was asked is marked as answered but I couldn't figure out what the answer was really! Can anyone explain [possibly with sample config/code] what do I exactly need do to?

Here is my stack trace:

java.lang.NullPointerException at org.apache.cxf.jaxb.Utils.getFieldXJTA( at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences( at org.apache.cxf.jaxb.JAXBContextInitializer.addClass( at org.apache.cxf.jaxb.JAXBContextInitializer.begin( at org.apache.cxf.service.ServiceModelVisitor.visitOperation( at org.apache.cxf.service.ServiceModelVisitor.walk( at org.apache.cxf.jaxb.JAXBDataBinding.initialize( at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings( at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL( at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel( at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create( at at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint( at org.apache.cxf.frontend.ClientFactoryBean.create( at org.apache.cxf.frontend.ClientProxyFactoryBean.create( at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create( at org.apache.cxf.jaxws.ServiceImpl.createPort( at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort( at org.apache.cxf.jaxws.ServiceImpl.getPort( at org.apache.cxf.jaxws.ServiceImpl.getPort( at [jboss-jaxws-api_2.2_spec-2.0.2.Final-redhat-1.jar:2.0.2.Final-redhat-1]

Accepted Solutions (0)

Answers (0)