Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7017891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:58:22+00:00 2026-05-27T22:58:22+00:00

This is a long shot, but I’m trying to write a web service client

  • 0

This is a long shot, but I’m trying to write a web service client with Spring-WS. I’m getting a NullPointerException with the following code:

public class WebServiceProcess {
    private WebServiceTemplate webServiceTemplate = new WebServiceTemplate();
    private CommonsHttpMessageSender messageSender = new CommonsHttpMessageSender();
    private SaajSoapMessageFactory messageFactory = new SaajSoapMessageFactory();
    private Jaxb2Marshaller marshaller = new Jaxb2Marshaller();

    private void init() {
        Resource schema = new ClassPathResource("/WEB-INF/mySchema.xsd");
        marshaller.setSchema(schema);
        marshaller.setContextPaths("list of packages with JAXB classes...");
        webServiceTemplate.setMarshaller(marshaller);
        webServiceTemplate.setUnmarshaller(marshaller);
        webServiceTemplate.setMessageSender(messageSender);
    }

    public TestResponse sendRequest(TestRequest request) {
        init();
        return response = (TestResponse) webServiceTemplate.marshalSendAndReceive("myEndpointURI", request);
    }
}

Stack trace:

Exception in thread "main" java.lang.NullPointerException
    at com.ibm.ws.webservices.engine.utils.WebServicesParserFactory.setNamespaceAware(WebServicesParserFactory.java:160)
    at com.ibm.ws.webservices.engine.utils.XMLUtils.initSAXFactory(XMLUtils.java:437)
    at com.ibm.ws.webservices.engine.utils.XMLUtils.getSAXParser(XMLUtils.java:490)
    at com.ibm.ws.webservices.engine.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:293)
    at com.ibm.ws.webservices.engine.SOAPPart._getSOAPEnvelope(SOAPPart.java:1064)
    at com.ibm.ws.webservices.engine.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:628)
    at com.ibm.ws.webservices.engine.SOAPPart.getEnvelope(SOAPPart.java:656)
    at org.springframework.ws.soap.saaj.support.SaajUtils.getSaajVersion(SaajUtils.java:155)
    at org.springframework.ws.soap.saaj.SaajSoapMessage.getSaajVersion(SaajSoapMessage.java:257)
    at org.springframework.ws.soap.saaj.SaajSoapMessage.getImplementation(SaajSoapMessage.java:342)
    at org.springframework.ws.soap.saaj.SaajSoapMessage.<init>(SaajSoapMessage.java:117)
    at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:184)
    at org.springframework.ws.soap.saaj.SaajSoapMessageFactory.createWebServiceMessage(SaajSoapMessageFactory.java:58)
    at org.springframework.ws.transport.AbstractWebServiceConnection.receive(AbstractWebServiceConnection.java:90)
    at org.springframework.ws.client.core.WebServiceTemplate.doSendAndReceive(WebServiceTemplate.java:548)
    at org.springframework.ws.client.core.WebServiceTemplate.sendAndReceive(WebServiceTemplate.java:496)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:343)
    at org.springframework.ws.client.core.WebServiceTemplate.marshalSendAndReceive(WebServiceTemplate.java:333)
    at com.lmig.processing.WebServiceProcess.sendRequest(WebServiceProcess.java:66)
    at com.lmig.processing.TestProcess.main(MainProcess.java:57)

Any help would be appreciated…. I know I don’t have a lot to go on. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:58:23+00:00Added an answer on May 27, 2026 at 10:58 pm

    Solved it. I had the wrong WebSphere jar on my classpath. I had com.ibm.ws.admin.client_7.0.0.jar rather than com.ibm.ws.webservices.thinclient_7.0.0.jar.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is a long shot but is there any way of getting
This is probably a long shot, but I'm trying to minimize the repition in
I know this is a long-shot, but since I need this code to work,
This is probably a long shot but I asked a question about converting one
This looks like a long shot, but does anyone know of a way to:
It might be a long shot posting this question here but we will see.
I know this might be a long shot, but here it goes. I have
Okay, so this is a long long shot but here it goes... When IE
I know this is a long shot, but does anyone know of a dataset
This might be a long shot, but I'm having a bug that I'm fairly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.