That problem has bitten me too. We want to do a dynamic publish which we try to use the Java2WSDL and WSDL2Java so we get a deploy.wsdd file. We found a couple of things that seemed to help. The biggest is we load a custom SecurityManager just before running the .main() methods. The primary objective of the custom SecurityManager is to reject any attempts at running System.exit(). What you'll get is an exception thrown when the System.exit() method gets invoked.
To clean up the exception caused by the SecurityManager we wrote a PrintStream that swallows the exception. This enabled us to essentially call the two utilities inside our JVM without having them shut us down. Note: this is a hack and the real solution would be for Axis to stop making the System.exit() call. Instead it should be doing a return...but I don't know who's listening or if its of significant value so my hack will stay in place for a while. Hope this helps, Grant ----- Original Message ----- From: "Eric BELLARD" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, October 17, 2002 6:52 AM Subject: How to use the Java2WSDL class inside a java program > Hi, > > I'm building a Axis plugin for the IDE eclipse and I've got some problems. > One of the functionnality I'd like to include in the plugin is to > generate a WSDL file from a selected Java class. > I'd like to use the Java2WSDL class for that. > I'd like to execute the method run of the Java2WSDL class. The problem > with this method is that it's not that, it proceeds a "System.exit(1)" > and it kills my eclipse! > > The only way I see is to use a "Runtime.getRuntime().exec(...)" to > execute a command like that: > > Is there a way to walk around? > Is there plan to change the implementation of the Java2WSDL class to be > easily used by another classes? > > Thanks in advance. > >
