Hi guys, wondering if any of you have had this before.
I have a basic login servlet, which simply checkers username/password with contents of a SQL database.
When I click on SUBMIT on the login.jsp the servlet fails to load and I get a - javax.servlet.ServletException: Servlet [LoginServlet]: uk.co.domain.servlets.LoginServlet was found, but is corrupt:
The package path is correct The name of the servlet is correct The servlet compiles successfully (obviously for me to have a class file)
I have tried removing the class file and recompiling, removing the servlet mapping and recreating it. I just can't see any reason for this error.
Here's the rest of the message from Websphere: 1. Check that the class resides in the proper package directory. 2. Check that the classname has been defined in the server using the proper case and fully qualified package. 3. Check that the class was transfered to the filesystem using a binary tranfer mode. 4. Check that the class was compiled using the proper case (as defined in the class definition). 5. Check that the class file was not renamed after it was compiled.
(found via a search on the net)
I'm assuming you've done all these things? Personally I think you may not have it packaged as you expect, ie it might have been accidentally compiled as src.uk.co.domain...etc I did that just last week.
Bob Backlund
Ranch Hand
Joined: Jun 05, 2003
Posts: 51
posted
0
I have checked through these 'suggestions' given by Websphere, the servlet is packaged correctly, the name has not been changed, compiled successfully etc...
Another possibility: does your servlet include any static code blocks or other code that gets run as the Class is loaded? When code of this type fails it prevents the class being loaded and sometimes causes strange ClassLoader side effects.
Heh, the best reference to a similar situation I found on the net has Marcus Green and William Brogden
Did the original have any static blocks? Your new one may never be getting loaded.
Bob Backlund
Ranch Hand
Joined: Jun 05, 2003
Posts: 51
posted
0
It had the database name and location (server) in it but that's it.
I have now cleared out the servlet, removed the folders the classes were in and even deleted the webapp and recreated it with the new 'cut down' LoginServlet. Copied the new compiled servlet back into a new folder the new webapp and still i get the same error!
this is getting stupid, can Websphere just not see servlets or something? There's nothing there to go wrong.
I have now solved the problem I had a "moment of clearity" (As one Mr Samuel L Jackson once said), It was the Java version that was causing the problem, WAS could not understand the sevlet as it was compiled in 1.5.