通过远程Java独立应用程序使用EJB 3.1 bean [英] using an EJB 3.1 bean through a remote java stand-alone application
问题描述
我一直在尝试使用Java EE 6创建一个基于Application Server的应用程序,该应用程序将从GWT Web应用程序接收Job对象,而这些Jobs将从Java独立应用程序中提取.我一直认为EJB模型将为我提供一种进行远程处理的简便方法,因为我的客户端应用程序应该能够在另一台机器上运行.
I have been trying to use Java EE 6 to create an Application Server based app which is to receive Job objects from a GWT Web Application and those Jobs would be pulled from a Java stand-alone application. I have been thinking that the EJB model would provide me with easy way to do remoting because my client app should be able to run on a different machine.
我将Glassfish 3.1和Netbeans 7.0.1用作我的IDE,我还使用了eclipse Java EE来重现相同的问题.
I am using Glassfish 3.1 and Netbeans 7.0.1 as my IDE, I have also used eclipse Java EE to reproduce same problem.
我一直面临着下一个困难:
I have been facing the next difficulties:
- 要找到
InitialContext
并不容易,这是使用远程处理的唯一方法吗? 我是否应该能够使用 - 我发现了一些要使
InitialContext
机制起作用的方式(在文档中未直接找到),我需要添加到我的库中:gf-client-module.jar
和weld-osgi-bundle.jar
- 我一直收到下一个错误:
@EJB
/@Inject
从我的独立应用程序中使用一些配置文件进行一些自动代码注入?
- It was not easy to find out about
InitialContext
, is it the only way to use the remoting? shouldn't I be able to use@EJB
/@Inject
for some automatic code injection from my stand alone app using some configuration file? - I have discovered some how (not found directly in documentation) that for the
InitialContext
mechanism to work I need to add to my Libraries:gf-client-module.jar
andweld-osgi-bundle.jar
- I have been receiving the next error:
Exception in thread "main" javax.ejb.EJBException: java.rmi.MarshalException: CORBA MARSHAL 1330446343 No; nested exception is:
org.omg.CORBA.MARSHAL: FINE: IOP00810007: Underflow in BufferManagerReadStream after last fragment in message vmcid: OMG minor code: 7 completed: No
at ContentCreator._JobDispatcherRemote_Wrapper.getSimpleJobForProcessing(ContentCreator/_JobDispatcherRemote_Wrapper.java)
at javaapplication1.JavaApplication1.main(JavaApplication1.java:35)
Caused by: java.rmi.MarshalException: CORBA MARSHAL 1330446343 No; nested exception is:
org.omg.CORBA.MARSHAL: FINE: IOP00810007: Underflow in BufferManagerReadStream after last fragment in message vmcid: OMG minor code: 7 completed: No
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:267)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:213)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:152)
at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:227)
at ContentCreator.__JobDispatcherRemote_Remote_DynamicStub.getSimpleJobForProcessing(ContentCreator/__JobDispatcherRemote_Remote_DynamicStub.java)
... 2 more
Caused by: org.omg.CORBA.MARSHAL: FINE: IOP00810007: Underflow in BufferManagerReadStream after last fragment in message vmcid: OMG minor code: 7 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:248)
at com.sun.corba.ee.spi.orbutil.logex.corba.CorbaExtension.makeException(CorbaExtension.java:95)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.handleFullLogging(WrapperGenerator.java:387)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator.access$400(WrapperGenerator.java:107)
at com.sun.corba.ee.spi.orbutil.logex.WrapperGenerator$2.invoke(WrapperGenerator.java:511)
at com.sun.corba.ee.spi.orbutil.proxy.CompositeInvocationHandlerImpl.invoke(CompositeInvocationHandlerImpl.java:99)
at $Proxy24.endOfStream(Unknown Source)
at com.sun.corba.ee.impl.encoding.BufferManagerReadStream.underflow(BufferManagerReadStream.java:128)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_1.grow(CDRInputStream_1_1.java:113)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_2.alignAndCheck(CDRInputStream_1_2.java:126)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_long(CDRInputStream_1_0.java:496)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.readValueTag(CDRInputStream_1_0.java:1810)
at com.sun.corba.ee.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1040)
at com.sun.corba.ee.impl.encoding.CDRInputObject.read_value(CDRInputObject.java:531)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl$14.read(DynamicMethodMarshallerImpl.java:384)
at com.sun.corba.ee.impl.presentation.rmi.DynamicMethodMarshallerImpl.readResult(DynamicMethodMarshallerImpl.java:483)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.privateInvoke(StubInvocationHandlerImpl.java:203)
... 5 more
在我的场景中,我一直面临着远程使用Java EE 6的问题,但是对于这些问题几乎找不到帮助,将不胜感激.
I have been facing problems with using Java EE 6 remotely in my scenario and have found little help for those problems any assistance would be greatly appreciated.
推荐答案
在我的情况下,我有相同的堆栈消息消息vmcid中的最后一个片段之后的BufferManagerReadStream下溢:OMG次要代码:7"
In my case i have the same stack message "Underflow in BufferManagerReadStream after last fragment in message vmcid: OMG minor code: 7"
在我的项目中,我有一个未实现Serializable接口的嵌套对象.实施接口解决了我的问题.
In my project i had a nested object which not implements the Serializable interface. Implementing the Inteface solved my problem.
这篇关于通过远程Java独立应用程序使用EJB 3.1 bean的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!