Sorry. I have been meaning to try to produce a small reproducible test case but haven't had time. My theory is that if you took the generate-wadl sample project and merged it (in spirit, not a real SCM merge) with the spring-annotations example, that will reproduce this error.
The reason I think so is because the field that is being processed when the error occurs in my project is an Autowired private Spring component that should not be relevant to the WADL at all.
On May 5, 2011, at 2:48 AM, Pavel Bucek wrote:
> Hello Jason,
>
> could you please share more info about this? I would like to fix this in 1.7 release which is closing..
>
> Thanks,
> Pavel
>
> On 4/29/11 11:11 AM, Pavel Bucek wrote:
>> Looks like a bug.
>>
>> Can you share some simple testcase (and expected output)?
>>
>> Fix could be as simple as relacing that line with:
>>
>> final ParamDocType paramDoc = (m == null ? null : _resourceDoc.getParamDoc( r.getResourceClass(), m.getMethod(), p));
>>
>> but I'm not really sure whether it doesn't break something else..
>>
>> (1.7 will be out soon (~2 weeks), so you should be able to use that version if me manage to fix it soon enough)
>>
>> Thanks,
>> Pavel
>>
>> On 4/29/11 3:50 AM, Jason Erickson wrote:
>>> I recently tried to update from Jersey 1.4 to Jersey 1.5 (and 1.6) but my build started failing with the following stack trace:
>>> java.lang.NullPointerException
>>> at com.sun.jersey.server.wadl.generators.resourcedoc.WadlGeneratorResourceDocSupport.createParam(WadlGeneratorResourceDocSupport.java:324)
>>> at com.sun.jersey.server.wadl.WadlBuilder.generateParam(WadlBuilder.java:266)
>>> at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:300)
>>> at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:350)
>>> at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:350)
>>> at com.sun.jersey.server.wadl.WadlBuilder.generateResource(WadlBuilder.java:271)
>>> at com.sun.jersey.server.wadl.WadlBuilder.generate(WadlBuilder.java:107)
>>> at com.sun.jersey.wadl.GenerateWadlMojo.createApplication(GenerateWadlMojo.java:285)
>>> at com.sun.jersey.wadl.GenerateWadlMojo.executeWithClasspath(GenerateWadlMojo.java:146)
>>> at com.sun.jersey.wadl.AbstractMojoProjectClasspathSupport.execute(AbstractMojoProjectClasspathSupport.java:101)
>>> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>>> ... Some more to the stack trace, but just Maven stuff.
>>>
>>> I stepped into the code and I see that WadlGeneratorResourceDocSupport.createParam, line 324 does a m.getMethod(), but m is null because WadlBuilder.generateResource, line 300 passes null to WadlBuilder.generateParam. The problem is that it is trying to process a field (possibly erroneously because of an @Autowired annotation?), so of course, there is no method.
>>>
>>> Is there a fix or workaround for this (besides just passing on the generating of WADL)?
>>>
>>>
>>
>>
>