You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Andreas Veithen (JIRA)" <ax...@ws.apache.org> on 2012/09/19 21:08:08 UTC

[jira] [Created] (AXIS-2877) wsdl2java ant task fails to load custom GeneratorFactory from

Andreas Veithen created AXIS-2877:
-------------------------------------

             Summary: wsdl2java ant task fails to load custom GeneratorFactory from <classpath>
                 Key: AXIS-2877
                 URL: https://issues.apache.org/jira/browse/AXIS-2877
             Project: Axis
          Issue Type: Bug
          Components: WSDL processing
    Affects Versions: 1.4
            Reporter: Andreas Veithen
            Assignee: Andreas Veithen
            Priority: Minor
             Fix For: 1.4.1


The wsdl2java ant task fails to load a custom GeneratorFactory (specified using the "factory" attribute) from the class path specified using a nested <classpath> element. This is caused by the following code in Wsdl2javaAntTask:

            if (factory != null) {
                emitter.setFactory(factory);
            }
            ...
            if (classpath != null) {
                AntClassLoader cl = new AntClassLoader(
                        getClass().getClassLoader(),
                        getProject(),
                        classpath,
                        false);
                log("Using CLASSPATH " + cl.getClasspath(),
                        Project.MSG_VERBOSE);
                ClassUtils.setDefaultClassLoader(cl);
            }

Axis attempts to load the custom GeneratorFactory in the Emitter#setFactory method, but the class loader (for the nested <classpath> element) is only set up later.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS-2877) wsdl2java ant task fails to load custom GeneratorFactory from

Posted by "Hudson (JIRA)" <ax...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459010#comment-13459010 ] 

Hudson commented on AXIS-2877:
------------------------------

Integrated in axis-trunk #142 (See [https://builds.apache.org/job/axis-trunk/142/])
    AXIS-2877:
 * Ensure that Wsdl2javaAntTask sets up the class loader before attempting to set the custom GeneratorFactory.
 * Change the class loader delegation mode to parent-first so that the custom GeneratorFactory can be loaded even if the nested <classpath> contains the Axis JARs. (Revision 1387718)

     Result = SUCCESS
veithen : 
Files : 
* /axis/axis1/java/trunk/axis-ant/pom.xml
* /axis/axis1/java/trunk/axis-ant/src/main/java/org/apache/axis/tools/ant/wsdl/Wsdl2javaAntTask.java
* /axis/axis1/java/trunk/axis-ant/src/test/ant/generatorfactory
* /axis/axis1/java/trunk/axis-ant/src/test/ant/generatorfactory/build.xml
* /axis/axis1/java/trunk/axis-ant/src/test/java/org
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis/tools
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis/tools/ant
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/CustomGeneratorFactoryTest.java
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/MyGeneratorFactory.java
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/MyServiceImplWriter.java
* /axis/axis1/java/trunk/axis-ant/src/test/java/org/apache/axis/tools/ant/wsdl/MyServiceWriter.java
* /axis/axis1/java/trunk/axis-ant/src/test/wsdl/generatorfactory
* /axis/axis1/java/trunk/axis-ant/src/test/wsdl/generatorfactory/sample.wsdl
* /axis/axis1/java/trunk/pom.xml
* /axis/axis1/java/trunk/samples/integrationguide-sample/pom.xml

                
> wsdl2java ant task fails to load custom GeneratorFactory from <classpath>
> -------------------------------------------------------------------------
>
>                 Key: AXIS-2877
>                 URL: https://issues.apache.org/jira/browse/AXIS-2877
>             Project: Axis
>          Issue Type: Bug
>          Components: WSDL processing
>    Affects Versions: 1.4
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.4.1
>
>
> The wsdl2java ant task fails to load a custom GeneratorFactory (specified using the "factory" attribute) from the class path specified using a nested <classpath> element. This is caused by the following code in Wsdl2javaAntTask:
>             if (factory != null) {
>                 emitter.setFactory(factory);
>             }
>             ...
>             if (classpath != null) {
>                 AntClassLoader cl = new AntClassLoader(
>                         getClass().getClassLoader(),
>                         getProject(),
>                         classpath,
>                         false);
>                 log("Using CLASSPATH " + cl.getClasspath(),
>                         Project.MSG_VERBOSE);
>                 ClassUtils.setDefaultClassLoader(cl);
>             }
> Axis attempts to load the custom GeneratorFactory in the Emitter#setFactory method, but the class loader (for the nested <classpath> element) is only set up later.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Resolved] (AXIS-2877) wsdl2java ant task fails to load custom GeneratorFactory from

