Tomcat response the same every time after initital response - java

I have a relatively simple spring web application running on tomcat which returns an xml document. The initial request goes in and I can debug into my code. However, subsequent requests do not drop into the debugger. I can make the initial request with either a browser or soapUI, and subsequent requests (on different browsers/programs/machines) get the same response as the initial one.
The localhost_access_log is getting populated with every request. However the log4j file is not getting populated beyond the first request.
I'm using Tomcat 7 and spring 3.1.1. This happens on both the tomcat deployed within eclipse (used to enable debugging), as well as deploying it on another tomcat server on linux.
This is similar to another question (Tomcat gives Same Response ) which never had an accepted answer.
So it doesn't appear to be browser caching (different applications making requests get the same response), but rather some sort of Tomcat caching.
Any ideas? Here is the server.xml which I believe may be the cause of the problem somehow, but I don't see any red flags. Also, I'm doing GETs to the web application, which may be caching somehow on the server side.
Example GET request: http://localhost:8130/bootstrap/xml?environment=dev
It returns a xml document as noted in this RequestMapping:
#RequestMapping(value = "/xml", method = RequestMethod.GET,produces="application/xml")
Sample Response:
<connection_details env="dev">
<servers>
<server host="localhost" name="auth" port="9876"/>
</servers>
</connection_details>
The issue manifests itself as every request returns the same as the initial request, even if the environment variable passed into the GET request changes. This is even if requested from different browsers and soapUI.
Example of how the response above is created:
private ModelAndView bootstrap(HttpServletResponse response, String environment) {
Map<String, Object> model = new HashMap<String, Object>();
try {
DOMSource domSource = new DOMSource(documentBuilder.parse(context
.getResourceAsStream(bootstrapXmlFileName)));
model.put("xml", domSource);
model.put("requestedEnvironment", environment);
}
catch (Exception e) {
response.setHeader("ERRORS", e.getMessage());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return null;
}
return new ModelAndView("bootstrap_connection_selector", model);
}
Then it is passed to an xslt transformation:
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.xslt.XsltView" />
<property name="prefix" value="/WEB-INF/xsl/" />
<property name="suffix" value=".xslt" />
</bean>
Finally the following transformation:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- parameter for the requested location -->
<xsl:param name="requestedlocation"/>
<!-- start template matching on the connection_details element -->
<xsl:template match="/connection_details">
<!-- duplicate the enclosing <connection_details env=xxx" element -->
<xsl:element name="connection_details">
<xsl:attribute name="env">
<xsl:value-of select="#env"/>
</xsl:attribute>
...
<!-- close the <connection_details> element -->
</xsl:element>
</xsl:template>
</xsl:stylesheet>
server.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8133" shutdown="SHUTDOWN">
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector connectionTimeout="20000" port="8130" protocol="HTTP/1.1" redirectPort="8131"/>
<Connector port="8132" protocol="AJP/1.3" redirectPort="8131"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context docBase="em_bootstrap" path="/bootstrap" reloadable="true" source="org.eclipse.jst.jee.server:em_bootstrap">
</Context></Host>
</Engine>
</Service>
</Server>

This turned out to be a bad case of not checking the Filters. There was a caching filter applied in the web.xml, probably the only place I didn't check. It was incorrectly using the request.getRequestURI as the key for the cache, when in reality it needed the entire request string to properly place it in the cache.
Thanks

Related

Primefaces File Upload won't upload files greater than 1 MB

