Burghard Britzke <[email protected]> writes: > it seems to be impossible to start the Network-Server as a maven goal. > The maven dependency > > <dependency> > <groupId>org.apache.derby</groupId> > <artifactId>derbynet</artifactId> > <version>10.10.1.1</version> > </dependency> > > loads a file named 'derbynet-10.10.1.1.jar'. > > When trying to Start the NetworkServerControl to start the > Network-Server, I am getting the error > "derbynet.jar konnte im Classpath nicht gefunden werden.", which is > the translation of the error code"DRDA_MissingNetworkJar.S" > > This error is raised at line 765 of NetworkServerControl.java > 743 /** > 744 *<p> > 745 * Find the url of the library directory which holds derby.jar and > 746 * derbynet.jar. The Basic policy assumes that both jar files > live in the > 747 * same directory. > 748 * </p> > 749 */ > 750 private static String getCodeSourcePrefix( > NetworkServerControlImpl server ) > 751 throws Exception > 752 { > 753 String derbyNetURL = > NetworkServerControl.class.getProtectionDomain().getCodeSource().getLocation().toExternalForm(); > 754 int idx = derbyNetURL.indexOf( DERBYNET_JAR ); > 755 > 756 // > 757 // If the customer isn't running against jar files, our Basic > policy > 758 // won't work. > 759 // > 760 if ( idx < 0 ) > 761 { > 762 String errorMessage = server.localizeMessage( > "DRDA_MissingNetworkJar.S", null ); > 763 > 764 // this throws an exception and exits this method > 765 server.consoleError( errorMessage ); > 766 } > 767 > 768 // > 769 // Otherwise, we have the directory prefix for our url. > 770 // > 771 String directoryPrefix = derbyNetURL.substring( 0, idx ); > 772 > 773 return directoryPrefix; > 774 } > It seems like for NetworkServerControl the name of the library file in > the classpath must be derbyclient.jar (not derbyclient-10.10.1.1.jar). > > Does anybody know how to fix it?
Hi Burghard, There are some possible workarounds for this problem, for example: - rename the jar file to derbynet.jar, or - start the network server with a custom security policy, where you specify the actual name of the jar file, as described here: http://db.apache.org/derby/docs/10.10/adminguide/tadminnetservcustom.html Some more permanent solutions have been discussed in this bug report: https://issues.apache.org/jira/browse/DERBY-3083 Unfortunately, no one has stepped up to fix it yet. -- Knut Anders
