Hi Jerry,
I have not tested on Weblogic. Jersey's class scanning technique may
not be portable across different app servers. But you are using the
right scanning technique, package scanning, as this is more portable
than class file scanning. As Imran says, please check the log to see
if your resource classes are getting found.
>
> I am trying to stand up Jersey in a Weblogic Portal project and
> have deployed
> a simple service with a GET method:
>
> <servlet>
> <servlet-name>Jersey REST Servlet</servlet-name>
> <servlet-class>
> com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
> <init-param>
>
> <param-name>com.sun.jersey.config.property.resourceConfigClass</
> param-name>
>
>
> <param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-
> value>
> </init-param>
BTW it is no longer necessary to declare the above param-name/value.
> <init-param>
> <param-name>com.sun.jersey.config.property.packages</param-
> name>
> <param-value>com.capitalone.ccl.service.rest.impl</param-
> value>
> </init-param>
> <load-on-startup>1</load-on-startup>
> </servlet>
> <servlet-mapping>
> <servlet-name> Jersey REST Servlet </servlet-name>
> <url-pattern>/rest/*</url-pattern>
> </servlet-mapping>
>
> The service:
>
> @Path("/helloworld")
> public class ConfirmOffersRestService extends AbstractRestService
> implements Service<ConfirmOffersRestRequest,
> ConfirmOffersRestResponse>{
>
> @GET
> @Produces("text/html")
> public String hello(){
> return "Hello world";
> }
>
>
>
>
> All I am trying to do is hit the service from a browser to see the
> response.
> I want to test it before writing a bunch of client code. I go into the
> browser and use the ".../rest/helloworld" address.
>
> All I get is "Invalid command: [/helloworld] -- Check syntax"
>
Did you verify if the hello method is getting called? e.g. debug or
put some print statements in the hello method.
Odd error, if Jersey finds the resource class
ConfirmOffersRestService is there any other information in the logs?
For example a stack trace when instantiating the class?
Nowhere in Jersey is there code to return an invalid command with the
servlet path. A wild guess: i wonder if the app server is checking if
the returned content and media type and saying that the content is
not valid text/html ?
Paul.
>
> What am I missing? Is the browser not generating a GET request to the
> resource?
>
> Thanks for any help...
> jerry..
> --
> View this message in context: http://n2.nabble.com/Testing-GET-
> resources-in-a-browser-tp785201p785201.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>