1

I wrote a JSF application that uses a connection to an Oracle database. I verified on my local Tomcat (version 7.0) that everything works well. Then when being deployed to a server with a Tomcat 7 that I don't administrate, I get the following error thrown:

Caused by:
java.lang.NoClassDefFoundError - Could not initialize class oracle.jdbc.driver.OracleDriver

On my local system I have the Oracle JDBC Driver (version 11.2.0.4) in CATANIA_HOME/lib. According to the information I have of my deployment server, they use the exact same driver.

At the moment I am using a very basic JSF software that does nothing else than execute

Class.forName("oracle.jdbc.driver.OracleDriver");

on page load. Again, works fine on my local system. Fails on the deployment server. I figured that maybe they missed to include the driver, although they wrote they put it in. So I added the ojdbc5.jar to WEB-INF/lib. However then I get a SealingViolation thrown, which seems to indicate that the class loader found TWO resources containing the oracle driver.

If would be very happy if you were to give me some hints as to how I might solve this problem.

Thanks

Pops
  • 30,199
  • 37
  • 136
  • 151
user1192475
  • 47
  • 1
  • 11
  • http://stackoverflow.com/questions/10093176/java-lang-securityexception-sealing-violation – Stefan Apr 17 '14 at 09:31
  • I already tried that, didn't work. Stills throws a Sealing violation (probably because I can't unseal also the one that is deployed on the Tomcat) Besides...I would be more happy to have an idea why I can't load the Oracle driver, although the jar is there – user1192475 Apr 17 '14 at 09:41
  • 1
    That sounds like a misconfiguration at server side. Clearly the jar is not loaded for your webapp and custom jars need to be sealed against the server keystore (maybe Tomcat is running with the SecurityManager option). Anyway if you cant manage the server yourself they have to fix that. – Stefan Apr 17 '14 at 09:52
  • Assuming it's unix - Ask your support team to give you the output of `lsof -p ` this shows you every JAR that tomcat has opened - here's one random example from mine `/apps/Tomcat/apache-tomcat-7.0.42/endorsed/ogclient.jar` – JoseK Apr 17 '14 at 12:05

1 Answers1

-1

Just put the driver jars in your WEB-INF/lib folder, in my case, I put ojdbc6.jar, you must have one ojdbc6.jar in your project, hope this help

raul_zevahc
  • 179
  • 2
  • 2