1 Reply Latest reply on May 30, 2006 6:47 AM by jaikiran pai

    Unexpected ClassCast Exception

    luca del core Newbie

      Hello people!
      I'm using netbeans 5.0 and jboss 4.0.2 to migrate a project from sun to jboss. When I try to use a servlet I have a strange classcast Exception:


      12:24:43,386 ERROR [[/presenze-WebModule]] StandardWrapper.Throwable
      java.lang.ClassCastException: $Proxy59
      at servlet.Aggiorna_presenze_Con_Col.init(Aggiorna_presenze_Con_Col.java:3 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:109 at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:75 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:13 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:17 at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:3 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:15 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:5 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:10 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:10 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:14 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:85 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:74 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:52 at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:11 at java.lang.Thread.run(Thread.java:5912:24:43,676 ERROR [[Aggiorna_presenze_Con_Col]] Allocate exception for servlet Aggiorna_presenze_Con_Col
      java.lang.ClassCastException: $Proxy59
      at servlet.Aggiorna_presenze_Con_Col.init(Aggiorna_presenze_Con_Col.java:3 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:109 at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:75 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:13 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:17 at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:3 at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:15 at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:5 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:12 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:10 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:10 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:14 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:85 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:74 at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:52 at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:11 at java.lang.Thread.run(Thread.java:5


      The source code of the servlet is

      public void init(ServletConfig config) throws ServletException {
      try{
      InitialContext ct = new InitialContext();
      //ds = (DataSource)ct.lookup("java:comp/env/jdbc/prologic");
      home_cntrlRenAttGio = (CntrlRenAttGioHomeLocal)ct.lookup("java:comp/env/ejb/CntrlRenAttGioHomeLocal");
      }
      catch(NamingException ne){
      ne.printStackTrace();
      }
      super.init(config);

      }