SRVE0200E error on WebSphere Application Server 8.5

13,116

Solution 1

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. Install the WASdev plugin for Eclipse. It can be retrieved from this URL: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/V8.5/

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

  3. 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 .

    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
    

    must be replaced with the following lines:

    --launcher.defaultAction
    openFile
    -vm
    {your_path}\IBM\WebSphere\AppServer\java\bin\javaw.exe
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Xms40m
    -Xmx512m
    
  4. Now you can create a new "Dynamic Web Project" specifing the WebSphere Application Server as a target runtime.

The exported WAR file works fine as Enterprise application.

I hope this can be useful.

Solution 2

Following step 3 above may not resolve the message like:

"Secure servers are only supported with IBM JRE 6.0 or above. Use the IBM JRE from the product installation image."

Instead of changing eclipse.ini you may need to add JVM directly to eclipse.exe command line like

{eclipse_install_path}/eclipse.exe -vm "C:\Program Files\Java\jdk1.6.0_16\bin\javaw.exe" -vmargs -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=512M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode

see more at Howto start eclipse in JDK?

Share:
13,116
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    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
    

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

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

    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");
       }
    
    }
    

    The web.xml file is:

    <?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>
    

    Thanks in advance!