I am writing a plugin for nexus oss . where I am using axis for making webservice calls . It throws an
InvocationTargetException : target : java.lang.NoClassDefFoundError: Could not initialize class org.apache.axis.client.AxisClient
so i was apprehensive if nexus could not find my axis jar as it threw this NoClassDefFoundError. so I started debugging step by step to check if nexus knows my axis jar and while debugging I found that the the control goes inside the axis jar (so my assumption that nexus did not see axis jar is wrong ). It went inside Service.java in axis and there the code was like
protected AxisClient getAxisClient() {
return new AxisClient(getEngineConfiguration());
}
/**
* Constructs a new Service object - this assumes the caller will set
* the appropriate fields by hand rather than getting them from the
* WSDL.
*/
public Service() {
engine = getAxisClient();
}
It was throwing this exception at line engine = getAxisClient(); that is actually at line return new AxisClient(getEngineConfiguration()); inside getAxisClient method . so if it can find service.java which is inside axis.jar , there cannot be any reason why it cannot find the AxisClient class which is in the same package in axis jar.
So can you please help me in spotting out the reasons for this exception.
Is my axis jar not fetched by nexus ? How to find if the jar was fetched by nexus ?
My boss helped me find the answer .
It was actually the problem with commons-logging . I loaded a commons-logging in my nexus .The nexus which was running in a jetty server itself had a commons-logging , so there was a conflict . Now I removed my commons logging from the plugin descriptor . Then the problem was over , my plugin started working .
Thanks .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With