lotus-notes - suitetalk 的轴故障 : faultString: java. io.IOException

标签 lotus-notes apache-axis webservice-client netsuite

我正在尝试使用 NetSuite 的 suiteTalk java api 编写我们的 Lotus Notes 系统和 NetSuite 之间的接口(interface)。 代码抛出的第一个错误是类定义未找到错误。 对于:

sun/security.provider/sun.class
sun/security.provider/sun$1.class
sun/security.provider/NativePRNG.class

我发现lotus Notes中的rt.jar实际上缺少这个文件。所以我从我单独下载的jdk1.6中添加了这些类文件。一旦我修复了这个问题,我就开始收到 axis.Faults 错误。

这是我尝试从 Lotus Note 代理执行的简单登录代码:

   public void loginTest(){

         NetSuitePortType _port=null;
        // In order to use SSL forwarding for SOAP message. Refer to FAQ for details
        System.setProperty("axis.socketSecureFactory","org.apache.axis.components.net.SunFakeTrustSocketFactory");


        // Locate the NetSuite web service
        NetSuiteServiceLocator serviceLocator= new NetSuiteServiceLocator();

        //Get the service port
        try {
            _port=serviceLocator.getNetSuitePort();
        } catch (ServiceException e) {
            System.out.println("Error in intializing GlobalSuiteTalkSetup");
            e.printStackTrace();
        }

        // Setting client timeout to 2 hours for long running operatotions
        ((NetSuiteBindingStub) _port).setTimeout(60*60*1000*2);
        try {
        // Populate Passport object with all login information
           Passport passport = new Passport();
           RecordRef role = new RecordRef();
           BufferedReader br = new BufferedReader(new InputStreamReader(System.in));


           passport.setEmail("username");
           passport.setPassword("password.");
           role.setInternalId("3");
           passport.setRole(role);
           passport.setAccount("111111");


           // Login to NetSuite
           System.out.print("\nLogging into NetSuite");
           System.out.print("  Username: " + passport.getEmail());
           System.out.print("  Account: " + passport.getAccount());
           System.out.print("  password: " + passport.getPassword());
           System.out.print("  role: " + passport.getRole());

           Status status;

            status = (_port.login(passport)).getStatus();

           // Process the response
           if (status.isIsSuccess() == true) 
           {

            System.out.print("\nThe login was successful and a new session has been created.");
           } else 
           {
            // Should never get here since any problems with the
            // login should have resulted in a SOAP fault
            System.out.print("Login failed");
            //System.out.print(getStatusDetails(status));
           }


    } catch (InvalidVersionFault e) {
        // TODO Auto-generated catch block
        e.printStackTrace();


    } catch (InvalidCredentialsFault e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InsufficientPermissionFault e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ExceededRequestLimitFault e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (UnexpectedErrorFault e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (InvalidAccountFault e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        }

代码抛出错误:

AxisFault


faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.io.IOException
 faultActor: 
 faultNode: 
 faultDetail: 
{http://xml.apache.org/axis/}stackTrace:java.io.IOException
at org.apache.axis.components.net.SunJSSESocketFactory.initFactory(SunJSSESocketFactory.java:88)
at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:79)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.netsuite.webservices.platform_2015_1.NetSuiteBindingStub.login(NetSuiteBindingStub.java:12799)
at Login.loginTest(Unknown Source)
at JavaAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)

{http://xml.apache.org/axis/}hostname:

java.io.IOException
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at com.netsuite.webservices.platform_2015_1.NetSuiteBindingStub.login(NetSuiteBindingStub.java:12799)
at Login.loginTest(Unknown Source)
at JavaAgent.NotesMain(Unknown Source)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Caused by: java.io.IOException
at org.apache.axis.components.net.SunJSSESocketFactory.initFactory(SunJSSESocketFactory.java:88)
at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:79)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
... 14 more

最佳答案

我找到了这个问题的解决方案。对于任何可能遇到类似问题的人都可以从此解决方案中获得一些线索:

问题是因为我在代码中放入了以下语句。

System.setProperty("axis.socketSecureFactory","org.apache.axis.components.net.SunFakeTrustSocketFactory");

此语句在使用 Sun JVM 时是必需的,但由于 Lotus Notes 使用 IBM JVM,因此将 axis.socketSecureFactory 设置为 org.apache.axis.components.net.SunFakeTrustSocketFactory 使系统查找 IBM JVM 中不存在的 Sun 类.

不需要像我之前那样将 Sun JVM 中缺少的类添加到 rt.jat 中。只需注释该语句并使用可用的轴路径 frpm NetSuite

在尝试运行代码之前,不要忘记将补丁放入 Note 的/JVM/Lib/EXT 文件夹中并重新启动 Lotus Notes。

关于lotus-notes - suitetalk 的轴故障 : faultString: java. io.IOException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31183674/

相关文章:

lotus-notes - 检索 Java 代理对文档所做的更改

java - 使用 Java api 按日期搜索 Lotus Notes

eclipse - 如何从 Eclipse 中的 Web 项目中删除 Axis 项目构面?

java - 将客户端应用程序从 Axis 迁移到 Axis 2 时的定位器和 stub 类

.net - 如何防止 .NET SOAP 客户端在 HTTP header 中包含 "Connection: KeepAlive"。 (使用WSE3.0)

web-services - 使用纯 JAX-WS 添加 SOAP header 对象

java - 如何使用 Java 调用 Web 服务

lotus-notes - Lotus Notes - 自动回复代理,用于接收到特定邮件接收的电子邮件

java - 使用 SOAP 中请求的证书注册协议(protocol) "https"多线程(轴 2)

dojo - XPages - Dojo 验证文本框 - 自定义消息