cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Deployment of java servlet fails when changing url pattern in web.xml

0 Kudos
1,982

Hi community,

I'm currently playing around with Java servlets on HCP and I'm not overly familiar with that.

Currently, I have this piece of config in my web.xml:

  <servlet-mapping>

  <servlet-name>HelloWorldServlet</servlet-name>

  <url-pattern>/*</url-pattern>

  </servlet-mapping>

This works perfectly fine and my app is properly deployed. However, when I change the url pattern to something else (e.g. to / or /hello-world/*), the service remains in Starting state.

There's the following log entry:

Failed to start web application at context path '/HelloWorld'

org.eclipse.gemini.web.core.spi.ServletContainerException: Web application at '/HelloWorld' cannot be added to the host.

  at org.eclipse.gemini.web.tomcat.internal.TomcatServletContainer.startWebApplication(TomcatServletContainer.java:128)

   [...]

I can't really make sense of it. Does anyone have an idea about what might cause this?

Thanks,

Max

View Entire Topic
gowrisankar_m2
Product and Topic Expert
Product and Topic Expert
0 Kudos

I guess you have to change in the servlet as well.[url pattern which you using it..]