**Primefaces don't allow me to upload a file greater than 1 MB as shown in the picture. The code works on my local tomcat server but would not work on the Amazon prod tomcat server. Any suggestions please I even used maxPostSize but it does not work. I guess the issue is with the server.xml as the code works fine. **
Server.xml
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
<Server port="8006" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
<Service name="Catalina">
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL/TLS HTTP/1.1 Connector on port 8080
-->
<!--
<Connector compressableMimeType="text/html,text/xml,text/css,text/javascript,application/x-javascript,application/javascript,image/png,image/jpeg,font/woff2,text/css; chartset=utf8,text/html;charset=UTF-8" compression="on" compressionMinSize="256" connectionTimeout="20000" noCompressionUserAgents="gozilla, traviata" port="8081" protocol="HTTP/1.1" redirectPort="8443"/>
-->
<!-- A "Connector" using the shared thread pool-->
<Connector executor="tomcatThreadPool"
port="8081" protocol="HTTP/1.1"
connectionTimeout="20000"
maxPostSize="-1"
redirectPort="8443" />
<!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443
This connector uses the NIO implementation that requires the JSSE
style configuration. When using the APR/native implementation, the
OpenSSL style configuration is required as described in the APR/native
documentation -->
<!--
<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"
maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html -->
<!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<Engine name="Catalina" defaultHost="localhost">
<!--For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation) -->
<!--
<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
<!-- Access log processes all example.
Documentation at: /docs/config/valve.html
Note: The pattern used is equivalent to using pattern="common" -->
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
File Upload Handler
public void handleFileUpload(FileUploadEvent event) {
UploadedDocument doc = new UploadedDocument();
try {
doc.setDoc(IOUtils.toByteArray(event.getFile().getInputstream()));
} catch (IOException e) {
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
event.getFile().getFileName() + " could not be uploaded.", null);
FacesContext.getCurrentInstance().addMessage(null, message);
}
doc.setDocName(event.getFile().getFileName());
if (temporaryUploadedDocuments == null) {
temporaryUploadedDocuments = new ArrayList<UploadedDocument>();
}
temporaryUploadedDocuments.add(doc);
FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
event.getFile().getFileName() + " has been uploaded.", null);
FacesContext.getCurrentInstance().addMessage(null, message);
count = count + 1;
}
File upload button
<p:fileUpload style="word-break: break-all;"
update="dtaAttachments"
fileUploadListener="#{AccountComponent.handleFileUpload}"
mode="advanced" sizeLimit="10000000" multiple="false"
fileLimit="5"
fileLimitMessage="Please zip if you have more than 5 files."
allowTypes="/(\.|\/)(pdf|docx|doc|png|jpg|jpeg|png|rar|zip|PDF|DOCX|DOC|PNG|JPG|JPEG|RAR|ZIP|xls|XLS|xlsx|XLSX|txt|eml)$/">
</p:fileUpload>
This post issue has been resolved. The issue was not with my tomcat. I had a Nginx server running blocking all uploads above 1 MB. To resolve this, just set this paramter in block below in /etc/nginx/nginx.conf file. This will allow uploads upto 100 Mb
http {
...
client_max_body_size 100M;
}

Setting URL with subfolder in Tomcat 9

I have Tomcat 9. I am trying to get the URL lik this: http://default.local:8080/default_war/ but my site is still available only by http://default.local:8080.
The address I am going to set is also generated by Intellij in Run/Configuration so it shoud be possible to set it. Of course I could edit it in Intellij but I wonder how to achieve URL subderictories in Tomcat 9.
What should I change in my code? Here there are my setting files:
$ cat /home/u/opt/tomcat/conf/server.xml
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="default.local" appBase="default"
unpackWARs="true" autoDeploy="true">
<Context path="/default_war" />
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
u#i3 ~/opt/tomcat
$ cat conf/Catalina/default.local/ROOT.xml
<?xml version="1.0" encoding="UTF-8"?>
<Context docBase="${catalina.base}/deploy/default_war.war">
</Context>
u#i3 ~/opt/tomcat
$
This is happening because you are using a context file called ROOT.xml.
The ROOT application is the one which is served from the base URL - in your case, http://default.local:8080.
Depending on exactly how you deployed your WAR, you will need to take the following steps:
1 - Stop Tomcat and change the name of the ROOT.xml file to default_war.xml.
The above step means you are no longer using a ROOT-based webapp (see final note below for more on that).
2 - Because you have specified appBase="default" in your server.xml, you may also need to go to that default folder and remove any sub-folders in there, before restating Tomcat.
I would expect there to be a ROOT folder in there, because you have already used a ROOT.xml context file. You don't want that folder, because that will continue to serve your webapp from the base URL.
When you restart Tomcat, you should see a new folder called default_war in the default folder - and that is where your application will be served from - and it should be available only at http://default.local:8080/default_war/.
Background note: In Tomcat, ROOT is something of a special case. When you download and install a fresh installation of Tomcat, you will see a folder called ROOT in the webapps directory. This is where the main Tomcat welcome/congratulations page is served from - and like your ROOT.xml content, it is served from the base URL. You can see some of the possible configurations in the "naming" table shown in this Tomcat documentation page.

Resource URIs not working in Java RESTful web service on tomcat 8 server

I created a RESTful web service using auto generated entity classes with netbeans. I also used maven. I deployed this in tomcat 8 as localhost. I do see the index page, but I cannot access any endpoints. I initially ran this locally on Glassfish server and it worked fine.
I tried test resource uri in netbeans but it says,
Unable to open resource URL : localhost:8080//api/activity
Here is my server.xml file from apache tomcat.
<?xml version="1.0" encoding="UTF-8"?>
--><Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener"/>
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log" suffix=".txt"/>
<Context antiJARLocking="true" docBase="C:\xxx\yyyy\apache-tomcat-8.0.36\apache-tomcat-8.0.36\wtpwebapps\xxDBWithMaven" path="/VoyateDBWithMaven" reloadable="true" source="org.eclipse.jst.jee.server:VoyateDBWithMaven"/></Host>
</Engine>
</Service>
</Server>
Is there anyway I can fix this so the resources can be accessed? It's confusing because the application gets deployed and the index file is displayed.
Unable to open resource URL : localhost:8080//api/activity
You have two slashes between "localhost:8080" and "api/activity". Remove one in the configuration where you specify the path: api/activity instead of /api/activity.

Tomcat 7 LifeCycleListener

