Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
prop.put(Context.PROVIDER_URL,"t3://localhost:7001");
Context ctx = new InitialContext(prop);
Object obj = ctx.lookup("EjbP");
SayHelloHome home=(SayHelloHome)PortableRemoteObject.narrow(obj, SayHelloHome.class);
SayHello login = home.create();
String xml = login.sayHello("中国人民解放军");
System.out.println(xml);
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:64)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
at com.ejb._SayHello_Stub.sayHello(Unknown Source)
at com.ejb.Test.main(Test.java:19)
Caused by: java.rmi.RemoteException: EJB Exception: ; nested exception is:
java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at weblogic.ejb20.internal.EJBRuntimeUtils.throwRemoteException(EJBRuntimeUtils.java:102)
at weblogic.ejb20.internal.BaseEJBHome.handleSystemException(BaseEJBHome.java:296)
at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:263)
at weblogic.ejb20.internal.StatelessEJBObject.postInvoke(StatelessEJBObject.java:140)
at com.ejb.EjbP_8sv2oa_EOImpl.sayHello(EjbP_8sv2oa_EOImpl.java:56)
at com.ejb.EjbP_8sv2oa_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:477)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:420)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:415)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at com.ejb.SayHelloBean.sayHello(SayHelloBean.java:32)
at com.ejb.EjbP_8sv2oa_EOImpl.sayHello(EjbP_8sv2oa_EOImpl.java:46)
... 10 more
注释:dom4j-1.6.1.jar 和log4j-1.2.8.jar包已经导入,但是还是包找不到包的错误?
请前辈们给以指点