[JBoss JIRA] Commented: (SEAMCATCH-4) Include the ability to filter stack traces
by Dan Allen (JIRA)
[ https://issues.jboss.org/browse/SEAMCATCH-4?page=com.atlassian.jira.plugi... ]
Dan Allen commented on SEAMCATCH-4:
-----------------------------------
Here are some examples.
1. Drop all frames in NoDefClassFoundError
public class NoClassFoundStackFrameFilter implements ExceptionStackFrameFilter<NoClassDefFoundError>
{
@Override
public StackFrameFilterResult process(StackFrame frame)
{
return StackFrameFilterResult.BREAK;
}
}
2. Truncate frames after a threshold (though no indication we did that we did)
public class TruncateExceptionStackFilter implements ExceptionStackFrameFilter<Throwable>
{
@Override
public StackFrameFilterResult process(StackFrame frame)
{
if (frame.getIterationStatus().getIndex() >= 20)
{
return StackFrameFilterResult.DROP_REMAINING;
}
return StackFrameFilterResult.INCLUDE;
}
}
3. Remove noise in between fire event and invoke observer
public class InvokeObserverStackFrameFilter implements ExceptionStackFrameFilter<Throwable>
{
@Override
public StackFrameFilterResult process(StackFrame frame)
{
StackTraceElement el = frame.getStackTraceElement();
if (frame.isMarkSet("event.firing"))
{
if (isReflectionInvoke(el))
{
frame.clearMark("event.firing");
return StackFrameFilterResult.DROP;
}
else
{
return StackFrameFilterResult.DROP;
}
}
else if (el.getClassName().contains(".BeanManager") && el.getMethodName().equals("fireEvent"))
{
frame.mark("event.firing");
return StackFrameFilterResult.INCLUDE;
}
return StackFrameFilterResult.INCLUDE;
}
private boolean isReflectionInvoke(StackTraceElement candidate)
{
return candidate.getClassName().equals(Method.class.getName())
&& candidate.getMethodName().equals("invoke");
}
}
4. Flatten reflections invoke into a single line
public class ReflectionInvokeStackFrameFilter implements ExceptionStackFrameFilter<Throwable>
{
@Override
public StackFrameFilterResult process(StackFrame frame)
{
if (frame.isMarkSet("reflections.invoke"))
{
if (frame.getStackTraceElement().getMethodName().startsWith("invoke") ||
frame.getStackTraceElement().getClassName().contains("_WeldClientProxy"))
{
return StackFrameFilterResult.DROP;
}
else
{
frame.clearMark("reflections.invoke");
}
}
return StackFrameFilterResult.INCLUDE;
}
}
> Include the ability to filter stack traces
> ------------------------------------------
>
> Key: SEAMCATCH-4
> URL: https://issues.jboss.org/browse/SEAMCATCH-4
> Project: Seam Catch
> Issue Type: Feature Request
> Reporter: Jason Porter
> Assignee: Jason Porter
> Fix For: Alpha3
>
>
> Catch should support ideas such as http://stackoverflow.com/questions/2504647/bash-how-to-filter-java-except... http://squirrelsewer.blogspot.com/2010/03/filter-your-stack-traces.html and http://pastebin.com/p8aCSeuu
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[JBoss JIRA] Commented: (SEAMCATCH-4) Include the ability to filter stack traces
by Dan Allen (JIRA)
[ https://issues.jboss.org/browse/SEAMCATCH-4?page=com.atlassian.jira.plugi... ]
Dan Allen commented on SEAMCATCH-4:
-----------------------------------
I played around with some ideas and we may even be able to use this for the exception mapping as well. Here are some prototype APIs.
/**
* A filter for processing the stack frames of a single exception (type parameter allows us to focus on a specific exception type)
*/
public interface ExceptionStackFrameFilter<T extends Throwable>
{
public StackFrameFilterResult process(StackFrame frame);
}
public interface StackFrame
{
StackElement getStackElement();
StackTraceElement getStackTraceElement();
void mark(String tag);
StackFrame getMarkedFrame(String tag);
boolean isMarkSet(String tag);
void clearMark(String tag);
void setStackTraceElement(StackTraceElement element);
IterationStatus getIterationStatus();
}
public enum StackFrameFilterResult
{
/**
* Include this frame
*/
INCLUDE,
/**
* Drop this frame
*/
DROP,
/**
* Include this frame, but skip any remaining frames in this cause
*/
DROP_REMAINING,
/**
* Drop this frame and any remaining frames in this cause
*/
BREAK,
/**
* Stops processing any remaining frames or causes
*/
TERMINATE,
/**
* Include this frame, then stop processing any remaining frames or causes
*/
TERMINATE_AFTER
}
/**
* A filter for processing the chained exceptions (i.e., the causes)
*/
public interface ExceptionStackFilter
{
public StackFilterResult process(StackElement element);
}
public interface StackElement
{
Throwable getThrowable();
void setThrowable(Throwable throwable);
IterationStatus getIterationStatus();
}
public enum StackFilterResult
{
/**
* Include this throwable
*/
INCLUDE,
/**
* Drop this throwable, go to next in chain (if any)
*/
DROP,
/**
* Drop any remaining throwables in the chain
*/
DROP_REMAINING,
/**
* Drop throwable and any remaining in the chain
*/
TERMINATE
}
> Include the ability to filter stack traces
> ------------------------------------------
>
> Key: SEAMCATCH-4
> URL: https://issues.jboss.org/browse/SEAMCATCH-4
> Project: Seam Catch
> Issue Type: Feature Request
> Reporter: Jason Porter
> Assignee: Jason Porter
> Fix For: Alpha3
>
>
> Catch should support ideas such as http://stackoverflow.com/questions/2504647/bash-how-to-filter-java-except... http://squirrelsewer.blogspot.com/2010/03/filter-your-stack-traces.html and http://pastebin.com/p8aCSeuu
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months
[JBoss JIRA] Created: (SEAMFACES-64) TransactionPhaseListener - NullPointerException
by Lukas Fryc (JIRA)
TransactionPhaseListener - NullPointerException
-----------------------------------------------
Key: SEAMFACES-64
URL: https://issues.jboss.org/browse/SEAMFACES-64
Project: Seam Faces
Issue Type: Bug
Components: Transactions & Persistence
Affects Versions: 3.0.0.Beta1
Environment: JBoss AS 6.0.0.CR1
OpenJDK Runtime Environment (IcedTea6 1.9.2)
Apache Maven 3.0 (r1004208; 2010-10-04 13:50:56+0200)
Reporter: Lukas Fryc
Sample application: https://svn.devel.redhat.com/repos/jboss-qa/people/ozizka/VUTcourse/proje...
Revision: 12454
17:04:18,180 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/practice03-jpa].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: java.lang.NullPointerException
at org.jboss.seam.faces.transaction.TransactionPhaseListener.begin(TransactionPhaseListener.java:136) [:20101101-1123]
at org.jboss.seam.faces.transaction.TransactionPhaseListener.begin(TransactionPhaseListener.java:129) [:20101101-1123]
at org.jboss.seam.faces.transaction.TransactionPhaseListener.handleTransactionsBeforePhase(TransactionPhaseListener.java:106) [:20101101-1123]
at org.jboss.seam.faces.transaction.TransactionPhaseListener.beforePhase(TransactionPhaseListener.java:82) [:20101101-1123]
at org.jboss.seam.faces.event.DelegatingPhaseListener.beforePhase(DelegatingPhaseListener.java:56) [:20101209-1701]
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228) [:2.0.2-FCS]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99) [:2.0.2-FCS]
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110) [:2.0.2-FCS]
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [:2.0.2-FCS]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312) [:2.0.2-FCS]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:]
at org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:63) [:]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:]
at org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:68) [:2010-08-30 15:40]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:274) [:]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.20100911-M5]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.CR3]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.CR3]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.20100911-M5]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [:]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:]
at java.lang.Thread.run(Thread.java:636) [:1.6.0_20]
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 4 months