I have been searching for days on how to get this to work but I have had no success.
I have a project which listens on port 6789 and when a connection is made I need to perform some specific actions. To do that I am trying to use a listener so that anytime that my servers Engineis run upon a connection being made.
Basically a mobile application is going to connect to an instance of a server, as soon as the connection is made, the server needs to authenticate the user, then receive data from the phone and place it in the database. If there is another way to do this please let me know. I have looked at filters but those need a url path to activate, and I also do not know how to use a servlet which will fire when a connection is made!
I have this so far in my server.xml:
<Service name="Catalina">
<Connector connectionTimeout="20000" port="6789" protocol="HTTP/1.1"
redirectPort="8443" />
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
<Engine defaultHost="localhost" name="Catalina">
<Listener className="Listeners.EngineListener" />
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase" />
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost"
unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log."
suffix=".txt" />
<Context docBase="PhoneListener" path="/PhoneListener"
reloadable="true" source="org.eclipse.jst.jee.server:PhoneListener">
</Context>
</Host>
</Engine>
</Service>
I have the full path to the file in the <Listener> tag. This is the same way I have executed many filters (authentication and noCache).
The class which implements the LifeCycleListener is here"
package Listeners;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
#ManagedBean
#SessionScoped
public class EngineListener implements LifecycleListener
{
#Override
public void lifecycleEvent(LifecycleEvent event)
{
// TODO Auto-generated method stub
System.out.println("The engine listener is working!");
}
}
The bean declaration is meaningless here, I get the same result with and without the bean declaration.
I have been working at this for a few days now.
I have installed maven and used it to fix dependencies. I have made new projects in new workspaces in an attempt to remedy and class path errors. I have tried to switch from the Majorra JSF library to the MyFaces library, I get the same errors. I am honestly at my wits end with the Listener.
Any ideas?
It turns out that there were no errors in my code, but an error with where files are placed. I have exported the PhoneListenerproject as a .jar and put it into the /lib folder of the server I am awaiting a connection on.
The server could not find my Listeners.PhoneListener as it was not in the start up directory of the server itself.

Setting property 'source' to 'org.eclipse.jst.jee.server:GestorContenidoWS' did not find a matching property. Try all the solutions

This is my first post here (but not the first time that I visit the page, I found a lot of solutions here), first of all, sorry for my english I will try to explain myself as best I can.
This question appears another time in this page, but I tried all the solutions that the people post and I still with this problem, well here we go.
I made a project on Eclipse(indigo) for launch like a WebService (I did it before with succes, is not my first time) and when I Run on Server(Tomcat7) all seems fine and the appears this Warning.
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:GestorContenidoWS' did not find a matching property.
Then appear in the Web perspective of Eclipse the page "HTTP 404". I'm telling this because I read in other post that this Warning is not a problem, but seems that it is for me (The project is also vinculated with a JPA Persistence).
.I found two solutions for make dissappear this Warning. First, go to Server Overview and select the option 'Publish module contexts to separate XML files' and then try to Run on server again, but didn't work.
The other option was, remove the project from the server from the Server View. Then run the project under the same server for recreated server.xml, but didn't work also.
Anybody can help me? Maybe the problem of this "HTTP 404 requested resource (/GestorContenidoWS/) is not available." is in another part or its because this Warning?"
The code of my server.xml (without comments) is this:
<?xml version="1.0" encoding="UTF-8"?>
--><Server port="8005" shutdown="SHUTDOWN">
<Listener SSLEngine="on" className="org.apache.catalina.core.AprLifecycleListener"/>
<Listener className="org.apache.catalina.core.JasperListener"/>
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory"name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1"redirectPort="8443"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
<Context docBase="GestorContenidoWS" path="/GestorContenidoWS" reloadable="true" source="org.eclipse.jst.jee.server:GestorContenidoWS"/></Host>
</Engine>
</Service>
Thank you
First of all this is a warning and not an error. So there is no need to worry too much about it. Basically it means, that Tomcat does not know what to do with the source attribute from context.
This source attribute is set by Eclipse (or to be more specific the Eclipse Web Tools Platform) to the server.xml file of Tomcat to match the running application to a project in workspace.
Tomcat generates a warning for every unknown markup in the server.xml (i.e. the source attribute) and this is the source of the warning. You can safely ignore it.
This is a warning and can be safely ignored. Tomcat or the Web container does not understand what to do with the property set by Eclipse
set contex-root
<property name="context-root" value="path" />
and http://localhost:8080/path
show your index file
Find server.xml. For example "C:\Dev\apache-tomcat-8.5.23\conf\server.xml"
Find your application in server.xml
<Context docBase="C:\Dev\apache-tomcat-8.5.23\wtpwebapps\SpringRestExample" path="/spring" reloadable="true" source="org.eclipse.jst.jee.server:SpringRestExample"/></Host>
Expected url http://localhost:8080/SpringRestExample/rest/emp/9999
But (path="/spring") instead (path="/SpringRestExample")
Therefore current url http://localhost:8080/spring/rest/emp/9999

Categories