Announcement Announcement Module
Collapse
No announcement yet.
Interceptor to invoke Beans through @Autowired annotation Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interceptor to invoke Beans through @Autowired annotation

    Hi Friends,

    I am coding Interceptor to check some security authentication, the code look like:

    Code:
    public class MaxInterceptor extends HandlerInterceptorAdapter {
    
    	private static Logger logger = Logger.getLogger(MaxInterceptor.class);
    	
    	private final static String URI = "max";
    	private final static String LOGIN_SCREEN = "login";
    	
    	
    	@Autowired
    	private SecurityDAO securityDAO;
    
    	@Autowired
    	private PeriodDAO periodDAO;
    ...
    }
    The configuration is like:

    Code:
    	<bean id="annotationMapper" class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
    			<property name="interceptors">
    			<list>
    				<ref bean="maxInterceptor"/>
    			</list>
    		</property>
    	</bean>
    When I invoke the url as: http://localhost:7001/test/index.html, I got the error like:
    Code:
    <Oct 21, 2009 12:55:23 PM PDT> <Error> <HTTP> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@1dc79ab - appName: 'WebRoot', name: 'WebRoot', context-path: '/WebRoot'] Root cause of ServletException.
    java.lang.LinkageError: org/springframework/web/servlet/ModelAndViewDefiningException
    	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:864)
    	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:808)
    	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
    	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
    	at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
    	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3231)
    	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    	at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2002)
    	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1908)
    	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1362)
    	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    	at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    Can someone give me the hint to trouble shooting from it?

    Thanks very much.

    Yi
Working...
X