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?
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}]
{http://neolink.ws.gpunkt.com}08.07.2011 15:49:43 org.apache.axis.deployment.wsdd.WSDDService deployTypeMapping
SCHWERWIEGEND: Unable to deploy typemapping:
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 {
{ URL.class }Method method = classLoaderClass.getDeclaredMethod("addURL",
new Class[]
);
{ url }method.setAccessible(true);
method.invoke(systemClassLoader, new Object[]
);
{ t.printStackTrace(); throw new IntrospectionException( "Error when adding url to system ClassLoader "); }} catch (Throwable t)
}
I used this method at the begin of method execute:
public void execute() throws AxisPluginException {
{ String path = (String) project.getCompileClasspathElements() .get(index); URL cpUrl = new File(path).toURL(); addURLToSystemClassLoader(cpUrl); }//add project classpath elements to mojo classpath
try {
if((project!=null)&&(project.getCompileClasspathElements()!=null)){
for (int index = 0; index < project.getCompileClasspathElements()
.size(); index++)
}
{ 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 (MalformedURLException 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?