Solved

Could not initialize class javax.crypto.SunJCE_b

Posted on 2014-01-10
7
1,951 Views
Last Modified: 2014-01-29
Hi all,

We have developed a Java servlet application to handle web service requests and responses.  It is built on Eclipse using Java 1.6.0.29 and Tomcat 7 all running on Windows.  It was developed on my PC then tested on a Test server and to be run Live on a Live server.  I have set up an SSL certificate on both the Test and Live servers as outlined on Tomcats online instructions and amended the Tomcat server.xml file to have the connector below;

<Connector SSLEnabled="true" acceptCount="100" clientAuth="false" disableUploadTimeout="true" enableLookups="false" maxThreads="150" port="8443" keystoreFile="C:\Keys\PortalLive.keystore" keystorePass="Key#P4rtal" protocol="org.apache.coyote.http11.Http11NioProtocol" scheme="https" secure="true" sslProtocol="TLS" />

The servlet deploys and functions fine on my PC and the Test server using a https://localhost:8443 URL with SoapUI but on the Live server no response is returned in SoapUI and the Tomcat logs error at the top is;

java.lang.NoClassDefFoundError: Could not initialize class javax.crypto.SunJCE_b

My investigation so far seems to suggest the issue is with the jce.jar, however I have tried the following with no success.  Please can someone help.

Ensured the jce.jar is in the jre\lib directory
Ensured the jre\lib is set up as JAVA_HOME environment variable
Ensured that JAVA_HOME is in the classpath environment variable
Tried swapping the location of jce.jar to Tomcats lib directory
Tried placing the jce.jar in the applications WEB-INF\lib directory and rebuilding and redeploying
Placing the location of the jce.jar in the applications Build Path and rebuilding and redeploying

I also attempted changing the “protocol” attribute of the server.xml connector from Http11NioProtocol to Http11Protocol but this gave the error below in the TOMCAT logs BEFORE Tomcat deployed the WAR;

Failed to initialize connector [Connector[HTTP/1.1-8443]]
org.apache.catalina.LifecycleException: Failed to initialize component [Connector[HTTP/1.1-8443]]

Thank you so much in advance

ajfarroll
0
Comment
Question by:ajfarroll
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
7 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 39781858
Can you make sure that you have *exactly* the same environment on both the test and production servers? There seems to be an incompatibility between these two.
0
 

Author Comment

by:ajfarroll
ID: 39796547
Hi,

I apologise for not responding sooner but was on annual leave for a few days.  Thanks girionis for your feedback.  We were doing some further investigation ourselves and one problem may be that the development PC and the testing server are running on Windows 32 bit but the Live server is running 64 bit and one source suggests that this is a problem for Java.  Do you agree?

Thanks again

ajfarroll
0
 
LVL 35

Accepted Solution

by:
girionis earned 500 total points
ID: 39799341
Yes, it's more than likely that the issue is caused because of this incompatibility.
0
 

Author Comment

by:ajfarroll
ID: 39800354
Thanks again for your response girionis.  The infrastructure guys in my company have stripped out Java and Tomcat 64 bit installs and installed 32 bit ones now.  I will be able test this tomorrow and let you know how I get on.

Regards

AJFarroll
0
 

Author Closing Comment

by:ajfarroll
ID: 39817219
Thanks gerionis.  Changing the Java and Tomcat to 32 bit got us past that problem.  This is one remember.

Regards

AJFarroll
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Detect Closed Loops (circles, figure-8s, etc) in PNG Images 6 74
how to debug htl and js pages 8 53
Java Eclipse Loop 3 29
spring maven example issues 3 38
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question