java - Spring security and spring email pom configuration conflict -
<spring.version>4.0.1.release</spring.version> <spring.security.core.version>3.1.1.release</spring.security.core.version> <spring.security.version>3.1.1.release</spring.security.version> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid> <version>${spring.version}</version> <exclusions> <exclusion> <artifactid>commons-logging</artifactid> <groupid>commons-logging</groupid> </exclusion> </exclusions> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-jdbc</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-orm</artifactid> <version>${spring.version}</version> </dependency> <dependency> <groupid>org.springframework.data</groupid> <artifactid>spring-data-jpa</artifactid> <version>1.1.0.release</version> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-test</artifactid> <version>${spring.version}</version> <scope>test</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-context-support</artifactid> <version>${spring.version}</version> </dependency> <!-- spring security --> <dependency> <groupid>org.springframework.security</groupid> <artifactid>spring-security-core</artifactid> <version>${spring.security.version}</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework.security</groupid> <artifactid>spring-security-web</artifactid> <version>${spring.security.version}</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework.security</groupid> <artifactid>spring-security-config</artifactid> <version>${spring.security.version}</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework.security</groupid> <artifactid>spring-security-taglibs</artifactid> <version>${spring.security.version}</version> <type>jar</type> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-aop</artifactid> <version>${spring.security.core.version}</version> </dependency>
i following error"
9169 [localhost-startstop-1] error org.springframework.web.context.contextloader - context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.security.filterchains': cannot resolve reference bean 'org.springframework.security.web.defaultsecurityfilterchain#0' while setting bean property 'sourcelist' key [0]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.security.web.defaultsecurityfilterchain#0': cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.exceptiontranslationfilter] while setting constructor argument key [5]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name '(inner bean)#5': cannot resolve reference bean 'restauthenticationentrypoint' while setting bean property 'authenticationentrypoint'; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'restauthenticationentrypoint' defined @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvereference(beandefinitionvalueresolver.java:331) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:107) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvemanagedlist(beandefinitionvalueresolver.java:354) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:154) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:1452) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1193) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:537) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:475) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:304) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:228) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:300) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:195) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:660) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:760) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:482) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:403) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:306) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:106) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:4729) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5167) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1409) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1399) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745) caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.security.web.defaultsecurityfilterchain#0': cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.exceptiontranslationfilter] while setting constructor argument key [5]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name '(inner bean)#5': cannot resolve reference bean 'restauthenticationentrypoint' while setting bean property 'authenticationentrypoint'; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'restauthenticationentrypoint' defined @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolveinnerbean(beandefinitionvalueresolver.java:285) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:126) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvemanagedlist(beandefinitionvalueresolver.java:354) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:154) @ org.springframework.beans.factory.support.constructorresolver.resolveconstructorarguments(constructorresolver.java:627) @ org.springframework.beans.factory.support.constructorresolver.autowireconstructor(constructorresolver.java:148) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.autowireconstructor(abstractautowirecapablebeanfactory.java:1110) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbeaninstance(abstractautowirecapablebeanfactory.java:1013) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:504) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:475) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:304) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:228) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:300) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:195) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvereference(beandefinitionvalueresolver.java:323) ... 26 more caused by: org.springframework.beans.factory.beancreationexception: error creating bean name '(inner bean)#5': cannot resolve reference bean 'restauthenticationentrypoint' while setting bean property 'authenticationentrypoint'; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'restauthenticationentrypoint' defined @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvereference(beandefinitionvalueresolver.java:331) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:107) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:1452) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1193) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:537) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:475) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolveinnerbean(beandefinitionvalueresolver.java:271) ... 40 more caused by: org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'restauthenticationentrypoint' defined @ org.springframework.beans.factory.support.defaultlistablebeanfactory.getbeandefinition(defaultlistablebeanfactory.java:617) @ org.springframework.beans.factory.support.abstractbeanfactory.getmergedlocalbeandefinition(abstractbeanfactory.java:1159) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:282) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:195) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvereference(beandefinitionvalueresolver.java:323) ... 46 more jul 23, 2015 6:26:17 pm org.apache.catalina.core.standardcontext listenerstart severe: exception sending context initialized event listener instance of class org.springframework.web.context.contextloaderlistener org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.security.filterchains': cannot resolve reference bean 'org.springframework.security.web.defaultsecurityfilterchain#0' while setting bean property 'sourcelist' key [0]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.security.web.defaultsecurityfilterchain#0': cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.exceptiontranslationfilter] while setting constructor argument key [5]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name '(inner bean)#5': cannot resolve reference bean 'restauthenticationentrypoint' while setting bean property 'authenticationentrypoint'; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'restauthenticationentrypoint' defined @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvereference(beandefinitionvalueresolver.java:331) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:107) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvemanagedlist(beandefinitionvalueresolver.java:354) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:154) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:1452) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1193) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:537) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:475) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:304) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:228) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:300) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:195) @ org.springframework.beans.factory.support.defaultlistablebeanfactory.preinstantiatesingletons(defaultlistablebeanfactory.java:660) @ org.springframework.context.support.abstractapplicationcontext.finishbeanfactoryinitialization(abstractapplicationcontext.java:760) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:482) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:403) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:306) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:106) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:4729) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5167) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1409) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1399) @ java.util.concurrent.futuretask.run(futuretask.java:262) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745) caused by: org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.security.web.defaultsecurityfilterchain#0': cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.exceptiontranslationfilter] while setting constructor argument key [5]; nested exception org.springframework.beans.factory.beancreationexception: error creating bean name '(inner bean)#5': cannot resolve reference bean 'restauthenticationentrypoint' while setting bean property 'authenticationentrypoint'; nested exception org.springframework.beans.factory.nosuchbeandefinitionexception: no bean named 'restauthenticationentrypoint' defined @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolveinnerbean(beandefinitionvalueresolver.java:285) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:126) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvemanagedlist(beandefinitionvalueresolver.java:354) @ org.springframework.beans.factory.support.beandefinitionvalueresolver.resolvevalueifnecessary(beandefinitionvalueresolver.java:154) @ org.springframework.beans.factory.support.constructorresolver.resolveconstructorarguments(constructorresolver.java:627) @ org.springframework.beans.factory.support.constructorresolver.autowireconstructor(constructorresolver.java:148)
web.xml
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>servletcontainer</servlet-name> <servlet-class>org.glassfish.jersey.servlet.servletcontainer</servlet-class> <init-param> <param-name>javax.ws.rs.application</param-name> <param-value>com.resource.myresourceconfig</param-value> </init-param> <init-param> <param-name>javax.json.stream.jsongenerator.prettyprinting</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>servletcontainer</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/index.html</url-pattern> </servlet-mapping> <listener> <listener-class>com.resource.listener.mycontextlistener</listener-class> </listener> <filter> <filter-name>cors</filter-name> <filter-class>com.thetransactioncompany.cors.corsfilter</filter-class> <init-param> <param-name>cors.supportedmethods </param-name> <param-value>get,post,put,delete,head,option</param-value> </init-param> </filter> <filter-mapping> <filter-name>cors</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <resource-ref> <description>db connection</description> <res-ref-name>jdbc/mydb</res-ref-name> <res-type>javax.sql.datasource</res-type> <res-auth>container</res-auth> </resource-ref> <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/application-context.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.contextloaderlistener </listener-class> </listener> <!-- apply spring security filter requests --> <filter> <filter-name>springsecurityfilterchain</filter-name> <filter-class>org.springframework.web.filter.delegatingfilterproxy</filter-class> </filter> <filter-mapping> <filter-name>springsecurityfilterchain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
spring-security.xml
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:security="http://www.springframework.org/schema/security" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd"> <security:http pattern="/rest/users/**" entry-point-ref="restauthenticationentrypoint" use-expressions="true" auto-config="false" create-session="stateless"> <security:custom-filter ref="authenticationtokenprocessingfilter" position="form_login_filter" /> <security:intercept-url pattern="/rest/users/{userid}/orders/**" access="role_customer" /> <security:logout /> </security:http> <bean id="authenticationtokenprocessingfilter" class="com.resource.security.tokenauthenticationfilter"> <constructor-arg type="java.lang.string"> <value>/rest/**</value> </constructor-arg> </bean>
application-context.xml
<?xml version="1.0" encoding="utf-8"?> <beans:beans xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:beans="http://www.springframework.org/schema/beans" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <beans:import resource="classpath:/meta-inf/spring/spring-email.xml" /> <beans:import resource="classpath:/meta-inf/spring/spring-security.xml" />
should entry point class file in path dont bean initialization error? tried excluding beans didn't work.
Comments
Post a Comment