[jboss-user] [JBoss Seam] - Re: Activation of SFSB and removal of it by Seam question

asookazian do-not-reply at jboss.com
Thu Dec 6 10:17:14 EST 2007


So the problem was caused by using log4j in the interceptor classes.  Should have done a global search I don't know why I thought it was in the 2 SFSB's somehow...

However, when I replaced the log4j with Seam log I was getting NullPointerException:

@Name("loggerInterceptor")
  | public class LoggerInterceptor {
  | 	
  | 	@Logger 
  | 	private Log log;
  | 		
  |     @AroundInvoke
  |     public Object profile(InvocationContext ic) throws Exception {
  |         log.info("*** Entering method: " + ic.getMethod().getName());
  |         return ic.proceed();        
  |     }
  | 	
  | 
  | }

When I added the static keyword the NullPointerException went away:

@Name("loggerInterceptor")
  | public class LoggerInterceptor {
  | 	
  | 	@Logger 
  | 	private static Log log;
  | 		
  |     @AroundInvoke
  |     public Object profile(InvocationContext ic) throws Exception {
  |         log.info("*** Entering method: " + ic.getMethod().getName());
  |         return ic.proceed();        
  |     }
  | 	
  | 
  | }

I will close the JIRA now since that is obviously not a bug.  thx.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110873#4110873

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110873



More information about the jboss-user mailing list