How do I avoid "Exception handling request to" javax.servlet.ServletException when redirecting? - jsf

I have logic in my backing bean that redirects if there is a session timeout.
FacesContext.getCurrentInstance().getExternalContext().setResponseStatus(responseCode);
FacesContext.getCurrentInstance().getExternalContext().setResponseHeader("Location", redirectURL);
FacesContext.getCurrentInstance().responseComplete();
However, the page that is being loaded still attempts to render, and throws this error:
2021-11-27 08:02:50,774 ERROR [io.undertow.request] (default task-2) UT005023: Exception handling request to /dashboard/mypage.htm: javax.servlet.ServletException
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:236)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:129)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:294)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:357)
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)
Caused by: java.lang.NullPointerException
at javax.el.ELUtil.buildParameters(ELUtil.java:699)
at javax.el.ELUtil.invokeMethod(ELUtil.java:243)
at javax.el.BeanELResolver.invoke(BeanELResolver.java:338)
at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:198)
at com.sun.el.parser.AstValue.getValue(AstValue.java:111)
at com.sun.el.parser.AstValue.getValue(AstValue.java:179)
at com.sun.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:39)
at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:44)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:202)
at org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:93)
at javax.faces.component._DeltaStateHelper.eval(_DeltaStateHelper.java:372)
at org.primefaces.component.menuitem.UIMenuItemBase.getUrl(UIMenuItemBase.java:91)
at org.primefaces.renderkit.MenuItemAwareRenderer.encodeOnClick(MenuItemAwareRenderer.java:67)
at org.primefaces.component.menu.BaseMenuRenderer.encodeMenuItem(BaseMenuRenderer.java:111)
at org.primefaces.component.menu.BaseMenuRenderer.encodeMenuItem(BaseMenuRenderer.java:69)
at org.primefaces.component.tieredmenu.TieredMenuRenderer.encodeElements(TieredMenuRenderer.java:124)
at org.primefaces.component.menubutton.MenuButtonRenderer.encodeMenu(MenuButtonRenderer.java:147)
at org.primefaces.component.menubutton.MenuButtonRenderer.encodeMarkup(MenuButtonRenderer.java:68)
at org.primefaces.component.menu.BaseMenuRenderer.encodeEnd(BaseMenuRenderer.java:50)
How can I get the view to stop loading on this workflow? It's obvious that, since the redirect occurred, the backing bean hasn't loaded everything and therefore EL expressions that depend on such objects being loaded, are failing.
I don't want to generate the error because this causes my admins grief because of the error emails that get generated. They can't tell if it is a real error or not.

Looks like you should have put some value on attribute in the request and that page uses that attribute and displays the nullPointer Exception as an error try to HttpServletRequest.setAttribute("bla", bla) nad check it.

Related

getRowCount() method on viewPanel control & database full text index error

I have simple code to count the rows in view panel control:
getComponent("viewPanel1").getRowCount()
Error calling method 'getRowCount()' on java class 'com.ibm.xsp.component.xp.XspViewPanel'
Stack trace shows the details as below:
Caused by: com.ibm.jscript.InterpretException: Script interpreter error, line=1, col=64: Error calling method 'getRowCount()' on java class 'com.ibm.xsp.component.xp.XspViewPanel'
Caused by: com.ibm.xsp.FacesExceptionEx: Notes error: The full text index for this database is in use
Caused by: NotesException: Notes error: The full text index for this database is in use
at lotus.domino.local.View.FTSearchSorted(Unknown Source)
Any quick solution to avoid these errors on server?
This is, in fact, a server issue. Take a look here or google it to fine-tune your server.

IBM HTTP Server is showing HTTP 1.1 500 status in logs

