for starters yes...
for starters yes...
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
when i did it i got it:
jshop-servlet.xmlCode:org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainProxy': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainList': Cannot resolve reference to bean '_rememberMeFilter' while setting bean property 'filters' with key [6]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeFilter': Cannot resolve reference to bean '_rememberMeServices' while setting bean property 'rememberMeServices'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeServices': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.userdetails.jdbc.JdbcUserDetailsManager#0': Cannot resolve reference to bean 'myDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'myDataSource' is defined at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardHost.start(StandardHost.java:785) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443) at org.apache.catalina.core.StandardService.start(StandardService.java:519) at org.apache.catalina.core.StandardServer.start(StandardServer.java:710) at org.apache.catalina.startup.Catalina.start(Catalina.java:581) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_filterChainList': Cannot resolve reference to bean '_rememberMeFilter' while setting bean property 'filters' with key [6]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeFilter': Cannot resolve reference to bean '_rememberMeServices' while setting bean property 'rememberMeServices'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeServices': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.userdetails.jdbc.JdbcUserDetailsManager#0': Cannot resolve reference to bean 'myDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'myDataSource' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:126) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.security.config.FilterChainProxyPostProcessor.postProcessBeforeInitialization(FilterChainProxyPostProcessor.java:52) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:350) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1331) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473) ... 29 more Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeFilter': Cannot resolve reference to bean '_rememberMeServices' while setting bean property 'rememberMeServices'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '_rememberMeServices': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.userdetails.jdbc.JdbcUserDetailsManager#0': Cannot resolve reference to bean 'myDataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'myDataSource' is defined at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
Code:<bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost/jshop"/> <property name="username" value="root"/> <property name="password" value="admin1029"/> </bean> <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" > <property name="dataSource" ref="myDataSource"/> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> <prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop> <prop key="hibernate.current_session_context_class">thread</prop> </props> </property> <property name="mappingResources" > <list> <value>com/jshop/hibernate/Product.hbm.xml</value> <value>com/jshop/hibernate/Category.hbm.xml</value> <value>com/jshop/hibernate/DeliveryForm.hbm.xml</value> <value>com/jshop/hibernate/PaymentMethod.hbm.xml</value> <value>com/jshop/hibernate/Newsletter.hbm.xml</value> <value>com/jshop/hibernate/AllTexts.hbm.xml</value> </list> </property> </bean>
Last edited by jolsys; Oct 6th, 2010 at 07:45 AM.
1) Your infrastructure code should be loaded by the contextloaderlistener so create an additional file containing your datasource/sessionfactory/tx management and move that to there and let it be loaded by the contextlodaerlistener. (Basically you want to do the same for your services and daos, the DispatcherServlet should only load web related things like controllers, views, etc...).
2. Your tx management is broken remove the hibernate.current_session_context_class property from the localsessionfactorybean, the same goes for the hibernate.connection properties as they are useless due to the fact that you are injecting a datasource.
As I wanted to prevent you from this hence my request for your configuration...
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
i I removed the
hibernate.current_session_context_class and hibernate.connection
I do not understand the first point
Code:jshop-servlet.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd"> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- URL Mappings --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- HandlerMapping - jest odpowiedzialny za okreslenie --> <!-- odpowiedniego kontrolera lub innego obiektu, do którego --> <!-- nalezy przekazac obsługe zadania --> <bean id="simpleUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/index.html">indexController</prop> <prop key="/product.html">ProductController</prop> </props> </property> <property name="alwaysUseFullPath" value="true"/> </bean> <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/> <!-- Scan for controllers and services --> <context:component-scan base-package="com.jshop.web"/> <context:component-scan base-package="com.jshop.service"/> <!-- Create a proxy to generate session-scoped shopping carts --> <bean id="shoppingCart" class="com.jshop.model.ShoppingCart" scope="session"> <!-- This requires CGLIB --> <aop:scoped-proxy/> </bean> <!-- <bean id="personReader" class="org.springframework.batch.item.validator.ValidatingItemReader"> <property name="validator" ref="validator" /> <property name="itemReader" ref="reader"/> </bean> --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- Controllers --> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <bean id="indexController" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="index"/> </bean> <bean id="ProductController" class="com.jshop.web.ProductController"> <property name="productManager" ref="ProductManager" /> <property name="shoppingCart" ref="ShoppingCartService" /> </bean> <bean name="/product.html" class="com.jshop.web.ProductController" > <property name="productManager" ref="ProductManager" /> <property name="shoppingCart" ref="ShoppingCartService" /> </bean> <bean name="ProductManager" class="com.jshop.service.ProductManager"> <property name="productDao" ref="ProductDao" /> </bean> <bean id="ProductDao" class="com.jshop.model.ProductDao"> <property name="sessionFactory" ref="mySessionFactory" /> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list><value>error-messages</value></list> </property> </bean> <!-- ViewResolver - jest to komponent, który odwzorowuje logiczne --> <!-- nazwy widoków na faktyczne widoki, które zostana uzyte do --> <!-- przedstawienia zawartosci modelu --> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="com.jshop.template.StringTemplateView" /> <property name="prefix" value="/WEB-INF/template/" /> <property name="suffix" value=".st" /> <property name="requestContextAttribute" value="rc" /> </bean> <!-- LocaleResolver - pozwala na okreslenie ustawien --> <!-- miedzynarodowych, jakich nalezy uzyc podczas generowania --> <!-- widoku --> <!-- HIBERNATE --> <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost/jshop"/> <property name="username" value="root"/> <property name="password" value="admin1029"/> </bean> <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" > <property name="dataSource" ref="myDataSource"/> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> </props> </property> <property name="mappingResources" > <list> <value>com/jshop/hibernate/Product.hbm.xml</value> <value>com/jshop/hibernate/Category.hbm.xml</value> <value>com/jshop/hibernate/DeliveryForm.hbm.xml</value> <value>com/jshop/hibernate/PaymentMethod.hbm.xml</value> <value>com/jshop/hibernate/Newsletter.hbm.xml</value> <value>com/jshop/hibernate/AllTexts.hbm.xml</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="mySessionFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> </beans>
shared code should be loaded by the contextloaderlistener, you want to share your (SINGLE) sessionfactory with your whole application, not only the web layer... Hence move those to a configuration file which is loaded by the contextloaderlistener.
You seem to be missing basic concepts and knowlegde I suggest a read of the reference guide (or at least a spring book) and take a look at the sample application, which shows what I mentioned earlier.
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
I look over some examples, and drawing upon them, it seems to me that I should move: (i`m right??)
jshop-servlet.xml
applicationContext.xmlCode:<beans > <!-- URL Mappings --> <bean id="simpleUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="mappings"> <props> <prop key="/product.html">ProductController</prop> <prop key="/login.html">LoginController</prop> <prop key="/logged.html">LoggedController</prop> </props> </property> <property name="alwaysUseFullPath" value="true"/> </bean> <!-- Scan for controllers and services --> <context:component-scan base-package="com.jshop.web"/> <context:component-scan base-package="com.jshop.service"/> <!-- Create a proxy to generate session-scoped shopping carts --> <bean id="shoppingCart" class="com.jshop.model.ShoppingCart" scope="session"> <!-- This requires CGLIB --> <aop:scoped-proxy/> </bean> <!-- Validation --> <bean id="productValidator" class="com.jshop.validator.ProductValidator" lazy-init="default" autowire="default" dependency-check="default" /> <!-- Controllers --> <bean id="indexController" class="org.springframework.web.servlet.mvc.ParameterizableViewController"> <property name="viewName" value="index"/> </bean> <bean id="ProductController" class="com.jshop.web.ProductController"> <property name="productManager" ref="ProductManager" /> <property name="shoppingCart" ref="ShoppingCartService" /> </bean> <bean name="/product.html" class="com.jshop.web.ProductController" > <property name="productManager" ref="ProductManager" /> <property name="shoppingCart" ref="ShoppingCartService" /> </bean> <bean id="LoggedController" class="com.jshop.web.LoggedController" /> <bean name="/logged.html" class="com.jshop.web.LoggedController" /> <bean id="LoginController" class="com.jshop.web.LoginController" /> <bean name="/login.html" class="com.jshop.web.LoginController" /> <bean name="ProductManager" class="com.jshop.service.ProductManager"> <property name="productDao" ref="ProductDao" /> </bean> <bean id="ProductDao" class="com.jshop.model.ProductDao"> <property name="sessionFactory" ref="mySessionFactory" /> </bean> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basenames"> <list><value>error-messages</value></list> </property> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="com.jshop.template.StringTemplateView" /> <property name="prefix" value="/WEB-INF/template/" /> <property name="suffix" value=".st" /> <property name="requestContextAttribute" value="rc" /> </bean> </beans>
applicationContext-security.xmlCode:<beans > <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost/jshop"/> <property name="username" value="root"/> <property name="password" value="admin1029"/> </bean> <bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean" > <property name="dataSource" ref="myDataSource"/> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop> <prop key="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</prop> <prop key="hibernate.current_session_context_class">thread</prop> </props> </property> <property name="mappingResources" > <list> <value>com/jshop/hibernate/Product.hbm.xml</value> <value>com/jshop/hibernate/Category.hbm.xml</value> <value>com/jshop/hibernate/DeliveryForm.hbm.xml</value> <value>com/jshop/hibernate/PaymentMethod.hbm.xml</value> <value>com/jshop/hibernate/Newsletter.hbm.xml</value> <value>com/jshop/hibernate/AllTexts.hbm.xml</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="mySessionFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager"/> </beans>
Code:<?xml version="1.0" encoding="UTF-8"?> <beans> <global-method-security secured-annotations="enabled"></global-method-security> <http auto-config="true"> <intercept-url pattern="/logged*" access="ROLE_USER,ROLE_ADMIN" /> <intercept-url pattern="/**" access="ROLE_ANONYMOUS" /> <intercept-url pattern="/add_product.html" access="ROLE_ADMIN" /> <logout logout-success-url="/login.html" /> <form-login authentication-failure-url="/login.html?login_error=1" login-page="/login.html" default-target-url="/logged.html" /> </http> <authentication-provider> <jdbc-user-service data-source-ref="myDataSource" users-by-username-query="select username, password, enabled from users where username=?" /> </authentication-provider> </beans:beans>
Last edited by jolsys; Oct 7th, 2010 at 07:47 AM.
Not completly..
Your services and dao's should also be in the root application context. As I stated earlier, the servlet.xml file should only contain web related materials like controllers, views, handlermappings...
And again remove the current-session-context stuff from your hibernate session factory, your current implementation is going to break proper tx management.
Also your url security is flawed, the urls are checked in order, your /** is in front of all your other urls so it is going to match making everything below your /** mapping is pretty much useless.
Also 2, why on earth do y ou have
1) Controller define dwith some name
2) Controller defined with some url
3) Component scanning...
For some reason you really seem to like duplication... The same, i have that feeling, goes probably for your services/dao/managers...
Also 3, your hibernate/datasource configuration is wrong. YOur datasource points to mysql, whereas your hibernate uses HSQL dialect
Is it possible to zip your project, leave out the libraries (hopefully it is a maven project!) so that we can take alook... Currently this is getting more or less into a guessing game.
Last edited by Marten Deinum; Oct 7th, 2010 at 07:58 AM. Reason: Added also 2, added also 3
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
thanks to your advice, everything started to work only if it delete
<prop key="hibernate.current_session_context_class"> thread </ prop>
then there is something: (I could send you my application for a private message, but you've got it locked)
Code:org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63) at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574) at com.jshop.service.AllTextsManager.getText(AllTextsManager.java:25) at com.jshop.web.AllTextsController.handleRequest(AllTextsController.java:23) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378) at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:52) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.rememberme.RememberMeProcessingFilter.doFilterHttp(RememberMeProcessingFilter.java:109) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:278) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Unknown Source)
As I stated you shouldn't have your services and dao's in your servlet (your component-scan includes services which duplicates the configuration of those services, which leads to your controllers using an unproxied instance).
YOu should really make sure that your servlet.xml really ONLY contains (even through classpath scanning) only web related things.
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
look at my application if you can There's the link to this file:
http://www.yousendit.com/download/WTNKZFhwTlE1bmp2Wmc9PQ
Last edited by jolsys; Oct 8th, 2010 at 04:30 AM.