[jboss-user] [EJB/JBoss] - Executing Remote-Method with Swing Client fails

empinator do-not-reply at jboss.com
Thu Sep 6 15:03:28 EDT 2007


Hello,

I'm using JBoss 4.0.5GA as ApplicationServer
having a Swing Client receiving the Business Logic through EJB.
Both running with Java 1.6.

They client-application is downloaded via WebStart containing all its neccassary libraries in the codebase folder

  | <jnlp
  | 	spec="1.5+"
  | 	codebase="http://localhost:8080/tima-client/application"
  | 	href="launch.jnlp">
  | <security>
  | 	<all-permissions/>
  | </security>
  | <resources>
  | 	<j2se version="1.6+" 
  | 		href="http://java.sun.com/products/autodl/j2se"  	
  | 		java-vm-args="-Xmx250M" />
  | 	<jar href="binding-1.3.1.jar"/>
  | 	<jar href="jboss-aop-jdk50.jar"/>
  | 	...					
  | </jnlp>
  | 

Receiving the Remote-Bean is successful, but when I'm trying to execute a specific method of this bean, my application stalls without throwing an Exception.
However this phenomen doesn't occur while running my client with eclipse.

Here's my code:


  | 
  | public class RemoteBeanUtil {
  | 
  | 	/** Login */
  | 	private final static String sLoginUc = "LoginUcImpl";
  | 
  | 	private static InitialContext getInitialContext() throws NamingException {
  | 		Properties lP = new Properties();
  | 		lP.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
  | 		lP.put(Context.URL_PKG_PREFIXES, " org.jboss.naming:org.jnp.interfaces");		
  | 		lP.put(Context.PROVIDER_URL, "jnp://antonius:1099");
  | 		return new InitialContext(lP);
  | 	}
  | 
  | 	
  | 	private static Object getBean(String pBeanName,
  | 			Class<? extends Object> pName) throws NamingException 
  | 	{
  | 		Object lRef = null;
  | 		InitialContext lInitialContext = getInitialContext();
  | 		lRef = lInitialContext.lookup(pBeanName + "/remote");
  | 
  | 		return PortableRemoteObject.narrow(lRef, pName);
  | 	}
  | 
  | 	public static LoginUc getLoginUc() throws Exception {
  | 		return (LoginUc) getBean(sLoginUc, LoginUc.class);
  | 	}
  | }
  | 

  | @Stateless
  | public class LoginUcImpl extends UcImplBase implements LoginUc {
  | 
  | 	public Benutzer authenticate(String pUser, String pPass)  {
  | 		// Businesslogic
  | 	}
  | 	
  | }
  | 

  | // Client
  | LoginUc lLuc = RemoteBeanUtil.getLoginUc();
  | if(lLuc == null) {
  | 	System.out.println("not here!");
  | }
  | Benutzer lBen = lLuc.authenticate(pUser, lPw);
  | System.out.println("here!");  // <-- unreached code!!
  | 
  | 

Any help, hints or suggestions are welcome!!

Thanks a lot
empi

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

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



More information about the jboss-user mailing list