Java 应用程序未在 websphere 8.5.5 中启动,但在 tomcat 中运行良好
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20839866/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Application is not starting in websphere 8.5.5 but works fine in tomcat
提问by Seeta Ramayya Vadali
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.
我有一个可以部署在 tomcat 中的 web 应用程序,但同一个应用程序没有在 websphere 8.5.5 中启动。我检查了 SystemErr.log 文件,该文件提供以下信息,我无法调试应用程序未启动的原因。如果我想了解更多有关问题的信息,我需要做什么。
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)
应用服务器版本:Websphere 8.5.5
Java 版本:java 版本“1.7.0_25”
OpenJDK 运行时环境 (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
这是 web.xml 文件
<?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>
回答by armstrhb
The error you are receiving says the context /*
is already being used by another application. The contexts for your web applications must be unique.
您收到的错误表示上下文/*
已被另一个应用程序使用。Web 应用程序的上下文必须是唯一的。
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:
您发布的 web.xml 没有context-root
标记,因此看起来 WebSphere 假设/*
. 您可以执行以下操作之一来更正:
- Update your web.xml to include the context-root. You'll probably need to redeploy the application to have this take effect.
- 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.
- 更新您的 web.xml 以包含 context-root。您可能需要重新部署应用程序才能使其生效。
- 或者,在 WebSphere 中更改应用程序的上下文根。这可以通过登录控制台管理员来完成,导航到Applications > Enterprise Applications > [App Name] > Context Root for Web Modules。然后可以在此处指定上下文根。
回答by Seeta Ramayya Vadali
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.
我的应用程序正在使用谷歌番石榴库,库的版本是15.0
. 我发现番石榴库(版本:15.0)与 jee6 不兼容(更多信息)。因此,我将版本从 15.0 更改为 14.0.1,然后正确部署了应用程序。
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
引起:com.ibm.ws.webcontainer.exception.WebAppNotLoadedException:无法加载webapp
I am sure this is helpful information.
我相信这是有用的信息。
回答by Shailendra Kumar
I was getting same error, so what i did was logged into admin console then went to applications, then to Websphere enterprise application (Here you can find list off all the application deployed). Just Undeploy the default Application (this application is deployed when we install web sphere). Once undeployed, it will work.
我遇到了同样的错误,所以我所做的是登录管理控制台,然后进入应用程序,然后进入 Websphere 企业应用程序(在这里你可以找到所有部署的应用程序的列表)。只需取消部署默认应用程序(此应用程序在我们安装 web Sphere 时部署)。一旦取消部署,它将起作用。
回答by Vivek
Go to IBM Console->Application->Application Types->Websphere Enterprice Application.
转至 IBM 控制台 -> 应用程序 -> 应用程序类型 -> Websphere Enterprise 应用程序。
Remove all the application other than YOUR APPLICATION.
删除除您的应用程序之外的所有应用程序。
Websphere automatically creates some sample application and in that application, some are pointed to "./"
Websphere 会自动创建一些示例应用程序,在该应用程序中,有些指向“./”
Mine problem solved like this.
我的问题是这样解决的。