好象语句中没有设置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 如果不清楚,我可以发给你一篇这方面的文档
可通过命令行运行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 如果不清楚,我可以发给你一篇这方面的文档
就是具体该如何配置classpath,
好象有点不是很明白。我搞不清楚跟用j2se的时候 ,有什么不同。
还是希望可以看看文挡,mail [email protected]
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;
}}
TTAllDetailEjb lEjb = (TTAllDetailEjb)RzEjbTools.narrow( TTAllDetailEjbHome.class, TTAllDetailEjb.class);
mTotalCount = lEjb.getCount(getCmEjbProperty(), mTTAllDetailTSData);