Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 2
yada_deloitte
Level 2

Likes

5 likes

Total Posts

30 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
yada_deloitte
Level 2

Likes

5 likes

Total Posts

30 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
yada_deloitte
Level 2

10-05-2017

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(Utils.java:269) at org.apache.cxf.jaxb.JAXBContextInitializer.walkReferences(JAXBContextInitializer.java:374) at org.apache.cxf.jaxb.JAXBContextInitializer.addClass(JAXBContextInitializer.java:346) at org.apache.cxf.jaxb.JAXBContextInitializer.begin(JAXBContextInitializer.java:183) at org.apache.cxf.service.ServiceModelVisitor.visitOperation(ServiceModelVisitor.java:97) at org.apache.cxf.service.ServiceModelVisitor.walk(ServiceModelVisitor.java:74) at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:336) at org.apache.cxf.service.factory.AbstractServiceFactoryBean.initializeDataBindings(AbstractServiceFactoryBean.java:86) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:446) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:548) at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:265) at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:215) at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:102) at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91) at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:157) at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142) at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:478) at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:558) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:345) at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:336) at javax.xml.ws.Service.getPort(Service.java:99) [jboss-jaxws-api_2.2_spec-2.0.2.Final-redhat-1.jar:2.0.2.Final-redhat-1]

Accepted Solutions (0)

Answers (0)