在maven下,spring的applicationContext.xml文件怎么写? [问题点数:30分,结帖人u011529349]

Bbs1
本版专家分:0
结帖率 50%
Bbs1
本版专家分:75
Bbs9
本版专家分:86678
版主
Blank
GitHub 绑定GitHub第三方账户获取
Blank
进士 2013年 总版技术专家分年内排行榜第六
Blank
银牌 2013年3月 总版技术专家分月排行榜第二
Blank
红花 2014年2月 Java大版内专家分月排行榜第一
2013年8月 Java大版内专家分月排行榜第一
2013年5月 Java大版内专家分月排行榜第一
2013年4月 Java大版内专家分月排行榜第一
2013年3月 Java大版内专家分月排行榜第一
2013年2月 Java大版内专家分月排行榜第一
maven项目中applicationContext.xml文件无法加载配置的原因。
折磨了好久。 原因是,<packageing> pom</packageing> 这个错了,应该是jar 或 war。
解决Maven项目启动Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
拆解之前的<em>maven</em>项目单独调试的时候出现下面的错误: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] org.<em>spring</em>framework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document f
maven搭建ssm框架之spring容器(applicationContext.xml)配置
基本内容:<em>spring</em>:业务逻辑组件   1.建一个jdbc.properties,先引入,数据源,事务控制,xxx。   2,扫描业务逻辑组件包(不扫描控制器)   3.配置Mybatis的整合:SqlSessionFactoryBean        指定mybatis全局配置<em>文件</em>的位置        指定mybatis,mapper<em>文件</em>的位置   4.配置扫描器,将mybatis接口的实现加...
Spring找不到applicationContext.xml文件
rn我使用的是开始使用<em>spring</em>框架,在使用数据源连接数据库时报找不到applicationContext.xml<em>文件</em>.rnrn我的工程名为ssh;rnapplicationContext.xml在web-inf下面rn具体位置:rnsshrn|-srcrn--|--com.conDAOrn|-sshrn--|--web-infrn-------+web-inf rnrnrn以下是com.conDAO的部分rnrnprivate static String CONFIG_FILE_LOCATION ="/ssh/ssh/web-inf/web-inf";rnrn/** Holds a single instance of Session */rnprivate static final ThreadLocal threadLocal = new ThreadLocal();rnrn/** The single instance of hibernate configuration */rnprivate static final Configuration cfg = new Configuration();rnrn/** The single instance of hibernate SessionFactory */rnprivate static org.hibernate.SessionFactory sessionFactory;rnrnpublic static Session currentSession() throws HibernateException rnSession session = (Session) threadLocal.get();rn rnif (session == null || !session.isOpen()) rnif (sessionFactory == null) rntry rncfg.configure(CONFIG_FILE_LOCATION);//这儿有问题rnsessionFactory = cfg.buildSessionFactory();rn catch (Exception e) rnSystem.err .println("%%%% Error Creating SessionFactory %%%%");rne.printStackTrace();rnrnrnsession = (sessionFactory != null) ? sessionFactory.openSession()rn : null;rnthreadLocal.set(session);rnrnreturn session;rnrnrn--------------rnprivate static String CONFIG_FILE_LOCATION ="/ssh/ssh/web-inf/web-inf";rnrncfg.configure(CONFIG_FILE_LOCATION);rn这儿有问题!请教大家如何解决rnrn
关于spring的applicationContext.xml文件的问题
我在applicationContext.xml<em>文件</em>里rn rn rnrn我想请问一下,这个引用的目录最大支持几层啊。rnrn容器是Tomcatrnrn请知道的大大解答一下,谢谢
spring 的applicationContext.xml
rnrnrn rn rnrn rn rn rn rnrn rn rn rn rn classpath*:jdbc.propertiesrn rn rn rn rn rn $jdbc.driverClassNamern rn rn $jdbc.urlrn rn rn $jdbc.usernamern rn rn $jdbc.passwordrn rn rnrn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn rn truern truern rn truern rn rn org.hibernate.cache.EhCacheProviderrn rn updatern rn rn rn rn rnrn rnrn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn
spring 加载applicationContext.xml文件报错
项目结构如下图n![图片说明](https://img-ask.csdn.net/upload/201611/01/1478008800_486803.png)n控制台输出的错误如下nnn```n 信息: Refreshing org.<em>spring</em>framework.context.support.GenericApplicationContext@7a61053: startup date [Tue Nov 01 21:56:43 CST 2016]; root of context hierarchyn十一月 01, 2016 9:56:43 下午 org.<em>spring</em>framework.context.support.GenericApplicationContext refreshn警告: Exception encountered during context initialization - cancelling refresh attempt: org.<em>spring</em>framework.beans.factory.BeanCreationException: Error creating bean with name 'loginLogDao' defined in file [D:\CodeLocation\Java\My_Learn\<em>spring</em>_chapter2\bin\com\baobaotao\dao\LoginLogDao.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.<em>spring</em>framework.beans.factory.BeanCreationException: Error creating bean with name 'org.<em>spring</em>framework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/reflect/ReflectionWorld$ReflectionWorldExceptionn十一月 01, 2016 9:56:43 下午 org.<em>spring</em>framework.test.context.TestContextManager prepareTestInstancen严重: Caught exception while allowing TestExecutionListener [org.<em>spring</em>framework.test.context.support.DependencyInjectionTestExecutionListener@8554f0c] to prepare test instance [com.baobaotao.service.TestUserService@75813820]njava.lang.IllegalStateException: Failed to load ApplicationContextnn```napplicationContext.xml代码如下nnn```n nnn n n nn n nn n nn n nn n n n n n n n n n nnn```nnn搞了好久一直没解决,如果还需要哪些代码段的话, 跟我说下,谢谢
怎么读取Spring 的配置文件applicationContext.xml
ApplicationContext ctx = new FileSystemXmlApplicationContext("F:\\Tomcat 5.0\\webapps\\Systrade\\WEB-INF\\classes\\applicationContext.xml");rnrn<em>怎么</em>把他转换到相对目录的读取法呀! Systrade这是这个项目的工程<em>文件</em>名!rn
Spring 关于MyEclipse下创建Maven项目找不到application.xml文件的处理方法
博主之前没有用<em>maven</em>创建项目的时候,application.xml<em>文件</em>是放在src<em>文件</em>夹下的,web.xml配置<em>文件</em>也找得到。后来因为项目问题,又重新用<em>maven</em>新建了项目,<em>文件</em>的位置什么的都没变,但web.xml这个<em>文件</em>就是找不到application.xml配置<em>文件</em>。博主在web.xml的配置如下:&amp;lt;context-param&amp;gt;        &amp;lt;param-name&amp;gt...
java项目里classpath具体指哪儿个路径
一、classpath路径指什么     只知道把配置<em>文件</em>如:mybatis.xml、<em>spring</em>-web.xml、applicationContext.xml等放到src目录(就是存放代码.java<em>文件</em>的目录),然后使用“classpath:xxx.xml”来读取,都放到src目录准没错,那么到底classpath到底指的什么位置呢?       src路径下的<em>文件</em>在编译后会放到WEB-I...
springmvc最全配置xml以及常用Maven pom.xml配置
<em>spring</em>.xml http://www.
Spring bean 的生命周期的详解
Spring bean生命周期 在传统的Java应用中,Bean的生命周期非常简单。 Java的关键词new用来实例化Bean(或许他是非序列化的)。这样就够用了。 相反,Bean的生命周期在Spring容器中更加细致。 理解Spring Bean的生命周期非常重要,因为你或许要利用Spring提供的机会来订制Bean的创建过程。 1.容器寻找Bean的定义信息并且将其实例化。
Spring配置-applicationContext.xml+jar包引入
<em>spring</em>核心:控制反转模式(依赖注入方式IOC)和AOP(面向切面编程)1、<em>spring</em> IOCjar包如下:并且注解方式下的依赖注入@Autowired applicationContext.xml<em>文件</em>配置为:&amp;lt;bean class=&quot;org.<em>spring</em>framework.beans.factory.annotation.AutowiredAnnotationBeanPostProc...
spring何时调用applicationcontext.xml文件
我的测试<em>文件</em>如下:用hibernate作的配置<em>文件</em>是可以的,可读<em>文件</em>就是不行,说了进无效的参数异常,需要SessionFactory对象,用log4j看不到程序读取<em>spring</em> 的application<em>文件</em>信息,那么这个<em>文件</em>什么时候读?是那个类读的呢?为什么我的set***方法没有被调用?rnrn下面的这个例子是用 开发手册 中的例子做的 hibernate3.0 与 <em>spring</em> 1.2.1rnrn类<em>文件</em>如下:rnrn/*rn * 创建日期 2005-7-3rn *rn * TODO 要更改此生成的<em>文件</em>的模板,请转至rn * 窗口 - 首选项 - Java - 代码样式 - 代码模板rn */rnpackage com.po;rnimport org.<em>spring</em>framework.orm.hibernate3.support.*;rnimport org.<em>spring</em>framework.orm.hibernate3.*;rnimport java.util.*;rnimport org.hibernate.cfg.*;rnimport org.hibernate.*;rnrnpublic class Testrn rn private SessionFactory sessionFactory;//=new Configuration().configure().buildSessionFactory();rn public static void main(String a[])rn rn Test t= new Test();rn List list=t.selectUser();rn System.out.print(list.size());rn rn public void setSessionFactory(SessionFactory sessionFactory)rn rn this.sessionFactory=sessionFactory;rn rn rn public List selectUser()rn rn List list = null;rn HibernateTemplate h =new HibernateTemplate(this.sessionFactory);rn return (List) h.execute(rn new HibernateCallback()rn public Object doInHibernate(Session session)rn rn List result =session.createQuery("from User").list();rn return result;rn rn rn );rn rnrnrn配置<em>文件</em>(applicationtext.xml)信息如下:rnrnrnrnrnrn rn com.microsoft.jdbc.sqlserver.SQLServerDriverrn jdbc:microsoft:sqlserver://sysmaster:1433;databasename=testrn sarn 123rn rnrn rn rn rn com/po/myuser.hbm.xmlrn rn rn org.hibernate.dialect.SQLServerDialectrn truern rn rn rn rn rn rn rn rn
spring 的bean.xml和applicationContext.xml
以前写 <em>spring</em>的时候 一直用的是applicationContext.xmlrnrn今天写dwr的时候 发现还有一个叫bean.xml的<em>文件</em>rn竟然在classes目录下 我<em>spring</em>基础不好rn谁和我解释一下啊
Spring 的applicationContext.xml加载
我已经在web.xml<em>文件</em>中加载了applicationContext.xml<em>文件</em>rn rn contextConfigLocationrn /WEB-INF/applicationContext.xmlrn rn rn SpringContextServletrn rn org.<em>spring</em>framework.web.context.ContextLoaderServletrn rn 1rn rnServlet中可以获取,但bean<em>文件</em>我这样获取的话就出错:rnpublic static Object getbean1(String name) rn Object bean = null;rnApplicationContext tx=WebApplicationContextUtils.getWebApplicationContext(); rn ean =ctx.getBean(name);rn rn
实在不会写applicationContext.xml这个配置文件了...求救~~
在用hibernate3+struts2+<em>spring</em>做东西 很简单,数据库里就一张表,就俩元素:姓名和密码 完了实现个登录功能就行了 其他都配置好了 就applicationContext.xml不
在eclipse中快速生成一个maven项目后一键生成web.xml
在web工程创建时创建web.xml:用Eclipse新建一个web项目没有自动生成web.xml在创建<em>maven</em>工程时,大多没有创建web.xml<em>文件</em>,web.xml路径:src/main/webapp/EWB-INF/web.xml创建web.xml:右键项目——&amp;gt;javaEE tools——&amp;gt;点击第二个Generate Deploymennt Descriptor Stub即可完...
idea中src/main/resources目录下的applicationContext.xml文件访问src/main/webap目录下的配置文件
如图所示,想要在src/main/resources目录下的applicationContext.xml<em>文件</em>中访问src/main/webap目录下的db.properties,需要两步: applicationContext-dao.xml中进行配置(classpath:后的路径看情况可自行修改): &lt;context:property-placeholder location="...
IDEA下maven的mapper.xml文件路径改为resources文件夹下
在IDEA下创建<em>maven</em>项目时, 使用SSM框架,需要把mapper.xml <em>文件</em>放在resources<em>文件</em>夹下,这样target<em>文件</em>夹才有mapper.xml<em>文件</em>,否则是没有的. 相关配置<em>文件</em>: application-dao.xml &amp;lt;beans xmlns=&quot;http://www.<em>spring</em>framework.org/schema/beans&quot; xmlns:xsi=&quot;http:...
使用maven搭建项目时,数据源配置context.xml文件应该放哪儿?
-
spring配置文件applicationContext.xml问题
一、有问题的applicationContext.xml<em>文件</em>内容如下:rnrnrnrnrn rn ......省略 rn rn rn 。。。省略rn rn rn com/account/model/Account.hbm.xml com/account/model/User.hbm.xmlrn rn rn rn rn[color=#FF0000] rn rn rn rn rn rn [/color] rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn 。。。省略rn rn rn rn 。。。省略rn rn rn二、问题描述:rn1、项目是一个ssh项目,配置<em>文件</em>中涉及2个模块:user和account。user模块现在可以正常CRUD。rn2、account模块pojo类:rnpublic class Accountrn private String name;rnrn public String getName() rn return this.name;rn rnrn public void setName(String name) rn this.name = name;rn rnrn3、account模块action:rnpublic class AccountAction extends ActionSupport rn private Account account;rn private AccountManager accountManager;rn //省略get、set方法rnrn //测试方法rn public String saveOrUpdate()rn tryrn System.out.println("/user/account!saveOrUpdate is invoked:"+account.getName());rn catch(Exception e)rn e.printStackTrace();rn rn return SUCCESS;rn rnrn4、页面表单rn ,提交给 AccountAction 的saveOrUpdate()方法;rn5、问题:当我把applicationContext.xml当中标红的user模块部分配置删除后, AccountAction 的saveOrUpdate()方法中account.getName()可以正常取得name属性值,如果保留user模块部分配置,则无法将参数传递给pojo类account,报如下空指针异常:rnjava.lang.NullPointerExceptionrn at com.account.action.AccountAction.saveOrUpdate(AccountAction.java:35)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)rn at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)rn at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)rn at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)rn at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)rn at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)rn at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)rn at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)rn at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)rn at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.<em>spring</em>framework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.<em>spring</em>framework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)rn at java.lang.Thread.run(Thread.java:662)rn
spring applicationContext.xml详细配置
applicationContext.xml+hiberniate属性+Session属性+自动代理+拦截器!!!! 上传的限制去除了jar包!
spring applicationContext.xml模块?
applicationContext.xml分模块写,需要<em>怎么</em>去设定,请同志们指点一下??rnrnrn谢谢!!
Spring[applicationContext.xml]灵活性代理
Spring[applicationContext.xml]灵活性代理
Spring装配 applicationContext.xml 问题
[img=https://img-bbs.csdn.net/upload/201603/07/1457355366_652973.png][/img]rn[img=https://img-bbs.csdn.net/upload/201603/07/1457355214_84340.png][/img]
解决ssm的maven框架启动找不到spring.xml或者applicationContext.xml此类的核心配置文件的问题
第一步,首先检查自己的配置<em>文件</em>是不是如图所示: 一定要先保证<em>spring</em>.xml<em>文件</em>是在resoures<em>文件</em>的跟目录下。 第二步,打开web.xml 找到<em>spring</em>.xml 检查下是否跟我的一致。如果一致,恭喜你,中奖了,这是个坑。 解决办法,把下面的代码复制下,覆盖了:     &amp;lt;!-- 读取<em>spring</em>配置<em>文件</em> --&amp;gt;     &amp;lt;context-para...
(Maven)Spring的applicationContext.xml第一行报错,或者约束空间/约束报错
Referenced file contains errors (http://www.<em>spring</em>framework.org/schema/beans ... ...省略 该错误是,引用<em>文件</em>出现错误,上图我出现的问题是“<em>spring</em>-beans.xsd”的约束空间出现错误。 一般情况下,出现这种类型错误的原因往往是下载该<em>文件</em>的时候未下载完成中途退出终止导致的,而不完整的该<em>文件</em>存在导...
使用Maven使用spring(注解版)
接上一篇:使用Maven配置<em>spring</em> 1.用到的依赖包    Pom.xml添加:     dependency>         groupId>org.<em>spring</em>frameworkgroupId>         artifactId><em>spring</em>-testartifactId>         version>3.0.0.RELEASEversion>
ssh框架在application.xml中配置数据源所需jar
- Application context definition for JPetStore's busines
springMVC配置applicationContext配置示例
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt;&amp;lt;beans xmlns=&quot;http://www.<em>spring</em>framework.org/schema/beans&quot;     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;    xmlns:context=&quot;http://www.<em>spring</em>
Spring 的applicationContext.xml问题
rnrnrnrnrnrn rn rn com.mysql.jdbc.Driverrn rn rn jdbc:mysql://localhost:3306/testrn rn rn rootrn rn rn 123rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn rn rn rn rn rn com/yourcompany/vo/Admin.hbm.xmlrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn
Spring中连接不上applicationContext.xml文件
package com.bjpownernode.<em>spring</em>.manage;rnrnpublic interface UserManager rn public void addUser(String username,String password);rnrnrnpackage com.bjpownernode.<em>spring</em>.manage;rnimport com.bjpownernode.<em>spring</em>.dao.UserDao;rnimport com.bjpownernode.<em>spring</em>.manage.UserManager;rnrnpublic class UserManagerImpl implements UserManager rn private UserDao userdao;rn public void setUserdao(UserDao userdao) rn this.userdao = userdao;rn rn @Overridern public void addUser(String username, String password) rn userdao.addUser(username, password);rn rnrnapplicationContext.xml配置:rn rn rn rn rn rn rn rn rn rn运行程序:rn public static void main(String[] args) rn rn BeanFactory factory=new ClassPathXmlApplicationContext("applicationContext.xml");rn// ApplicationContext ac=new ClassPathXmlApplicationContext("applicationContext.xml");rn UserManager userManager=(UserManager) factory.getBean("userDaoOracle");rn rn userManager.addUser("chenjianyi", "123");rn rnrn结果出现错误:Exception in thread "main" java.lang.ClassCastException: com.bjpownernode.<em>spring</em>.dao.UserDaoImpl1 cannot be cast to com.bjpownernode.<em>spring</em>.manage.UserManagerrn at com.bjpownernode.<em>spring</em>.client.Client.main(Client.java:20)rnrn请问下大侠们,这到底是哪里出了问题呢?
在配置Spring的applicationContext.xml文件的时候报错
[code=java]rnrnrn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]rn[img=https://img-bbs.csdn.net/upload/201708/31/1504112695_834973.jpg][/img]rn请问各位大神。到底是哪里除了问题呀。
applicationContext.xml文件怎么配置struts2和spring配置文件的加载路径
在appltionContext.xml<em>文件</em>中的配置方法如下: contextConfigLocation classpath*:<em>spring</em>Cfg/<em>spring</em>-*.xml org.<em>spring</em>framework.web.context.ContextLoaderListener
【Spring】【环境搭建】【applicationContext.xml文件的部署+web.xml部署】
applicationContext.xml<em>文件</em>的部署 1.声明命名空间 tx+beans+context+aop "http://www.<em>spring</em>framework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.<em>spring</em>
spring做的一个小项目,tomcat报错applicationcontext.xml不存在
servlet里面的doget方法。。。 protected void doGet(HttpServletRequest request, HttpServletResponse response)
ApplicationContext详解以及多个ApplicationContext.xml的相互引用
如果说BeanFactory是<em>spring</em>的心脏,那么Application就是完整的身躯。ApplicationContext就是由BeanFactory派生出来的。 一、ApplicationContext类 ApplicationContext的主要实现类是ClassPathXmlApplicationContext和FileSystemXmlApplicationContext,前者...
maven多模块下的spring 自动扫描
-
Spring的applicationContext.xml文件
想必用过Spring的程序员们都有这样的感觉,Spring把逻辑层封装的太完美了(个人感觉View层封装的不是很好)。以至于有的初学者都不知道Spring配置<em>文件</em>的意思,就拿来用了。所以今天我给大家详细解释一下Spring的applicationContext.xml<em>文件</em>。Ok,我还是通过代码加注释的方式为大家演示: 以下是详解Spring的applicationContext.xml<em>文件</em>代码...
Spring中怎么更改applicationContext.xml的加载位置
我在初始创建工程的时候是把applicationContext.xml放在![图片说明](https://img-ask.csdn.net/upload/201606/14/1465893511_40767.png)rn可是他实际运行时却是去WEB-INF下classes里找![图片说明](https://img-ask.csdn.net/upload/201606/14/1465893566_645131.png)rn我照网上的把一段配置信息写进去web.xml里![图片说明](https://img-ask.csdn.net/upload/201606/14/1465893600_592354.png)rn可是还是不行![图片说明](https://img-ask.csdn.net/upload/201606/14/1465893612_671994.png)rn我就是不想把配置<em>文件</em>放在classes里 因为我在myeclipse里看不见他
spring找不到applicationContext.xml问题
目录格式 rn[color=red] rn <em>spring</em>rn srcrn default packagern MyTest.javarn ShowMessage.javarn applicationContext.xmlrn JRE System Libraryrn Soring 2.0 .Core rn[/color]rnrnrnlog4j:WARN No appenders could be found for logger (org.<em>spring</em>framework.context.support.FileSystemXmlApplicationContext).rnlog4j:WARN Please initialize the log4j system properly.rnException in thread "main" org.<em>spring</em>framework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from file [D:\MyEclipse 10组件\<em>spring</em>\src\aplicationContext.xml]; nested exception is java.io.FileNotFoundException: src\aplicationContext.xml (系统找不到指定的<em>文件</em>。)rnCaused by: java.io.FileNotFoundException: src\aplicationContext.xml (系统找不到指定的<em>文件</em>。)rn at java.io.FileInputStream.open(Native Method)rn at java.io.FileInputStream.(FileInputStream.java:106)rn at org.<em>spring</em>framework.core.io.FileSystemResource.getInputStream(FileSystemResource.java:85)rn at org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:307)rn at org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:290)rn at org.<em>spring</em>framework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:131)rn at org.<em>spring</em>framework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:147)rn at org.<em>spring</em>framework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:173)rn at org.<em>spring</em>framework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:112)rn at org.<em>spring</em>framework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:79)rn at org.<em>spring</em>framework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:101)rn at org.<em>spring</em>framework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:394)rn at org.<em>spring</em>framework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:324)rn at org.<em>spring</em>framework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:124)rn at org.<em>spring</em>framework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:68)rn at MyTest.main(MyTest.java:5)rnrn测试程序MyTestrnimport org.<em>spring</em>framework.context.ApplicationContext;rnimport org.<em>spring</em>framework.context.support.FileSystemXmlApplicationContext;rnpublic class MyTestrn public static void main(String[] args)rn ApplicationContext ctx=new FileSystemXmlApplicationContext("src/aplicationContext.xml");rn ShowMessage sm=(ShowMessage)ctx.getBean("myBean");rn sm.show();rn rn
Spring源码学习--Spring配置解析文件ApplicationContext.xml(一)
接下来我们用多篇<em>文件</em>对Spring解析Bean配置<em>文件</em>ApplicationContext.xml的过程进行一系列的了解,了解Spring对我们在ApplicationContext.xml中注入的Bean的解析流程。AbstractApplicationContext:中会初始化Bean容器@Override public void refresh() throws BeansExceptio
applicationContext.xml文件报错
大家好,正在写一个<em>spring</em>的小例子,但是配置<em>文件</em>报错了,在aop:pointcut提示:Description Resource Path Location Typerncvc-complex-type.2.4.a: Invalid content was found starting with element 'aop:pointcut'. One of '"http://www.<em>spring</em>framework.org/schema/aop":aspect' is expected.rn而且和也打不出来,请问大家<em>怎么</em>解决?rn[code=text]rnrnrn rn rn rn rn rn rn rn rn rn rn rn rnrn[/code]
spring2.5+Hibernate3.2,applicationContext.xml文件报错
我用<em>spring</em>2.5+Hibernate3.2做自动装配的一个例子,在applicationContext.xml中添加了后配置<em>文件</em>报错:rnUnexpected exception parsing XML document from file [D:/JavaWork/workspace/mini/src/applicationContext.xml]; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassReader.accept(Lorg/objectweb/asm/ClassVisitor;Z)Vrnrnasm2.2.3.jar已经删除了,程序可以正常运行.因为配置<em>文件</em>报错,没法生成Hibernate3.2提供的具有注解功能的POJO。rnrnAdd Hibernate mapping annotations to POJO (Hibernate3.2 only) 这一项是没法选的,rn如果把<em>spring</em>配置<em>文件</em>applicationContext.xml中的这段代码取掉,就不会出现上面的问题,请问如何解决这个问题呢?
applicationContext.xml文件配置问题!急!!!!!!!!!!!!!!!!
大虾们我是一个初学者,遇到了这个问题,希望帮我解决解决,先闪分给大家rnapplicationContext.xml<em>文件</em>配置这样配置可以吗?我用的是SQL SERVER 2000,这样配置可以不?如果不可以话,帮我修改修改哦!谢谢
Spring中的applicationContext.xml配置的问题?
我的applicationContext.xml配置<em>文件</em>如下:rnrnrnrnrn Message Bookrnrn rn rn rn com.microsoft.jdbc.sqlserver.SQLServerDriverrn rn rn jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=MessageBookrn rn rn sarn rn rn 0077rn rn rn 5rn rn rn 2rn rn rn 20000rn rn rn truern rn rnrn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn cn/com/evin/hibernate/Message.hbm.xml rn rn rn rn rn rn org.hibernate.dialect.SQLServerDialectrn rn truern 10rn 10rn rn rn rnrn rn rn rn rn rn rnrn rn rn rn rn rn rnrn rn rn rn rn rn rnrn rn rn rn rn rn rn rn rn rn rn PROPAGATION_REQUIREDrn PROPAGATION_REQUIREDrn PROPAGATION_REQUIREDrn rn rn rn rn rnrnrnrn当我启动web后,在一个Action用如下代码调用时就会出错:rnrnjavax.servlet.ServletException: Error creating bean with name 'messageDAO' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.<em>spring</em>framework.beans.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested propertyAccessExceptions are: [org.<em>spring</em>framework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [net.sf.hibernate.SessionFactory] for property 'sessionFactory']rn org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)rn org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)rn org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)rn org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)rn org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrnrn哪位兄弟碰到过,帮忙看看?谢了先!!
关于ibatis和spring的applicationContext.xml整合
这是applicationContext.xml的配置rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn这是被引入的DB<em>spring</em>.xml配置rnrnrn rn rn rnrnrn rn rn rn rn rnrnrn然后它报了这样的错误,求大神们指点rnorg.<em>spring</em>framework.beans.factory.BeanCreationException: Error creating bean with name 'dao' defined in ServletContext resource [/WEB-INF/classes/<em>spring</em>s/DB<em>spring</em>.xml]: Error setting property values; nested exception is org.<em>spring</em>framework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [dao.sqldao.BaseDao]: Bean property 'sessionFactory' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?rn at org.<em>spring</em>framework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1303)rn at org.<em>spring</em>framework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1042)rn at org.<em>spring</em>framework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)rn at org.<em>spring</em>framework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:485)rn at java.security.AccessController.doPrivileged(Native Method)rn
applicationContext.xml文件出错
具体出错信息:rn2006-09-01 09:01:45,453 WARN ehcache.config.Configurator:126 2006-09-01 09:01:49,265 ERROR web.context.ContextLoader:205 org.<em>spring</em>framework.beans.factory.BeanCreationException: Error creating bean with name 'newscontentTarget' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.<em>spring</em>framework.beans.NotWritablePropertyException: Invalid property 'newscontentDAO' of bean class [com.caicai.lead21.service.<em>spring</em>.NewsContentServiceSpringImpl]: Bean property 'newscontentDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?rnorg.<em>spring</em>framework.beans.NotWritablePropertyException: Invalid property 'newscontentDAO' of bean class [com.caicai.lead21.service.<em>spring</em>.NewsContentServiceSpringImpl]: Bean property 'newscontentDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?rnsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:585)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)rn2006-09-01 09:01:49,265 ERROR [Catalina].[localhost].[/oil]:662 org.<em>spring</em>framework.beans.factory.BeanCreationException: Error creating bean with name 'newscontentTarget' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.<em>spring</em>framework.beans.NotWritablePropertyException: Invalid property 'newscontentDAO' of bean class [com.caicai.lead21.service.<em>spring</em>.NewsContentServiceSpringImpl]: Bean property 'newscontentDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?rnorg.<em>spring</em>framework.beans.NotWritablePropertyException: Invalid property 'newscontentDAO' of bean class [com.caicai.lead21.service.<em>spring</em>.NewsContentServiceSpringImpl]: Bean property 'newscontentDAO' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?rn
如何取得spring的配置文件applicationContext.xml
ApplicationContext context=new FileSystemXmlApplicationContext("applicationContext.xml");rn我这么写,报错,系统找不到指定的<em>文件</em>rn服务器是weblogicrnrn请问应该<em>怎么</em>取?
Spring中applicationContext.xml配置文件问题?
这是我的applicationContext.xml<em>文件</em>rn[code=text]rnrn[/code]rn其中我导的Spring包如图:[img=https://img-bbs.csdn.net/upload/201704/13/1492071997_847414.png][/img]rn主要报错如下:[code=java]org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 51; schema_reference.4: 无法读取方案文档 'http://www.<em>spring</em>framework.org/schema/context/<em>spring</em>-context-4.3.0.xsd', 原因为 1) 无法找到文档; 2) 无法读取文档; 3) 文档的根元素不是 。rn [/code]rn大神们,如何改正?
Spring Security3.1的applicationContext.xml加载错误问题
错误如下,希望各位可以帮小弟解决!rnrn2012-10-20 12:10:07 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring FrameworkServlet 'twr'rn2012-10-20 12:10:09 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn2012-10-20 12:10:09 org.<em>spring</em>framework.web.context.ContextLoader initWebApplicationContextrn信息: Root WebApplicationContext: initialization startedrn2012-10-20 12:10:09 org.<em>spring</em>framework.context.support.AbstractApplicationContext prepareRefreshrn信息: Refreshing org.<em>spring</em>framework.web.context.support.XmlWebApplicationContext@121a2cc7: display name [Root WebApplicationContext]; startup date [Sat Oct 20 12:10:09 CST 2012]; root of context hierarchyrn2012-10-20 12:10:09 org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]rn2012-10-20 12:10:11 org.<em>spring</em>framework.security.core.SpringSecurityCoreVersion rn信息: You are running with Spring Security Core 3.1.0.RELEASErn2012-10-20 12:10:11 org.<em>spring</em>framework.security.core.SpringSecurityCoreVersion rn严重: *** Spring Major version '3' expected, but you are running with version: 2.5.6. Please check your classpath for unwanted jar files.rn2012-10-20 12:10:11 org.<em>spring</em>framework.security.core.SpringSecurityCoreVersion rn警告: **** You are advised to use Spring 3.0.6.RELEASE or later with this version. You are running: 2.5.6rn2012-10-20 12:10:11 org.<em>spring</em>framework.security.config.SecurityNamespaceHandler rn信息: Spring Security 'config' module version is 3.1.0.RELEASErn2012-10-20 12:10:11 org.<em>spring</em>framework.web.context.ContextLoader initWebApplicationContextrn严重: Context initialization failedrnorg.<em>spring</em>framework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.NoSuchMethodError: org.<em>spring</em>framework.beans.factory.xml.BeanDefinitionParserDelegate.getLocalName(Lorg/w3c/dom/Node;)Ljava/lang/String;rn at org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)rn at org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)rn at org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)rn at org.<em>spring</em>framework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)rn at org.<em>spring</em>framework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)rn at org.<em>spring</em>framework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)rn at org.<em>spring</em>framework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)rn at org.<em>spring</em>framework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)rn at org.<em>spring</em>framework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)rn at org.<em>spring</em>framework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)rn at org.<em>spring</em>framework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)rn at org.<em>spring</em>framework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.<em>spring</em>framework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.<em>spring</em>framework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4323)rn at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4771)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)rn at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990)rn at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)rn at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990)rn at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:275)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)rn at org.apache.catalina.core.StandardService.startInternal(StandardService.java:424)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)rn at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:648)rn at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:576)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415)rnCaused by: java.lang.NoSuchMethodError: org.<em>spring</em>framework.beans.factory.xml.BeanDefinitionParserDelegate.getLocalName(Lorg/w3c/dom/Node;)Ljava/lang/String;rn at org.<em>spring</em>framework.security.config.SecurityNamespaceHandler.parse(SecurityNamespaceHandler.java:69)rn at org.<em>spring</em>framework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1297)rn at org.<em>spring</em>framework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1287)rn at org.<em>spring</em>framework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135)rn at org.<em>spring</em>framework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)rn at org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)rn at org.<em>spring</em>framework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)rn ... 33 morern2012-10-20 12:10:11 org.apache.catalina.core.StandardContext startInternalrn严重: Error listenerStartrn2012-10-20 12:10:11 org.apache.catalina.core.StandardContext startInternalrn严重: Context [/<em>spring</em>text] startup failed due to previous errorsrn2012-10-20 12:10:11 org.apache.catalina.core.ApplicationContext logrn信息: Closing Spring root WebApplicationContextrnrnrnrnrnweb.xml如下rnrnrnrn rn contextConfigLocationrn /WEB-INF/applicationContext*.xmlrn rnrn rn rn org.<em>spring</em>framework.web.context.ContextLoaderListenerrn rn rnrn rn <em>spring</em>SecurityFilterChainrn rn org.<em>spring</em>framework.web.filter.DelegatingFilterProxyrn rn rn rn <em>spring</em>SecurityFilterChainrn /*rn rnrnrn rn login.jsprn rnrnrnrnrnapplicationContext.xml如下rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn rn rnrnrnrnrn
spring 的applicationContext.xml bean配置报错问题
[code=Java]rnrnrnrn rn rn rn rnrn rn rn rnrn rnrn rnrn rn [color=#FF0000][/color] //这里报错 No setter found for porperty 'sessionFactory' in class orm.BooktblDAOrn rn rn rnrnrn rn rn rn rn rnrn rn rn rn rn rnrn rn rn rn rn rnrnrn rn rn rn rn rnrn rn rnrnrn[/code]rnrnNo setter found for porperty 'sessionFactory' in class orm.BooktblDAO 如何解决?
Spring的applicationContext.xml总配置错误
如题,总是显示lineNumber: 6; columnNumber: 68; cvc-elt.1: 找不到元素 'beans' 的声明。rn代码如下rn[code=text]rnrnrn rnrn[/code]
springapplicationcontext.xml 事务 配置问题
最近在搭建SSH平台时,发现一个疑惑,<em>applicationcontext.xml</em>中的 事务配置代码(红色代码区),rn发现是一个可有可无的配置项,删除了代码,照样能连接oracle数据库,保存对象。rn非常不解,按理事务应该回滚的,求教中。。。。rnrnrn<em>spring</em> 配置代码如下:rn[code=XML]rnrnrnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.Oracle9Dialectrn rn rn rn rn rn domain/Users.hbm.xmlrn domain/Dishes.hbm.xmlrn domain/Orders.hbm.xmlrn domain/Detail.hbm.xmlrn rn rn rn [color=#FF0000]rn rn [/color]rnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rnrn rn rn rn rn rnrnrnrn[/code]rnrnhibernate 实现的dao层代码如下:rnrn[code=Java]rnpackage daoimpl;rnrnimport java.util.List;rnimport java.util.Set;rnimport org.hibernate.LockMode;rnimport org.slf4j.Logger;rnimport org.slf4j.LoggerFactory;rnimport org.<em>spring</em>framework.context.ApplicationContext;rnimport org.<em>spring</em>framework.orm.hibernate3.support.HibernateDaoSupport;rnrnimport dao.UsersDAO;rnimport domain.Users;rnrn/**rn * A data access object (DAO) providing persistence and search support for Usersrn * entities. Transaction control of the save(), update() and delete() operationsrn * can directly support Spring container-managed transactions or they can bern * augmented to handle user-managed Spring transactions. Each of these methodsrn * provides additional information for how to configure it for the desired typern * of transaction control.rn * rn * @see domain.Usersrn * @author MyEclipse Persistence Toolsrn */rnrnpublic class UsersDAOimpl extends HibernateDaoSupport implements UsersDAO rn private static final Logger log = LoggerFactory.getLogger(UsersDAOimpl.class);rn protected void initDao() rn // do nothingrn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#save(domain.Users)rn */rn public void save(Users transientInstance) rn log.debug("saving Users instance");rn try rn getHibernateTemplate().save(transientInstance);rn log.debug("save successful");rn catch (RuntimeException re) rn log.error("save failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#delete(domain.Users)rn */rn public void delete(Users persistentInstance) rn log.debug("deleting Users instance");rn try rn getHibernateTemplate().delete(persistentInstance);rn log.debug("delete successful");rn catch (RuntimeException re) rn log.error("delete failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findById(java.math.BigDecimal)rn */rn public Users findById(java.math.BigDecimal id) rn log.debug("getting Users instance with id: " + id);rn try rn Users instance = (Users) getHibernateTemplate().get("domain.Users",rn id);rn return instance;rn catch (RuntimeException re) rn log.error("get failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByExample(domain.Users)rn */rn public List findByExample(Users instance) rn log.debug("finding Users instance by example");rn try rn List results = getHibernateTemplate().findByExample(instance);rn log.debug("find by example successful, result size: "rn + results.size());rn return results;rn catch (RuntimeException re) rn log.error("find by example failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByProperty(java.lang.String, java.lang.Object)rn */rn public List findByProperty(String propertyName, Object value) rn log.debug("finding Users instance with property: " + propertyNamern + ", value: " + value);rn try rn String queryString = "from Users as model where model."rn + propertyName + "= ?";rn return getHibernateTemplate().find(queryString, value);rn catch (RuntimeException re) rn log.error("find by property name failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByUsername(java.lang.Object)rn */rn public List findByUsername(Object username) rn return findByProperty(USERNAME, username);rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByRealname(java.lang.Object)rn */rn public List findByRealname(Object realname) rn return findByProperty(REALNAME, realname);rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByEmail(java.lang.Object)rn */rn public List findByEmail(Object email) rn return findByProperty(EMAIL, email);rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByPassword(java.lang.Object)rn */rn public List findByPassword(Object password) rn return findByProperty(PASSWORD, password);rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByAddre(java.lang.Object)rn */rn public List findByAddre(Object addre) rn return findByProperty(ADDRE, addre);rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findByTele(java.lang.Object)rn */rn public List findByTele(Object tele) rn return findByProperty(TELE, tele);rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#findAll()rn */rn public List findAll() rn log.debug("finding all Users instances");rn try rn String queryString = "from Users";rn return getHibernateTemplate().find(queryString);rn catch (RuntimeException re) rn log.error("find all failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#merge(domain.Users)rn */rn public Users merge(Users detachedInstance) rn log.debug("merging Users instance");rn try rn Users result = (Users) getHibernateTemplate().merge(rn detachedInstance);rn log.debug("merge successful");rn return result;rn catch (RuntimeException re) rn log.error("merge failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#attachDirty(domain.Users)rn */rn public void attachDirty(Users instance) rn log.debug("attaching dirty Users instance");rn try rn getHibernateTemplate().saveOrUpdate(instance);rn log.debug("attach successful");rn catch (RuntimeException re) rn log.error("attach failed", re);rn throw re;rn rn rnrn /* (non-Javadoc)rn * @see daoimpl.UsersDAO#attachClean(domain.Users)rn */rn public void attachClean(Users instance) rn log.debug("attaching clean Users instance");rn try rn getHibernateTemplate().lock(instance, LockMode.NONE);rn log.debug("attach successful");rn catch (RuntimeException re) rn log.error("attach failed", re);rn throw re;rn rn rnrn public static UsersDAO getFromApplicationContext(ApplicationContext ctx) rn return (UsersDAO) ctx.getBean("UsersDAO");rn rnrn[/code]rnrnrnrnrn
Spring之S2SH整合(applicationContext.xml配置)
本教程从基础的三大框架开始介绍,到进行整合,同时加入了FreeMarker模板和Spring OSGI的说明及应用。后以Maven项目进行整理,让学员能够将知识融会贯通,活学活用,把技术知识运用到实际的项目中来。其中分布介绍了,各个框架的基本独立使用,以及后续Maven的安装和应用,包括私服Nexus的搭建解决网络问题。项目中对EasyUI的通用及独特之处均有相应的模板。
spring配置文件详解(applicationContext.xml)(2)
<em>spring</em>配置<em>文件</em>详解
Spring 学习笔记《依赖注入》—— 配置 applicationContext.xml
要开始学习 Spring 了,先找找组织 本家和大户 https://<em>spring</em>.io/projects/<em>spring</em>-framework https://github.com/<em>spring</em>-projects/<em>spring</em>-framework 源码 https://github.com/<em>spring</em>-projects/<em>spring</em>-framework/releases/tag/v3.2.5.RE...
eclipse 新建applicationContext.xml文件
以前使用<em>spring</em>框架,创建applicationContext.xml<em>文件</em>总是从别的项目中拷贝过来。这次想自己新建一个applicationContext.xml<em>文件</em>,步骤如下:新建-》other->xml->xml File->next->create XML file from an XML schema file ->select xml catelog entry->选中需要的xsd,生成xml<em>文件</em>如下:rnrnrnrn rnrnrn请问prefix p如何在去除,我看其他项目中的applicationContext.xml<em>文件</em>都没有这个prefix。
applicationContext.xml
applicationContext.xml
ApplicationContext.xml
博文链接:https://jacklang.iteye.com/blog/152841
Spring与Mybatis整合时,applicationContext.xml文件的详细配置
1.引入外部配置<em>文件</em> &amp;lt;context:property-placeholder location=&quot;classpath:db.properties&quot; /&amp;gt; 2.注册数据源 &amp;lt;bean id=&quot;dataSource class=&quot;org.apache.commons.dbcp.BasicDataSource&quot;&amp;gt;     &amp;lt;property  name=&quot;&quot; valu.
spring运行的时候,哪个类读取了applicationContext.xml文件
我想知道,在服务启动的时候,那个JAVA<em>文件</em>最先读取的applicationContext.xml<em>文件</em>,谢谢!
spring如何读取放在/WEB-INF/目录中的applicationContext.xml文件?
在练习junit时出现不知道如何读取放在/WEB-INF/目录中的applicationContext.xml<em>文件</em>,放到classes目录中没任何问题!
spring配置文件ApplicationContext.xml文件里面代码没有提示功能
由于编者水平有限,文中难免会有错误和疏漏,请各位读者能提出宝贵建议或给予指正,可在博文下评论指出,我会及时改进,在此先感谢各位。   本文是自己学习所做笔记,欢迎转载,但请注明出处:http://blog.csdn.NET/yijuanxia. 系统环境:Win7-64位 开发环境:myeclipse-64位 步骤一:确定xsd<em>文件</em>位置 <em>spring</em>-framework-3.2.0
spring的applicationContext.xml文件一定要放在jar包内是怎么回事?
有一个项目,applicationContext.xml直接放在src目录下,载入方式是 rnApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext.xml") rnrn在eclipse运行良好,打包成jar后,发现这个<em>文件</em>必须放在jar的内部,放在jar外部(和jar处于一个目录下),就报找不到这个<em>文件</em>。这是为什么呢
SSH框架applicationContext.xml头部文件
SSH框架applicationContext.xml头部<em>文件</em>
maven spring
<em>maven</em> <em>spring</em> mvc项目,有助于了解如何构建<em>maven</em>项目,如何下载jar包。以及<em>文件</em>的部署。
Maven Spring
Spring Maven 拼装组合的运行工程,可以向SPring学习
Spring中的applicationContext.xml中的Bo(业务层)怎么配?
RT;本人刚接触Spring,以前只用过Struts+Hibernate。rn做了下网上的例子,貌似都是直接在Action直接注入个Dao的。rn[color=#FF0000]我现在想在Action中注入Bo,在Bo中注入Dao,不知道这么想对不对。[/color]rnrn然后就在XML中rn[code=XML]rnrn rn rn rn rn rn rn rn rn rnrn[/code]rnrn但发觉value="" 总不对。rn谢谢哪位大哥指点下?rn
【工具】applicationContext.xml文件放在src下
将applicationContext.xml<em>文件</em>放在src下
spring里applicationContext.xml里的一堆http://...怎么记亿?
我就要是用注解来使用aop,结果applicationContext.xml里就要这么一大堆xmlns和xsi,这叫人<em>怎么</em>记啊,我电脑不联网的情况下项目就能运行,这些http://...有什么用,又是<em>怎么</em>得出来的?能从<em>spring</em>的jar包里找到吗,或别的方法推出来吗?rnrn而且用了aop注解,原来用的继承接口的proxy方式就报类型转换异常[url=http://topic.csdn.net/u/20111106/10/f725a9f6-71c2-446d-b186-b8a7da5e68b6.html]这个帖子里[/url]的“Hi h = (Hi) ac.getBean("proxy");”报java.lang.ClassCastException异常rnrn[code=Java]rnrnrnrn rn rnrnrn[/code]
要想看懂 spring 的配置文件:ApplicationContext.xml 第一步
要想看懂 <em>spring</em> 的配置<em>文件</em>:ApplicationContext.xml 就得先从简单的来,一步一步的看才会理解的清楚明白。 首先得知道什么叫ioc---依赖注入,注入的方式一般有2个;设值注入和构造注入。 然后就知道这个配置<em>文件</em>是干嘛的,具体<em>怎么</em>配置的。 还是得多看,看多了,就知道啦,具体<em>怎么</em>弄啦。 对于<em>spring</em>的配置<em>文件</em>里面bean的配置, 当每个bean的很多属性对应的不同类型的时候,<em>怎么</em>在配置<em>文件</em>里面配置。 当然这是简单的配置,就是展示一下用法。 做个如下测试,当个例子。 首先是Jav
spring配置文件applicationContext.xml不能提示的解决方法
依次打开windows→preference→myeclipse→iles and editors→xml→xmlcatalog点击Add 在Add XML Catalog Element窗口中选择File System..选择对应<em>spring</em>的xsd<em>文件</em>Key 改为http://www.<em>spring</em>framework.org/schema/beans/<em>spring</em>-beans-3.0.xsd
ASP.NET Gridview隐藏/显示列源码下载
ASP.NET实现Gridview隐藏/显示列源码 介绍: 这篇文章演示如果让用户有显示/隐藏他们需要的GridView的列的功能,这是非常有用的,因为在GridView的所有列并不是每个的用户都需要的.用户想根据自己的需求看到想要的列.而不是显示一个巨大的gridview,霸占了整个屏幕,而是一个整洁的Gridview,而且它有所有你需要的列.对于页面的打印这也是一个非常有用的技术,因为用户可以灵活地选择GridView的列打印。 背景: RowCreated 和ItemDataBound 事件允许你用多种方式注入HTML, CSS,和JavaScript 来增强GridView 控件的 相关下载链接:[url=//download.csdn.net/download/kongyuan0629/2109318?utm_source=bbsseo]//download.csdn.net/download/kongyuan0629/2109318?utm_source=bbsseo[/url]
MCU破解葵花宝典下载
MCU破解葵花宝典 相关下载链接:[url=//download.csdn.net/download/lmtang1/2810461?utm_source=bbsseo]//download.csdn.net/download/lmtang1/2810461?utm_source=bbsseo[/url]
jdk-7u9-windows-i586.part2.rar下载
2012-11-11最新版,jdk-7u9-windows-i586 相关下载链接:[url=//download.csdn.net/download/jantw996/4762654?utm_source=bbsseo]//download.csdn.net/download/jantw996/4762654?utm_source=bbsseo[/url]
我们是很有底线的