IntelliJ and Tomcat….changed files are not automatically recognized by Tomcat

This cannot be done if you deploy a war with IntelliJ IDEA. However, it can be if you deploy an exploded war. In IDEA: open your Tomcat Run/Debug configuration (Run > Edit Configurations) Go to the “Deployment” tab In the “Deploy at Server Startup” section, remove (if present) the artifact my-webapp-name:war Click the add icon, … Read more

How can I specify system properties in Tomcat configuration on startup?

cliff.meyers‘s original answer that suggested using <env-entry> will not help when using only System.getProperty() According to the Tomcat 6.0 docs <env-entry> is for JNDI. So that means it won’t have any effect on System.getProperty(). With the <env-entry> from cliff.meyers‘s example, the following code System.getProperty(“SMTP_PASSWORD”); will return null, not the value “abc123ftw”. According to the Tomcat … Read more

Can’t access Tomcat using IP address

You need allow ip based access for tomcat in server.xml, by default its disabled. Open server.xml search for ” <Connector port=”8080″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ URIEncoding=”UTF-8″ redirectPort=”8443″ /> Here add a new attribute useIPVHosts=”true” so it looks like this, <Connector port=”8080″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ URIEncoding=”UTF-8″ redirectPort=”8443″ useIPVHosts=”true” /> Now restart tomcat, it should work

How to config Tomcat to serve images from an external folder outside webapps? [duplicate]

This is the way I did it and it worked fine for me. (done on Tomcat 7.x) Add a <context> to the tomcat/conf/server.xml file. Windows example: <Context docBase=”c:\Documents and Settings\The User\images” path=”/project/images” /> Linux example: <Context docBase=”/var/project/images” path=”/project/images” /> Like this (in context): <Server port=”8025″ shutdown=”SHUTDOWN”> … <Service name=”Catalina”> … <Engine defaultHost=”localhost” name=”Catalina”> … <Host … Read more

How to run different apps on single Tomcat instance behind different ports?

I think you can configure that in you server.xml file and put 2 services : <Service name=”app1″> <Connector port=”8081″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app1″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service> <Service name=”app2″> <Connector port=”8082″ protocol=”org.apache.coyote.http11.Http11NioProtocol” connectionTimeout=”20000″ redirectPort=”8443″ /> <Engine name=”Catalina” defaultHost=”localhost”> <Host name=”localhost” appBase=”app2″ unpackWARs=”true” autoDeploy=”true”> </Host> </Engine> </Service>

java.lang.IllegalArgumentException: Invalid in servlet mapping

<url-pattern>*NEXTEVENT*</url-pattern> The URL pattern is not valid. It can either end in an asterisk or start with one (to denote a file extension mapping). The url-pattern specification: A string beginning with a ‘/’ character and ending with a ‘/*’ suffix is used for path mapping. A string beginning with a ‘*.’ prefix is used as … Read more