Corba不发送动态字符串数组

时间:2013-12-25 14:22:28

标签: java corba

我想从客户端的Corba服务器发送动态String数组。它只适用于静态数组,但我需要从数据库中获取数据,因此无法静态编写。

IDL文件:

module ModData {
  typedef sequence<string> List;
  interface Data {
    List getData();
  };
};

服务器:

public String[] getData() { 
    //This is not working
    String[] data = new String[1];
    data[0] = "xxxx";         

    //This is working
    String[] data = {"xxxx"};
    return data;
}

第一个选项失败了:

com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl convertThrowableToSystemException
WARNING: "IOP00010202: (UNKNOWN) Unknown user exception thrown by the server" org.omg.CORBA.UNKNOWN:   vmcid: SUN  minor code: 202 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.runtimeexception(ORBUtilSystemException.java:8869)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.convertThrowableToSystemException(CorbaMessageMediatorImpl.java:1936)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1886)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleThrowableDuringServerDispatch(CorbaMessageMediatorImpl.java:1839)
at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:274)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1700)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1558)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:940)
at com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:198)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:712)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:469)
at com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1230)
at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.performWork(ThreadPoolImpl.java:490)
at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:519)
Caused by: java.lang.NullPointerException
at ModAuthFIT.ListHelper.write(ListHelper.java:57)
at ModAuthFIT.AuthFITPOA._invoke(AuthFITPOA.java:75)
at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:653)
at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:205)
    ... 9 more

0 个答案:

没有答案