war files and WebSphere [Solved]

Hey guys,

So I’m currently writing a school project that’s all about writing a “bank app” on one of IBM mainframes. However, my .class files aren’t imported into the WAR file, when I export the project in Eclipse, and when I add the class files manually, then I get funny exceptions.

So does anyone know anything about deploying web apps on WebSphere? (My jsp files run without any trouble. Just the .class files that doesn’t work.

The funny exception:

Exception thrown by application class 'com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run():1526' 
  SRVE0202E: Servlet [test.TestMuffin]: test.TestMuffin 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.

I have no idea of how it should’ve gotten corrupted. And for the rest of the “check blabla” it seems to not be the case.

Well check the server and what is deployed there, especially the servlet class file. Is in the right package inside WEB-INF/classes? What is the filesize? Is it perhaps 0-bytes in size?

Note that I would first try to get your war deployed on simple and reliable Tomcat 7 first for which you can find a giant pile of tutorials and articles. Once you get that working, all you need to do is figure out the Websphere specifics which will generally boil down to setting up a proper datasource and such. That will probably require eating through a boring book and visiting the dodgy IBM forums, you’d have more luck getting online help if you were using Glassfish or JBoss.

It’s working on localhost, through Glassfish. :slight_smile:

And when I extract the war file I’ve generated, the class file is in the correct path and does have a size that’s not 0b. :stuck_out_tongue:

Problem solved. Turned out that I needed to compile for Java 1.5, instead of Java 1.6 or 1.7.

Thanks for the help though! :slight_smile:

Argh, what an unhelpful error message! At least the standard Java runtime moans about incompatible class versions in stead of spewing a word like “corrupt”.

Running on the IBM JVM I’m guessing. Yeah, welcome to IBM software.

This paragraph intentionally left blank.

At least they have regular error codes though, something Sun never bothered with (Oracle’s stuff does, but they’re stuck with Sun’s legacy).