0 Replies Latest reply on Jul 12, 2005 10:15 AM by Bernd Dutkowski

    ClassCastException in Webapp

    Bernd Dutkowski Newbie

      I'm in big trouble: I'm using an ServletContextListener to trigger init() on an Stateless Sessionbean. This works fine with Preview 5 but not with Beta 1 (included in JBoss AS 4.0.3RC1)

       public void contextInitialized(ServletContextEvent servletContextEvent)
       {
       Home home;
       Context jndiContext;
      
       try
       {
       jndiContext = new InitialContext();
       home = (Home) jndiContext.lookup(Home.class.getName());
       home.init();
       }
       catch (NamingException e)
       {
       servletContextEvent.getServletContext().log(e.getMessage(), e);
       }
       }
      


      ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/shop]] Exception sending context initialized event to listener instance of class shop.ShopContextListener
      java.lang.ClassCastException: $Proxy59
       at shop.ShopContextListener.contextInitialized(ShopContextListener.java:25)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3669)