0 Replies Latest reply on Sep 6, 2007 3:03 PM by empinator

    Executing Remote-Method with Swing Client fails

      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