Problem:
- Product Name: Borland Enterprise Server, AppServer Edition
- Product Version: 5.2.1
- Product Component: SSL
- Platform/OS Version: AIX 5.3
- JDK: IBM 1.4.2
- Patch: n.a.
How to resolve ClassNotFoundException:sun/security/provider/Sun.
The steps to run the test case are documented in the ${INSTALLATION}\\examples\\vbe\\ssl\\bank_ssl\\bank_ssl_java.html. When the SecureServer is started, the following exception is thrown.
$ Exception in thread "main" java.lang.NoClassDefFoundError: sun/security/provider/Sun
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java:180)
at com.inprise.vbroker.orb.ORB.installServiceCollection(ORB.java:1257)
at com.inprise.vbroker.orb.ORB.installServices(ORB.java:1298)
at com.inprise.vbroker.orb.ORB.initialize(ORB.java:1089)
at com.inprise.vbroker.orb.ORB.set_parameters(ORB.java:1332)
at org.omg.CORBA.ORB.init(ORB.java:368)
at SecureServer.main(SecureServer.java:11)
Resolution:
The exception occurs because the classloader is not able to find sun.security.provider.Sun class in the classpath.
In JDK 1.3.1, the class sun.security.provider.Sun is found in rt.jar.
However, Java 1.4.1 does not have rt.jar. The classes in the jar were split into several other jars. One of them is security.jar, which contains the package sun.security.provider but without the Sun class.
The fix is to remove the static loading of SUN Security provider for the IBM JDK. The issue can be resolved by upgrading to VisiBroker 5.2.1 Service Pack 3 & above.
Author: Matthew Ong
#VisiBroker
#Security