问题描述
publicstaticvoidmain(String[]args)throwsException{Propertiesenv=newProperties();env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");env.put(Context.PROVIDER_URL,"iiop://catghost");InitialContextctx=newInitialContext(env);FirstEjbejb=(FirstEjb)ctx.lookup("FirstEjbBean/remote");//Strings=ejb.saySomething("张三");//System.out.println(s);}
报错:Exceptioninthread"P=648156:O=0:CT"java.lang.NoClassDefFoundError:com.ibm.ffdc.Manageratcom.ibm.ws.naming.util.RasUtil.logException(RasUtil.java:164)atcom.ibm.ws.naming.util.RasUtil.logException(RasUtil.java:72)atcom.ibm.ws.naming.util.Helpers.getOrb(Helpers.java:362)atcom.ibm.ws.naming.util.WsnInitCtxFactory.getInitialContextInternal(WsnInitCtxFactory.java:421)atcom.ibm.ws.naming.util.WsnInitCtx.getContext(WsnInitCtx.java:123)atcom.ibm.ws.naming.util.WsnInitCtx.getContextIfNull(WsnInitCtx.java:798)atcom.ibm.ws.naming.util.WsnInitCtx.getEnvironment(WsnInitCtx.java:702)atjavax.naming.InitialContext.getEnvironment(UnknownSource)atejb.FirstEjbClient.main(FirstEjbClient.java:21)Causedby:java.lang.ClassNotFoundException:com.ibm.ffdc.Manageratjava.net.URLClassLoader.findClass(URLClassLoader.java:419)atjava.lang.ClassLoader.loadClass(ClassLoader.java:643)atsun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:300)atjava.lang.ClassLoader.loadClass(ClassLoader.java:609)...9more
解决方案
解决方案二:
环境是:IBMRationalSoftwareArchitectforWebSphere
解决方案三:
runtimeclasspath有没有加入WASruntime库?
解决方案四:
具体一些....刚学....那些jar文件
解决方案五:
http://www-01.ibm.com/support/docview.wss?rs=2042&context=SSRTLW&dc=DB560&dc=DB520&uid=swg21358301&loc=en_US&cs=UTF-8&lang=en&rss=ct2042rational看一下这个网址,或许对你有用
解决方案六:
WAS7.0的话,至少需要加<classpathentrykind="lib"path="X:/IBM/WebSphere/AppServer7.0/runtimes/com.ibm.ws.orb_7.0.0.jar"/><classpathentrykind="lib"path="X:/IBM/WebSphere/AppServer7.0/runtimes/com.ibm.ws.ejb.thinclient_7.0.0.jar"/>WAS6.1的话,至少需要加<classpathentrykind="lib"path="X:/IBM/WebSphere/AppServer/runtimes/com.ibm.ws.webservices.thinclient_6.1.0.jar"/><classpathentrykind="lib"path="X:/IBM/WebSphere/AppServer/runtimes/com.ibm.ws.admin.client_6.1.0.jar"/><classpathentrykind="lib"path="D:/IBM/WebSphere/AppServer/lib/rsahelpers.jar"/><classpathentrykind="lib"path="D:/IBM/WebSphere/AppServer/lib/rsadbutils.jar"/><classpathentrykind="lib"path="X:/IBM/WebSphere/AppServer/plugins/com.ibm.ws.runtime_6.1.0.jar"/><classpathentrykind="lib"path="X:/IBM/WebSphere/AppServer/plugins/com.ibm.ws.emf_2.1.0.jar"/>
解决方案七:
我在测试ejb时碰到同样的问题,在WebSphereAppServerruntimes下导入com.ibm.ws.ejb.thinclient_7.0.0.jar包就OK了。
解决方案八:
该回复于2009-09-06 13:10:23被版主删除