WebSphere Application Server 8.5上的SRVE0200E错误 [英] SRVE0200E error on WebSphere Application Server 8.5

查看:958
本文介绍了WebSphere Application Server 8.5上的SRVE0200E错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个正确部署在 Apache Tomcat 上的Java动态Web项目。现在我正在尝试在 WebSphere Application Server 8.5 上部署 .war 文件。企业应用程序已正确创建,但当我尝试使用浏览器访问我的应用程序时,我收到以下错误:

I've developed a Java dynamic web project correctly deployed on Apache Tomcat. Now I'm trying to deploy the .war file on WebSphere Application Server 8.5. The enterprise application is correctly created but when I try to reach my application with browser I get the following error:

Error 404: javax.servlet.UnavailableException: SRVE0200E: Servlet [it.foo.simpleapp.SimpleApp]: Could not find required class - class java.lang.ClassNotFoundException: it.foo.simpleapp.SimpleApp

应用程序非常简单:当 GET 到达时,它应该以 text / html 内容回答。

The application is very simple: it should answer with a text/html content when a GET arrives.

我很确定 .war 文件是正确的,但我是WebSphere部署的新手。

I'm pretty sure that .war file is correct but I'm new to WebSphere deploying.

servlet类是:

The servlet class is:

@WebServlet("/")
public class SimpleApp extends HttpServlet {
   private static final long serialVersionUID = 1L;

   public SimpleApp() {
      super();
   }

   protected void doGet(HttpServletRequest request, HttpServletResponse response)
   throws ServletException, IOException {
      response.getWriter().print("<html><body><h1>SimpleApp servlet ready!</h1>");
      response.getWriter().print("</body></html>");
      response.setContentType("text/html");
   }

}

web.xml 文件是:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>SimpleApp</display-name>
</web-app>

提前致谢!

推荐答案

问题可能与 Tomcat WebSphere 环境中缺少某些库有关;所以我解决了用IBM Java库编译代码的问题。以下步骤解决了我的问题。

The problem is probably related to the absence of some libraries used by Tomcat into WebSphere environment; so I solved compiling the code with IBM Java libraries. The following steps solved my problem.


  1. 安装Eclipse的WASdev插件。可以从以下网址检索: http: //public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/V8.5/

在Eclipse中,在窗口>首选项>服务器>运行时环境下,应添加一个新的运行时环境,单击添加... 按钮。

In Eclipse, under "Window > Preferences > Server > Runtime Environments", a new runtime environment should be added clicking on the "Add..." button.

IBM 文件夹下,选择 WebSphere Application Server v8.5 运行时环境并选中创建新的本地服务器。在下一个窗口中,必须提供安装目录;例如: {your_path} \IBM \WebSphere\AppServer

Under the "IBM" folder choose the "WebSphere Application Server v8.5" runtime environment and check "Create a new local server". In the next window the "Installation directory" must be provided; for example: {your_path}\IBM\WebSphere\AppServer .

如果在这些操作中有消息例如安全服务器仅受IBM JRE 6.0或更高版本支持。使用产品安装映像中的IBM JRE。,您可以按照本教程以便更改 eclipse.ini 内容。行:

If during these operations a message like "Secure servers are only supported with IBM JRE 6.0 or above. Use the IBM JRE from the product installation image." is shown, you can follow this tutorial in order to change the eclipse.ini content. The lines:

--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Dhelp.lucene.tokenizer=standard
-Xms40m
-Xmx512m

必须替换为以下行:

--launcher.defaultAction
openFile
-vm
{your_path}\IBM\WebSphere\AppServer\java\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m


  • 现在你可以创建一个新的动态Web项目 WebSphere Application Server 指定为目标运行时

    导出的 WAR 文件可以正常用作企业应用程序

    The exported WAR file works fine as Enterprise application.

    I希望这可能有用。

    这篇关于WebSphere Application Server 8.5上的SRVE0200E错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