2 Replies Latest reply on Nov 5, 2002 7:48 AM by Robert Stewart

    Redeployment of EJBs without redeployment of client?

    Stefan Wachter Newbie

      Hi all.

      Is it possible to redeploy EJBs without redeploying their client?

      I split my application into two parts: an ejb.ear and a web.ear archive. The ejb.ear publishes its EJBs in the global JNDI context whereas the web.ear references them.

      When I redeploy the ejb.ear only, without changing any bean interfaces, I get a ClassCastException in the web client. (I get the ClassCastException even if I started a new web session.)

      After stopping JBoss and restarting it all works fine again, i.e. the two deployed parts can work together in principle.

      Thanks for your attention,
      --Stefan

        • 1. Re: Redeployment of EJBs without redeployment of client?
          murthy Newbie

          Hi,
          I am trying to do the same thing.
          I deployed the EJB in ear and trying to access that EJB from a web component deployed in a different war file.
          but I am getting the following eror..

          org.jboss.docs.ExchangeRate.ExchangeRate not found in import

          =======
          <%@ page import="org.jboss.docs.ExchangeRate.ExchangeRate,
          org.jboss.docs.ExchangeRate.ExchangeRateHome,
          javax.ejb.*,
          java.math.*,
          javax.naming.*,
          javax.rmi.PortableRemoteObject,
          java.rmi.RemoteException"
          %>

          <%! private ExchangeRate exchange = null;

          public void jspInit() {
          try {
          InitialContext ic = new InitialContext();
          Object objRef = ic.lookup("java:comp/env/ejb/ExchangeRate");
          ExchangeRateHome home = (ExchangeRateHome)PortableRemoteObject.narrow(objRef, ExchangeRateHome.class);
          exchange = home.create();
          } catch (RemoteException ex) {
          System.out.println("Couldn't create converter bean."+ ex.getMessage());
          } catch (CreateException ex) {
          System.out.println("Couldn't create converter bean."+ ex.getMessage());
          } catch (NamingException ex) {
          System.out.println("Unable to lookup home: "+ "TheConverter "+ ex.getMessage());
          }
          }

          public void jspDestroy() {
          exchange = null;
          }
          %>
          =======
          Please help me with how to access the EJB from a dierent archive.
          -THanks
          javadocs

          • 2. Re: Redeployment of EJBs without redeployment of client?
            Robert Stewart Newbie

            I had grief with something like this but my exception was to do with serial numbers, you probably know about these things anyway.
            There is a unique security identifier generated for RMI client code and there's a tool that comes with JDK to find out what that number is; I think it's called serialver. Each time you compile your server code, you need to generate your client stubs otherwise they will refuse to talk to each other. I think you can force this identifier to be a fixed number - but this might encourage others to rearrange your client code. I didn't pursue fixing the serial versions but modified my ANT scripts instead to do the dog-work for me.