我想在WAS8.5.5.2中部署一个应用程序。我用结构制造了耳朵:
serverEar.ear
-- serverWar.war
---- WEB-INF
---- 'web' directory contents
我有application.xml :
<application version="6" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" >
<module>
<web>
<web-uri> serverWar.war</web-uri>
<context-root>serverWar</context-root>
</web>
</module>
<library-directory> web/lib</library-directory>
</application>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>p1</servlet-name>
<servlet-class>com.test.Server</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>p1</servlet-name>
<url-pattern>/server</url-pattern>
</servlet-mapping>
<security-constraint>
<display-name/>
<web-resource-collection>
<web-resource-name/>
<description/>
<url-pattern>/*</url-pattern>
<http-method>POST</http-method>
<http-method>GET</http-method>
</web-resource-collection>
<user-data-constraint>
<description/>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
</web-app>
我有目录结构:
我已经安装了来自WAS /console的应用程序。安装目录为..\Desktop\Test\out\artifacts\serverEar
,其中放置了ear文件(不确定安装目录是否影响到此?)。
应用程序已成功安装并已启动。
我尝试过url:服务器:9443/serverWar/server,它给了我:Error 404: java.io.FileNotFoundException: SRVE0190E: File not found: /server
我以前从未处理过这件事,也不知道我可能在哪里出了问题。
任何建议,指针都是非常感谢的!
发布于 2016-04-18 10:15:47
好了,问题现在解决了。问题是context root
没有被设置为serverWar,所以它没有识别serverWar/server url。因此,我遵循这些步骤到从IBM控制台设置上下文根。
在解决了这个问题之后,我又遇到了一个相关的问题:
Error 404: javax.servlet.UnavailableException: SRVE0200E: Servlet: Could not find required class
我们似乎需要在WEB-INF
中有类目录,IntelliJ由于某种原因没有创建这个目录,而且上面的结构对WildFly和WebLogic都有效。因此,在部署ear文件时,只需从production
目录复制类。它使我的应用程序像预期的那样工作。
在进行了上述所有更改之后,我可以成功地访问url 服务器:9443/serverWar/server。
希望这能帮助那些新来的人!
发布于 2018-10-18 18:48:29
我希望这对其他人有帮助,因为我花了很多小时才找到原因:
当我尝试在is8.5上部署一个WAR文件时,我遇到了同样的问题,在我的例子中,问题是这个有java jdk 6,而我的应用程序需要jdk 8。
https://stackoverflow.com/questions/36625804
复制相似问题