RESTful jersey 404 not found
<p>I am developing a ws with jersey and Tomcat8, the problem is that @path are not being processed, therefore the resultant URL is not working properly.</p>

<p><strong>Packages and classes description:</strong></p>

<p><em>eu.datex and eu.datex2 packages</em> contain java classes with xml annotations for JAXB.  </p>

<p><em>Transformer class</em> converts xml data to java, this java classes are processed and saved in new datex2 object that will be returned ass http get in order to response with an XML.</p>

<p><em>URL that does not work</em> localhost:8090/org.CTAG.DATEX2REST/rest/datex</p>

<p>Here I show you my mvn project structure and some important files.</p>

<p><strong>mvn structure:</strong></p>

<p><a href="https://i.stack.imgur.com/3nzdc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3nzdc.png" alt="enter image description here"></a></p>

<p><strong>This is ResourceConfig class:</strong></p>

<pre><code>package com.CTAG.application;
import javax.ws.rs.ApplicationPath;
import org.glassfish.jersey.server.ResourceConfig;


@ApplicationPath("/rest")
public class MyApplication extends ResourceConfig {

    public MyApplication() {
        packages("com.CTAG.rest;");
    }

}
</code></pre>

<p><strong>web.xml:</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"&gt;
  &lt;display-name&gt;org.CTAG.DATEX2REST&lt;/display-name&gt;
  &lt;welcome-file-list&gt;
    &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
    &lt;welcome-file&gt;index.htm&lt;/welcome-file&gt;
    &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.html&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.htm&lt;/welcome-file&gt;
    &lt;welcome-file&gt;default.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;

  &lt;display-name&gt;CTAG DATEX2&lt;/display-name&gt;

    &lt;listener&gt;
        &lt;listener-class&gt;
            com.CTAG.application.Init
        &lt;/listener-class&gt;
    &lt;/listener&gt;
&lt;/web-app&gt;
</code></pre>

<p>This class initializes the conversion from a xml data(from server GET) to Java classes with JAXB:</p>

<pre><code>public class Init implements ServletContextListener {

    @Override
    public void contextDestroyed(ServletContextEvent arg0) {
        System.out.println("ServletContextListener destroyed");
    }
    @Override
    public void contextInitialized(ServletContextEvent arg0) {
        System.out.println("----INITIALIZED----");
        try {
            Map&lt;SituationRecord, Integer&gt; map = new HashMap&lt;&gt;();

                URL url = new URL(" http://infocar.dgt.es/datex2/dgt/SituationPublication/all/content.xml");
                Map&lt;SituationRecord, Integer&gt; copia = map;
                map = Traslator.traslator(copia, url);
                System.out.println("----DATEX now available----");

                // Preubassleep(30000);

        } catch (TransformerConfigurationException | JAXBException | ParserConfigurationException | IOException e) {

            e.printStackTrace();
        }
    }
}
</code></pre>

<p><strong>Resource class(DataExchange)</strong>, this has to returned a java class that will be converted to XML:</p>

<pre><code>package com.CTAG.rest;


@Path("/datex")
@Produces(MediaType.APPLICATION_XML)
public class DataExchange {

    private D2LogicalModel datex2 = Traslator.d2;

    @GET
    @Produces(MediaType.APPLICATION_XML)
    public Response getDatex() {

        return Response.ok(this.datex2).build();
    }

    @GET
    @Path("/{road}")
    public Response getDatexByRoad(@PathParam("road") String roadName){

        SituationPublication payLoad = (SituationPublication)this.datex2.getPayloadPublication();
        FilterByRoad filter = new FilterByRoad(payLoad.getSituation());
        List&lt;Situation&gt; filteredList = new LinkedList&lt;&gt;();
        filteredList.addAll(filter.filterByRoad(roadName));
        payLoad.setSituation(filteredList);
        this.datex2.setPayloadPublication(payLoad);

        return Response.ok(this.datex2).build();
    }
</code></pre>