[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index] [Home]

ClassCastException when trying to load a bean.



> Error:
> Exception: java.lang.ClassCastException: com.boeing.bpi.uam.UamAccessCard
> java.lang.ClassCastException: com.boeing.bpi.uam.UamAccessCard
>         at com.boeing.bpi.uam.UamServlet.getAccessCard(Compiled Code)
>         at com.boeing.bpi.uam.UamServlet.initialize(Compiled Code)
>         at jsp__uam__pages__home_2ejsp._jspService(Compiled Code)
>         at com.boeing.bpi.uam.UamJsp.service(Compiled Code)
>         at org.gjt.jsp.JspServlet$Page.process(Compiled Code)
>         at org.gjt.jsp.JspServlet.xservice(Compiled Code)
>         at org.gjt.jsp.JspServlet.service(Compiled Code)
>         at javax.servlet.http.HttpServlet.service(Compiled Code)
>         at org.apache.jserv.JServConnection.run(Compiled Code)
>         at java.lang.Thread.run(Compiled Code)
> 
> GNUJSP: Please report to Administrator. No JSP error page registered.
> 
> 
> My configuration
> 	Sun Solaris
> 	Apache 1.3.6
> 	ApacheJServ/1.0b4
> 	gnujsp-1.0cvs-20000116-0000
> 	<permissions on scratchdir wide open>
> 
> jserv.properties file
> 	...
> 	wrapper.classpath=/usr/local/jserv/lib/ApacheJServ.jar
> 	wrapper.classpath=/usr/JSDK2.0/lib/jsdk.jar
> 	wrapper.classpath=/usr/local/bpijserv/lib/BPI_Oracle.jar
> 	wrapper.classpath=/usr/local/bpijserv/lib/BPI_IBMVisAge.jar
> 	wrapper.classpath=/usr/local/bpijserv/servlet/config
> 	...
> 
> zone.properties file
> 
> # List of Repositories
> #######################
> 
> # The list of servlet repositories controlled by this servlet zone
> # Syntax: repositories=[repository],[repository]...
> # Default: NONE
> repositories=/usr/local/gnujsp/gnujsp-1.0cvs-20000116-0000/lib/gnujsp10cvs.jar
> repositories=/usr/local/gnujsp/gnujsp-1.0cvs-20000116-0000/lib/servlet-2.0-plus.jar
> repositories=/usr/local/bpijserv/servlet
> ....
> servlet.gnujsp.initArgs=propfile=UamCfg
> servlet.gnujsp.initArgs=jserv=true
> servlet.gnujsp.initArgs=checkclass=true
> servlet.gnujsp.initArgs=checkdependencies=true
> servlet.gnujsp.initArgs=scratchdir=/usr/local/bpijserv/pages/jsp_temp
> servlet.gnujsp.initArgs=debug=true
> servlet.gnujsp.initArgs=xjspjar=/usr/local/gnujsp/gnujsp-1.0cvs-20000116-0000/lib/gnujsp10cvs.jar
> servlet.gnujsp.initArgs=xsrvpls=/usr/local/gnujsp/gnujsp-1.0cvs-20000116-0000/lib/servlet-2.0-plus.jar
> servlet.gnujsp.initArgs=xbeans=/usr/local/bpijserv/servlet
> servlet.gnujsp.initArgs=compiler=builtin-javac -classpath %classpath%:%scratchdir%:%xsrvpls%:%xjspjar%:%xbeans% -d %scratchdir% -deprecation %source%
> 
> 
> I am at a loss here.  I have been using GNUJSP 0.9.2 for the past several months with no issue until this week when due to a new development effort I needed extend my solutions to dynamically load JSPs with in JSPs.  I tried everything from gnujsp mods that gave me callPage() functionality to attempting the <jsp: include..> command.  After exhausting the mailing list archive I decided to upgrade to gnujsp 1.0.  After a bit of pain with configuration and code changes I got everything working and was reaping much success with the <jsp:include>. All in all, very happy!  ...except, my JSPs were not autoloading when I modified them.  I had to dump my scratchdir and recycle the jserv engine.  Assuming this was a bug I went right to grabbing the latest version of the code from the snapshot list and blammo I had autoloading working.  However, now I have a new problem....   
> 
> The beans that get created in my JSPs cause a ClassCastException when I try to pull them out of my session with in my servlets.  The servlet finds the matching name and tries to cast the object it pulls out.  What I have done is followed a model I saw in the mailing list
> 
> 	<my servlet> extends HttpServlet,  
> 		<my jsp core servlet> extends <my servlet> implements HttpJspPage. , 
> 			all of my JSPs extend <my jsp core servlet>
> 
> I needed some functionality embedded into the servlet that is my jsp.  The first line of all my JSPs in my application call an initializing method to load specific page formatting and check user access based on the usage of > that page.  This has worked up until now. The initializing method tries to extract the bean stored in the session from a previous call but fails due to the casting issue.> 
> 
> 
> 
> So what have I done wrong or not done right?
> 
> Thanks,
> Steve
> Steven J. Neff      IBM Global Services
> BOEING / BPI Team
> Phone: 425.237.1539
> E-mail:  Steven.Neff@PSS.Boeing.com
> Cell: (253) 222-4039 or Cell-Email: steven.neff@voicestream.net
>