really getting mad here...
Now i have my DatabaseBusinessException where i have the PL/SQL exception stack elements attached with an ArrayList.
So when i first get the error stack from the DB i do the following:
Code:
private DataBaseBusinessException handleDBBusinessException(String errorMessage) {
List plStackTrace = PlSqlStackTraceParser.parse(errorMessage);
DataBaseBusinessException dbbe = new DataBaseBusinessException("Some Business Errors happened in the DB - Please check the PL/SQL Stack trace") ;
dbbe.setPlsqlExceptionStack(plStackTrace);
return dbbe;
}
So the only stack element i see in the java exception stack is this message, which is just read by the developers.
Now comes the problem....after throwing this runtimeexception it gets caught by a JSF based class, that is trying to resolve the Expression Language element in my jsp.
To make it understandable...to have a better i18n i have created an annotation with a custom Property/Variable resolver in JSF that is able translate the following syntax.
MySimpleService.myBean.myattribute
JSF then calls the service method getMyBean() and resolves the myattribute attribute
As an exception is happening in the SQLErrorCodeTranslation the EL-Resolver of JSF is automatically throwing the javax.faces.el.EvaluationException
and the portlet PortletException etc.
That just means that i can never be sure that my exception that i threw is the last one or not and have to iterate programaticall through the error
stack and do some instanceof's to get my DatabaseBusinessException. Im i dreaming or do i really have to get that far? ;-D
I just wanted to show you the error stack (shortened as it exceeded the character limit):
Code:
[12.02.09 14:16:51:718 CET] 00000083 jsf W com.sun.faces.application.ViewHandlerImpl getFacesMapping Unable to determine FaceServlet mapping for servlet path '/portlet'.
[12.02.09 14:16:51:734 CET] 00000083 jsf W com.sun.faces.application.ViewHandlerImpl getFacesMapping Unable to determine FaceServlet mapping for servlet path '/portlet'.
[12.02.09 14:16:51:734 CET] 00000083 jsf W com.sun.faces.application.ViewHandlerImpl getFacesMapping Unable to determine FaceServlet mapping for servlet path '/portlet'.
[12.02.09 14:16:57:359 CET] 00000083 PropertyAware I Setting up the connection for further use...
[12.02.09 14:16:57:406 CET] 00000083 ServletWrappe E SRVE0068E: Die Methode service() für das Servlet /XPOPublicSampleView.jsp konnte nicht aufgerufen werden. Ausgelöste Ausnahme: javax.servlet.ServletException: javax.faces.el.EvaluationException: Error getting property 'sampleBean' from bean of type pagecode.sample.XPOPublicSampleView: ch.xxxxxxx.xnet.fwk.exception.DataBaseBusinessException: Some Business Errors happened in the DB - Please check the PL/SQL Stack trace
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:648)
at com.ibm._jsp._XPOPublicSampleView._jspService(_XPOPublicSampleView.java:117)
at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:93)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1696)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:825)
at com.ibm.wsspi.webcontainer.servlet.GenericServletWrapper.handleRequest(GenericServletWrapper.java:121)
at com.ibm.ws.jsp.webcontainerext.JSPExtensionServletWrapper.handleRequest(JSPExtensionServletWrapper.java:216)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.include(WebAppRequestDispatcher.java:670)
at org.apache.pluto.core.impl.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:112)
at com.ibm.faces.portlet.httpbridge.PortletRequestDispatcherWrapper.include(PortletRequestDispatcherWrapper.java:61)
at com.ibm.faces.portlet.httpbridge.PortletRequestDispatcherWrapper.forward(PortletRequestDispatcherWrapper.java:35)
at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:325)
at com.ibm.faces.portlet.httpbridge.PortletExternalContextWrapper.dispatch(PortletExternalContextWrapper.java:83)
at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:262)
at com.ibm.faces.portlet.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:74)
at com.ibm.faces.portlet.PortletViewHandlerImpl.renderView(PortletViewHandlerImpl.java:74)
---- Begin backtrace for Nested Throwables
javax.faces.el.EvaluationException: javax.faces.el.EvaluationException: Error getting property 'sampleBean' from bean of type pagecode.sample.XPOPublicSampleView: ch.xxxxxxx.xnet.fwk.exception.DataBaseBusinessException: Some Business Errors happened in the DB - Please check the PL/SQL Stack trace
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:186)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:137)
at javax.faces.component.UIOutput.getValue(UIOutput.java:147)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:84)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:211)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:171)
at com.ibm.faces.renderkit.DefaultAjaxRenderer.encodeEnd(DefaultAjaxRenderer.java:83)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:762)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:604)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:527)
at com.sun.faces.taglib.html_basic.OutputTextTag.doEndTag(OutputTextTag.java:202)
at com.ibm._jsp._XPOPublicSampleView._jspx_meth_h_outputText_0(_XPOPublicSampleView.java:178)
at com.ibm._jsp._XPOPublicSampleView._jspx_meth_h_form_0(_XPOPublicSampleView.java:399)
at com.ibm._jsp._XPOPublicSampleView._jspx_meth_hx_scriptCollector_0(_XPOPublicSampleView.java:449)
Caused by: javax.faces.el.EvaluationException: Error getting property 'sampleBean' from bean of type pagecode.sample.XPOPublicSampleView: ch.xxxxxxx.xnet.fwk.exception.DataBaseBusinessException: Some Business Errors happened in the DB - Please check the PL/SQL Stack trace
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:90)
at com.ibm.faces.databind.SelectItemsPropResolver.getValue(SelectItemsPropResolver.java:41)
at ch.xxxxxxx.xnet.fwk.jsf.resolver.CommonPropResolver.getValue(CommonPropResolver.java:47)
at com.sun.faces.el.impl.ArraySuffix.evaluate(ArraySuffix.java:167)
at com.sun.faces.el.impl.ComplexValue.evaluate(ComplexValue.java:151)
at com.sun.faces.el.impl.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:243)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:156)
at com.sun.faces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:137)
at javax.faces.component.UIOutput.getValue(UIOutput.java:147)
at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:84)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:211)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:171)
at com.ibm.faces.renderkit.DefaultAjaxRenderer.encodeEnd(DefaultAjaxRenderer.java:83)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:762)
at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:604)
at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:527)
at com.sun.faces.taglib.html_basic.OutputTextTag.doEndTag(OutputTextTag.java:202)
at com.ibm._jsp._XPOPublicSampleView._jspx_meth_h_outputText_0(_XPOPublicSampleView.java:178)
at com.ibm._jsp._XPOPublicSampleView._jspx_meth_h_form_0(_XPOPublicSampleView.java:399)
at com.ibm._jsp._XPOPublicSampleView._jspx_meth_hx_scriptCollector_0(_XPOPublicSampleView.java:449)
at com.ibm._jsp._XPOPublicSampleView._jspx_meth_f_view_0(_XPOPublicSampleView.java:476)
at com.ibm._jsp._XPOPublicSampleView._jspService(_XPOPublicSampleView.java:110)
Caused by: ch.xxxxxxx.xnet.fwk.exception.DataBaseBusinessException: Some Business Errors happened in the DB - Please check the PL/SQL Stack trace
at ch.xxxxxxx.xnet.fwk.exception.CommonSQLErrorCodeTranslator.handleDBBusinessException(CommonSQLErrorCodeTranslator.java:28)
at ch.xxxxxxx.xnet.fwk.exception.CommonSQLErrorCodeTranslator.customTranslate(CommonSQLErrorCodeTranslator.java:19)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:230)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:212)
at org.springframework.orm.ibatis.SqlMapClientTemplate.update(SqlMapClientTemplate.java:411)
at org.springframework.orm.ibatis.SqlMapClientTemplate.update(SqlMapClientTemplate.java:405)
at ch.xxxxxxx.xnet.sample.dao.SampleDAO.getBusinessException(SampleDAO.java:20)
at ch.xxxxxxx.xnet.sample.service.SampleService.getBusinessException(SampleService.java:22)
at pagecode.sample.XPOPublicSampleView.getSampleBean(XPOPublicSampleView.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
at java.lang.reflect.Method.invoke(Method.java:391)
at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:80)
at com.ibm.faces.databind.SelectItemsPropResolver.getValue(SelectItemsPropResolver.java:41)
at ch.xxxxxxx.xnet.fwk.jsf.resolver.CommonPropResolver.getValue(CommonPropResolver.java:47)