0

I've deployed an application(EAR) on IBM WebSphere succesffully. When I hit the URL - "https://WAS-External-IP:PORT/ProjectName/OtherInfo/ServletName, I get the error:

Error 404: javax.servlet.UnavailableException: SRVE0200E: Servlet [ServletName]: Could not find required class - class ServletName : javax.servlet.ServletException: Project's Exception: com.sun.crypto.provider.SealedObjectForKeyProtector

From the post - identify whether is code running on app engine runtime (Java) I figure that GAE runtime 1.9.23 has the fix for runtime whitelisting, which omitted one or more classes needed to load the JCEKS key store. However, I can't figure out where can I find the GAE runtime version in my WebSphere.

When the same code is run when Application is installed on a Windows box, I don't get this error.

When I looked at the trace logs, I get the error: Caused by: java.lang.IllegalStateException: No implementation could be SystemErr R at jarName.classname.methodName(className.java:LineNumber)

From debugging, I see the class-name string is not loaded in the classpath. However, when I checked the jars available in the path mentioned in the classpath, I can see the JAR is present there. The JAR is also present in the pom file of the project.

I'm not able to set debug points at static blocks of missing class to see what is going wrong.

Windows and Linux often return list of files in different order, which can lead to jars being added to the classpath in a different order. How can I make Linux read the missing JAR in the classpath the way Windows does?

Community
  • 1
  • 1
user2769790
  • 123
  • 1
  • 17
  • What exactly is "Project's Exception"? That doesn't explicitly look like a class loading failure, unless your application is catching the exception and rethrowing with the message text but not the actual wrapped exception. If there IS a ClassNotFoundException, its stack would show you what loaders are being used for the failing class load. – Jarid Apr 10 '17 at 12:29
  • Regarding the secondary issue, WebSphere (and IBM Java in general) have no support for explicitly ordering the entries for directories that are pulled into a class loader en masse (like an "ext.dirs" property, or WEB-INF/lib). That's something explicitly undefined by Java spec, and there's no way to utilize duplicate classes within a loader, so the best answer is "get rid of the class(es) you don't want)", rather than trying to massage filesystem settings to get the "correct" order. – Jarid Apr 10 '17 at 12:32
  • The error is thrown when the code tries to create an implementation of the class. If it can't create, it returns null, which eventually returns an IllegalStateException("No implementation could be found"). "There's no way to utilize duplicate classes within a loader" - I did't get this point. Where are the duplicate classes? Note: The same code works for Windows, and not for Linux. – user2769790 Apr 10 '17 at 13:50
  • That was based on your question about the order of the list of files in a class path - the only way that would matter is if you have two of the same class in the class path. A class loader can't define the same class more than once, so there is no way to actually use both copies of the class. – Jarid Apr 10 '17 at 14:26
  • Just found in the SystemError Logs: Caused by: java.lang.ClassCastException: NewPackageNAme.NewDataSource incompatible with PackageNAme.PresentDataSource SystemErr at JARNAme.ImplementationClass$Method.(ImplementationClass.java:226) – user2769790 Apr 10 '17 at 18:25
  • Reason being - PackageNAme.PresentDataSource is Deprecated. As of versionNumber, consumers should use NewDataSource or implement their own version of a DataSource. That means that the classpath is able to locate the ImplementationClass. It was just not showing in the debug string variable of classpath as the length of the string was too long. The question now is that if I can replace the data-source from PresentDataSource to NewDataSource and if Linux supports it or not. – user2769790 Apr 10 '17 at 18:25
  • Any suggestions on how to fix this? @jarid – user2769790 Apr 10 '17 at 22:37
  • Are these DataSource classes custom classes, or replacements for the JAva API? If they're custom classes, you should just be able to swap in the right one and take out the old one, wherever it is they're located. There are very few behavior differences between Linux and Windows, mostly just small stuff like the file/path separators. – Jarid Apr 11 '17 at 12:44

0 Answers0