Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Glassfish 3, REST 1.0,  RSS feed

 
Sergei Zhylinski
Ranch Hand
Posts: 89
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to everyone,

Could someone please help with the issue. I would like to get acquainted with REST in different application servers. At the moment I'm deploying a simple REST application on Glassfish 3.1.2.

As per section 2.3.2 JSR 311, JAX-RS, Java API for RESTful Web Services 1.0: ""When using a JAX-RS aware servlet container, the 'servlet-class' element of the 'web.xml' descriptor SHOULD name the application supplied subclass of 'Application'. <...> When using a non-JAX-RS aware servlet container, the 'servlet-class' element of the 'web.xml' descriptor SHOULD name the JAX-RS implementation-supplied Servlet class. The application-supplied subclass of 'Application' is identified using an 'init-param' with a 'param-name' of 'javax.ws.rs.Application'."

I assume that Glassfish 3 is JAX-RS aware servlet container and try do the following.

My web.xml descriptor:



Class 'com.sze.EchoApplication':



The only 'com.sze.Echo' resource:



But when I send the request like 'http://127.0.0.1:8080/testprj/services/echo?input=some_input' II'm always receiving the error:



The code above does is executed successfuly on JBoss EAP 6/Wildfly.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!