Skip to main content

is not found. Have you run APT to generate them?

8 replies [Last post]
najmi
Offline
Joined: 2003-06-17

I have run into what seems to be the following issue:

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6544369

My project is not using any "." character in any name AFAIK.

However, my webapp is being run from its source directory using
maven-jetty6-plugin and this common use case has caused problems with
JAXWS RI elsewhere. For example, I ran into another known issue:

https://jax-ws.dev.java.net/issues/show_bug.cgi?id=309

which was also simply because of existence of .svn directory in the wsdlDirectory and just like this current issue, it gave a rather misleading error message.

I am wondering if anyone has any experience on what other reasons there would be to hit this issue and how can I avoid it. Thanks for your help.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
najmi
Offline
Joined: 2003-06-17

So I finally got my web service deployed and started correctly. Thanks Vivek!

The docs misled me to believe that wsgen is only for Java-First web service. So I ended up using wsgen in my jaxws-maven-plugin. At first I got a ClassNotFoundException AnnotationProcessorFactory. After some puttering around I realized it was in the JDK tools.jar and after including it I was able to get the problem to go away. This sounds like a potential bug since it should automatically be a dependency of the jaxws-maven-plugin.

So now I have a separate new problem when I invoke my service method. I will post a separate thread on it but the stack trace is as follows:

java.lang.NullPointerException
at com.sun.xml.stream.writers.XMLStreamWriterImpl.getProperty(XMLStreamWriterImpl.java:440)
at com.sun.xml.ws.util.xml.XMLStreamWriterFilter.getProperty(XMLStreamWriterFilter.java:139)
at com.sun.xml.ws.streaming.XMLStreamWriterUtil.getOutputStream(XMLStreamWriterUtil.java:77)
at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.java:308)
at com.sun.xml.ws.message.AbstractMessageImpl.writeTo(AbstractMessageImpl.java:142)
at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:158)
at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:265)
at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:320)
at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:93)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:454)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:767)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:423)

najmi
Offline
Joined: 2003-06-17

I have created a reproducable simple test case as a sample in the hyperjaxb3 project at java.net. Here are the instructions to reproduce the problem:

1. Checkout and build HyperJAXB3 following instructions at:
http://wiki.glassfish.java.net/gfwiki/Wiki.jsp?page=Hyperjaxb3Install

2. Change to directory containing sample project that reproduces bug:
cd .../hyperjaxb3/samples/po-ws

3. Build sample project cleanly
mvn clean
mvn install

4. Run sample project in jetty6 using
mvn jetty6:run

You will get the following:

Jun 5, 2007 1:33:16 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
INFO: WSSERVLET12: JAX-WS context listener initializing
Jun 5, 2007 1:33:16 PM com.sun.xml.ws.transport.http.servlet.WSServletContextListener contextInitialized
SEVERE: WSSERVLET11: failed to parse runtime descriptor: runtime modeler error: Wrapper class org.jvnet.hyperjaxb3.samples.pows.server.jaxws.Query is not found. Have you run APT to generate them?
com.sun.xml.ws.model.RuntimeModelerException: runtime modeler error: Wrapper class org.jvnet.hyperjaxb3.samples.pows.server.jaxws.Query is not found. Have you run APT to generate them?
at com.sun.xml.ws.model.RuntimeModeler.getClass(RuntimeModeler.java:270)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:581)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:528)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:355)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:241)
at com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:322)
at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:188)
at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parseAdapters(DeploymentDescriptorParser.java:253)
at com.sun.xml.ws.transport.http.DeploymentDescriptorParser.parse(DeploymentDescriptorParser.java:147)
at com.sun.xml.ws.transport.http.servlet.WSServletContextListener.contextInitialized(WSServletContextListener.java:108)

Note that there is no type named Order in my project. However, there is a method on my Web Service interface by that name. Does that info help?

Please contact me any time if you have any questions by email at farrukh@wellfleetsoftware.com . Kohsuke also has my phone and IM handles if you need.

