You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Jean-Sebastien Delfino (JIRA)" <ji...@apache.org> on 2006/02/27 06:16:39 UTC
[jira] Created: (TUSCANY-42) Exception in JavaGenerator when
generating SDO classes from a .wsdl file
Exception in JavaGenerator when generating SDO classes from a .wsdl file
------------------------------------------------------------------------
Key: TUSCANY-42
URL: http://issues.apache.org/jira/browse/TUSCANY-42
Project: Tuscany
Type: Bug
Components: Java SDO Implementation
Environment: Linux
Reporter: Jean-Sebastien Delfino
Assigned to: Frank Budinsky
To reproduce this problem pass a .wsdl file to JavaGenerator (instead of an .xsd). This is supposed to be supported but throws the following exception:
java.lang.IllegalArgumentException
at org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:197)
at org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:166)
at org.apache.tuscany.sdo.generate.JavaGenerator.generateFromXMLSchema(JavaGenerator.java:246)
at org.apache.tuscany.sdo.plugin.GeneratorMojo.execute(GeneratorMojo.java:144)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:432)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
The IllegalArgumentException actually wraps a ClassCastException on line 175 of XSDHelperImpl. The problem is that XSDHelperImpl expects an XSDResource to be loaded from the input file, but gets a vanilla XMLResource instead because the XSDResourceFactoryImpl is not registered with the .wsdl extension (it is registered with .xsd but the registration with .wsdl is missing).
I am checking in a patch to DataObjectUtil to temporarily fix this problem:
//FIXME ClassCastException in XSDHelper.define() if you give it a WSDL file
// Patch for JIRA TUSCANY-42
if (Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.wsdl")) == null)
{
result.put("wsdl", new XSDResourceFactoryImpl());
}
Frank, can you please review to see if this is how you want to fix the problem. Thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (TUSCANY-42) Exception in JavaGenerator when
generating SDO classes from a .wsdl file
Posted by "Frank Budinsky (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/TUSCANY-42?page=all ]
Frank Budinsky resolved TUSCANY-42:
-----------------------------------
Resolution: Fixed
Sebastien, your patch is the right way to fix this. Thanks.
> Exception in JavaGenerator when generating SDO classes from a .wsdl file
> ------------------------------------------------------------------------
>
> Key: TUSCANY-42
> URL: http://issues.apache.org/jira/browse/TUSCANY-42
> Project: Tuscany
> Type: Bug
> Components: Java SDO Implementation
> Environment: Linux
> Reporter: Jean-Sebastien Delfino
> Assignee: Frank Budinsky
>
> To reproduce this problem pass a .wsdl file to JavaGenerator (instead of an .xsd). This is supposed to be supported but throws the following exception:
> java.lang.IllegalArgumentException
> at org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:197)
> at org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:166)
> at org.apache.tuscany.sdo.generate.JavaGenerator.generateFromXMLSchema(JavaGenerator.java:246)
> at org.apache.tuscany.sdo.plugin.GeneratorMojo.execute(GeneratorMojo.java:144)
> at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:432)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:530)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:472) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:451)
> at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:303) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:270) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:139)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:249)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> The IllegalArgumentException actually wraps a ClassCastException on line 175 of XSDHelperImpl. The problem is that XSDHelperImpl expects an XSDResource to be loaded from the input file, but gets a vanilla XMLResource instead because the XSDResourceFactoryImpl is not registered with the .wsdl extension (it is registered with .xsd but the registration with .wsdl is missing).
> I am checking in a patch to DataObjectUtil to temporarily fix this problem:
> //FIXME ClassCastException in XSDHelper.define() if you give it a WSDL file
> // Patch for JIRA TUSCANY-42
> if (Resource.Factory.Registry.INSTANCE.getFactory(URI.createURI("*.wsdl")) == null)
> {
> result.put("wsdl", new XSDResourceFactoryImpl());
> }
> Frank, can you please review to see if this is how you want to fix the problem. Thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira