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

  • Home
  • SEARCH
  • 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 7681331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T18:19:04+00:00 2026-05-31T18:19:04+00:00

I am creating a web service for work. I am breaking it down into

  • 0

I am creating a web service for work. I am breaking it down into 3 separate Maven projects:

  • SOA (stores the request and response objects used in web methods)
  • Services (this stores the classes that actually do the processing of the data)
  • WebServices (This stores the endpoint interface and generated jaxws folder)

In the SOA project, I have a simple POJO that is used to pass in the needed values to the web method

public class RequestObject {
    private String firstName = null;
    private String lastName = null;

    // Setters and Getters below...
}

Then I try to reference this class in the WebServices project. I include the SOA generated JAR as a dependency in Maven. This does work and pulls in the files correctly.

Interface:

@WebService
public interface WebServiceInf {
    @WebMethod
    @WebResult(name="WebMethodResult")
    String createSomething(@WebParam(name="requestObject")RequestObject request);
}

Web Service:

import com.mine.data.RequestObject;

@WebServiceInterface(endpointInterface="com.mine.WebServiceInf")
public class WebServiceImpl implements WebServiceInf {
    @Override
    public String createSomething(RequestObject request) {
        return "I was created!";
    }
}

The issue I am running into is when I use the wsgen tool. It works fine if I place the RequestObject inside the WebService project. But, once I placed that class into the SOA project, it throws the following error:

Problem encountered during annotation processing; see stacktrace below for more information. java.lang.NullPointerException
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLegalType(WebServiceVisitor.java:770)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLegalParameter(WebServiceVisitor.java:670)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLegalMethod(WebServiceVisitor.java:637)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.methodsAreLegal(WebServiceVisitor.java:575)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.isLegalSEI(WebServiceVisitor.java:567)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.shouldProcessWebService(WebServiceVisitor.java:300)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.visitInterfaceDeclaration(WebServiceVisitor.java:94)
        at com.sun.tools.apt.mirror.declaration.InterfaceDeclarationImpl.accept(InterfaceDeclarationImpl.java:32)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.inspectEndpointInterface(WebServiceVisitor.java:395)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceVisitor.visitClassDeclaration(WebServiceVisitor.java:128)
        at com.sun.tools.apt.mirror.declaration.ClassDeclarationImpl.accept(ClassDeclarationImpl.java:95)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.buildModel(WebServiceAP.java:315)
        at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.process(WebServiceAP.java:256)
        at com.sun.mirror.apt.AnnotationProcessors$CompositeAnnotationProcessor.process(AnnotationProcessors.java:60)
        at com.sun.tools.apt.comp.Apt.main(Apt.java:454)
        at com.sun.tools.apt.main.JavaCompiler.compile(JavaCompiler.java:258)
        at com.sun.tools.apt.main.Main.compile(Main.java:1102)
        at com.sun.tools.apt.main.Main.compile(Main.java:964)
        at com.sun.tools.apt.Main.processing(Main.java:95)
        at com.sun.tools.apt.Main.process(Main.java:85)
        at com.sun.tools.apt.Main.process(Main.java:67)
        at com.sun.tools.internal.ws.wscompile.WsgenTool.buildModel(WsgenTool.java:204)
        at com.sun.tools.internal.ws.wscompile.WsgenTool.run(WsgenTool.java:112)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:105)
        at com.sun.tools.internal.ws.WsGen.main(WsGen.java:41) error: compilation failed, errors should have been reported

So this looks like I need a certain annotation to tell the WebService project that the RequestObject is in another project/JAR.

What annotation would I use to do this? Thank you so very much for the help!

UPDATE

This is how I am calling the wsgen. I am executing this command from the WebServices root folder

wsgen -keep -cp target/classes/ -s src/main/java -d target/classes/ com.mine.WebServiceImpl
  • 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-31T18:19:05+00:00Added an answer on May 31, 2026 at 6:19 pm

    Your classpath is pointing at target/classes. Maven will put all compiled classes for the current module in that folder. That explains why wsgen only finds the class when it is in the local module. There is a jax-ws maven plugin that will setup the classpath for you. This would be the easiest approach in my mind. Essentially what you want is…

    wsgen -keep -cp target/classes:dependency1.jar:dependency2.jar:etc. -s src/main/java -d target/classes com.mine.WebServiceImpl
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Actually, i have started work on creating a web service in Python and C#(.NET
I am creating a web service to allow application developers (A.K.A. My friends) to
I am creating an XML web service that passes an array of custom types.
I'm creating mail sender web service. Every 10 second 1 mail sent. My total
thanks for any assistance. I'm creating a wcf web service for an external client.
I am creating a very simple web service and I don't want to bother
I am creating an application which involves so many web-service calls. I am using
I am creating an application in which I want to access a web service
I have an irritating problem, I'm creating an asp.net web service; this service should
I'm creating REST service using ASP.NET Web API. How can I return 401 status

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.