[JBoss JIRA] Issue Comment Edited: (SEAMCATCH-4) Include the ability to filter stack traces
by Jason Porter (JIRA)
[ https://issues.jboss.org/browse/SEAMCATCH-4?page=com.atlassian.jira.plugi... ]
Jason Porter edited comment on SEAMCATCH-4 at 2/19/11 2:27 PM:
---------------------------------------------------------------
Here are some examples.
1. Drop all frames in NoDefClassFoundError
{code:java}
public class NoClassFoundStackFrameFilter implements ExceptionStackFrameFilter<NoClassDefFoundError>
{
@Override
public StackFrameFilterResult process(StackFrame frame)
{
return StackFrameFilterResult.BREAK;
}
}
{code}
2. Truncate frames after a threshold (though no indication we did that we did)
{code:java}
public class TruncateExceptionStackFilter implements ExceptionStackFrameFilter<Throwable>
{
@Override
public StackFrameFilterResult process(StackFrame frame)
{
if (frame.getIterationStatus().getIndex() >= 20)
{
return StackFrameFilterResult.DROP_REMAINING;
}
return StackFrameFilterResult.INCLUDE;
}
}
{code}
3. Remove noise in between fire event and invoke observer
{code:java}
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");
}
}
{code}
4. Flatten reflections invoke into a single line
{code:java}
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;
}
}
{code}
was (Author: dan.j.allen):
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: 3.0.0.CR1
>
>
> Catch should draw from ideas such as:
> - http://www.docjar.org/html/api/org/apache/commons/lang/exception/Nestable...
> - http://stackoverflow.com/questions/2504647/bash-how-to-filter-java-except...
> - http://squirrelsewer.blogspot.com/2010/03/filter-your-stack-traces.html
> - http://pastebin.com/p8aCSeuu
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[JBoss JIRA] Issue Comment Edited: (SEAMCATCH-4) Include the ability to filter stack traces
by Jason Porter (JIRA)
[ https://issues.jboss.org/browse/SEAMCATCH-4?page=com.atlassian.jira.plugi... ]
Jason Porter edited comment on SEAMCATCH-4 at 2/19/11 2:25 PM:
---------------------------------------------------------------
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.
{code:java}
/**
* 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
}
{code}
was (Author: dan.j.allen):
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: 3.0.0.CR1
>
>
> Catch should draw from ideas such as:
> - http://www.docjar.org/html/api/org/apache/commons/lang/exception/Nestable...
> - http://stackoverflow.com/questions/2504647/bash-how-to-filter-java-except...
> - http://squirrelsewer.blogspot.com/2010/03/filter-your-stack-traces.html
> - http://pastebin.com/p8aCSeuu
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[JBoss JIRA] Reopened: (SEAMJMS-16) Event to JMS to Event mapping behavior
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/SEAMJMS-16?page=com.atlassian.jira.plugin... ]
Pete Muir reopened SEAMJMS-16:
------------------------------
Reopening, I don't understand what is spec required about this? Also, this is certainly fixable in JBoss AS, even if we have to do something complex to get there.
> Event to JMS to Event mapping behavior
> --------------------------------------
>
> Key: SEAMJMS-16
> URL: https://issues.jboss.org/browse/SEAMJMS-16
> Project: Seam JMS
> Issue Type: Bug
> Reporter: John Ament
>
> While working on seam jms, I've noted the following behavior.
> java.lang.IllegalStateException: Singleton not set for BaseClassLoader@3479404a{vfs:///apps/jboss/jboss-6.0.0.Final/server/all/conf/jboss-service.xml}
> at org.jboss.weld.integration.provider.JBossSingletonProvider$EarSingleton.get(JBossSingletonProvider.java:59) [:6.0.0.Final]
> at org.jboss.weld.Container.instance(Container.java:58) [:6.0.0.Final]
> at org.jboss.weld.resolution.ResolvableBuilder.checkQualifier(ResolvableBuilder.java:209) [:6.0.0.Final]
> at org.jboss.weld.resolution.ResolvableBuilder.addQualifier(ResolvableBuilder.java:174) [:6.0.0.Final]
> at org.jboss.weld.resolution.ResolvableBuilder.addQualifierIfAbsent(ResolvableBuilder.java:184) [:6.0.0.Final]
> at org.jboss.weld.manager.BeanManagerImpl.resolveObserverMethods(BeanManagerImpl.java:464) [:6.0.0.Final]
> at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:604) [:6.0.0.Final]
> at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:598) [:6.0.0.Final]
> at org.jboss.seam.jms.bridge.IngressMessageListener.onMessage(IngressMessageListener.java:45)
> at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91) [:6.0.0.Final]
> at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822) [:6.0.0.Final]
> at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46) [:6.0.0.Final]
> at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940) [:6.0.0.Final]
> at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.0.0.Final]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
> at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
> This exception occurs when trying to fire an event with the contents of a JMS message. The message listener in this case is instantiated from the portable extension and receives the bean manager as an argument in the constructor. I am able to get as far as reading the data from JMS, but when firing the second event the above exception occurs. I'm not certain that this is a Weld problem, but it seem slike a good place to start based on the packages shown.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months
[JBoss JIRA] Closed: (SEAMJMS-16) Event to JMS to Event mapping behavior
by John Ament (JIRA)
[ https://issues.jboss.org/browse/SEAMJMS-16?page=com.atlassian.jira.plugin... ]
John Ament closed SEAMJMS-16.
-----------------------------
Resolution: Rejected
Rejecting issue. This is apparently as defined by spec, so cannot be fixed.
> Event to JMS to Event mapping behavior
> --------------------------------------
>
> Key: SEAMJMS-16
> URL: https://issues.jboss.org/browse/SEAMJMS-16
> Project: Seam JMS
> Issue Type: Bug
> Reporter: John Ament
>
> While working on seam jms, I've noted the following behavior.
> java.lang.IllegalStateException: Singleton not set for BaseClassLoader@3479404a{vfs:///apps/jboss/jboss-6.0.0.Final/server/all/conf/jboss-service.xml}
> at org.jboss.weld.integration.provider.JBossSingletonProvider$EarSingleton.get(JBossSingletonProvider.java:59) [:6.0.0.Final]
> at org.jboss.weld.Container.instance(Container.java:58) [:6.0.0.Final]
> at org.jboss.weld.resolution.ResolvableBuilder.checkQualifier(ResolvableBuilder.java:209) [:6.0.0.Final]
> at org.jboss.weld.resolution.ResolvableBuilder.addQualifier(ResolvableBuilder.java:174) [:6.0.0.Final]
> at org.jboss.weld.resolution.ResolvableBuilder.addQualifierIfAbsent(ResolvableBuilder.java:184) [:6.0.0.Final]
> at org.jboss.weld.manager.BeanManagerImpl.resolveObserverMethods(BeanManagerImpl.java:464) [:6.0.0.Final]
> at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:604) [:6.0.0.Final]
> at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:598) [:6.0.0.Final]
> at org.jboss.seam.jms.bridge.IngressMessageListener.onMessage(IngressMessageListener.java:45)
> at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91) [:6.0.0.Final]
> at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822) [:6.0.0.Final]
> at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46) [:6.0.0.Final]
> at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940) [:6.0.0.Final]
> at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.0.0.Final]
> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_22]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_22]
> at java.lang.Thread.run(Thread.java:662) [:1.6.0_22]
> This exception occurs when trying to fire an event with the contents of a JMS message. The message listener in this case is instantiated from the portable extension and receives the bean manager as an argument in the constructor. I am able to get as far as reading the data from JMS, but when firing the second event the above exception occurs. I'm not certain that this is a Weld problem, but it seem slike a good place to start based on the packages shown.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 8 months