DerbyDB start fails on Docker -- Problem and Solution

An attempt to start DerbyDB delivered with Glassfishv5 or recent Payara (asadmin start-database) will fail with:

Starting database in Network Server mode on host and port 1527.
Unable to start database.  Please check log in /glassfish5/glassfish/databases/derby.log.

The derby.log contains the following exceptions:

Thu Jul 06 16:20:06 UTC 2017 : Security manager installed using the Basic server security policy.
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at com.sun.enterprise.admin.cli.optional.DerbyControl.invokeNetworkServerControl(
	at com.sun.enterprise.admin.cli.optional.DerbyControl.main(
Caused by: java.lang.ExceptionInInitializerError
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(
	at org.apache.derby.impl.drda.NetworkServerControlImpl.startNetworkServer(Unknown Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)
	at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source)
	at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)
	... 6 more
Caused by: java.lang.ClassCastException: cannot be cast to java.lang.RuntimeException
	at Source)
	at Source)
	at Source)
	at Source)
	at Method)
	at Source)
	at Source)
	at Source)
	at Source)
	at Source) 

The exception is related to the issues: DERBY-6410 and DERBY-6503

Fix: update DerbyDB: recent versions are running on Docker without any issues, checkout docker image: Docklands DerbyDB image.

GlassFish v5, as well as, recent Payara Server (Issue #1738), are delivered with an old DerbyDB version. Thankfully the DerbyDB version can be easily upgraded just by overriding the folders: payara41/javadb glassfish5/javadb with the recent DerbyDB version. See e.g. the Docker image: Payara With DerbyDB.

See you at Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home:


Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments