0 Replies Latest reply on Apr 21, 2006 1:17 PM by sierras

    PLEASE HELP - TOMCAT - EJB3 Integration problem

    sierras

      I've a project with a piece of JSP code running like this one


      WorkerComment

      <%
      try
      {
      Country country;

      ServerObjects so = ServerObjects.getSO();
      CountryDAO countries = so.getCountries();

      if ( countries != null )
      {
      List list = countries.getAllCurrent();
      Iterator iterator = list.iterator();

      while ( iterator.hasNext() )
      {
      country = (Country) iterator.next();

      %>


      <%
      }
      }

      The problem is that when running this code under a standalone Tomcat instace the code fails when calling "so.getCountries();" which looks for the remote interface of a server object.

      public CountryDAO getCountries()
      {
      Object o;
      try
      {
      o = server.getConnection().lookup(COUNTRIES_OBJECT);
      if ( o != null )
      {
      System.out.println(o);

      if ( o instanceof CountryDAO )
      {
      return (CountryDAO) o;
      }
      }
      }
      catch ( Exception e )
      {
      e.printStackTrace();
      }

      return null;
      }


      The same code executed under a Java Application scenario works well. Gets the remote interface and everithing is OK.

      When fails object "o" is not instanceof CountryDAO, then returns null.
      When goes well object "o" is (yes, yes) is instanceof CountryDAO, then proxy object for the server object.

      Is there anything between Tomcat and JBoss AS integration that I'm missing????

      The Application Server is the same. (JBoss AS 4.0.3 SP1).
      The Library Class of the ServerObjects class is the same.
      The Final code is the same.

      Any idea about what's wrong????

      Thanks in advance.