Closed glassfishrobot closed 13 years ago
Reported by johnlon@java.net
rustamabd@java.net said: Created an attachment (id=14) the proposed change in patch format
euxx@java.net said: This is duplicated by issue #32 and it would be really nice to have it fixed in the next release
johnlon@java.net said: Created an attachment (id=17) The patch needs to look more like this.
@lukasj said: looks fixed in 1.13-SNAPSHOT
@lukasj said: closing old and already fixed issues
File: correction.java Attached By: johnlon@java.net
File: wsimport.exception.patch Attached By: rustamabd@java.net
This issue was imported from java.net JIRA JAX_WS_COMMONS-22
Marked as fixed on Thursday, October 6th 2011, 10:30:12 am
In WsImportMojo.java we have exception handling that swallows useful info on root causes which makes life difficult for users.
private void wsImport( ArrayList args )
throws MojoExecutionException
{
try {
final ClassLoader cl = Invoker.createClassLoader(Thread.currentThread
().getContextClassLoader());
Class c = cl.loadClass("com.sun.tools.ws.wscompile.WsimportTool");
Object tool = c.getConstructor(OutputStream.class).newInstance
(System.out);
String[] ar = args.toArray( new String[args.size()] );
Boolean result = (Boolean)c.getMethod("run", ar.getClass()).invoke
(tool, new Object[]
{ar}
); if ( !result )
{ throw new MojoExecutionException( "Error executing: wsimport " + args); }
// New handler complementing thrown exception above } catch (MojoExecutionException e)
{ throw e; }
catch (Exception e)
{ // Corrected throw to include second param 'e' (chaining) throw new MojoExecutionException( "Error executing: wsimport " + args, e ); }
}
Without this we cannot see the reasons why the function is failing. See also ... http://forums.java.net/jive/thread.jspa?messageID=293732񇭤
PS I would contribute if I knew how.
Environment
Operating System: All Platform: All
Affected Versions
[current]