我有一个完美的CORBA客户端 - 服务器程序。客户端可以获得一个仆人并远程调用方法。
我现在想让服务器使用JPA与数据库进行交互。但是,当我将这一行添加到服务器代码时,一切都会出错:
emf.createEntityManager();
服务器构建,它无错误地注册到orbd。但是,当我运行尝试连接服务器的客户端时,我得到以下异常:
异常:org.omg.CORBA.OBJECT_NOT_EXIST:
完整异常和堆栈跟踪是:
异常:org.omg.CORBA.OBJECT_NOT_EXIST:---------- BEGIN服务器端堆栈跟踪---------- org.omg.CORBA.OBJECT_NOT_EXIST:vmcid:SUN次要代码:401已完成:否 at com.sun.corba.se.impl.logging.ActivationSystemException.errorInBadServerIdHandler(ActivationSystemException.java:239) at com.sun.corba.se.impl.logging.ActivationSystemException.errorInBadServerIdHandler(ActivationSystemException.java:257) at com.sun.corba.se.impl.activation.ServerManagerImpl.handle(ServerManagerImpl.java:604) at com.sun.corba.se.impl.orb.ORBImpl.handleBadServerId(ORBImpl.java:1602) at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.checkServerId(CorbaServerRequestDispatcherImpl.java:407) at com.sun.corba.se.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:182) 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:471) 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) 引起:com.sun.corba.se.spi.activation.ServerNotRegistered:IDL:activation / ServerNotRegistered:1.0 at com.sun.corba.se.impl.activation.RepositoryImpl.getDBServerDef(RepositoryImpl.java:221) at com.sun.corba.se.impl.activation.RepositoryImpl.getServer(RepositoryImpl.java:228) at com.sun.corba.se.impl.activation.ServerManagerImpl.getEntry(ServerManagerImpl.java:350) at com.sun.corba.se.impl.activation.ServerManagerImpl.handle(ServerManagerImpl.java:566) ......还有12个
在我看来,对createEntityManager
的调用在逻辑上完全独立于CORBA网络功能,因此我无法看到这可能对连接到服务器的客户端产生影响。
答案 0 :(得分:0)
异常来自我的EntityManagerFactory。它与网络无关,但因为在客户端连接之前我从未运行过服务器,所以在此之前没有发生任何异常。
异常输出不是特别有用。我发现注释掉所有网络代码并将服务器作为开发中的独立程序运行是有帮助的(当出现问题时更有用的错误消息)。