xml - Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': -
creating web application using spring , hibernate framework... while running project, getting error. please help. if change in dispatcher-servlet.xml , im getting other errors.
**here dispatcher-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:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"> <context:property-placeholder location="classpath:jdbc.properties" /> <context:component-scan base-package="com.tcs.dlite.controller" /> <mvc:annotation-driven /> <mvc:resources mapping="/resources/**" location="/resources/" /> <mvc:resources mapping="/views/**" location="/views/" /> <bean id="multipartresolver" class="org.springframework.web.multipart.commons.commonsmultipartresolver"> <property name="maxuploadsize" value="52428800" /> </bean> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix" value="/jsp/" /> <property name="suffix" value=".jsp" /> </bean> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="${database.driver}" /> <property name="url" value="${database.url}" /> <property name="username" value="${database.user}" /> <property name="password" value="${database.password}" /> </bean> <!-- <bean id="sessionfactory" class="org.springframework.orm.hibernate3.annotation.annotationsessionfactorybean"> --> <bean id="sessionfactory" class="org.springframework.orm.hibernate4.localsessionfactorybean"> <property name="datasource" ref="datasource" /> <property name="annotatedclasses"> <list> ******models called here********* </list> </property> <property name="hibernateproperties"> <props> <prop key="hibernate.dialect">${hibernate.dialect}</prop> <prop key="hibernate.show_sql">${hibernate.show_sql}</prop> </props> </property> </bean> <!-- transaction manager --> <tx:annotation-driven transaction-manager="hibernatetransactionmanager" /> <bean id="hibernatetransactionmanager" class="org.springframework.orm.hibernate4.hibernatetransactionmanager"> <property name="sessionfactory" ref="sessionfactory" /> </bean> <bean id="mailsender" class="org.springframework.mail.javamail.javamailsenderimpl"> <property name="host" value="smtp.tcs.com" /> <property name="port" value="25" /> <property name="username" value="" /> <property name="password" value="" /> <property name="javamailproperties"> <props> <prop key="mail.transport.protocol">smtp</prop> <prop key="mail.smtp.auth">true</prop> <prop key="mail.smtp.starttls.enable">true</prop> </props> </property> </bean> <bean id="messagesource" class="org.springframework.context.support.reloadableresourcebundlemessagesource"> <property name="basename" value="/web-inf/messages" /> </bean> </beans>` **here spring-security.xml:** `<beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" 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-3.2.xsd"> <http pattern="/resources/js/**" security="none" /> <http pattern="/resources/bootstrap/**" security="none" /> <http pattern="/resources/css/**" security="none" /> <http pattern="/resources/font-awesome/**" security="none" /> <http pattern="/resources/src/**" security="none" /> <http pattern="/resources/img/**" security="none" /> <http auto-config="true" use-expressions="true"> <intercept-url pattern="/login**" access="permitall" /> <intercept-url pattern="/checkuser**" access="permitall" /> <intercept-url pattern="/loginerror**" access="permitall" /> <intercept-url pattern="/updatepasswordajax**" access="permitall" /> <intercept-url pattern="/loginerror**" access="permitall" /> <intercept-url pattern="/appendquestion**" access="permitall" /> <intercept-url pattern="/checkanswer**" access="permitall" /> <intercept-url pattern="/resetpassword**" access="permitall" /> <intercept-url pattern="/saveregistration**" access="permitall" /> <intercept-url pattern="/**" access="isauthenticated()" /> <form-login login-page="/login.html" default-target-url="/index.html" authentication-failure-url="/faillogin.html?error=true" always-use-default-target="true" /> <logout logout-success-url="/login.html" /> </http> <authentication-manager> <authentication-provider> <password-encoder ref="encoder" /> <jdbc-user-service data-source-ref="datasource" users-by-username-query="select uempemailid,upassword,active empauthentication uempemailid=?" authorities-by-username-query="select uemail,urole userinfo uemail=?" /> </authentication-provider> </authentication-manager> <beans:bean id="encoder" class="org.springframework.security.crypto.bcrypt.bcryptpasswordencoder"> <beans:constructor-arg name="strength" value="11" /> </beans:bean> </beans:beans>` here web.xml: ` <?xml version="1.0" encoding="utf-8"?> <web-app 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" version="2.5"> <display-name>tcsdlite hiber</display-name> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> <listener> <listener-class>org.springframework.security.web.session.httpsessioneventpublisher</listener-class> </listener> <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/dispatcher-servlet.xml, /web-inf/spring-security.xml </param-value> </context-param> <!-- spring security --> <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> <session-config> <session-timeout>25</session-timeout> </session-config> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> </web-app>` ****error:**** org.springframework.beans.factory.beancreationexception: error creating bean name 'org.springframework.beans.factory.config.propertyplaceholderconfigurer#0': initialization of bean failed; nested exception java.lang.noclassdeffounderror: org/springframework/core/io/support/springfactoriesloader @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:532) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:461) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:295) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:223) @ org.springframework.beans.factory.support.abstractbeanfactory.dogetbean(abstractbeanfactory.java:292) @ org.springframework.beans.factory.support.abstractbeanfactory.getbean(abstractbeanfactory.java:198) @ org.springframework.context.support.abstractapplicationcontext.invokebeanfactorypostprocessors(abstractapplicationcontext.java:644) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:446) @ org.springframework.web.context.contextloader.configureandrefreshwebapplicationcontext(contextloader.java:383) @ org.springframework.web.context.contextloader.initwebapplicationcontext(contextloader.java:283) @ org.springframework.web.context.contextloaderlistener.contextinitialized(contextloaderlistener.java:112) @ org.apache.catalina.core.standardcontext.listenerstart(standardcontext.java:4992) @ org.apache.catalina.core.standardcontext.startinternal(standardcontext.java:5490) @ org.apache.catalina.util.lifecyclebase.start(lifecyclebase.java:150) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1575) @ org.apache.catalina.core.containerbase$startchild.call(containerbase.java:1565) @ 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: java.lang.noclassdeffounderror: org/springframework/core/io/support/springfactoriesloader @ org.springframework.beans.cachedintrospectionresults.<clinit>(cachedintrospectionresults.java:65) @ org.springframework.beans.beanwrapperimpl.getcachedintrospectionresults(beanwrapperimpl.java:321) @ org.springframework.beans.beanwrapperimpl.getpropertydescriptorinternal(beanwrapperimpl.java:351) @ org.springframework.beans.beanwrapperimpl.iswritableproperty(beanwrapperimpl.java:427) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.applypropertyvalues(abstractautowirecapablebeanfactory.java:1393) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.populatebean(abstractautowirecapablebeanfactory.java:1132) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:522) ... 19 more caused by: java.lang.classnotfoundexception: org.springframework.core.io.support.springfactoriesloader @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1720) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1571) ... 26 more pls help...
Comments
Post a Comment