【问题标题】:NoClassDEfFoundError while Using AXis with Lotus notes 6.5将 AXis 与 Lotus notes 6.5 一起使用时出现 NoClassDEfFoundError
【发布时间】:2012-12-05 06:57:17
【问题描述】:

我正在尝试在 Lotus notes 6.5 中使用 APACHE-AXIS 框架。

我做到了:

  1. 在脚本库中创建了 java 库
  2. 从 WSDL 创建 Java 文件并添加到库中
  3. 已将 xml-apis.jar 添加到库中。

现在我创建了一个代理并将创建的库添加到它。 请参阅下面的代理代码:

import lotus.domino.*;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.parsers.ParserConfigurationException;
import org.apache.axis.client.*;
public class JavaAgent extends AgentBase {

    public void NotesMain() {

        try {
            Session session = getSession();
            AgentContext agentContext = session.getAgentContext();

            URL url = new URL("http://foo.com");
            QName qName = new QName("xxxx", "getFooDataUser");
            TestWebServiceLocator loc = new TestWebServiceLocator();

            System.out.println("Before STUB Calling");

                        // (Your code goes here) 

        } catch(Exception e) {
            e.printStackTrace();
        }
    }
}

现在在代理中每当代码遇到任何初始化代码(构造函数调用)时,都是NoClassDefFoundError

请参阅下面的堆栈跟踪:

java.lang.NoClassDefFoundError: javax/xml/parsers/ParserConfigurationException

    at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:179)

    at org.apache.axis.AxisEngine.init(AxisEngine.java:172)

    at org.apache.axis.AxisEngine.<init>(AxisEngine.java:156)

    at org.apache.axis.client.AxisClient.<init>(AxisClient.java:52)

    at org.apache.axis.client.Service.getAxisClient(Service.java:103)

    at org.apache.axis.client.Service.<init>(Service.java:112)

    at JavaAgent.NotesMain(JavaAgent.java:18)

    at lotus.domino.AgentBase.runNotes(Unknown Source)

    at lotus.domino.NotesThread.run(NotesThread.java:218)

【问题讨论】:

  • 尝试删除这个未使用的导入:import javax.xml.parsers.ParserConfigurationException;
  • 我删除了,这也无济于事。现在错误消失了,新的错误 java.lang.NoSuchMethodError: org.w3c.dom.Element: method getLocalName()Ljava/lang/String;没找到
  • 看来这是因为R6.5只支持JRE 1.3,而这个getLocalName方法是在JRE 1.4中加入的。任何人都知道这个的解决方法..?

标签: java web-services lotus-notes lotus-domino axis


【解决方案1】:

将 xalan-2.0.1.jar 添加到库中。

您可以在 http://www.java2s.com/Code/Jar/x/Downloadxalan201jar.htm

【讨论】:

  • java.lang.NoSuchMethodError: org.w3c.dom.Element: 方法 getLocalName()Ljava/lang/String;在 org.apache.axis.deployment.wsdd.WSDDDocument.setDocument(WSDDDocument.java:136) 找不到任何想法为什么会发生这种情况
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-06-02
  • 2019-09-16
  • 1970-01-01
  • 2021-05-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多