Error 404: javax.servlet.UnavailableException: SRVE0202E: Servlet was found, but is corrupted: SRVE0227E:

Background

Playing around with Liberty, but not getting far.

One of the errors that I am seeing is the one posted below.

Error

Error Image

SRVE0202E_20180721_0626PM

Error Text


 Error 404: javax.servlet.UnavailableException: 

SRVE0202E: Servlet [helloWorld]: wasdev.helloWorld was found, but is corrupted: 

SRVE0227E: Check that the class resides in the proper package directory. 

SRVE0228E: Check that the classname has been defined in the server using the proper case and fully qualified package. 

SRVE0229E: Check that the class was transferred to the filesystem using a binary transfer mode. 

SRVE0230E: Check that the class was compiled using the proper case (as defined in the class definition). 

SRVE0231E: Check that the class file was not renamed after it was compiled.

Trouble Shooting

Class File Name & Folder Structure

Here are the steps we took to validate the file:

  1. Checked to ensure that file is indeed present in the war file
    • The War is a simple archive file and was able to use 7-Zip to review the file’s location
      • Package name matches folder structure

Environment

Java Run-time

Task Manager

Using MS Windows Task Manager, reviewed the java run-time.

Task Manager – Details

taskManager_javaw_20180721_0655PM

Task Manager – Process – javaw.exe – Tab – Details
Image

javaw_20180721_0654PM

Image
  1. File Version :- 8.0.1210.13
  2. Product Version :- 8.0.1210.13

Compiler

Java Compiler

javac

Reviewed the java compiler that we are using and noticed that we are using Version 10.

Sample

"C:\Program Files\Java\jdk-10.0.2\bin\javac" -version

Output

javac_Version_20180721_0713PM

Remediation

Java Compiler

Stay with later model Java Compiler and use -release option

Update the script to use the “–release” option.


 >"C:\Program Files\Java\jdk-10.0.2\bin\javac" -cp C:\IBM\WebSphere\Liberty\v18.0.0.2\extract\\wlp\dev\api\spec\com.ibm.websphere.javaee.servlet.3.1_1.0.21.jar;C:\IBM\WebSphere\Liberty\v18.0.0.2\extract\\wlp\dev\api\spec\com.ibm.websphere.javaee.annotation.1.3_1.0.21.jar   --release 8 -d WEB-INF\classes helloWorld.java

Align Java Compiler

Downloaded JDK v8, Installed it, and changed our script from using javac 10 to now use java 8.

Credit

Will have to come back and credit where I got this salient advice from.

As I always say, the whole point of writing is to cite proven sources.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s