users@glassfish.java.net

Re: GF v3.1 not reading JAX-RS Application class

From: CasMeiron <casmeiron_at_gmail.com>
Date: Thu, 2 Sep 2010 09:11:53 -0300

Ok, I've created a test case using maven (attached).
The project only have 2 classes: ApplicationConfig and a TestResource. When
you try to deploy the app on glassfish v3.1 (September 2nd build) you gonna
get:

INFO: No timers to be deleted for id: 84110750714757120
INFO: PersistenceStrategyBuilderFactory>>createPersistenceStrategyBuilder:
CandidateBuilderClassName = class
com.sun.enterprise.web.MemoryStrategyBuilder
INFO: WEB0671: Loading application [javaee6-jaxws] at [/javaee6-jaxws]
*WARNING: Unable to get Application config for: javaee6-jaxws*
INFO: PersistenceStrategyBuilderFactory>>createPersistenceStrategyBuilder:
CandidateBuilderClassName = class
com.sun.enterprise.web.MemoryStrategyBuilder

INFO: WEB0671: Loading application [javaee6-jaxws] at [/javaee6-jaxws]
INFO: loading.application.time
INFO: javaee6-jaxws was successfully deployed in 833 milliseconds.

Can't see the reason why the application config failed.

Thanks for any help.
-------------------------------
Paulo Reis




On Thu, Sep 2, 2010 at 8:39 AM, CasMeiron <casmeiron_at_gmail.com> wrote:

> Hi,
>
> Thanks for the info, i was using the 2.5 version by mistake.
>
> I've changed to 3.0 and guess what, nothing changed, i still can't access
> the resources.
>
> I'm using the september 1st version, gonna try today with the new build and
> let you know. With this version, i'm getting a bunch of weird warning
> messages like:
>
> WARNING: WEB9052: Unable to load class login, reason:
> java.lang.ClassNotFoundException: login
> WARNING: WEB9052: Unable to load class getPortedNumber, reason:
> java.lang.ClassNotFoundException: getPortedNumber
> WARNING: WEB9052: Unable to load class getPortedNumber, reason:
> java.lang.ClassNotFoundException: getPortedNumber
> WARNING: WEB9052: Unable to load class login, reason:
> java.lang.ClassNotFoundException: login
> WARNING: WEB9052: Unable to load class isPorted, reason:
> java.lang.ClassNotFoundException: isPorted
> WARNING: WEB9052: Unable to load class isPorted, reason:
> java.lang.ClassNotFoundException: isPorted
> WARNING: WEB9052: Unable to load class getPortedNumber, reason:
> java.lang.ClassNotFoundException: getPortedNumber
> WARNING: WEB9052: Unable to load class getPortedNumber, reason:
> java.lang.ClassNotFoundException: getPortedNumber
> WARNING: WEB9052: Unable to load class isPorted, reason:
> java.lang.ClassNotFoundException: isPorted
> WARNING: WEB9052: Unable to load class isPorted, reason:
> java.lang.ClassNotFoundException: isPorted
>
> WARNING: WEB0517: Unable to restore sessions for web module [/nprd-gui]
> from previous deployment
> java.lang.ClassCastException: cannot assign instance of
> org.jboss.weld.bean.proxy.util.SerializableProxy to field
> org.jboss.weld.conversation.AbstractConversationManager.conversation of type
> org.jboss.weld.conversation.ConversationImpl in instance of
> org.jboss.weld.conversation.ServletConversationManager
> at
> java.io.ObjectStreamClass$FieldReflector.setObjFieldValues(ObjectStreamClass.java:2032)
> at java.io.ObjectStreamClass.setObjFieldValues(ObjectStreamClass.java:1212)
>
> Maybe this is the root problem but it's seems a glassfish error because the
> related "ClassNotFoundException" messages are not Class but methods.
>
> Thanks in advance.
> -------------------------------
> Paulo Reis
>
>
>
>
>
> On Wed, Sep 1, 2010 at 6:40 PM, Ludovic Champenois <
> ludovic.champenois_at_oracle.com> wrote:
>
>> On 9/1/10 9:19 AM, CasMeiron wrote:
>>
>> Hi guys,
>>
>> I'm tryin' a simple test case for JAX-RS, without using web.xml (I have
>> it but nothing on it).
>>
>>
>> Nothing is something..., especially the version!!!
>> Is it a Web.xml 3.0 or older? If older, I am not sure it would work.
>> Check for web-app_3_0
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <web-app xmlns="http://java.sun.com/xml/ns/javaee"<http://java.sun.com/xml/ns/javaee>
>>
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<http://www.w3.org/2001/XMLSchema-instance>
>> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
>> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"<http://java.sun.com/xml/ns/javaeehttp://java.sun.com/xml/ns/javaee/web-app_3_0.xsd>
>> version="3.0">
>> </web-app>
>>
>> Or delete it entirely...
>> Ludo
>>
>>
>> I've created the follow class:
>>
>> import javax.ws.rs.ApplicationPath;
>> import javax.ws.rs.core.Application;
>>
>> @ApplicationPath(RestApplicationConfig.REST_APPLICATION_PATH)
>> public class RestApplicationConfig extends Application {
>> public static final String REST_APPLICATION_PATH = "rest";
>> }
>>
>> And then I've created the follow resource:
>>
>> @Path("/hello")
>> @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
>> @Consumes({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
>> @Stateless
>> public class TestResource {
>> @GET
>> public String hello( ) {
>> return "hello world!";
>> }
>>
>> }
>>
>> I can deploy the war with no problems but it seems that the rest context
>> is not created, I always get:
>>
>> HTTP Status 404 -
>> ------------------------------
>>
>> *type* Status report
>>
>> *message*
>>
>> *description*The requested resource () is not available.
>> Any thoughts? I think this should work.
>>
>> Thanks in advance.
>>
>> -------------------------------
>> Paulo Reis
>>
>>
>>
>>
>>
>