-
1. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
dinesh_hyd Sep 21, 2012 10:28 AM (in response to gajendra083)Hi Gajendra,
I am also in the process of migrating an existing java project from jboss4 to jboss7 and I ran into the same exact error.
I am using JDK1.6.0_34. I see that <JAVA_HOME>/jre/lib/ext has sunjce_provide.jar but still it is failing with the above error.
I am using a Windows 7 machine and PATH has <JAVA_HOME>\bin and CLASSPATH has <JAVA_HOME>\jre\lib set.
Can you please let me know what exactly have you done to get rid of this error?
Can you also let me know any other problems you encountered during the migration which would greatly help me as well?
Thanks
Dinesh
-
2. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
mlw5415 Sep 24, 2012 11:19 PM (in response to gajendra083)May be you can try as below:
modify {JBOSS_HOME}/modules/sun/jdk/main/module.xml, add packages that you need to 'paths' node, like '<path name="com/sun/crypto"/>'
-
3. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
ctomc Sep 25, 2012 4:34 AM (in response to mlw5415)Just for information,
this was fixed in upstream so you will get it if you use nightly build and will be avalible in next release.
--
tomaz
-
4. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
dinesh_hyd Sep 26, 2012 10:19 AM (in response to mlw5415)Iwen,
Thanks for replying to my post.
I tried your solution but it is still not working and failing with the same error(java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE ).
JFYI, I am using jdk1.6.0_34 installed in my local machine.
The following is the line of code in my java program where it is erroring out.
Security.addProvider(new com.sun.crypto.provider.SunJCE());
Any other sugestions?
--
Dinesh
-
5. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
ctomc Sep 26, 2012 10:23 AM (in response to dinesh_hyd)Hi,
also add
<path name="com/sun/crypto/provider"/>
every package has to be imported separatly
--
tomaz
-
6. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
dinesh_hyd Sep 26, 2012 10:25 AM (in response to ctomc)Tomaz,
Thanks for replying to my post.
Can you please specify the release number when you meant next release in your post.
If it is a small fix can you please provide the steps so that I can try it out.
--
Dinesh
-
7. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
ctomc Sep 26, 2012 10:57 AM (in response to dinesh_hyd)Hi,
this is the https://github.com/jbossas/jboss-as/blob/master/build/src/main/resources/modules/sun/jdk/main/module.xml that is going to be part of next version 7.2.x
you can just take whole module.xml file and replace it with what you have in modules/sun/jdk/main
--
tomaz
-
8. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
dinesh_hyd Sep 26, 2012 11:23 AM (in response to ctomc)Tomaz,
Thanks a ton.
It is working now.
--Dinesh
-
9. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
b.eckenfels Sep 26, 2012 3:18 PM (in response to ctomc)Is there a similiar API export for the IBM JCE providers?
-
10. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
ctomc Sep 26, 2012 3:36 PM (in response to b.eckenfels)Hi,
I don't have/use ibm jdk very regulary, so i cannot confirm.
But support for ibm jdk specific classes was added as part of new module "ibm.jdk"
can you check if packages that contain ibm's JCE are there?
But please note, that ibm.jdk module will only work on 7.2.x builds.
--
tomaz
-
11. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
b.eckenfels Sep 26, 2012 3:45 PM (in response to ctomc)Tomaz Cerar wrote:
can you check if packages that contain ibm's JCE are there?
I will check later on, but I think it misses some packages, like com.ibm.jsse2,com.ibm.crypto.provider,com.ibm.security.jgss,com.ibm.security.cert,com.ibm.security.sasl,com.ibm.fips.jsse,com.ibm.fips.crypto.fips.provider and possibly some others. I will check
But please note, that ibm.jdk module will only work on 7.2.x builds.
Do you mean the module.xml is not present in 7.1 or do you mean I cannot copy it to 7.1?
Bernd
-
12. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
ctomc Sep 26, 2012 6:28 PM (in response to b.eckenfels)Bernd Eckenfels wrote:
But please note, that ibm.jdk module will only work on 7.2.x builds.
Do you mean the module.xml is not present in 7.1 or do you mean I cannot copy it to 7.1?
Bernd
it is a new module only present in 7.2. You could copy it to 7.1 but it would not have any affect.
What you can do is (which is ugly) add this ibm specific packages to sun.jdk module until 7.2 has this separated.
Given that you clearly have lots of expirence with ibm jdk, would you be willing to contribute fixed(with added packages) ibm.jdk module.xml by submiting pull request for master branch.
thanks in advance.
--
tomaz
-
13. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
dinesh_hyd Sep 27, 2012 10:30 AM (in response to dinesh_hyd)Tomaz,
As mentioned yesterday that SunJCE error is gone after making <path name="com/sun/crypto/provider"/> entry under modules/sun/jdk/main/module.xml file.
Just curious, Is there any other way to get rid of this error like adding an entry in jboss-deployment-structure.xml file?
Actually, I am following the migration document from the following link and trying to understand the class loading concept in AS7.
Couple more issues which i encountered yesterday as part of upgrade which I would like to share and may need your suggestion.
As mentioned in the above document i generated a Jboss Tattletale report.
When i started my server the follwing is the error i see in the log file:
Issue 1:
--------------
Error : 0:22:39,545 ERROR [stderr] (DownHandler (NAKACK)) Caused by: java.lang.ClassNotFoundException: EDU.oswego.cs.dl.util.concurrent.ReadWriteLock from [Module "deployment.gateway.war:main" from Service Module Loader]
10:22:39,545 ERROR [stderr] (DownHandler (NAKACK)) at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
As per the Tattletale report the above is part of jgroups-all.jar which exists in the project classpath not sure why it failed even after existing in classpath
I got rid of the above error by creating a jboss-deployment-structure.xml file under webapp/WEB-INF with the following entry.
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.jgroups" />
</dependencies>
</deployment>
</jboss-deployment-structure>Can you please suggest if this is the right way of doing it? If not can you pls suggest the right way?
Issue 2 :
------------
I removed a package and a class under the package in my project but in the logs i still getting a ClassNotFoundException for that particular class.
Is there anything to be done in JBoss to get rid of this error?
--Dinesh
-
14. Re: java.lang.ClassNotFoundException: com.sun.crypto.provider.SunJCE
ctomc Sep 27, 2012 2:49 PM (in response to dinesh_hyd)Hi,
for classloading in general take a look at https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7
basicly you can do almost everything as part of jboss-deployment-structure.xml
jdk classes are bit special, but usualy they can also be imported by jboss-deployment-structure.xml depends who the caller is.
--
tomaz