users@jersey.java.net

[Jersey] Re: Glassfish startup error

From: Martin Matula <martin.matula_at_oracle.com>
Date: Fri, 11 Mar 2011 23:22:41 +0100

Since you are using NetBeans, you can simply switch to the Files tab,
browse to it, expand it and see the structure, see which files are in, etc.
Anyway, I think I know what happened. I see NetBeans has this feature
when you create a new RESTful resource through it, it asks you how you
want to register the RESTful app. In one of the options it generates
that ApplicationConfig class for you and annotates it with
ApplicationPath annotation, so that you don't have to register Jersey
servlet in web.xml.
Seems like you did this and later decided to register in web.xml. If so,
you should right-click on the RESTful Web Services node in the Projects
tab, and select REST Resource Configuration in the pop-up menu. That
allows you to change the way how you register your app. If you choose
the option in the middle, NetBeans will leave the registration fully up
to you. Then you can simply delete the generated ApplicationConfig
class, and if you registered the servlet in web.xml correctly, things
should start working.
Martin

On 11.3.2011 23:07, Arthur Yeo wrote:
> What's the easiest way to peek into the war file?
>
> On Fri, Mar 11, 2011 at 11:11 AM, Arthur Yeo <artyyeo_at_gmail.com
> <mailto:artyyeo_at_gmail.com>> wrote:
>
> Yes, I did do a {clean, build, deploy}.
> I am using NetBeans.
>
>
> On Fri, Mar 11, 2011 at 11:06 AM, Martin Matula
> <martin.matula_at_oracle.com <mailto:martin.matula_at_oracle.com>> wrote:
>
> Did you try cleaning the project before running it?
> Not sure what that generated source is. How did you create
> your application? Look at what your resulting war looks like.
> Martin
>
>
> On 11.3.2011 19:59, Arthur Yeo wrote:
>> I just checked and there are no "@ApplicationPath" anywhere
>> in my project src code.
>> And, yes, "resources" is defined in the web.xml file and it
>> has always been there.
>>
>> I do see this generated file
>> ..MyProject\build\generated-sources\rest\org\netbeans\rest\application\config\ApplicationConfig.java
>> that has "resources" defined in there.
>>
>> Do you think it has got to do with @Startup @Singleton bean
>> that is causing the issue?
>>
>> >Is it possible you have an application class annotated with
>> @ApplicationPath("/resources/") as well as a servlet mapped
>> to /resources/* defined in web.xml?
>> Martin
>>
>> On Fri, Mar 11, 2011 at 9:32 AM, Arthur Yeo
>> <artyyeo_at_gmail.com <mailto:artyyeo_at_gmail.com>> wrote:
>>
>> All,
>>
>> What does this error mean when it is appearing during
>> startup?
>>
>> SEVERE: Mapping conflict. A Servlet declaration exists
>> with same mapping as the Jersey servlet application,
>> named
>> org.netbeans.rest.application.config.ApplicationConfig,
>> at the servlet mapping, /resources/*. The Jersey servlet
>> is not deployed.
>>
>> --
>> Arthur Y.
>>
>>
>>
>>
>> --
>> Arthur Y.
>
>
>
>
> --
> Arthur Y.
>
>
>
>
> --
> Arthur Y.