JBuilder+weblogic6.1+EJB出现问题,EJB已经成功部署,但运行客户端程序报错,请高手帮忙!
我已经将JBulier和weblogic6.1连接了起来,我做了一个会话EJB的简单的例子,就是为了输出helloworldEJB已经成功编译成了JAR文件,并部署到了weblogic上,但是我在用客户端程序调用的时候,运行有错误,有如下提示:
D:\bea\jdk131\bin\javaw -classpath "E:\test\ejb\helloworld\HelloWorld\classes;D:\bea\wlserver6.1\lib\weblogic_sp.jar;D:\bea\wlserver6.1\lib\weblogic.jar;E:\test\guestbook\lib\mysql-connector-java-2.0.14-bin.jar;C:\j2sdk1.4.2_03\jre\lib\jce.jar;C:\j2sdkee1.3.1\lib\j2ee.jar;E:\test\gd\classes;C:\bea\user_projects\applications\mydomain\DefaultWebApp\WEB-INF\classes;D:\bea\jdk131\jre\lib\i18n.jar;D:\bea\jdk131\jre\lib\jaws.jar;D:\bea\jdk131\jre\lib\rt.jar;D:\bea\jdk131\jre\lib\sunrsasign.jar;D:\bea\jdk131\lib\dt.jar;D:\bea\jdk131\lib\htmlconverter.jar;D:\bea\jdk131\lib\tools.jar" com.learnweblogic.examples.ch8.helloworld.HelloWorldClient
** Unable to connect to the server at:t3://localhost:7001
javax.naming.CommunicationException. Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:311)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:211)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at com.learnweblogic.examples.ch8.helloworld.BaseClient.getInitialContext(BaseClient.java:31)
at com.learnweblogic.examples.ch8.helloworld.HelloWorldClient.<init>(HelloWorldClient.java:16)
at com.learnweblogic.examples.ch8.helloworld.HelloWorldClient.main(HelloWorldClient.java:58)
javax.naming.CommunicationException. Root exception is java.net.ConnectException: t3://localhost:7001: Destination unreachable; nested exception is:
java.net.ConnectException: Connection refused: connect; No available router to destination
at weblogic.rjvm.RJVMFinder.findOrCreate(RJVMFinder.java:155)
at weblogic.rjvm.ServerURL.findOrCreateRJVM(ServerURL.java:207)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:311)
at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:211)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:149)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:665)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:246)
at javax.naming.InitialContext.init(InitialContext.java:222)
at javax.naming.InitialContext.<init>(InitialContext.java:198)
at com.learnweblogic.examples.ch8.helloworld.BaseClient.getInitialContext(BaseClient.java:31)
at com.learnweblogic.examples.ch8.helloworld.HelloWorldClient.<init>(HelloWorldClient.java:16)
at com.learnweblogic.examples.ch8.helloworld.HelloWorldClient.main(HelloWorldClient.java:58)
Exception in thread "main"
我的客户端程序如下:
package com.learnweblogic.examples.ch8.helloworld;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
public final class HelloWorldClient extends BaseClient {
private Context ctx;
HelloWorldClient(String [] argv)
throws NamingException
{
super(argv);
ctx = getInitialContext();
}
public void runClient()
throws Exception
{
HelloWorldHome home = null;
try {
Object h = ctx.lookup("HelloWorld");
home = (HelloWorldHome)
PortableRemoteObject.narrow(h, HelloWorldHome.class);
} catch (NamingException ne) {
System.err.println("Unable to lookup the HelloWorld EJB.");
System.err.println("Please make sure that the bean has been deployed"+
", and the client's classpath has been set correctly.");
throw ne;
}
try {
HelloWorld hw = home.create();
System.out.println("Say Hello to EJB.");
String ejbSays = hw.helloWorld();
System.out.println("The EJB said: "+ejbSays);
} catch (Exception e) {
System.err.println("Received an unexpected exception " + e
+ " while using the HelloWorldEJB.");
throw e;
}
}
public static void main(String[] argv)
throws Exception
{
HelloWorldClient hwc = new HelloWorldClient(argv);
hwc.runClient();
}
}
请问是哪里错了??