spring - ClassPathXmlApplicationContext to load beans -


i trying access bean through classpathxmlapplicationcontext. xml under web-inf directory here code:

 applicationcontext context =                 new classpathxmlapplicationcontext("web-inf\\spring\\scgid-send-mail.xml"); 

but while passing path getting error:

java.io.filenotfoundexception: class path resource [web-inf/spring/scgid-send-mail.xml] cannot opened because not exist     org.springframework.core.io.classpathresource.getinputstream(classpathresource.java:157)     org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:328)     org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:302)     org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:174)     org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:209)     org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:180)     org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:243)     org.springframework.context.support.abstractxmlapplicationcontext.loadbeandefinitions(abstractxmlapplicationcontext.java:127)     org.springframework.context.support.abstractxmlapplicationcontext.loadbeandefinitions(abstractxmlapplicationcontext.java:93)     org.springframework.context.support.abstractrefreshableapplicationcontext.refreshbeanfactory(abstractrefreshableapplicationcontext.java:130)     org.springframework.context.support.abstractapplicationcontext.obtainfreshbeanfactory(abstractapplicationcontext.java:537)     org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:451)     org.springframework.context.support.classpathxmlapplicationcontext.<init>(classpathxmlapplicationcontext.java:139)     org.springframework.context.support.classpathxmlapplicationcontext.<init>(classpathxmlapplicationcontext.java:83)     com.mbww.scgid.user.usercontroller.sendmail(usercontroller.java:80)     com.mbww.scgid.user.usercontroller.get(usercontroller.java:74)     sun.reflect.nativemethodaccessorimpl.invoke0(native method)     sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)     sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     java.lang.reflect.method.invoke(method.java:601)     org.springframework.web.method.support.invocablehandlermethod.invoke(invocablehandlermethod.java:219)     org.springframework.web.method.support.invocablehandlermethod.invokeforrequest(invocablehandlermethod.java:132)     org.springframework.web.servlet.mvc.method.annotation.servletinvocablehandlermethod.invokeandhandle(servletinvocablehandlermethod.java:104)     org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.invokehandlemethod(requestmappinghandleradapter.java:745)     org.springframework.web.servlet.mvc.method.annotation.requestmappinghandleradapter.handleinternal(requestmappinghandleradapter.java:686)     org.springframework.web.servlet.mvc.method.abstracthandlermethodadapter.handle(abstracthandlermethodadapter.java:80)     org.springframework.web.servlet.dispatcherservlet.dodispatch(dispatcherservlet.java:925)     org.springframework.web.servlet.dispatcherservlet.doservice(dispatcherservlet.java:856)     org.springframework.web.servlet.frameworkservlet.processrequest(frameworkservlet.java:936)     org.springframework.web.servlet.frameworkservlet.doget(frameworkservlet.java:827)     javax.servlet.http.httpservlet.service(httpservlet.java:617)     org.springframework.web.servlet.frameworkservlet.service(frameworkservlet.java:812)     javax.servlet.http.httpservlet.service(httpservlet.java:717)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:330)     org.springframework.security.web.access.intercept.filtersecurityinterceptor.invoke(filtersecurityinterceptor.java:118)     org.springframework.security.web.access.intercept.filtersecurityinterceptor.dofilter(filtersecurityinterceptor.java:84)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.access.exceptiontranslationfilter.dofilter(exceptiontranslationfilter.java:113)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.session.sessionmanagementfilter.dofilter(sessionmanagementfilter.java:103)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.authentication.anonymousauthenticationfilter.dofilter(anonymousauthenticationfilter.java:113)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.servletapi.securitycontextholderawarerequestfilter.dofilter(securitycontextholderawarerequestfilter.java:54)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.savedrequest.requestcacheawarefilter.dofilter(requestcacheawarefilter.java:45)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.authentication.www.basicauthenticationfilter.dofilter(basicauthenticationfilter.java:150)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.authentication.abstractauthenticationprocessingfilter.dofilter(abstractauthenticationprocessingfilter.java:183)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.authentication.logout.logoutfilter.dofilter(logoutfilter.java:105)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.context.securitycontextpersistencefilter.dofilter(securitycontextpersistencefilter.java:87)     org.springframework.security.web.filterchainproxy$virtualfilterchain.dofilter(filterchainproxy.java:342)     org.springframework.security.web.filterchainproxy.dofilterinternal(filterchainproxy.java:192)     org.springframework.security.web.filterchainproxy.dofilter(filterchainproxy.java:160)     org.springframework.web.filter.delegatingfilterproxy.invokedelegate(delegatingfilterproxy.java:346)     org.springframework.web.filter.delegatingfilterproxy.dofilter(delegatingfilterproxy.java:259) 

try this:

applicationcontext context =             new classpathxmlapplicationcontext("**/scgid-send-mail.xml"); 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -