Java servlet 404 error tomcat 8 but not tomcat 6Apache Tomcat Servlet 404 TroubleshootingTomcat 6.0 service does not start: java/lang/NoClassDefFoundErrorSetting Environment Variable for Tomcat 6 Servletcan't start tomcat on vps - java VM error “could not reserve enough space for object heap”Cannot shutdown Tomcat - transport Errordeploying application on tomcat server status is ok but hitting the url throws 404 not foundMemory-consuming servlet crashes TomcatTomcat startup script on RHEL not starting tomcat on rebootTomcat 8.5 can't load @WebServlet annotationsCannot get SSL working on Tomcat8.5

What's the correct term for a waitress in the Middle Ages?

How is it possible that Gollum speaks Westron?

About the expansion of seq_set_split

What can plausibly explain many of my very long and low-tech bridges?

How did students remember what to practise between lessons without any sheet music?

SF novella separating the dumb majority from the intelligent part of mankind

How do I write "Show, Don't Tell" as a person with Asperger Syndrome?

Average spam confidence

After the loss of Challenger, why weren’t Galileo and Ulysses launched by Centaurs on expendable boosters?

Did Darth Vader wear the same suit for 20+ years?

Smooth switching between 12v batteries, with toggle switch

Translating 'Liber'

Company did not petition for visa in a timely manner. Is asking me to work from overseas, but wants me to take a paycut

Russian equivalent of the French expression "broyer du noir"

How many pairs of subsets can be formed?

How can drunken, homicidal elves successfully conduct a wild hunt?

Question about JavaScript Math.random() and basic logic

What risks are there when you clear your cookies instead of logging off?

Last survivors from different time periods living together

Can a user sell my software (MIT license) without modification?

Approximate solutions to non polynomial equations

What happened to all the nuclear material being smuggled after the fall of the USSR?

Random Portfolios vs Efficient Frontier

PL/SQL function to receive a number and return its binary format



Java servlet 404 error tomcat 8 but not tomcat 6


Apache Tomcat Servlet 404 TroubleshootingTomcat 6.0 service does not start: java/lang/NoClassDefFoundErrorSetting Environment Variable for Tomcat 6 Servletcan't start tomcat on vps - java VM error “could not reserve enough space for object heap”Cannot shutdown Tomcat - transport Errordeploying application on tomcat server status is ok but hitting the url throws 404 not foundMemory-consuming servlet crashes TomcatTomcat startup script on RHEL not starting tomcat on rebootTomcat 8.5 can't load @WebServlet annotationsCannot get SSL working on Tomcat8.5






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I have a server which I flip back and forth between tomcat 6 and tomcat 8. When I do an HTTP post using the command



curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


I get different results between the different versions of tomcat.



First of all, for tomcat 8, I get:



