You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement better logging for our Faces application and ran into a problem. When the problematic expression goes through ExpressionFactory#coerceToType, the resulting exception is not wrapped in an ELException and thus some information is lost along the way.
Here is our example stack trace:
org.hibernate.LazyInitializationException: Unable to perform requested lazy initialization [redacted.object] - session is closed and settings disallow loading outside the Session
at [email protected]//org.hibernate.bytecode.enhance.spi.interceptor.EnhancementHelper.throwLazyInitializationException(EnhancementHelper.java:275)
at [email protected]//org.hibernate.bytecode.enhance.spi.interceptor.EnhancementHelper.performWork(EnhancementHelper.java:174)
at [email protected]//org.hibernate.bytecode.enhance.spi.interceptor.EnhancementAsProxyLazinessInterceptor.handleRead(EnhancementAsProxyLazinessInterceptor.java:106)
at [email protected]//org.hibernate.bytecode.enhance.spi.interceptor.AbstractInterceptor.readObject(AbstractInterceptor.java:152)
at deployment.redacted.ear.redacted-ejb.jar//redacted.Object.$$_hibernate_read_field(RedactedEntity.java)
at deployment.redacted.ear.redacted-ejb.jar//redacted.Object.toString(RedactedEntity.java:1173)
at [email protected]//org.glassfish.expressly.lang.ELSupport.coerceToString(ELSupport.java:401)
at [email protected]//org.glassfish.expressly.lang.ELSupport.coerceToType(ELSupport.java:438)
at [email protected]//org.glassfish.expressly.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:70)
at [email protected]//jakarta.el.ELContext.convertToType(ELContext.java:440)
at [email protected]//org.glassfish.expressly.lang.EvaluationContext.convertToType(EvaluationContext.java:141)
at [email protected]//org.glassfish.expressly.ValueExpressionImpl.getValue(ValueExpressionImpl.java:142)
at [email protected]//org.jboss.weld.module.web.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at jakarta.faces.impl:[email protected]//org.apache.myfaces.view.facelets.el.ContextAwareTagValueExpression.getValue(ContextAwareTagValueExpression.java:100)
If the exception would be wrapped in an ELException, MyFaces would wrap it in an exception that contains information about the location and expression that resulted in the exception. As it is, the exception is being passed through.
I checked different implementations, and both seem to behave the same: Tomcat Expressly
The question is: should the exception actually be wrapped in an ELException? The spec says: An ELException is thrown if an error results from applying the conversion rules.
Thank you very much in advance!
The text was updated successfully, but these errors were encountered:
I was trying to implement better logging for our Faces application and ran into a problem. When the problematic expression goes through
ExpressionFactory#coerceToType
, the resulting exception is not wrapped in anELException
and thus some information is lost along the way.Here is our example stack trace:
If the exception would be wrapped in an
ELException
, MyFaces would wrap it in an exception that contains information about the location and expression that resulted in the exception. As it is, the exception is being passed through.I checked different implementations, and both seem to behave the same:
Tomcat
Expressly
The question is: should the exception actually be wrapped in an
ELException
? The spec says:An ELException is thrown if an error results from applying the conversion rules.
Thank you very much in advance!
The text was updated successfully, but these errors were encountered: