Tomcat4.1访问Weblogic8的EJB

03-07-31 mellon
我看了前面的那个帖子,http://www.jdon.com:81/jive/thread.jsp?forum=16&thread=8330。

他们讨论的我本来就都作了。只是问题并没有解决:

java.lang.NoClassDefFoundError: weblogic/rmi/extensions/server/Stub

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:509)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)

at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:431)

at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:169)

at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

at java.lang.ClassLoader.loadClass(ClassLoader.java:262)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:207)

at weblogic.utils.classfile.utils.CodeGenerator.generateClass(CodeGenerator.java:71)

at weblogic.rmi.internal.StubGenerator.getStubClass(StubGenerator.java:672)

at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:712)

at weblogic.rmi.internal.StubGenerator.generateStub(StubGenerator.java:699)

at weblogic.rmi.extensions.StubFactory.getStub(StubFactory.java:76)

at weblogic.jndi.WLInitialContextFactoryDelegate.newRootNamingNodeStub(WLInitialContextFactoryDelegate.java:486)

at weblogic.jndi.WLInitialContextFactoryDelegate.newRemoteContext(WLInitialContextFactoryDelegate.java:449)

at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:345)

at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:308)

at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:234)

at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:135)

at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)

at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)

at javax.naming.InitialContext.init(InitialContext.java:219)

at javax.naming.InitialContext.(InitialContext.java:195)

at com.mellon.test.web.IndexServlet.login(IndexServlet.java:40)

at com.mellon.test.web.IndexServlet.doGet(IndexServlet.java:24)

at com.mellon.test.web.IndexServlet.doPost(IndexServlet.java:69)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

mellon
2003-07-31 18:50
我删掉了weblogic.jar的servlet包,tomcat已经成功装载了weblogic.jar。(在删掉后,tomcat启动时提示weblogic.jar装载失败的信息没有了,而且运行程序输出的Exception也变了。

只是,EJB依然没有访问到,前面的帖子讨论了narrow问题,可我的程序根本连Context都没能创建。

Properties h = new Properties();

h.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");

h.put(Context.PROVIDER_URL,"t3://localhost:7001");

Context ctx = new InitialContext(h);//这一句就出错了。

BugSysUserSessionHome userHome=(BugSysUserSessionHome)ctx.lookup("BugSysUserSessionBean");

mellon
2003-08-01 10:17
顶一下,希望有人关心。

mellon
2003-08-04 09:36
一直问到bea ,总算有了结果,将wlclient.jar而不是weblogic.jar放入WEB-INF/lib就可以了。

想来汗颜,本来是看到别人在问这个问题,我觉得奇怪,为什么不用wlclient.jar呢,但一看,报告的找不到的类,wlclient.jar里根本没有,轻易推断出不行的结论,结果浪费了大量时间。

猜你喜欢