[ 
https://jira.codehaus.org/browse/MAXISTOOLS-3?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=272673#comment-272673
 ] 

Kirstin Ebeling commented on MAXISTOOLS-3:
------------------------------------------

I now use this great plugin in my webservice project and had also this problem:

[INFO] [axistools:admin {execution: publish_NLServer_2_server_config_wsdd}]
08.07.2011 15:49:43 org.apache.axis.deployment.wsdd.WSDDService 
deployTypeMapping
SCHWERWIEGEND: Unable to deploy typemapping: 
{http://neolink.ws.gpunkt.com}ArrayOf_tns8_IntegerWithAbsolutCount
java.lang.ClassNotFoundException: 
[Lcom.gpunkt.ws.neolink.model.query.IntegerWithAbsolutCount;
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
        at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
        at 
org.apache.axis.deployment.wsdd.WSDDTypeMapping.getLanguageSpecificType(WSDDTypeMapping.java:183)
        at 
org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.java:542)
        at 
org.apache.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:253)
        at 
org.apache.axis.deployment.wsdd.WSDDService.<init>(WSDDService.java:233)
        at 
org.apache.axis.deployment.wsdd.WSDDDeployment.<init>(WSDDDeployment.java:192)
        at 
org.apache.axis.deployment.wsdd.WSDDDocument.<init>(WSDDDocument.java:78)
        at org.apache.axis.utils.Admin.processWSDD(Admin.java:111)
        at org.apache.axis.utils.Admin.process(Admin.java:158)
        at 
org.codehaus.mojo.axistools.admin.AdminWrapper.execute(AdminWrapper.java:83)
        at 
org.codehaus.mojo.axistools.admin.DefaultAdminPlugin.execute(DefaultAdminPlugin.java:94)
        at org.codehaus.mojo.axistools.AdminMojo.execute(AdminMojo.java:90)
        ...

Because I need a solution, I checked out axistools-maven-plugin from svn and 
insert following method (first in DefaultAdminPlugin.java, but in the end in 
AbstractAxisPlugin - so it works for all goals)

        public void addURLToSystemClassLoader(URL url)
                        throws IntrospectionException {
                URLClassLoader systemClassLoader = (URLClassLoader) ClassLoader
                                .getSystemClassLoader();
                Class classLoaderClass = URLClassLoader.class;

                try {
                        Method method = 
classLoaderClass.getDeclaredMethod("addURL",
                                        new Class[] { URL.class });
                        method.setAccessible(true);
                        method.invoke(systemClassLoader, new Object[] { url });
                } catch (Throwable t) {
                        t.printStackTrace();
                        throw new IntrospectionException(
                                        "Error when adding url to system 
ClassLoader ");
                }
        }

I used this method at the begin of method execute:

           public void execute() throws AxisPluginException {   
                //add project classpath elements to mojo classpath
                try {
                        
if((project!=null)&&(project.getCompileClasspathElements()!=null)){
                                for (int index = 0; index < 
project.getCompileClasspathElements()
                                                .size(); index++) {
                                        String path = (String) 
project.getCompileClasspathElements()
                                                        .get(index);
                                        URL cpUrl = new File(path).toURL();
                                        addURLToSystemClassLoader(cpUrl);
                                }
                        }
                } catch (MalformedURLException e) {
                        getLog().warn("Can't add compile classpath elements to 
mojo!",e);
                } catch (DependencyResolutionRequiredException e) {
                        getLog().warn("Can't add compile classpath elements to 
mojo!",e);
                } catch (IntrospectionException e) {
                        getLog().warn("Can't add compile classpath elements to 
mojo!",e);
                }               
        }

In subclasses of AbsractAxisPlugin I insert the call "super.execute()" at the 
begin of execute()-method.

This works fine. Would you please insert this in your project, so all user of 
your plugin (I too) can access and use this?



> axistools:admin does not include target/classes in classpath
> ------------------------------------------------------------
>
>                 Key: MAXISTOOLS-3
>                 URL: https://jira.codehaus.org/browse/MAXISTOOLS-3
>             Project: Maven 2.x Axis Tools Plugin
>          Issue Type: Bug
>          Components: admin
>         Environment: windows xp sp2, maven 2.0.6, axistools 1.1
>            Reporter: Rick Janda
>
> The execution of org.apache.axis.utils.Admin in the axistools:admin goal 
> should contain the target/classes path (or whatever path, the classes are 
> compiled to) in its classpath, as of it depends on the compiled classes from 
> a preceding wsdl2java run. Right now, it seems, it does not. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to