[jax-rs-spec users] Adopt-a-JSR

From: Mohamed Taman <>
Date: Sat, 5 Jan 2013 01:16:38 +0200

JAX-RS application Failed to load and run, when using jersey Application
servlet class defined inside the web.xml (v3).

                 Key: JAX_RS_SPEC-330
             Project: jax-rs-spec
          Issue Type: Bug
          Components: model api, server
    Affects Versions: 2.0-pr
         Environment: Windows 7 Professional SP1.
GlassFish 4_b69
            Reporter: Mohamed Taman
            Priority: Blocker

When I was testing the *section 2.3.2 Servlet* for the first part which

• If no Application subclass is present, JAX-RS implementations are
REQUIRED to dynamically add a servlet and set its name to

and to automatically discover all root resource classes and providers which
MUST be packaged with the application. Additionally, the application MUST
be packaged with a web.xml that specifies a servlet mapping for the added
servlet. An example of such a web.xml file is:

1 <web-app version="3.0" xmlns=""
2 xmlns:xsi=""
3 xsi:schemaLocation="
5 <servlet>
6 <servlet-name></servlet-name>
7 </servlet>
8 <servlet-mapping>
9 <servlet-name></servlet-name>
10 <url-pattern>/myresources/*</url-pattern>
11 </servlet-mapping>
12 </web-app>

The following JAX-RS2 app bellow was failed to be registered and run by the
*Glassfish v4_b69*, while it runs on *Glassfish*, by raising the
following info message _"[failed to localize],
[])|#]"_ which it should be *error* not *info* message also.

{color:red}+Full error:+{color}

1357338577121;_LevelValue=800;|{color:red}[failed to localize], [])|#]{color}

application [JAX-RS_v2.0_Test] at [/rs2/test]|#]

Application Details:


<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns=""

+Resource Class:+



 * Created with IntelliJ IDEA.
 * User: mohamed_taman
 * Date: 1/4/13
 * Time: 11:44 PM
 * This class intended to test that there is no application sub class
exists and the jax-rs 2 implementation should serve this
 * resource, by adding in the web.xml the Application class and its servlet

public class GreeterResource {

    public String greeting(){
        return "Hello world";

Thanks & Best Regards

“*I**mprove your **Life** through Science and **Art**…”*

Mohamed Mahmoud Taman

*Business **Solutions,*

*Systems Architect & Design Supervisor*

*Java Team Leader*

|Oracle Egypt Architects Club board member

| JavaOne & EG-JDC Speaker


e-finance,BLDG17, Smart Village,

KM 28 Cairo-Alex Desert Road,

Ground Floor, Giza, Egypt
*Postal Code :* 12577

( : +(202) 3827 1422

(: +(202) 3827 1499

(: +(202) 3827 1599

È: +(201) 00531 8017

*P** **Before you print Think about Your ENVIRONMENTAL responsibility.***