即使存在轴jar,也无法初始化抛出的类org.apache.axis.client.AxisClient类

Har*_*nam 3 java axis web-services noclassdeffounderror nexus

我正在为nexus oss编写插件。我在哪里使用axis进行webservice调用。它抛出一个

InvocationTargetException:target:java.lang.NoClassDefFoundError:无法初始化类org.apache.axis.client.AxisClient

因此,如果神经联系因为抛出此NoClassDefFoundError而找不到我的轴罐,我会感到不安。因此我逐步进行调试,以检查nexus是否了解我的轴jar,并且在调试时发现控件进入轴jar内(因此我的假设是nexus没有看到轴jar是错误的)。它进入了轴向的Service.java里面,代码就像

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();
}
Run Code Online (Sandbox Code Playgroud)

它在行引擎= getAxisClient()处抛出此异常;实际上在行返回new AxisClient(getEngineConfiguration()); 在getAxisClient方法中。因此,如果它可以找到在axis.jar内的service.java,则没有任何理由无法找到在Axis jar的同一包中的AxisClient类。

因此,能否请您帮助我找出此异常的原因。

是不是我的轴震击器没有被联系获取?如何确定罐子是否被连结拿走?

Har*_*nam 5

老板帮我找到了答案。

这实际上是commons-logging的问题。我在公共关系中加载了公共日志。在码头服务器中运行的关系本身具有公共日志,因此发生了冲突。现在,我从插件描述符中删除了公共日志。然后问题解决了,我的插件开始工作了。

谢谢 。