I am new to IBM HTTP Server and Websphere commerce. I am trying to access our application, but access.log file is showing "HTTP 1.1 500" status code. When I checked the systemout.log for WAS Console, It is showing below error:
webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[Stores Request Servlet]: java.lang.NoClassDefFoundError: com.ibm.commerce.seo.url.helpers.SEOURLMapperSource (initialization failure)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:140)
at com.ibm.commerce.webcontroller.RuntimeServletFilter.init(RuntimeServletFilter.java:151)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:548)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:462)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:319)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:379)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:860)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:935)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:503)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:181)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3954)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:276)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:942)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1592)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:453)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:515)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:306)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:277)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
I checked for SEOURLMappersource class, and it is there in SEO-BaseComponentLogic.jar, which is already present in my wc.ear and other relevent classes to SEO are present in SEO-BaseComponentLogic-FEP.jar.
Please guide me for the error.
The (initialization failure) means that a class failed initialization. There should be a Caused by explaining that problem, but if there's not, search the logs for SEOURLMapperSource.<clinit> to find the underlying problem. If that doesn't yield any results either, then wrap your static{} block in a try{}catch{} to print the real problem (and don't forget to move any static ... = ... initializations into the static{} block as well).
I ran into the same problem described by this WC stack exception. I found out that on our system the owner/group for the related jar files was not set for the wc user but for the root user. Thus even though the class/jar present, it was not read due to permissions. This initialization exception went away after chown/chgrp and a restart.

How to localize JSF composite component?

I'm having trouble localizing a composite component (Mojarra 2.2, Glassfish 4.0).
I tried BalusC's solution here to put the properties file in the same directory as the composite component with the same file name as the composite component and a .properties extension -- that works to externalize the strings from the composite component's definition.
But when I want to localize the strings (by adding _en suffix to the property file's filename) I get this error (only thing changed is the name of the properties file):
[2013-08-08T13:49:04.234-0500] [glassfish 4.0] [WARNING] [] [javax.enterprise.web] [tid: _ThreadID=24 _ThreadName=http-listener-1(5)] [timeMillis: 1375987744234] [levelValue: 900] [[
StandardWrapperValve[Faces Servlet]: Servlet.service() for servlet Faces Servlet threw exception
java.lang.NullPointerException
at javax.faces.component.UIComponent.findComponentResourceBundleLocaleMatch(UIComponent.java:1204)
at javax.faces.component.UIComponent.getResourceBundleMap(UIComponent.java:1007)
at sun.reflect.GeneratedMethodAccessor1226.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at com.sun.faces.facelets.el.ELText$ELTextVariable.writeText(ELText.java:227)
at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:85)
at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:894)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1856)
...
I read an article (post from 24/Aug/12 03:50 PM) that JSF localizes differently than standard Java and that the properties files would go in resources/en/<library>/<component>.properties, so I put mycomp.properties there and got the error again.
My default locale is actually "en_US" -- I tried that as well with the same results.
So, this works:
resources/lib/mycomp.xhtml, resources/lib/mycomp.properties
These don't work:
resources/lib/mycomp.xhtml, resources/lib/mycomp_en.properties
resources/lib/mycomp.xhtml, resources/en/lib/mycomp.properties
What am I doing wrong?
I can reproduce your problem. This is quite embarrassing. Apparently something changed related to this in a newer Mojarra version. I can't get both the old and new approach to work in 2.2.0.
I peeked in the Mojarra source code again, starting at UIComponent#getResourceBundleMap(), and I learned that the resource bundle is first searched based on the FQN of the component's class. We could easily make use of it.
If not already done, first create a backing component class:
package com.example.composite;
#FacesComponent("myComposite")
public class MyComposite extends UINamingContainer {
// Can be kept empty.
}
And declare it in the composite component definition:
<cc:interface componentType="myComposite">
Then, you can simply put the MyComposite.properties, MyComposite_en.properties, etc in the very same com.example.composite package. It worked for me.

RedirectSignal error upon redirection via Java

I have designed the following method and using that within managed beans:
public static void redirectToPrevious() {
FacesContext context = FacesContext.getCurrentInstance();
XSPContext xContext=XSPContext.getXSPContext(context);
xContext.redirectToPrevious();
}
It works as expected. It redirects to the previous page (or home page if there is not any).
However, everytime it works, it throws RedirectSignal error:
com.ibm.xsp.FacesExceptionEx: javax.faces.el.EvaluationException: com.ibm.xsp.acl.RedirectSignal
at com.ibm.xsp.util.DataPublisher.publishControlData(DataPublisher.java:204)
at com.ibm.xsp.component.UIDataPanelBase.publishControlData(UIDataPanelBase.java:310)
at com.ibm.xsp.component.UIDataPanelBase.initBeforeContents(UIDataPanelBase.java:451)
at com.ibm.xsp.component.UIIncludeComposite.initBeforePageContents(UIIncludeComposite.java:668)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:339)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.addComponent(AbstractCompiledPage.java:389)
at com.ibm.xsp.component.UIIncludeComposite.buildContents(UIIncludeComposite.java:453)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildFacet(CompiledComponentBuilder.java:205)
at com.ibm.xsp.component.UICallback.buildContents(UICallback.java:180)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)
at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
at com.ibm.xsp.extlib.component.layout.UIVarPublisherBase.buildContents(UIVarPublisherBase.java:97)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)
at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
at com.ibm.xsp.component.UIIncludeComposite.buildPageContents(UIIncludeComposite.java:692)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:340)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.addComponent(AbstractCompiledPage.java:389)
at com.ibm.xsp.component.UIIncludeComposite.buildContents(UIIncludeComposite.java:453)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildChildren(CompiledComponentBuilder.java:123)
at com.ibm.xsp.page.compiled.CompiledComponentBuilder.buildAll(CompiledComponentBuilder.java:84)
at com.ibm.xsp.component.UIViewRootEx.buildContents(UIViewRootEx.java:1649)
at com.ibm.xsp.component.UIViewRootEx2.buildContents(UIViewRootEx2.java:247)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.initComponent(AbstractCompiledPage.java:334)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.createTree(AbstractCompiledPage.java:256)
at com.ibm.xsp.page.compiled.AbstractCompiledPage.createViewRoot(AbstractCompiledPage.java:167)
at com.ibm.xsp.application.ViewHandlerExImpl._createViewRoot(ViewHandlerExImpl.java:521)
at com.ibm.xsp.application.ViewHandlerExImpl.createViewRoot(ViewHandlerExImpl.java:567)
at com.ibm.xsp.application.ViewHandlerExImpl.doCreateView(ViewHandlerExImpl.java:142)
at com.ibm.xsp.application.ViewHandlerEx.createView(ViewHandlerEx.java:90)
at com.ibm.xsp.webapp.FacesServlet.serviceView(FacesServlet.java:251)
at com.ibm.xsp.webapp.FacesServletEx.serviceView(FacesServletEx.java:157)
at com.ibm.xsp.webapp.FacesServlet.service(FacesServlet.java:160)
at com.ibm.xsp.webapp.FacesServletEx.service(FacesServletEx.java:138)
at com.ibm.xsp.webapp.DesignerFacesServlet.service(DesignerFacesServlet.java:103)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.invokeServlet(ComponentModule.java:576)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.invokeServlet(NSFComponentModule.java:1315)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$AdapterInvoker.invokeServlet(ComponentModule.java:853)
at com.ibm.designer.runtime.domino.adapter.ComponentModule$ServletInvoker.doService(ComponentModule.java:796)
at com.ibm.designer.runtime.domino.adapter.ComponentModule.doService(ComponentModule.java:565)
at com.ibm.domino.xsp.module.nsf.NSFComponentModule.doService(NSFComponentModule.java:1299)
at com.ibm.domino.xsp.module.nsf.NSFService.doServiceInternal(NSFService.java:662)
at com.ibm.domino.xsp.module.nsf.NSFService.doService(NSFService.java:482)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.doService(LCDEnvironment.java:350)
at com.ibm.designer.runtime.domino.adapter.LCDEnvironment.service(LCDEnvironment.java:306)
at com.ibm.domino.xsp.bridge.http.engine.XspCmdManager.service(XspCmdManager.java:272)
Caused by: javax.faces.el.EvaluationException: com.ibm.xsp.acl.RedirectSignal
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:142)
at com.ibm.xsp.actions.ExecuteScriptAction.invoke(ExecuteScriptAction.java:78)
at com.ibm.xsp.actions.ActionGroup.invoke(ActionGroup.java:135)
at com.ibm.xsp.model.AbstractDocumentDataSource.invoke(AbstractDocumentDataSource.java:299)
at com.ibm.xsp.model.AbstractDocumentDataSource.newDocument(AbstractDocumentDataSource.java:126)
at com.ibm.xsp.model.AbstractDocumentDataSource.load(AbstractDocumentDataSource.java:97)
at com.ibm.xsp.model.AbstractDataSource.getDataContainer(AbstractDataSource.java:474)
at com.ibm.xsp.model.domino.DominoDocumentData.getDataObject(DominoDocumentData.java:145)
at com.ibm.xsp.model.AbstractDataSource.pushData(AbstractDataSource.java:576)
at com.ibm.xsp.util.DataPublisher.publishControlData(DataPublisher.java:181)
... 50 more
Caused by: com.ibm.xsp.acl.RedirectSignal
at com.ibm.xsp.designer.context.XSPContext.renderPage(XSPContext.java:194)
at com.ibm.xsp.designer.context.XSPContext.redirectToPage(XSPContext.java:917)
at com.ibm.xsp.designer.context.XSPContext.redirectToPage(XSPContext.java:929)
at com.ibm.xsp.designer.context.XSPContext.redirectToPrevious(XSPContext.java:939)
at com.developi.toolbox.BeanUtils.redirectToPrevious(BeanUtils.java:57)
at com.hillside.flowng.beans.JobManager.postNewJob(JobManager.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:138)
... 59 more
I can use try-catch and ignore the error but I'm not sure why this is happenning inside a managed bean but not in SSJS.
Any idea?
The RedirectSignal is not a java.lang.Exception, it is a java.lang.Error. That's why it is not catched with a default try/catch block. There are some other signals f.e. the NoAccessSignal or the ResponseCompleteSignal which are handled internally to stop processing requests and/or code execution, but are not "real" errors for the XPages servlet.
When redirecting to another page, the RedirectSignal is required to stop processing "useless" code and is catched in SSJS Interpreter. A button with this code...
print("BEFORE!");
context.redirectToPrevious();
print("AFTER");
will just send the BEFORE! to the console, the rest of the SSJS will not be executed.
You have to handle the RedirectSignal by your own (in the method of your bean) to prevent the printing to the console / the log.
XSPContext.getXSPContext(FacesContext) just uses the variable resolver to resolve the context variable, so this method should return a handle on the same object that context evaluates to within SSJS. So I'm not sure why you would see different behavior in different languages.
However, a RedirectSignal is only shown when recursion has been detected during a redirect. If I'm interpreting your stack trace correctly, refreshMode is set to partial on your event. All redirects must be performed from within a full refresh event.

