[jboss-user] [JNDI/Naming/Network] - a problem in jboss-4.2.0GA

huyiping2007 do-not-reply at jboss.com
Tue Jun 5 01:30:54 EDT 2007


first,run -c all,i can see that CounterBean is deployed successfully in the following:
09:44:04,046 INFO  [JmxKernelAbstraction] creating wrapper delegate for: org.jbo
ss.ejb3.stateless.StatelessContainer
09:44:04,078 INFO  [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=count
er.jar,name=CounterBean,service=EJB3 with dependencies:
09:44:05,406 INFO  [EJBContainer] STARTED EJB: com.jboss.ejb3.CounterBean ejbNam
e: CounterBean
09:44:05,687 INFO  [EJB3Deployer] Deployed: file:/E:/jboss-4.2.0.GA/server/all/d
eploy/counter.jar
second,my client code is in the following:

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.jboss.ejb3.RemoteCounter;

public class Client {

	public Client() {
		super();
		// TODO Auto-generated constructor stub
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Context ctx = null;
		try
		{
			
			ctx = new InitialContext();
			RemoteCounter counter = (RemoteCounter) ctx.lookup("counter/remote");
			System.out.println(counter);
			counter.add(10);
			System.out.println("the number:" + counter.getNumber());
		
		}
		catch (NamingException e)
		{
		    e.printStackTrace();
		}
	}

}

third,run client class,and the result is in the following.the blue section is client counterbean instance that is printed in the client program :
jboss.j2ee:jar=counter.jar,name=CounterBean,service=EJB3
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
	at $Proxy0.add(Unknown Source)
	at Client.main(Client.java:28)
Caused by: java.lang.Exception: Can not make remoting client invocation due to not being connected to server.
	at org.jboss.remoting.Client.invoke(Client.java:1555)
	at org.jboss.remoting.Client.invoke(Client.java:530)
	at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
	at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
	at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
	at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:72)
	at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
	at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:103)
	... 2 more


help me,please. 
thanks a lot

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4051166#4051166

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4051166



More information about the jboss-user mailing list