好象语句中没有设置classpath    EJB发布成功以后
  可通过命令行运行runclient,查看运行结果。
  runclient.cmd内容如下:java –classpath %CLASSPATH%;client_classes com.learnweblogic.examples.ch8.hellowo
rld.HelloWorldClient例如:
c:\hello>runclient
c:\hello>java -classpath .;d:\bea\weblogic700\sever\lib\weblogic.jar;d:\bea\jdk131_03\lib;client_classes helloejb.helloServerTestClient1  如果不清楚,我可以发给你一篇这方面的文档

解决方案 »

  1.   

    谢谢楼上的大哥,
    就是具体该如何配置classpath,
    好象有点不是很明白。我搞不清楚跟用j2se的时候 ,有什么不同。
    还是希望可以看看文挡,mail [email protected]
      

  2.   

    还有,我想问个好愚蠢的问题,就是说,在部署后,是不是已经给.jar文件给upload到我的d:bea\user_projects\mydomain\myserver\upload 文件夹里面了。不知道client是怎么通过容器自动找到呢,并且运行呢??
      

  3.   

    呵呵,多调试几个实例,多上上java网站,多看看上面的技术论坛,多上CSDN,你会很快明白的
      

  4.   

    public class RzEjbTools {    public static Context getInitialContext(){
            Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
    properties.put(Context.PROVIDER_URL, "t3://localhost:80");
    properties.put(Context.SECURITY_PRINCIPAL, "system");
    properties.put(Context.SECURITY_CREDENTIALS, "weblogic");        InitialContext initialcontext = null;
            try {
    initialcontext = new InitialContext(properties);
            } catch (NamingException namingexception){        }
            return initialcontext;
        }    public static Object narrow(Class class1, Class class2)
        {
            Context context = getInitialContext();
            Object obj = null;
            try {
                Object obj1 = context.lookup(class1.getName());
                EJBHome ejbhome = (EJBHome)PortableRemoteObject.narrow(obj1, class1);
                Method method = class1.getMethod("create", new Class[0]);
                obj = PortableRemoteObject.narrow(method.invoke(ejbhome, null), class2);
                context.close();
            } catch(Exception e) {        }
            return obj;
        }}
      

  5.   

    使用方法:
    TTAllDetailEjb lEjb = (TTAllDetailEjb)RzEjbTools.narrow( TTAllDetailEjbHome.class, TTAllDetailEjb.class);
    mTotalCount = lEjb.getCount(getCmEjbProperty(), mTTAllDetailTSData);