Servlet exception stream closed jsp

I am getting a servlet Exception "Stream closed" !!. I am not able to identify which jsp page is the problematic one or which line has the issue. It's showing the pagedefinition page as well as included pages.
As it is not easy to show all the pages attaching as a zip file : InGoogleDocs
The structure is like
pageDef.jsp Contains : allThings.jsp design.jsp myFile.jsp
The exception I got is as follows:
javax.servlet.jsp.JspException: ServletException in
'/layout/global/allThings.jsp': ServletException in
'/layout/body/design.jsp': ServletException in
'/layout/sub/design.jsp': ServletException in
'/module/air/myFile.jsp': Stream closed
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:920)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
at org.apache.jsp.pagedef.air.pageDef_jsp._jspx_meth_tiles_insert_0(pageDef_jsp.java:1693)
at org.apache.jsp.pagedef.air.pageDef_jsp._jspService(pageDef_jsp.java:146)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:386)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:270)
at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java:269)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
at org.apache.catalina.security.SecurityUtil.execute(SecurityUtil.java:302)
at org.apache.catalina.security.SecurityUtil.doAsPrivilege(SecurityUtil.java:163)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:283)
at org.apache.catalina.core.ApplicationFilterChain.access$000(ApplicationFilterChain.java:56)
Important Note:
I am not getting this exception all the time.
when I go to the page (sometimes i will get the exception). If not getting , if I click back button in the jsp and coming back to the page will make the exception.
This problem is solved.
The problem was in a JSTL custom tag library's for-loop !!
How I solved(debugging JSP):
I made different copies of problematic file and included each of them in definition JSP.
Each of those problematic JSP files are edited in different areas as follows. If we do so, the error will be in only one/some JSP and so it is easy to find out the exception.
Say:
problematic-ORIGINAL.jsp
<jsp:for...></jsp>
<c:...>..</c>
...
problematic-1.jsp
<c:...>..</c>
problematic-2.jsp
<jsp:for...></jsp>
problematic-3.jsp
...
And then include 1,2 and 3 in definition JSP. Thus I could find the prob was in 2nd one. Enjoy coding ..

Resources