gpt4 book ai didi

java - 查找中未处理的异常 [根异常是 org.omg.CORBA.MARSHAL :

转载 作者:太空宇宙 更新时间:2023-11-04 11:30:40 27 4
gpt4 key购买 nike

我需要帮助!

到目前为止我已经尝试过了......

这是我的 ejb 代码:

package ejb30.session;
import java.util.*;
import javax.ejb.Stateless;

//@Stateless
@Stateless(mappedName="Time")
public class TimeServiceBean implements TimeService {
public String getTime() {
Formatter fmt = new Formatter();
Calendar cal = Calendar.getInstance();
fmt.format("%tr", cal);
return fmt.toString();
}

}

这是我的 ejb 客户端代码:

package ejb30.client;

import javax.naming.*;
import ejb30.session.*;

public class Client {
public static void main(String args[]) throws Exception {

InitialContext ctx = new InitialContext();

// glassfish version:
// TimeService timeService = (TimeService) ctx.lookup("ejb30.session.TimeService");

// weblogic version:
TimeService timeService = (TimeService) ctx.lookup("Time#ejb30.session.TimeService");

String time = timeService.getTime();
System.out.println("Time is: " + time);
}
}

我正在使用 weblogic 12.2 并且启动了我的 weblogic 服务器:当我调用客户端代码时,出现以下错误:

run-client:
[java] May 07, 2017 10:46:58 PM com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value
[java] WARNING: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
[java] org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
[java] at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7004)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1010)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:844)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:838)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:828)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:287)
[java] at com.sun.corba.se.impl.util.Utility.readAbstractAndNarrow(Utility.java:964)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:2030)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2254)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1249)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:416)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:341)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:307)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:999)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:844)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:267)
[java] at com.sun.corba.se.impl.corba.TCUtility.unmarshalIn(TCUtility.java:285)
[java] at com.sun.corba.se.impl.corba.AnyImpl.read_value(AnyImpl.java:590)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:704)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream.read_any(CDRInputStream.java:238)
[java] at weblogic.corba.cos.naming._NamingContextAnyStub.resolve_any(_NamingContextAnyStub.java:81)
[java] at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:227)
[java] at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:191)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:417)
[java] at ejb30.client.Client.main(Unknown Source)
[java] Caused by: java.lang.ClassNotFoundException: ejb30.session.TimeServiceBean_9qy6tc_TimeServiceRIntf
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1207)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:348)
[java] at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:261)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1722)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1240)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:416)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:341)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:307)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:999)
[java] ... 23 more
[java]
[java] Exception in thread "main" javax.naming.NamingException: Unhandled exception in lookup [Root exception is org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe]
[java] at weblogic.corba.j2ee.naming.Utils.wrapNamingException(Utils.java:83)
[java] at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:251)
[java] at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:191)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:417)
[java] at ejb30.client.Client.main(Unknown Source)
[java] Caused by: org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
[java] at com.sun.corba.se.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7004)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1010)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:844)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:838)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_1_0.java:828)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java:287)
[java] at com.sun.corba.se.impl.util.Utility.readAbstractAndNarrow(Utility.java:964)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputObjectField(IIOPInputStream.java:2030)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputClassFields(IIOPInputStream.java:2254)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1249)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:416)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:341)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:307)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:999)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:844)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream.read_value(CDRInputStream.java:267)
[java] at com.sun.corba.se.impl.corba.TCUtility.unmarshalIn(TCUtility.java:285)
[java] at com.sun.corba.se.impl.corba.AnyImpl.read_value(AnyImpl.java:590)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_any(CDRInputStream_1_0.java:704)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream.read_any(CDRInputStream.java:238)
[java] at weblogic.corba.cos.naming._NamingContextAnyStub.resolve_any(_NamingContextAnyStub.java:81)
[java] at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:227)
[java] ... 3 more
[java] Caused by: java.lang.ClassNotFoundException: ejb30.session.TimeServiceBean_9qy6tc_TimeServiceRIntf
[java] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[java] at sun.rmi.server.LoaderHandler$Loader.loadClass(LoaderHandler.java:1207)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:348)
[java] at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.readObject(RemoteBusinessIntfProxy.java:261)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1722)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.inputObject(IIOPInputStream.java:1240)
[java] at com.sun.corba.se.impl.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:416)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:341)
[java] at com.sun.corba.se.impl.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:307)
[java] at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:999)
[java] ... 23 more
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 16 seconds

C:\EJB3DeveloperGuide\tempCode\tempWeblogicCode\EJB3Chap02\weblogic10.3\lab1>

我需要一些线索来了解问题的原因...

最佳答案

当您加载 TimeServiceBean 类时,您会收到错误,如果您仔细阅读堆栈跟踪,您会看到这一点。检查你加载bean的方式

关于java - 查找中未处理的异常 [根异常是 org.omg.CORBA.MARSHAL :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43839340/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com