Thanks for your help on this showstopping issue for my project.

najmi
Offline
Joined: 2003-06-17

>
> Note that there is no type named Order in my project.
> However, there is a method on my Web Service
> interface by that name. Does that info help?

Oops I meant that there is no type name Query in my project.
However, there is a method on my Web Service
interface by that name. Does that info help?

Thanks.

mahmutuludag
Offline
Joined: 2007-05-11

The error message seems to be genuine. As far as I know jaxws use document/literal-wrapped style by default so you should expect a jaxws type generated for the methods in your interface. I'm new to jaxws but found netbeans en excellent tool to also learn jaxws. For example after following a netbeans jaxws tutorial you can switch to 'Files' view and can see all the generated files easily that help quite a lot to understand what you are doing.

HTH

vivekp
Offline
Joined: 2003-06-10

Yes, by default JAXWS use wrapper style. this means given the operation

publich String echo(String arg0, String arg1);

JAXWS will expect a wrapper bean that corresponds to schema:




You need to run apt or wsgen ant[1] or maven[2] to generate the wrapper classes if you prefer the wrapper style. Other option you have is to switch to BARE mode by putting this annotation on your endpoint impl:

@SOAPBinding(parameterStyle=ParameterStyle.BARE)

-vivek.
[1]https://jax-ws.dev.java.net/nonav/2.1.1/docs/wsimportant.html
[2]https://jax-ws-commons.dev.java.net/jaxws-maven-plugin/

najmi
Offline
Joined: 2003-06-17

Hi Vivek,

Thanks very much for your help. I am still confused though.

> Yes, by default JAXWS use wrapper style. this means
> given the operation
>
> publich String echo(String arg0, String arg1);

I am using a document / literal style WSDL interface as my source and have never used an rpc style web service. Would it be possible to help me based on WSDL-first doc/literal example? I do not believe JAXWS RI comes with such an example. IMHO, This is unfortunate as many people use WSDL-first doc/literal for implementing web services today.

>
> JAXWS will expect a wrapper bean that corresponds to
> schema:
>
>
>
>
>
>
> You need to run apt or wsgen ant[1] or maven[2] to
> generate the wrapper classes if you prefer the
> wrapper style. Other option you have is to switch to
> BARE mode by putting this annotation on your endpoint
> impl:

Can you please point me to where WRAPPER vs. BARE mode is described.
At this point I don't even know what they mean and how they are different and which one fits my needs best.

I have found no document that tells me what I need to do for a WSDL-first doc/literal use case. wsgen according to docs is only relevant if I am starting with an impl Java class for my service (I am starting from WSDL). Am I wrong here? Also, I am not quite getting what apt does exactly.

I know your time is tight so I would be happy if you can just point me in the right direction based upon WSDL-first, doc/literal use case. Thanks very much.

>
> @SOAPBinding(parameterStyle=ParameterStyle.BARE)
>
>
> -vivek.
> [1]https://jax-ws.dev.java.net/nonav/2.1.1/docs/wsimpo
> rtant.html
> [2]https://jax-ws-commons.dev.java.net/jaxws-maven-plu
> gin/

najmi
Offline
Joined: 2003-06-17

Based on reading 3.6.2.2 of jaxws 2.0 pfd spec it appears I cannot use BARE mode because I have 1 in non-header param as well as 1 return non-header param. Thus it is my understanding that I need to use WRAPPED mode and for that I am required to run apt. Please confirm.

I am wondering why wsimport generates WRAPPED mode SEI by default but does not automatically run apt by default to be consistent. It would be nice to have that option. Just a thought.

Thanks again for your help.

mahmutuludag
Offline
Joined: 2007-05-11

I think both wsimport and wsgen use apt (I mean the annotation processing libraries). It seems the error message is not the best possible error message for that error...

Wait a better response from Vivek or other JAXWS experts.