Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » Unable to load Derby EmbeddedDriver even though it's in the classpath(Getting NoClassDefFoundError in Stardust Maven project in Eclipse)
Unable to load Derby EmbeddedDriver even though it's in the classpath [message #831378] Wed, 28 March 2012 20:49 Go to next message
Jan Hendrik Scheufen is currently offline Jan Hendrik Scheufen
Messages: 61
Registered: October 2011
Member

I created a Stardust utility project with a Maven configuration. The project is connected to a Dynamic Web Project in Eclipse (via Deployment Assembly) to deploy it on a local Tomcat instance.

When running JUnit tests inside the utility project which bootstrap an IPP engine, the Derby EmbeddedDriver cannot be found even though it's declared as a Maven dependency and it's definitely on the classpath:

		<dependency>
			<groupId>org.apache.derby</groupId>
			<artifactId>derby</artifactId>
			<version>${derby.version}</version>
			<scope>test</scope>
		</dependency>


In the log the following exceptions appear:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.derby.jdbc.EmbeddedDriver
...
Caused by: java.lang.SecurityException: sealing violation: package org.apache.derby.impl.store.raw.data is sealed
Re: Unable to load Derby EmbeddedDriver even though it's in the classpath [message #831382 is a reply to message #831378] Wed, 28 March 2012 20:56 Go to previous messageGo to next message
Jan Hendrik Scheufen is currently offline Jan Hendrik Scheufen
Messages: 61
Registered: October 2011
Member

The problem had to do with the fact that the utility project was also connected to the Dynamic Web Project (which was deployed on Tomcat) which automatically added an additional library entry ("Apache Tomcat 6.x") to the utility project.

Since the Dynamic Web Project is a Stardust RAD project, the Derby drivers were copied into the <tomcat>/common/lib directory in the server install directory as well.
Therefore I had two different Derby JARs on the classpath which explains the SecurityException.

Resolution:
Open the properties of the utility project, go to "Targeted Runtimes" and uncheck the target server (Apache Tomcat 6.x in my case) to remove the Tomcat libraries from the utility project's classpath.
Re: Unable to load Derby EmbeddedDriver even though it's in the classpath [message #1020183 is a reply to message #831382] Sun, 17 March 2013 13:20 Go to previous message
Robert Emsbach is currently offline Robert Emsbach
Messages: 119
Registered: October 2011
Location: Singapore
Senior Member

I just ran into the same stack trace. The root cause was also having two derby jars in the classpath. The target runtime was not checked, though.
Instead I had derby jars in my Tomcat's lib folder (reused one from another setup with an external derby). Removing those jars fixed the issue.
Previous Topic:IAF-Stardust: WSP_1018_POLICY_EXCEPTION_WHILE_FINISHING_PARSING_WSDL
Next Topic:Support Case Participants do not show
Goto Forum:
  


Current Time: Wed Oct 01 06:03:11 GMT 2014

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

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