0 Replies Latest reply on Jan 24, 2004 12:55 PM by Arup Sarkar

    java.lang.ClassCastException Error

    Arup Sarkar Newbie

      Hi,

      It would be great if anyone can help. I am trying to build a stateless session bean with DAO and a servlet accessing the session bean, compilation, packaging and deployment is working fine, but when I am hitting the url for the servlet I am getting the following error. Please let me know if you need any additional files. I will definately post it.

      /************************************************/

      2004-01-24 13:23:28,078 INFO [STDOUT] Entering AccessControllerServlet.init()
      2004-01-24 13:23:28,125 ERROR [STDERR] java.lang.ClassCastException
      2004-01-24 13:23:28,125 ERROR [STDERR] at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:293)
      2004-01-24 13:23:28,125 ERROR [STDERR] at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
      2004-01-24 13:23:28,125 ERROR [STDERR] at com.zen.store.servlet.AccessControllerServlet.getHome(Unknown Source)
      2004-01-24 13:23:28,125 ERROR [STDERR] at com.zen.store.servlet.AccessControllerServlet.init(Unknown Source)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:280)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:333)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:294)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:558)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1714)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:507)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.http.HttpContext.handle(HttpContext.java:1664)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.http.HttpServer.service(HttpServer.java:863)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.jboss.jetty.Jetty.service(Jetty.java:460)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.http.HttpConnection.service(HttpConnection.java:775)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:939)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:792)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:201)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:289)
      2004-01-24 13:23:28,125 ERROR [STDERR] at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:455)
      2004-01-24 13:23:28,125 INFO [STDOUT] Exception AccessControllerServlet.init()java.lang.ClassCastException
      2004-01-24 13:23:28,125 INFO [STDOUT] Leaving AccessControllerServlet.init()
      2004-01-24 13:23:28,125 INFO [STDOUT] Exception AccessControllerServlet.doGet()java.lang.NullPointerException

      /*********************************************************************/

      I am using XDoclet to generate my files. I have attached the ejbdoclet tag which builds my jar file.

      Regards
      Arup

      /********** ejb jar tag *****/

      
       <target name="build-ejb-jar">
       <mkdir dir="${ejb.jar.dir}"/>
      
       <ejbjar srcdir="${build.dir}"
       descriptordir="${ejb.deployment.dir}"
       destdir="${ejb.jar.dir}"
       basejarname="${app.name}"
       naming="basejarname"
       genericjarsuffix="-ejb.jar">
      
       <include name="*.xml"/>
      
      
       <support dir="${build.dir}">
       <include name="**/*Value.class"/>
       <include name="**/*Bean.class"/>
       <include name="**/*Util.class"/>
       <include name="**/*Exception.class"/>
       <include name="**/*DAO.class"/>
       </support>
      
      
       <dtd
       publicId="-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
       location="./ejb-jar_2_0.dtd"
       />
      
       </ejbjar>
       </target>