PageContextImpl giving issues (java.lang.ClassCastException: java.security.AccessControlException) with Spring form tag?

141 views
Skip to first unread message

N. Peeters

unread,
Apr 10, 2009, 10:50:02 AM4/10/09
to Google App Engine
Hi, I'm getting the following error when the JSP page tries to
compile. Any idea?


Nested in org.springframework.web.util.NestedServletException: Request
processing failed; nested exception is java.lang.ClassCastException:
java.security.AccessControlException cannot be cast to
javax.servlet.ServletException:
java.lang.ClassCastException: java.security.AccessControlException
cannot be cast to javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:754)
at org.apache.jsp.WEB_002dINF.jsp.searchCustomerInput_jsp._jspService
(searchCustomerInput_jsp.java:64)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

The page code is as follows:

<%@ include file="/WEB-INF/jsp/include.jsp"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/
form"%>
<html>
<body>
<form:form commandName="searchCustomer">
<table>
<tr>
<td>First Name:</td>
<td><form:input path="firstName" /></td>
</tr>
<tr>
<td>Last Name:</td>
<td><form:input path="lastName" /></td>
</tr>
<tr>
<td colspan="3">
<input type="submit" value="Search" />
</td>
</tr>
</table>
</form:form>

N. Peeters

unread,
Apr 12, 2009, 10:28:26 AM4/12/09
to Google App Engine
It seems that this is cause by all specific forms fromthe Spring
taglib <form:form... >. Any idea how to get around this? Anybody got
Spring forms to work on GAE?

On Apr 10, 4:50 pm, "N. Peeters" <peete...@gmail.com> wrote:
> Hi, I'm getting the following error when the JSP page tries to
> compile. Any idea?
>
> Nested in org.springframework.web.util.NestedServletException: Request
> processing failed; nested exception is java.lang.ClassCastException:
> java.security.AccessControlException cannot be cast to
> javax.servlet.ServletException:
> java.lang.ClassCastException: java.security.AccessControlException
> cannot be cast to javax.servlet.ServletException
>         at org.apache.jasper.runtime.PageContextImpl.handlePageException
> (PageContextImpl.java:754)
>         at org.apache.jsp.WEB_002dINF.jsp.searchCustomerInput_jsp._jspService
> (searchCustomerInput_jsp.java:64)
>         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
> The page code is as follows:
>
> <%@ include file="/WEB-INF/jsp/include.jsp"%>
> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
> <html>
> <body>
> <form:formcommandName="searchCustomer">

Elvea

unread,
Apr 12, 2009, 1:23:42 AM4/12/09
to Google App Engine
add a custom editor to the binder then i got it work
(1)
public class BindingInitializer implements WebBindingInitializer {
@Override
public void initBinder(WebDataBinder binder, WebRequest request) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
binder.registerCustomEditor(Date.class, new CustomDateEditor
(dateFormat, true));
binder.registerCustomEditor(Integer.class, new CustomNumberEditor
(Integer.class, true));
binder.registerCustomEditor(Double.class, new CustomNumberEditor
(Double.class, true));
binder.registerCustomEditor(Float.class, new CustomNumberEditor
(Float.class, true));
binder.registerCustomEditor(String.class, new CharacterEditor
(true));
}

}

(2) and the dispatcher-servlet,xml
<!-- annotationMethodHandlerAdapter -->
<bean id="annotationMethodHandlerAdapter"
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="gaej.test.BindingInitializer" />
</property>
</bean>

Jason (Google)

unread,
Apr 13, 2009, 8:56:55 PM4/13/09
to google-a...@googlegroups.com

N. Peeters

unread,
Apr 14, 2009, 3:59:36 AM4/14/09
to Google App Engine
Still not working, I'm afraid. Any other idea?

nicolas...@gmail.com

unread,
Apr 15, 2009, 10:31:26 AM4/15/09
to Google App Engine
Hi,

I seem to have the same problem without Spring but with JSF. I think
that may be in the taglibs.

My code:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
www.w3.org/TR/html4/loose.dtd">
<html>
<f:view>
<f:loadBundle basename="messages" var="msg" />
<head>
<%@ include file="/page/fragment/head.jspf"%>
<title><h:outputText value="#{msg.application_title}" /></title>
</head>
<body>
<h1><h:outputText value="#{msg.list_page_title}" /></h1>
<h:form>
<h:dataTable value="#{timesheetsBean.timesheets}" var="timesheet">
<h:column>
<f:facet name="header">
<h:outputText value="#{msg.list_page_name}" />
</f:facet>
<h:outputText value="#{timesheet.name}" />
</h:column>
</h:dataTable>
<h:commandButton action="#{timesheetsBean.list}" />
</h:form>
</body>
</f:view>
</html>

My stack trace:

java.lang.ClassCastException:
org.datanucleus.exceptions.NucleusUserException cannot be cast to
javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException
(PageContextImpl.java:754)
at org.apache.jsp.page.listTimesheets_jsp._jspService
(listTimesheets_jsp.java:90)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:362)
at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:268)
at org.mortbay.jetty.servlet.Dispatcher.forward(Dispatcher.java:126)
at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch
(ServletExternalContextImpl.java:425)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView
(JspViewHandlerImpl.java:255)
at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute
(RenderResponseExecutor.java:41)
at org.apache.myfaces.lifecycle.LifecycleImpl.render
(LifecycleImpl.java:146)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:147)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1093)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter
(SaveSessionFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle
(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle
(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle
(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle
(ContextHandler.java:712)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle
(AppVersionHandlerMap.java:237)
at org.mortbay.jetty.handler.HandlerWrapper.handle
(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:313)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
506)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
(HttpConnection.java:830)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable
(RpcRequestParser.java:63)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
at
com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest
(JettyServletEngineAdapter.java:125)
at com.google.apphosting.runtime.JavaRuntime.handleRequest
(JavaRuntime.java:235)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:4547)
at com.google.apphosting.base.RuntimePb$EvaluationRuntime
$6.handleBlockingRequest(RuntimePb.java:4545)
at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest
(BlockingApplicationHandler.java:24)
at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:
359)
at com.google.net.rpc.impl.Server$2.run(Server.java:792)
at com.google.tracing.LocalTraceSpanRunnable.run
(LocalTraceSpanRunnable.java:56)
at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan
(LocalTraceSpanBuilder.java:489)
at com.google.net.rpc.impl.Server.startRpc(Server.java:748)
at com.google.net.rpc.impl.Server.processRequest(Server.java:340)
at com.google.net.rpc.impl.ServerConnection.messageReceived
(ServerConnection.java:422)
at com.google.net.rpc.impl.RpcConnection.parseMessages
(RpcConnection.java:319)
at com.google.net.rpc.impl.RpcConnection.dataReceived
(RpcConnection.java:290)
at com.google.net.async.Connection.handleReadEvent(Connection.java:
419)
at com.google.net.async.EventDispatcher.processNetworkEvents
(EventDispatcher.java:733)
at com.google.net.async.EventDispatcher.internalLoop
(EventDispatcher.java:207)
at com.google.net.async.EventDispatcher.loop(EventDispatcher.java:
101)
at com.google.net.rpc.RpcService.runUntilServerShutdown
(RpcService.java:249)
at com.google.apphosting.runtime.JavaRuntime$RpcRunnable.run
(JavaRuntime.java:373)
at java.lang.Thread.run(Unknown Source)
Reply all
Reply to author
Forward
0 new messages