Posted by "Andreas Veithen (JIRA)" <ax...@ws.apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Veithen resolved AXIS-2877.
-----------------------------------

    Resolution: Fixed
    
> wsdl2java ant task fails to load custom GeneratorFactory from <classpath>
> -------------------------------------------------------------------------
>
>                 Key: AXIS-2877
>                 URL: https://issues.apache.org/jira/browse/AXIS-2877
>             Project: Axis
>          Issue Type: Bug
>          Components: WSDL processing
>    Affects Versions: 1.4
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.4.1
>
>
> The wsdl2java ant task fails to load a custom GeneratorFactory (specified using the "factory" attribute) from the class path specified using a nested <classpath> element. This is caused by the following code in Wsdl2javaAntTask:
>             if (factory != null) {
>                 emitter.setFactory(factory);
>             }
>             ...
>             if (classpath != null) {
>                 AntClassLoader cl = new AntClassLoader(
>                         getClass().getClassLoader(),
>                         getProject(),
>                         classpath,
>                         false);
>                 log("Using CLASSPATH " + cl.getClasspath(),
>                         Project.MSG_VERBOSE);
>                 ClassUtils.setDefaultClassLoader(cl);
>             }
> Axis attempts to load the custom GeneratorFactory in the Emitter#setFactory method, but the class loader (for the nested <classpath> element) is only set up later.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org


[jira] [Commented] (AXIS-2877) wsdl2java ant task fails to load custom GeneratorFactory from

Posted by "Andreas Veithen (JIRA)" <ax...@ws.apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS-2877?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13458994#comment-13458994 ] 

Andreas Veithen commented on AXIS-2877:
---------------------------------------

In addition to that, Wsdl2javaAntTask creates the class loader with parent-last delegation mode. If the nested <classpath> happens to contain the Axis JARs, then the execution fails with the following error:

java.lang.ClassCastException: xxx.MyGeneratorFactory cannot be cast to org.apache.axis.wsdl.gen.GeneratorFactory
        at org.apache.axis.wsdl.toJava.Emitter.setFactory(Emitter.java:469)
        at org.apache.axis.tools.ant.wsdl.Wsdl2javaAntTask.execute(Wsdl2javaAntTask.java:243)
                
> wsdl2java ant task fails to load custom GeneratorFactory from <classpath>
> -------------------------------------------------------------------------
>
>                 Key: AXIS-2877
>                 URL: https://issues.apache.org/jira/browse/AXIS-2877
>             Project: Axis
>          Issue Type: Bug
>          Components: WSDL processing
>    Affects Versions: 1.4
>            Reporter: Andreas Veithen
>            Assignee: Andreas Veithen
>            Priority: Minor
>             Fix For: 1.4.1
>
>
> The wsdl2java ant task fails to load a custom GeneratorFactory (specified using the "factory" attribute) from the class path specified using a nested <classpath> element. This is caused by the following code in Wsdl2javaAntTask:
>             if (factory != null) {
>                 emitter.setFactory(factory);
>             }
>             ...
>             if (classpath != null) {
>                 AntClassLoader cl = new AntClassLoader(
>                         getClass().getClassLoader(),
>                         getProject(),
>                         classpath,
>                         false);
>                 log("Using CLASSPATH " + cl.getClasspath(),
>                         Project.MSG_VERBOSE);
>                 ClassUtils.setDefaultClassLoader(cl);
>             }
> Axis attempts to load the custom GeneratorFactory in the Emitter#setFactory method, but the class loader (for the nested <classpath> element) is only set up later.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org