title: Step into Java EE code in Eclipse
body: <p>Debugging sessions in Eclipse and Java EE code are a pain and I'm hoping someone has a better method than mine.</p>
  
  <p>Here is a typical call stack between 2 EJB stateless bean methods (using TomEE 1.0) :</p>
  
  <pre><code>NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]  
  NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39  
  DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25  
  Method.invoke(Object, Object...) line: 597  
  ReflectionInvocationContext$BeanInvocation(ReflectionInvocationContext$Invocation).invoke() line: 181   
  ReflectionInvocationContext.proceed() line: 163 
  StatsInterceptor.record(InvocationContext, Method) line: 176    
  StatsInterceptor.invoke(InvocationContext) line: 95 
  GeneratedMethodAccessor35.invoke(Object, Object[]) line: not available  
  DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25  
  Method.invoke(Object, Object...) line: 597  
  ReflectionInvocationContext$InterceptorInvocation(ReflectionInvocationContext$Invocation).invoke() line: 181    
  ReflectionInvocationContext.proceed() line: 163 
  CdiInterceptor.invoke(InvocationContext) line: 129  
  CdiInterceptor.access$000(CdiInterceptor, InvocationContext) line: 45   
  CdiInterceptor$1.call() line: 66    
  CdiInterceptor.aroundInvoke(InvocationContext) line: 72 
  GeneratedMethodAccessor34.invoke(Object, Object[]) line: not available  
  DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25  
  Method.invoke(Object, Object...) line: 597  
  ReflectionInvocationContext$InterceptorInvocation(ReflectionInvocationContext$Invocation).invoke() line: 181    
  ReflectionInvocationContext.proceed() line: 163 
  InterceptorStack.invoke(Object...) line: 138    
  StatelessContainer._invoke(Method, Method, Object[], Instance, ThreadContext, InterfaceType) line: 226  
  StatelessContainer.invoke(Object, InterfaceType, Class, Method, Object[], Object) line: 178 
  StatelessEjbObjectHandler(EjbObjectProxyHandler).synchronizedBusinessMethod(Class&lt;?&gt;, Method, Object[], Object) line: 260   
  StatelessEjbObjectHandler(EjbObjectProxyHandler).businessMethod(Class&lt;?&gt;, Method, Object[], Object) line: 240   
  StatelessEjbObjectHandler(EjbObjectProxyHandler)._invoke(Object, Class, Method, Object[]) line: 91  
  StatelessEjbObjectHandler(BaseEjbProxyHandler).invoke(Object, Method, Object[]) line: 284   
  MyService$LocalBeanProxy.removeScheduledEvent(ScheduledEvent) line: not available   
  </code></pre>
  
  <p>That's 30 lines of Java EE plumbing method calls that I don't want to inspect!</p>
  
  <p>My only reliable way to skip all this when stepping into a method is to put a breakpoint in the next method call, then hit "Step Over" instead of "Step Into". However, setting breakpoints all the time like that is a major hassle compared to a simple "Step Into". I have to repeat the same thing when I need to step out of the method I'm inspecting.</p>
  
  <p>I know about step filters in Eclipse and tried using those but some automatically-generated proxy classes are injected in my own packages so I can't easily use that.</p>
  
  <p>Does anybody have a good solution for this?</p>
  
  <h3>update</h3>
  
  <p>Using the following step filters skips all unwanted steps for now :</p>
  
  <pre><code>*$$*  // for CGLib proxies
  *$LocalBeanProxy  // for other EJB proxies
  java.*
  net.sf.*
  sun.*
  </code></pre>
  
  <h3>edit 2</h3>
  
  <p>Here's an example from the MyService class:</p>
  
  <pre><code>public void removeScheduledEvent(ScheduledEvent event) {
      // ...
      otherEJB.doStuff(event);
  }
  </code></pre>
  
  <p>Since otherEJB is an EJB bean running in a stateless container, the 30 calls above are inserted automatically via proxies.</p>