Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Not able to load Run Time JRE class: com.sun.crypto.provider.SunJCE(Caused by: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE)
icon4.gif  Not able to load Run Time JRE class: com.sun.crypto.provider.SunJCE [message #1015899] Mon, 04 March 2013 08:46 Go to next message
Bibhu Prasad Sahoo is currently offline Bibhu Prasad SahooFriend
Messages: 2
Registered: March 2013
Location: Hyderabad, India
Junior Member
We used to work in Virgo Tomcat Server 3.0.3. Now we are planning to upgrade our Virgo Tomcat Server to 3.6.1 which is compatible with Spring 3.1.0 and Spring-Integration2.1.0.

But we are getting following exception while loading one of our module, which was working fine with Virgo Tomcat Server 3.0.3.

Caused by: java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE
at com.pg.utils.Configuration.setKey(Configuration.java:115)
at com.pg.utils.Configuration.initialize(Configuration.java:293)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1581)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452)
... 17 common frames omitted
Caused by: org.eclipse.virgo.kernel.osgi.framework.ExtendedClassNotFoundException: com.sun.crypto.provider.SunJCE in KernelBundleClassLoader: [bundle=pgutils_0.0.0]
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:139)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 26 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at org.eclipse.virgo.kernel.userregion.internal.equinox.KernelBundleClassLoader.loadClass(KernelBundleClassLoader.java:135)
... 27 common frames omitted

I tried to resolve it by adding this package(com.sun.crypto.provider) under org.osgi.framework.system.packages of virgo-tomcat--3.6.1.RELEASE\configuration\java6-server.profile. But still getting the same issue.

OS: Linux 2.6.18-92.el5 i686
Java: java version "1.6.0_21"

Please let me know if anyone faced such issue and how to resolve it.

Thanks in Advance,
Bibhu Prasad Sahoo
Re: Not able to load Run Time JRE class: com.sun.crypto.provider.SunJCE [message #1016946 is a reply to message #1015899] Fri, 08 March 2013 09:55 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
Adding the package to org.osgi.framework.system.packages would only solve the class loading error if there was an optional import of the package that was getting discarded. The normal way to load such classes is via boot delegation (details in the OSGi core spec). However, all packages beginning with com.sun are already boot delegated:
org.osgi.framework.bootdelegation = \
 org.eclipse.virgo.nano.authentication,\
 com.sun.*,\
...


Check that you have com.sun.* there in your java6-server.profile.

If you have, then I would investigate your JRE and make sure it can load that class:
$ java com.sun.crypto.provider.SunJCE
Exception in thread "main" java.lang.NoSuchMethodError: main

If you can't load the class, you'll get a NoClassDefFoundError.
Re: Not able to load Run Time JRE class: com.sun.crypto.provider.SunJCE [message #1017181 is a reply to message #1016946] Sun, 10 March 2013 18:52 Go to previous messageGo to next message
Bibhu Prasad Sahoo is currently offline Bibhu Prasad SahooFriend
Messages: 2
Registered: March 2013
Location: Hyderabad, India
Junior Member
Thanks Glyn for your reply.

I checked "com.sun.*", is part of my java6-server.profile and getting the similar exception(Exception in thread "main" java.lang.NoSuchMethodError: main) as you have mentioned when I tried "java com.sun.crypto.provider.SunJCE".

My doubt is if with same jars and Java version there were no issue with Virgo-3.0.3, why there is an issue with Virgo-3.6.1? Is there any change at java class loading of default jre classes for Virgo-3.6.1?

Thanks & Regards,
Bibhu Prasad Sahoo
Re: Not able to load Run Time JRE class: com.sun.crypto.provider.SunJCE [message #1017246 is a reply to message #1017181] Mon, 11 March 2013 09:43 Go to previous message
Glyn Normington is currently offline Glyn NormingtonFriend
Messages: 1222
Registered: July 2009
Senior Member
There was a big change between Virgo 3.0.x and 3.5.0 as we moved to using the Equinox launcher instead of Virgo's own launcher.

I think it's time for you to break out the debugger and step through the class load of that class to see what's really going on.
Previous Topic:Virgo Crashing on Resolution Failure
Next Topic:Requiring org.slf4j.api causes uses violations in empty server
Goto Forum:
  


Current Time: Thu Apr 25 20:49:18 GMT 2024

Powered by FUDForum. Page generated in 0.03463 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top