Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application is not starting in websphere 8.5.5 but works fine in tomcat

I have a web application which can be deployed in tomcat but the same application is not starting in websphere 8.5.5. I have checked SystemErr.log file which gives following information, i cannot debug why application is not starting. If I would like to know more about problem what I need to do.

Application Server Version : Websphere 8.5.5
Java Version : java version "1.7.0_25"
OpenJDK Runtime Environment (rhel-2.3.10.4.el6_4-x86_64)

[12/30/13 12:43:01:144 CET] 000000ab SystemErr     R Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Failed to load webapp: Context root /* is already bound. Cannot start application My Application
[12/30/13 12:43:01:149 CET] 000000ab SystemErr     R    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:759)
[12/30/13 12:43:01:149 CET] 000000ab SystemErr     R    at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
[12/30/13 12:43:01:149 CET] 000000ab SystemErr     R    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
[12/30/13 12:43:01:149 CET] 000000ab SystemErr     R    ... 93 more
[12/30/13 12:43:01:149 CET] 000000ab SystemErr     R Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp: Context root /* is already bound. Cannot start application My Application
[12/30/13 12:43:01:150 CET] 000000ab SystemErr     R    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:133)
[12/30/13 12:43:01:150 CET] 000000ab SystemErr     R    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
[12/30/13 12:43:01:150 CET] 000000ab SystemErr     R    ... 95 more

Here is web.xml file

<?xml version="1.0" encoding="UTF-8"?><web-app metadata-complete="true" version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <display-name>My Application</display-name>
    <servlet>
        <display-name>MyApplication</display-name>
        <servlet-name>app</servlet-name>
        <servlet-class>com.seeta.vadali.MyReceiverServlet</servlet-class>
        <init-param>
            <param-name>uploadDir</param-name>
            <param-value>/tmp</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>app</servlet-name>
        <url-pattern>/any</url-pattern>
    </servlet-mapping>
</web-app>
like image 836
Seeta Ramayya Vadali Avatar asked Dec 30 '13 12:12

Seeta Ramayya Vadali


2 Answers

The error you are receiving says the context /* is already being used by another application. The contexts for your web applications must be unique.

The web.xml you posted has no context-root tag, so it looks like WebSphere is assuming /*. You can do one of the following to correct:

  1. Update your web.xml to include the context-root. You'll probably need to redeploy the application to have this take effect.
  2. Or, Change the context root of your application in WebSphere. This can be done by logging in to the console admin, navigating to Applications > Enterprise Applications > [App Name] > Context Root for Web Modules. The context root can then be specified here.
like image 50
armstrhb Avatar answered Oct 05 '22 04:10

armstrhb


Finally I can fix the issue.

My application is using google guava library and version of library was 15.0. I found guava library (version:15.0) is not compatible with jee6 (more information). So I changed the version from 15.0 to 14.0.1 then application got deployed correctly.

What I didn't understand is, how can I understand with the following error message what went wrong??? Don't you think it is little difficult to figure it out.

Caused by: com.ibm.ws.webcontainer.exception.WebAppNotLoadedException: Failed to load webapp

I am sure this is helpful information.

like image 21
Seeta Ramayya Vadali Avatar answered Oct 05 '22 04:10

Seeta Ramayya Vadali