* About to connect() to localhost port 8080 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8080 (#0)
> POST /fortive2/tsmService HTTP/1.1
> User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Referrer:mobileWMS,LLC
> Content-Type:text/xml
> Content-Length: 218
>
< HTTP/1.1 404
< Content-Length: 0
< Date: Mon, 20 May 2019 16:17:36 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0


Then, for tomcat 6, I get the proper response, no 404 error. What is happening? This is literally the same server, the same WAR file. My servlets are defined in the main tomcat web.xml ( $CATALINA_HOME/conf/web.xml ), NOT in the war file. This is on purpose, as it lets me quickly add web service URLs for new customers without changing the war file.



Also, I will say that multiple web applications reference the same war file ( multiple customers, so multiple websites with slight different configutations but the same UI ). This has always worked just fine for servlets in tomcat 6, so I just assumed this would keep working for Tomcat 8. Could this be causing a problem?



Also, as a side point, I can access port 8080 just fine in the browser, because that is how I sometimes get to the website or the tomcat manager ( when SSL is giving me problems with certificates ). So it is not the port.



Also, as added information, I have this for ONE of my servlets ( not the one I am using, a totally different servlet ):



@WebServlet(urlPatterns = "/*", name = "WmsServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = WmsUI.class, productionMode = false)
@SuppressWarnings("serial")
public class WmsServlet extends VaadinServlet

@Override
protected final void servletInitialized() throws ServletException
super.servletInitialized();
getService().addSessionInitListener(new WmsSessionInitListener());




And here are some example $CATALINA_HOME/conf/web.xml servlet configurations:



 <servlet>
<servlet-name>veeder-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>VEEDER-WS</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>spence-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>SPENCE-WS</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>veeder-ws</servlet-name>
<url-pattern>/veeder-ws/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>spence-ws</servlet-name>
<url-pattern>/spence-ws/tsmService</url-pattern>
</servlet-mapping>


5/21/2019 update: using Servlet Context listener, I get the following for my development server:



[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST; Mappings: /NEWCUST-WebsiteXML
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: default; Mappings: /
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WmsServlet; Mappings: /*
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: FortivePFC; Mappings: /Fortive-PFC
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive3; Mappings: /fortive3/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: jsp; Mappings: *.jspx, *.jsp
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive2; Mappings: /fortive2/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST2; Mappings: /NEWCUST2-WebsiteXML


And the servlet sections of global web.xml ( so $CATALINA_HOME/conf/web.xml ) for my dev machine, where the above logging was printed:



<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">

<!-- snipped unrelated config -->

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<!-- ================ Built In Servlet Mappings ========================= -->


<!-- The servlet mappings for the built in servlets defined above. Note -->
<!-- that, by default, the CGI and SSI servlets are *not* mapped. You -->
<!-- must uncomment these mappings (or add them to your application's own -->
<!-- web.xml deployment descriptor) to enable these services -->

<!-- The mapping for the default servlet -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

<!-- The mappings for the JSP servlet -->
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

<!-- snipped unrelated config -->

<!-- ==================== Custom WMS servlet setup ===================== -->
<servlet>
<servlet-name>FortivePFC</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive_PFC</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive2</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive3</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive3</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST2</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>FortivePFC</servlet-name>
<url-pattern>/Fortive-PFC</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive2</servlet-name>
<!-- <url-pattern>/turnsmith/tsmService</url-pattern>-->
<url-pattern>/fortive2/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive3</servlet-name>
<!-- <url-pattern>/NEWCUST/tsmService</url-pattern>-->
<url-pattern>/fortive3/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<url-pattern>/NEWCUST-WebsiteXML</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<url-pattern>/NEWCUST2-WebsiteXML</url-pattern>
</servlet-mapping>

</web-app>









share|improve this question
























  • Literally the same server? Tomcat8 is using Servlet API 3.1 while Tomcat6 is using Servlet API 2.5. Increase log verbosity and check your webapp and catalina logs...

    – Freddy
    May 20 at 21:56












  • Also read Migrating from 6.0.x to 7.0.x and Migrating from 7.0.x to 8.0.x.

    – Freddy
    May 20 at 22:02











  • yes, same physical server. It is trivial to run "service tomcat6 stop" and then "service tomcat8 start".

    – user3329922
    May 20 at 22:06












  • Ok, that's what you meant with server. I thought you mean Tomcat. And there might be one or two things you have to adjust. Reading the migration guides could help as well as increasing the log verbosity on both Tomcats/Webapps and comparing the logfiles.

    – Freddy
    May 20 at 22:13











  • unless I am mistaken, logging level already set to "ALL". Nothing useful in there. What would I be looking for? I mean, does it even log anything to the tomcat logs in this case?

    – user3329922
    May 20 at 22:41

















0















I have a server which I flip back and forth between tomcat 6 and tomcat 8. When I do an HTTP post using the command



curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


I get different results between the different versions of tomcat.



First of all, for tomcat 8, I get:



* About to connect() to localhost port 8080 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8080 (#0)
> POST /fortive2/tsmService HTTP/1.1
> User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Referrer:mobileWMS,LLC
> Content-Type:text/xml
> Content-Length: 218
>
< HTTP/1.1 404
< Content-Length: 0
< Date: Mon, 20 May 2019 16:17:36 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0


Then, for tomcat 6, I get the proper response, no 404 error. What is happening? This is literally the same server, the same WAR file. My servlets are defined in the main tomcat web.xml ( $CATALINA_HOME/conf/web.xml ), NOT in the war file. This is on purpose, as it lets me quickly add web service URLs for new customers without changing the war file.



Also, I will say that multiple web applications reference the same war file ( multiple customers, so multiple websites with slight different configutations but the same UI ). This has always worked just fine for servlets in tomcat 6, so I just assumed this would keep working for Tomcat 8. Could this be causing a problem?



Also, as a side point, I can access port 8080 just fine in the browser, because that is how I sometimes get to the website or the tomcat manager ( when SSL is giving me problems with certificates ). So it is not the port.



Also, as added information, I have this for ONE of my servlets ( not the one I am using, a totally different servlet ):



@WebServlet(urlPatterns = "/*", name = "WmsServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = WmsUI.class, productionMode = false)
@SuppressWarnings("serial")
public class WmsServlet extends VaadinServlet

@Override
protected final void servletInitialized() throws ServletException
super.servletInitialized();
getService().addSessionInitListener(new WmsSessionInitListener());




And here are some example $CATALINA_HOME/conf/web.xml servlet configurations:



 <servlet>
<servlet-name>veeder-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>VEEDER-WS</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>spence-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>SPENCE-WS</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>veeder-ws</servlet-name>
<url-pattern>/veeder-ws/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>spence-ws</servlet-name>
<url-pattern>/spence-ws/tsmService</url-pattern>
</servlet-mapping>


5/21/2019 update: using Servlet Context listener, I get the following for my development server:



[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST; Mappings: /NEWCUST-WebsiteXML
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: default; Mappings: /
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WmsServlet; Mappings: /*
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: FortivePFC; Mappings: /Fortive-PFC
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive3; Mappings: /fortive3/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: jsp; Mappings: *.jspx, *.jsp
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive2; Mappings: /fortive2/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST2; Mappings: /NEWCUST2-WebsiteXML


And the servlet sections of global web.xml ( so $CATALINA_HOME/conf/web.xml ) for my dev machine, where the above logging was printed:



<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">

<!-- snipped unrelated config -->

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<!-- ================ Built In Servlet Mappings ========================= -->


<!-- The servlet mappings for the built in servlets defined above. Note -->
<!-- that, by default, the CGI and SSI servlets are *not* mapped. You -->
<!-- must uncomment these mappings (or add them to your application's own -->
<!-- web.xml deployment descriptor) to enable these services -->

<!-- The mapping for the default servlet -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

<!-- The mappings for the JSP servlet -->
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

<!-- snipped unrelated config -->

<!-- ==================== Custom WMS servlet setup ===================== -->
<servlet>
<servlet-name>FortivePFC</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive_PFC</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive2</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive3</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive3</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST2</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>FortivePFC</servlet-name>
<url-pattern>/Fortive-PFC</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive2</servlet-name>
<!-- <url-pattern>/turnsmith/tsmService</url-pattern>-->
<url-pattern>/fortive2/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive3</servlet-name>
<!-- <url-pattern>/NEWCUST/tsmService</url-pattern>-->
<url-pattern>/fortive3/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<url-pattern>/NEWCUST-WebsiteXML</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<url-pattern>/NEWCUST2-WebsiteXML</url-pattern>
</servlet-mapping>

</web-app>









share|improve this question
























  • Literally the same server? Tomcat8 is using Servlet API 3.1 while Tomcat6 is using Servlet API 2.5. Increase log verbosity and check your webapp and catalina logs...

    – Freddy
    May 20 at 21:56












  • Also read Migrating from 6.0.x to 7.0.x and Migrating from 7.0.x to 8.0.x.

    – Freddy
    May 20 at 22:02











  • yes, same physical server. It is trivial to run "service tomcat6 stop" and then "service tomcat8 start".

    – user3329922
    May 20 at 22:06












  • Ok, that's what you meant with server. I thought you mean Tomcat. And there might be one or two things you have to adjust. Reading the migration guides could help as well as increasing the log verbosity on both Tomcats/Webapps and comparing the logfiles.

    – Freddy
    May 20 at 22:13











  • unless I am mistaken, logging level already set to "ALL". Nothing useful in there. What would I be looking for? I mean, does it even log anything to the tomcat logs in this case?

    – user3329922
    May 20 at 22:41













0












0








0








I have a server which I flip back and forth between tomcat 6 and tomcat 8. When I do an HTTP post using the command



curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


I get different results between the different versions of tomcat.



First of all, for tomcat 8, I get:



* About to connect() to localhost port 8080 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8080 (#0)
> POST /fortive2/tsmService HTTP/1.1
> User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Referrer:mobileWMS,LLC
> Content-Type:text/xml
> Content-Length: 218
>
< HTTP/1.1 404
< Content-Length: 0
< Date: Mon, 20 May 2019 16:17:36 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0


Then, for tomcat 6, I get the proper response, no 404 error. What is happening? This is literally the same server, the same WAR file. My servlets are defined in the main tomcat web.xml ( $CATALINA_HOME/conf/web.xml ), NOT in the war file. This is on purpose, as it lets me quickly add web service URLs for new customers without changing the war file.



Also, I will say that multiple web applications reference the same war file ( multiple customers, so multiple websites with slight different configutations but the same UI ). This has always worked just fine for servlets in tomcat 6, so I just assumed this would keep working for Tomcat 8. Could this be causing a problem?



Also, as a side point, I can access port 8080 just fine in the browser, because that is how I sometimes get to the website or the tomcat manager ( when SSL is giving me problems with certificates ). So it is not the port.



Also, as added information, I have this for ONE of my servlets ( not the one I am using, a totally different servlet ):



@WebServlet(urlPatterns = "/*", name = "WmsServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = WmsUI.class, productionMode = false)
@SuppressWarnings("serial")
public class WmsServlet extends VaadinServlet

@Override
protected final void servletInitialized() throws ServletException
super.servletInitialized();
getService().addSessionInitListener(new WmsSessionInitListener());




And here are some example $CATALINA_HOME/conf/web.xml servlet configurations:



 <servlet>
<servlet-name>veeder-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>VEEDER-WS</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>spence-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>SPENCE-WS</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>veeder-ws</servlet-name>
<url-pattern>/veeder-ws/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>spence-ws</servlet-name>
<url-pattern>/spence-ws/tsmService</url-pattern>
</servlet-mapping>


5/21/2019 update: using Servlet Context listener, I get the following for my development server:



[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST; Mappings: /NEWCUST-WebsiteXML
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: default; Mappings: /
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WmsServlet; Mappings: /*
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: FortivePFC; Mappings: /Fortive-PFC
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive3; Mappings: /fortive3/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: jsp; Mappings: *.jspx, *.jsp
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive2; Mappings: /fortive2/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST2; Mappings: /NEWCUST2-WebsiteXML


And the servlet sections of global web.xml ( so $CATALINA_HOME/conf/web.xml ) for my dev machine, where the above logging was printed:



<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">

<!-- snipped unrelated config -->

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<!-- ================ Built In Servlet Mappings ========================= -->


<!-- The servlet mappings for the built in servlets defined above. Note -->
<!-- that, by default, the CGI and SSI servlets are *not* mapped. You -->
<!-- must uncomment these mappings (or add them to your application's own -->
<!-- web.xml deployment descriptor) to enable these services -->

<!-- The mapping for the default servlet -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

<!-- The mappings for the JSP servlet -->
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

<!-- snipped unrelated config -->

<!-- ==================== Custom WMS servlet setup ===================== -->
<servlet>
<servlet-name>FortivePFC</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive_PFC</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive2</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive3</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive3</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST2</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>FortivePFC</servlet-name>
<url-pattern>/Fortive-PFC</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive2</servlet-name>
<!-- <url-pattern>/turnsmith/tsmService</url-pattern>-->
<url-pattern>/fortive2/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive3</servlet-name>
<!-- <url-pattern>/NEWCUST/tsmService</url-pattern>-->
<url-pattern>/fortive3/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<url-pattern>/NEWCUST-WebsiteXML</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<url-pattern>/NEWCUST2-WebsiteXML</url-pattern>
</servlet-mapping>

</web-app>









share|improve this question
















I have a server which I flip back and forth between tomcat 6 and tomcat 8. When I do an HTTP post using the command



curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


I get different results between the different versions of tomcat.



First of all, for tomcat 8, I get:



* About to connect() to localhost port 8080 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8080 (#0)
> POST /fortive2/tsmService HTTP/1.1
> User-Agent: curl/7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.27.1 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: localhost:8080
> Accept: */*
> Referrer:mobileWMS,LLC
> Content-Type:text/xml
> Content-Length: 218
>
< HTTP/1.1 404
< Content-Length: 0
< Date: Mon, 20 May 2019 16:17:36 GMT
<
* Connection #0 to host localhost left intact
* Closing connection #0


Then, for tomcat 6, I get the proper response, no 404 error. What is happening? This is literally the same server, the same WAR file. My servlets are defined in the main tomcat web.xml ( $CATALINA_HOME/conf/web.xml ), NOT in the war file. This is on purpose, as it lets me quickly add web service URLs for new customers without changing the war file.



Also, I will say that multiple web applications reference the same war file ( multiple customers, so multiple websites with slight different configutations but the same UI ). This has always worked just fine for servlets in tomcat 6, so I just assumed this would keep working for Tomcat 8. Could this be causing a problem?



Also, as a side point, I can access port 8080 just fine in the browser, because that is how I sometimes get to the website or the tomcat manager ( when SSL is giving me problems with certificates ). So it is not the port.



Also, as added information, I have this for ONE of my servlets ( not the one I am using, a totally different servlet ):



@WebServlet(urlPatterns = "/*", name = "WmsServlet", asyncSupported = true)
@VaadinServletConfiguration(ui = WmsUI.class, productionMode = false)
@SuppressWarnings("serial")
public class WmsServlet extends VaadinServlet

@Override
protected final void servletInitialized() throws ServletException
super.servletInitialized();
getService().addSessionInitListener(new WmsSessionInitListener());




And here are some example $CATALINA_HOME/conf/web.xml servlet configurations:



 <servlet>
<servlet-name>veeder-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>VEEDER-WS</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>spence-ws</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>SPENCE-WS</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>veeder-ws</servlet-name>
<url-pattern>/veeder-ws/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>spence-ws</servlet-name>
<url-pattern>/spence-ws/tsmService</url-pattern>
</servlet-mapping>


5/21/2019 update: using Servlet Context listener, I get the following for my development server:



[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST; Mappings: /NEWCUST-WebsiteXML
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: default; Mappings: /
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WmsServlet; Mappings: /*
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: FortivePFC; Mappings: /Fortive-PFC
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive3; Mappings: /fortive3/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: jsp; Mappings: *.jspx, *.jsp
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: Fortive2; Mappings: /fortive2/tsmService
[2019-05-21 13:11:47 EDT] FINE com.mobiwms.website.WmsContextListener logCurrentServlets Servlet name: WMSWebsite-NEWCUST2; Mappings: /NEWCUST2-WebsiteXML


And the servlet sections of global web.xml ( so $CATALINA_HOME/conf/web.xml ) for my dev machine, where the above logging was printed:



<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">

<!-- snipped unrelated config -->

<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>fork</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>


<!-- snipped unrelated config -->

<!-- ================ Built In Servlet Mappings ========================= -->


<!-- The servlet mappings for the built in servlets defined above. Note -->
<!-- that, by default, the CGI and SSI servlets are *not* mapped. You -->
<!-- must uncomment these mappings (or add them to your application's own -->
<!-- web.xml deployment descriptor) to enable these services -->

<!-- The mapping for the default servlet -->
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>

<!-- The mappings for the JSP servlet -->
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspx</url-pattern>
</servlet-mapping>

<!-- snipped unrelated config -->

<!-- ==================== Custom WMS servlet setup ===================== -->
<servlet>
<servlet-name>FortivePFC</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive_PFC</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive2</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>Fortive3</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSProcessorServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>Fortive3</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST</param-value>
</init-param>
</servlet>

<servlet>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<servlet-class>com.wmsvision.servlet.WMSWebsiteServlet</servlet-class>
<init-param>
<param-name>socketType</param-name>
<param-value>WMSWebsite-NEWCUST2</param-value>
</init-param>
</servlet>

<servlet-mapping>
<servlet-name>FortivePFC</servlet-name>
<url-pattern>/Fortive-PFC</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive2</servlet-name>
<!-- <url-pattern>/turnsmith/tsmService</url-pattern>-->
<url-pattern>/fortive2/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>Fortive3</servlet-name>
<!-- <url-pattern>/NEWCUST/tsmService</url-pattern>-->
<url-pattern>/fortive3/tsmService</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST</servlet-name>
<url-pattern>/NEWCUST-WebsiteXML</url-pattern>
</servlet-mapping>

<servlet-mapping>
<servlet-name>WMSWebsite-NEWCUST2</servlet-name>
<url-pattern>/NEWCUST2-WebsiteXML</url-pattern>
</servlet-mapping>

</web-app>






tomcat6 tomcat8 servlets






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 21 at 17:34







user3329922

















asked May 20 at 16:30









user3329922user3329922

1698




1698












  • Literally the same server? Tomcat8 is using Servlet API 3.1 while Tomcat6 is using Servlet API 2.5. Increase log verbosity and check your webapp and catalina logs...

    – Freddy
    May 20 at 21:56












  • Also read Migrating from 6.0.x to 7.0.x and Migrating from 7.0.x to 8.0.x.

    – Freddy
    May 20 at 22:02











  • yes, same physical server. It is trivial to run "service tomcat6 stop" and then "service tomcat8 start".

    – user3329922
    May 20 at 22:06












  • Ok, that's what you meant with server. I thought you mean Tomcat. And there might be one or two things you have to adjust. Reading the migration guides could help as well as increasing the log verbosity on both Tomcats/Webapps and comparing the logfiles.

    – Freddy
    May 20 at 22:13











  • unless I am mistaken, logging level already set to "ALL". Nothing useful in there. What would I be looking for? I mean, does it even log anything to the tomcat logs in this case?

    – user3329922
    May 20 at 22:41

















  • Literally the same server? Tomcat8 is using Servlet API 3.1 while Tomcat6 is using Servlet API 2.5. Increase log verbosity and check your webapp and catalina logs...

    – Freddy
    May 20 at 21:56












  • Also read Migrating from 6.0.x to 7.0.x and Migrating from 7.0.x to 8.0.x.

    – Freddy
    May 20 at 22:02











  • yes, same physical server. It is trivial to run "service tomcat6 stop" and then "service tomcat8 start".

    – user3329922
    May 20 at 22:06












  • Ok, that's what you meant with server. I thought you mean Tomcat. And there might be one or two things you have to adjust. Reading the migration guides could help as well as increasing the log verbosity on both Tomcats/Webapps and comparing the logfiles.

    – Freddy
    May 20 at 22:13











  • unless I am mistaken, logging level already set to "ALL". Nothing useful in there. What would I be looking for? I mean, does it even log anything to the tomcat logs in this case?

    – user3329922
    May 20 at 22:41
















Literally the same server? Tomcat8 is using Servlet API 3.1 while Tomcat6 is using Servlet API 2.5. Increase log verbosity and check your webapp and catalina logs...

– Freddy
May 20 at 21:56






Literally the same server? Tomcat8 is using Servlet API 3.1 while Tomcat6 is using Servlet API 2.5. Increase log verbosity and check your webapp and catalina logs...

– Freddy
May 20 at 21:56














Also read Migrating from 6.0.x to 7.0.x and Migrating from 7.0.x to 8.0.x.

– Freddy
May 20 at 22:02





Also read Migrating from 6.0.x to 7.0.x and Migrating from 7.0.x to 8.0.x.

– Freddy
May 20 at 22:02













yes, same physical server. It is trivial to run "service tomcat6 stop" and then "service tomcat8 start".

– user3329922
May 20 at 22:06






yes, same physical server. It is trivial to run "service tomcat6 stop" and then "service tomcat8 start".

– user3329922
May 20 at 22:06














Ok, that's what you meant with server. I thought you mean Tomcat. And there might be one or two things you have to adjust. Reading the migration guides could help as well as increasing the log verbosity on both Tomcats/Webapps and comparing the logfiles.

– Freddy
May 20 at 22:13





Ok, that's what you meant with server. I thought you mean Tomcat. And there might be one or two things you have to adjust. Reading the migration guides could help as well as increasing the log verbosity on both Tomcats/Webapps and comparing the logfiles.

– Freddy
May 20 at 22:13













unless I am mistaken, logging level already set to "ALL". Nothing useful in there. What would I be looking for? I mean, does it even log anything to the tomcat logs in this case?

– user3329922
May 20 at 22:41





unless I am mistaken, logging level already set to "ALL". Nothing useful in there. What would I be looking for? I mean, does it even log anything to the tomcat logs in this case?

– user3329922
May 20 at 22:41










1 Answer
1






active

oldest

votes


















0














OK, found the answer, and it is so simple. So quick answer, and to save people from making my mistake, don't just check the mappings in web.xml, make sure the context is there, or make sure your URL includes a valid context. So if you are not including the context in the URL, make sure the ROOT.xml configuration is there.



So, to be more specific, in my case, I removed $CATALINA_HOME/conf/Catalina/localhost/ROOT.xml, but was posting to the root context. So with my test above,



curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


"fortive2" is NOT the context, it is part of my reference to the servlet. You can see this in my web.xml snippets. Because tomcat8 configuration had no ROOT.xml, it was failing with 404 because could not be found. But tomcat6 worked because I never removed ROOT.xml from that "localhost" directory.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "2"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968119%2fjava-servlet-404-error-tomcat-8-but-not-tomcat-6%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    OK, found the answer, and it is so simple. So quick answer, and to save people from making my mistake, don't just check the mappings in web.xml, make sure the context is there, or make sure your URL includes a valid context. So if you are not including the context in the URL, make sure the ROOT.xml configuration is there.



    So, to be more specific, in my case, I removed $CATALINA_HOME/conf/Catalina/localhost/ROOT.xml, but was posting to the root context. So with my test above,



    curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


    "fortive2" is NOT the context, it is part of my reference to the servlet. You can see this in my web.xml snippets. Because tomcat8 configuration had no ROOT.xml, it was failing with 404 because could not be found. But tomcat6 worked because I never removed ROOT.xml from that "localhost" directory.






    share|improve this answer



























      0














      OK, found the answer, and it is so simple. So quick answer, and to save people from making my mistake, don't just check the mappings in web.xml, make sure the context is there, or make sure your URL includes a valid context. So if you are not including the context in the URL, make sure the ROOT.xml configuration is there.



      So, to be more specific, in my case, I removed $CATALINA_HOME/conf/Catalina/localhost/ROOT.xml, but was posting to the root context. So with my test above,



      curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


      "fortive2" is NOT the context, it is part of my reference to the servlet. You can see this in my web.xml snippets. Because tomcat8 configuration had no ROOT.xml, it was failing with 404 because could not be found. But tomcat6 worked because I never removed ROOT.xml from that "localhost" directory.






      share|improve this answer

























        0












        0








        0







        OK, found the answer, and it is so simple. So quick answer, and to save people from making my mistake, don't just check the mappings in web.xml, make sure the context is there, or make sure your URL includes a valid context. So if you are not including the context in the URL, make sure the ROOT.xml configuration is there.



        So, to be more specific, in my case, I removed $CATALINA_HOME/conf/Catalina/localhost/ROOT.xml, but was posting to the root context. So with my test above,



        curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


        "fortive2" is NOT the context, it is part of my reference to the servlet. You can see this in my web.xml snippets. Because tomcat8 configuration had no ROOT.xml, it was failing with 404 because could not be found. But tomcat6 worked because I never removed ROOT.xml from that "localhost" directory.






        share|improve this answer













        OK, found the answer, and it is so simple. So quick answer, and to save people from making my mistake, don't just check the mappings in web.xml, make sure the context is there, or make sure your URL includes a valid context. So if you are not including the context in the URL, make sure the ROOT.xml configuration is there.



        So, to be more specific, in my case, I removed $CATALINA_HOME/conf/Catalina/localhost/ROOT.xml, but was posting to the root context. So with my test above,



        curl -v -X POST -d @webOpenCnsRealCheatsheet.xml -H Referrer:mobileWMS,LLC -H Content-Type:text/xml http://localhost:8080/fortive2/tsmService


        "fortive2" is NOT the context, it is part of my reference to the servlet. You can see this in my web.xml snippets. Because tomcat8 configuration had no ROOT.xml, it was failing with 404 because could not be found. But tomcat6 worked because I never removed ROOT.xml from that "localhost" directory.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered May 22 at 16:10









        user3329922user3329922

        1698




        1698



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Server Fault!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f968119%2fjava-servlet-404-error-tomcat-8-but-not-tomcat-6%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

            Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

            Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020