spring配置文件引用问题 10C

mybatis-config.xml配置数据源,spring-tx.xml管理事务,需要引用mybatis-config.xml,我增加spring-activiti.xml文件也需要引用mybatis-config.xml配置文件,因为使用同一个数据源,但是这样我引用两次mybatis-config.xml会不会导致最终创建了两个数据源

1个回答

不会,最终只会创建一个。xml配置的是数据源的参数。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
spring 配置文件的相互引用问题
UserDAOSupport.xmlrnrn rn rn rn rn rnrnrnrnFactoryConfigDataSource.xmlrnrnrnrn rn rn rn rn rn rn User.hbm.xmlrn rn rn rn rn org.hibernate.dialect.SQLServerDialectrn truern rn rn rnrnrnrn两个配置文件在同一包spring_unite_hibernate下面,为什么UserDAOSupport.xml的bean中引用rnrnFactoryConfigDataSource.xml中的sessionFactory 一直提示引用的bean‘sessionFactory’找不到rnrnrnrn
spring 配置文件引用
You can use the application context constructor to load bean definitions from all these XML fragments. This onstructor takes multiple Resource locations, as was shown in the previous section. Alter
引用外部Spring配置文件
背景 Spring的配置文件有两种,分别是Spring和Spring MVC的配置文件,一般放在classpath下或者WEB-INF下,加载的方式一般在web.xml中声明,如下: <?xml version="1.0" encoding="UTF-8&am
spring中引用多个配置文件
中间以逗号分开即可:<context:property-placeholder location="classpath:/jdbc.properties,classpath:/solr.properties" />
spring配置文件中xsd引用问题
XML的一些概念 首先来看下xml的一些概念:xml的schema里有namespace,可以给它起个别名。比如常见的spring的namespace:xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" 通常情况下
Spring的数据源引用问题,拆分配置文件
==================================================== 0.借助hibernate的数据源使用,即引入hibernate.cfg.xml文件 注意:此时使用的失误提交机制被关闭,应在hibernate.cfg.xml中添加true <bean id="sessionFactory" class="org.springframew
spring boot 配置文件中参数间的引用
com.july.young.name=扫地君 com.july.young.title=扫地心得 com.july.young.desc=${com.july.young.name}正在努力写《${com.july.young.title}》
spring引用配置文件的时候classpath:和classpath*:的区别
我们平时使用spring框架的时候经常需要引入一些配置文件,如.propertis文件。其实有号和没有星号的区别不是很大,但有细微区别,这里我结合spring的源码简要分析有号和没有*号的的区别,有误的地方请指出。 classparth:只会从第一个classpath中加载,而classpath*:会从所有的classpath中加载如果要加载的资源,不在当前ClassLoader的路径里,那么如果
spring配置文件location引用外部文件
<!-- 数据库配置文件位置 --> <context:property-placeholder location="file:///D:/conf/config.properties"/>
Spring application.properties配置文件中变量之间引用
问题 利用application.properties配置文件定义变量,在编写代码时可利用Spring占位符可以很方面的使用, 如@Value注解。 但是在application.properties配置文件内部, 变量之间如何引用呢? 考虑一种场景: 我们定义多个日志文件的路径,除了日志名称不同,其他完全相同。 如下所示: # application.properties文件 # 日志...
spring配置文件中引用外部的properties文件方式
要在spring的xml中引用properties文件中定义的属性,比如配置数据源等需要修改的地方。 &lt;bean id="dataSource" class="${dataSource}"&gt; &lt;!-- 这些配置Spring在启动时会去conn.properties中找 --&gt; &lt;property name="driverClass" value="${driv...
引用配置文件
&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&amp;gt; &amp;lt;configuration&amp;gt;   &amp;lt;appSettings&amp;gt;     &amp;lt;add key=&quot;connString&quot; value =&quot; server=.;database=test;integrated security=true;&quot;/&amp;gt;  
Spring配置文件报错问题
项目中Spring的各种配置文件报错,在左边处显示红叉.问题一: 出现这种情况是标签头部有空格!. 问题二: 问题描述:配置文件傍边会报错,就是说找不到这个标签对应的约束等,spring-mvc.xml,spring-mybatis,applicationContext.xml等配置文件都会出现这样的错误. 查阅了网上的资料,说的各种解决方法,比如说是对应的约束jar包没有引入等等解决方案.但是我这
Spring 的配置文件的问题
我在service的配置文件中如下配置rnrn rn rn rn和rn rn这两种配置有什么不同?rn我的程序在两种情况下都能正常运行,没发现什么不同或者异常。rn我的Service类rnpublic class UserService implements IUserService rnrn private IUserDAO userDAO = null;rn rn public IUserDAO getUserDAO() rn return userDAO;rn rnrn public void setUserDAO(IUserDAO userDAO) rn this.userDAO = userDAO;rn rnrn
spring 配置文件拆分 问题
现在我只有一个spring文件,不知道把他分成2个会不会好点?谁能给我解释一下 一个spring 配置文件 与多个配置文件的区别。。rn如果需要将一个分成两个,要怎么分?
spring多配置文件问题
目录结构:rnsrc/main/resoures目录下有三个spring配置文件rnapplicationContext-actions.xml 这里面有:rnapplicationContext-beans.xml 这里面有: rnapplicationContext-dao.xml 这里面有:rnrnsrc/main/webapp/WBE-INF里有rnapplicationContext.xmlrnweb.xmlrnrnapplicationContext.xml里有一句:rnrn在MyEclipse中用tomcat发布时报错:rn[code=Java]rn2009-12-28 16:19:12 org.apache.catalina.core.ApplicationContext logrn信息: Initializing Spring root WebApplicationContextrn2009-12-28 16:19:12 org.springframework.web.context.ContextLoader initWebApplicationContextrn信息: Root WebApplicationContext: initialization startedrn2009-12-28 16:19:12 org.springframework.context.support.AbstractApplicationContext prepareRefreshrn信息: Refreshing org.springframework.web.context.support.XmlWebApplicationContext@1e78c96: display name [Root WebApplicationContext]; startup date [Mon Dec 28 16:19:12 CST 2009]; root of context hierarchyrn2009-12-28 16:19:12 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]rn2009-12-28 16:19:13 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitionsrn信息: Loading XML bean definitions from class path resource [applicationContext-actions.xml]rn2009-12-28 16:19:13 org.springframework.web.context.ContextLoader initWebApplicationContextrn严重: Context initialization failedrnorg.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:applicationContext-actions.xml]rnOffending resource: ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext-actions.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext-actions.xml] cannot be opened because it does not existrn at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)rn at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)rn at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:182)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseDefaultElement(DefaultBeanDefinitionDocumentReader.java:147)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:132)rn at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)rn at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)rn at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)rn at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)rn at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at rn[/code]
SPRING配置文件出错的问题
org.springframework.beans.factory.BeanDefinitionStoreException: Line 66 in XML document from file [D:\workspace\BlogOnline\src\applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Attribute "abstract" must be declared for element type "bean".rnorg.xml.sax.SAXParseException: Attribute "abstract" must be declared for element type "bean".rn at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)rn at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)rn at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)rn at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)rn at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)rn at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)rn at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)rn at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)rn at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)rn at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)rn at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)rn at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)rn at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)rn at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)rn at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)rn at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)rn at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:126)rn at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:125)rn at org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory(AbstractXmlApplicationContext.java:65)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:226)rn at org.springframework.context.support.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:60)rn at test.TestArticleWork.setUp(TestArticleWork.java:37)rn at junit.framework.TestCase.runBare(TestCase.java:125)rn at junit.framework.TestResult$1.protect(TestResult.java:106)rn at junit.framework.TestResult.runProtected(TestResult.java:124)rn at junit.framework.TestResult.run(TestResult.java:109)rn at junit.framework.TestCase.run(TestCase.java:118)rn at junit.framework.TestSuite.runTest(TestSuite.java:208)rn at junit.framework.TestSuite.run(TestSuite.java:203)rn at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)rnrnrn在配置文件中相关内容为:rn rn rn rn PROPAGATION_REQUIRED,readOnlyrn PROPAGATION_REQUIRED,readOnlyrn PROPAGATION_REQUIRED,-Exceptionrn PROPAGATION_REQUIRED,-Exceptionrn PROPAGATION_REQUIRED,-Exceptionrn rn rn rnrn他的意思大概是说abstract必须写在bean标签里面是吧,,我是这样的啊,不知道错在哪里了,请各位高手帮帮忙,看看到底哪里错了.
spring配置文件的问题
rnrnrnrnrnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrnrnrn rnrn rnrn rnrn rnrn rnrn org.hibernate.dialect.MySQLDialectrn rnrn truernrn updaternrn 20rnrn rnrn rnrn rnrn rnrn Hibernate/orm/Spring.hbm.xmlrnrn rnrn rnrn rnrnrnrn rnrn rnrn rnrn rnrnrnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn PROPAGATION_REQUIRED,readOnlyrn rnrn PROPAGATION_REQUIREDrnrn rnrn rnrn rnrnrnrn rnrn rnrn rnrn rnrn rnrn rnrn userrnrn rnrn rnrn rnrn rnrn rnrn rnrn rnrn transactionInterceptorrnrn rnrn rnrn rnrnrn rnrn rnrn rnrn rnrn rnrnrnrnrn错误是:Error creating bean with name 'user' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [Hibernate.Dao.UserDao]: Specified class is an interfacernrn顺便帮我通俗的讲解下bean中 id class property ref的含义,谢谢了。
spring配置文件applicationContext.xml问题
一、有问题的applicationContext.xml文件内容如下: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项目,配置文件中涉及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.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)rn at org.springframework.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 配置文件的问题
spring 配置文件的问题rn rninterface Daornrnabstract class SupporDao extends HibernateDaoSupport implements Daornrninterface ProductDao extends Daornrnclass ProductDaoImpl extends SupporDao implement ProductDaornrn 类和接口的关系大概这样rnrn在spring配置文件中 我已经配置好 sessionFactory 与 hibernateTempldate rnrn那么 以上的bean大概要怎么配置rnrn
Spring 配置文件问题
在配置Spring的配置文件时发现一个问题,我定义一个bean id为"beanA11",我另外一个类需要注入这个类就定义了一个property ref,属性name 为 "beanA",配置好后在调用这个需要注入的类时,一直获取不到注入的对象,后来把定义那个bean id设为和引用属性设置的名称相同时,能正常的注入,我又改名后确认是这个问题引起的.后来我在需要注入那个类加入如setBeanA11的方法后,也能正常注入,我的sessonFactory在定义时用不同的名称进行注入都未遇到这个问题,请各位帮忙解释下这个问题.rnrn注:需要注入的类是Struts 2的ACTION类,只继承了一个ActionSupportrnrnrnrn rn rn rnrnrnrnrnrn rn rn rn
spring配置文件的奇怪问题
简单的程序:rnrnrnrnrnrnrnrntest/sun/hibernate/BUser.hbm.xmlrnrnrn就是那句注释掉的,加上后就出现servlet not available错误rn明白的人请不吝赐教!rn
Spring的容器配置文件问题
spring reference4.2 21章有详细介绍,关于context的,网络上的一切关于spring mvc action类AOP失效,配置文件问题,都是源于这个,仔细阅读,茅塞顿开,恍然大悟。 It is also possible to have just one root context for single DispatcherServlet scenarios.也可
spring配置文件问题
哪位大哥帮帮忙rnrn帮我看一下 我的配置文件哪儿写错了 注入不了rnrnrnrnrn rn rn /WEB-INF/jdbc.properties rn rn rnrnrn rn rn $jdbc.driver rn rn rn $jdbc.url rn rn rn $jdbc.user rn rn rn $jdbc.password rn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn rn rn rn rn rn org/ethip/catalog/model/User.hbm.xmlrn rn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rnrn rn rn rn rn rnrn rn rn rn
Spring MVC 配置文件问题
application.xmlrn[code=Java]rnrn rn rn rn rn rn rn rn rn /WEB-INF/jdbc.propertiesrn rn rn rnrn rn rn rn $jdbc.driverrn rn rn $jdbc.urlrn rn rn $jdbc.userrn rn rn $jdbc.passwordrn rn rn $jdbc.minPoolSizern rn rn $jdbc.maxPoolSizern rn rn $jdbc.maxIdleTimern rn rn $jdbc.acquireIncrementrn rn rn rn $jdbc.acquireRetryAttemptsrn rn rn $jdbc.acquireRetryDelayrn rn rn $jdbc.testConnectionOnCheckinrn rn rn $jdbc.automaticTestTablern rn rn $jdbc.idleConnectionTestPeriodrn rn rn $jdbc.checkoutTimeoutrn rnrn rnrnrn rn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn rn rnrn truern org.hibernate.cache.EhCacheProviderrn falsern truernrn updatern truern truernrn rn rn rn rnrn rn rnrn rn rn rnrnrn rn rn rn rn rn rn rn rn rn rnrn[/code]rnrnrnrnrn rn rn rn rn自动注解后,Controller里面就包含了,所有页面的启动方法:类似下面的"/loginC" 或者"/" rn[code=Java] @RequestMapping(value = "/", method = RequestMethod.GET)rn String index() rn return "b_info_1";rn rnrn @RequestMapping(value = "/loginC", method = RequestMethod.GET)rn public String loginC() rn return "login";rn [/code]rn问题是:这么配置rnrn redirect.jsprn rn这个完全失效了。rn我现在启动首页 都启动不了, 只能是:http://localhost:8080/loginCrn我用glassfish_web.xml 配置了上下文根目录: /rn取消了项目名。rnrn但是想手动配置进入页面 就启用了。rnindex-servlet.xmlrn[code=Java]rnrn rnrn rn rn rn rn rn indexControllerrn rn rn rn rnrn rnrn rn rn rnrn[/code]rnrn部署项目是没问题的,但是上面的部署完全失效,想找到页面就得去Controller里面写方法。rn 本人刚刚毕业,这框架还是刚刚学习。rnrnrn
spring 获取配置文件问题
比如一个test.jsp页面,用户直接请求该页面, rn需要在该页面中获取到spring的service.xml中 rn定义的bean,该如何做呢? rn不能在页面中用new ClassPathXmlApplicationContext()的方法,因为这会导致 rnbean被重复初始化,是不是有方法可以直接从session中获得service。xml文件呢。n[b]问题补充:[/b]n我的写的 :evil: rn<%rn ApplicationContext ctx=WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());rn IpolicemanJqServie jqs=(IpolicemanJqServie)ctx.getBean("jq.jqService");rn System.out.print("jqs==ddd"+jqs.getjqSituation("8a89db6023034df00123081efd171903"));rn%>rn这样就行了恩,谢谢
关于spring配置文件的问题。
NaiveWaiter继承Waiter接口rn配置文件内容是:rnrnrnrnrn测试代码是:rnString configPath="com/baobaotao/aspectj/aspectj/AspectJProxyXML.xml";rnApplicationContext ctx=new ClassPathXmlApplicationContext(configPath);rnWaiter temp=(Waiter)ctx.getBean("waiter");rnrn为什么测试代码的第三行一定要返回Waiter类型呢? 为什么不能用NaiveWaiter类型。rn而且Waiter类型不是一个接口嘛?
spring配置文件的注入问题
求解:rn这样写的时候没有错rn[code=XML]rn rn rn rn rn[/code]rnrn这样写报错了:rn[code=XML] rn rn rn rn rn rn rn[/code]rnrn[color=#FF0000]org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'organuserServices' defined in ServletContext resource [/WEB-INF/classes/dataAccessContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [java.util.ArrayList] to required type [com.core.DAO.EntityDao] for property 'entityDao'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [java.util.ArrayList] to required type [com.core.DAO.EntityDao] for property 'entityDao': no matching editors or conversion strategy found[/color]
关于Spring配置文件的问题
我是新手,在做实现增删改查的功能的模块,spring文件有问题,大家帮看看,小女感激不尽!rnapplicationContext.xmlrn[code=Java]rn rn rn rn rn rn rn rn rn rn rn rn rn rn[/code]rn错误如下:rn[code=Java]2012-4-12 9:48:30 org.apache.catalina.core.StandardContext listenerStartrn严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerrnorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'UserManagerDao' defined in class path resource [applicationContext-zsptest.xml]: Cannot resolve reference to bean 'zsptest' while setting bean property 'zsptest'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'zsptest': org.springframework.beans.factory.FactoryBeanNotInitializedException: Cannot determine target class for proxyrn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)rn at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)rn at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)rn at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)rn at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)rn at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)rn at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)rn at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)rn at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)rn at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)rn at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)rn at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)rn at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)rn at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)rn at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)rn at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498)rn at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)rn at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)rn at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)rn at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)rn at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)rn at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)rn at org.apache.catalina.core.StandardService.start(StandardService.java:516)rn at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)rn at org.apache.catalina.startup.Catalina.start(Catalina.java:593)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:289)rn at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)rnCaused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'zsptest': org.springframework.beans.factory.FactoryBeanNotInitializedException: Cannot determine target class for proxyrn at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:124)rn at java.security.AccessController.doPrivileged(Native Method)rn at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116)rn at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1288)rn at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:217)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)rn at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)rn at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)rn ... 42 morern2012-4-12 9:48:30 org.apache.catalina.core.StandardContext startrn严重: Error listenerStartrn[/code][code=Java]package com.experiment.Dao.DapImpl;rnimport ...;rnpublic class UserManagerDaoImpl implements UserManagerDao rn private SessionFactory sessionFactory ;rn private HibernateTemplate hibernateTemplate = null; rn public void setSessionFactory(SessionFactory sessionFactory) rn this.sessionFactory = sessionFactory ;rn rn public SessionFactory getSessionFactory() rn return this.sessionFactory ;rn rn public HibernateTemplate getHibernateTemplate()rnrn rn if (hibernateTemplate == null)rnrn hibernateTemplate = new HibernateTemplate(sessionFactory);rnrn rn return hibernateTemplate;rnrn rn public void add(UserInfo user) rnrn this.getHibernateTemplate().save( user) ;rn rnrn public UserInfo getUserInfo(String id) rnrn return (UserInfo) this.getHibernateTemplate().get(UserInfo.class, id) ;rn rnrn @SuppressWarnings("unchecked")rn public List getUserInfos() rn rn return this.getHibernateTemplate().find("from USERTABLE order by id" ) ;rn rnrn public void delete(String id) rnrn this.getHibernateTemplate().delete(this.getUserInfo(id)) ;rn rnrn public void saveOrUpdate(UserInfo user) rnrn this.getHibernateTemplate().saveOrUpdate(user) ;rn rnrn @SuppressWarnings("unchecked")rn public List getUserInfo(String account, String name) rnrn Object values[] =account, name ;rn System.out.println("查询的结果是:"+ account + " "+ name) ;rn return this.getHibernateTemplate().find("from USERTABLE e where e.account=? and e.name=? order by id", values) ;rn rn rn @Overridern public String query() rn // TODO Auto-generated method stubrn DefaultBeanFactory.getBean("");rn return null;rn rn[/code]
Spring多配置文件的问题
想把Spring的配置文件按照业务分成几个配置文件。如:rn--applicationContext.xml---rn |rn |rn foldA ---rn |rn |--- applicationContextAA.xmlrn |rn |--- applicationContextBB.xmlrn请问该如何配置?rn是否要在applicationContext.xml中写上foldA/applicationContextAA.xml和foldA/applicationContextBB.xml的地址? rn
Spring配置文件的问题
提示错误 :rnException in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.lfw.sh.manager.impl.UserManagerImpl#10b4b2f' defined in class path resource [applicationContext-commom.xml]: Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is requiredrnjava.lang.IllegalArgumentException: sessionFactory or hibernateTemplate is requiredrnrnSpring配置文件如下:rnrnrn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn rn org.hibernate.dialect.MySQLDialectrn rn rn truern rn rn rn rn rn com/lfw/sh/domin/User.hbm.xmlrn rn rn rn rn rn rn rn rnrn rn rn rn rn rn rn rn PROPAGATION_REQUIRED,readOnlyrn PROPAGATION_REQUIRED,readOnlyrn PROPAGATION_REQUIRED,readOnlyrn PROPAGATION_REQUIREDrn PROPAGATION_REQUIREDrn PROPAGATION_REQUIRED,ISOLATION_SERIALIZABLErn PROPAGATION_REQUIREDrn PROPAGATION_REQUIREDrn rn rn rnrn rn rn rn rn rn rn rn rn rn rn rn我明明已经注入了sessionFactory了呀,怎么还是提示找不到的?n[b]问题补充:[/b]nUserManagerImpl类已经继承了HibernateDaoSupport类
jar包引用外部配置文件问题
由于最近需要把项目打包部署到线上服务,之前的2G接入平台启动是要读取配置文件的,在idea启动服务时只需要配置读取文件地址即可,但是打成jar包后在读取外部配置文件就成了一个难题 于是上网找了部分资料,发现可以通过命令执行读取配置文件 windows启动jar包读取配置文件 java -jar -Dconfig=配置文件绝对路径 jar包.jar liunx启动jar包读取配置文件 nohup...
spring的jar包引用问题
新建一个动态网站,导入了一个spring的jar包:spring-web.jar;rn添加类test.java,此类继承了spring-web.jar下面的一个类:org.springframework.remoting.jaxrpc.ServletEndpointSupport;rnrn代码如下:rn[code="java"]rnimport org.springframework.remoting.jaxrpc.ServletEndpointSupport;rnrnpublic class test extends ServletEndpointSupport rnrnrn[/code]rnrn问题:第二图片中的错误提示中说到的 javax.xml.rpc.server.ServiceLifecycle是个什么东西,我没用到它啊。rnrn网上查了一下,都说重新引入JRE,试了一下还是不行。rnrnrnspring版本2.5.6;rnjre版本:jre7;
关于spring配置文件引用properties文件报错的问题,求助
引用的时候报错无法解决占位符的问题。rn[img=https://img-bbs.csdn.net/upload/201801/15/1515979398_92625.png][/img]rn[img=https://img-bbs.csdn.net/upload/201801/15/1515979311_815290.png][/img]rn[img=https://img-bbs.csdn.net/upload/201801/15/1515979468_849196.png][/img]rn网上也搜了 spring用的2.5.6 然后也写了 rn但是依旧还是报错占位符的问题。有没有大神可以帮助一下
spring boot整合shiro引用配置文件配置是出现的问题
Spring boot 整合shiro 使用yml配置文件     最近自己玩一下springBoot配置 然后整合一下常用的框架,遇到一个问题。配置LifecycleBeanPostProcessor Bean 的时候总是先于spring 读取yml文件。导致配置失败 @Bean(name = "shiroEhcacheManager") public EhCacheMan
请教大家一个关于Spring 多配置文件互相引用问题???
我在spring.xml中定义了1个datasourcern我要在spring_a.xml中直接使用这个datasource,该怎么写???
【Spring】Spring配置文件
1.设置别名 Beans.xml Beans.xml
Spring杂记之--Spring配置文件
Spring配置文件格式如下 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/bean
spring配置文件
spring框架的配置文件,搭建spring框架时候的配置文件
spring 配置文件
spring 配置文件
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法