2007-10-30
struts2+spring配置后bean加载,bean为什么会初始化2次
关键字: struts,spring,hiberante
下面是我的服务器出错情况:
15:53:02,546 INFO [XmlWebApplicationContext] Bean factory for application conte
xt [org.springframework.web.context.support.XmlWebApplicationContext@18c56d]: or
g.springframework.beans.factory.support.DefaultListableBeanFactory@16921fd
15:53:03,125 INFO [PropertyPlaceholderConfigurer] Loading properties file from
ServletContext resource [/WEB-INF/hibernate.properties]
15:53:03,250 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@16921fd: de
fining beans [propertyConfigurer,messageSource,dataSource,jdbcTemplate,sessionFa
ctory,transactionManager,baseTxProxy,UserActionBean,UserDAOBean,UserHelperImplBe
an]; root of factory hierarchy
15:53:04,062 INFO [LocalSessionFactoryBean] Building new Hibernate SessionFacto
ry
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@cbdb20)
LogAbandoned: true
RemoveAbandoned: true
RemoveAbandonedTimeout: 60
15:53:05,296 WARN [Configurator ] No configuration found. Configuring eh
cache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/dist/easou_
ssh/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
15:53:05,671 INFO [HibernateTransactionManager] Using DataSource [org.apache.co
mmons.dbcp.BasicDataSource@32060c] of Hibernate SessionFactory for HibernateTran
sactionManager
15:53:05,671 INFO [ContextLoader ] Root WebApplicationContext: initializa
tion completed in 4328 ms
15:53:06,281 INFO [XmlConfigurationProvider] Parsing configuration file [struts
-default.xml]
15:53:06,812 INFO [XmlConfigurationProvider] Parsing configuration file [struts
-plugin.xml]
15:53:06,843 INFO [XmlConfigurationProvider] Parsing configuration file [struts
.xml]
15:53:07,171 INFO [StrutsSpringObjectFactory] Initializing Struts-Spring integr
ation...
15:53:07,171 INFO [SpringObjectFactory ] Setting autowire strategy to name
15:53:07,171 INFO [StrutsSpringObjectFactory] ... initialized Struts-Spring int
egration successfully15:53:09,015 INFO [XmlConfigurationProvider] Unable to verify action class [Use
rActionBean] exists at initialization15:53:09,046 INFO [ObjectTypeDeterminerFactory] Setting DefaultObjectTypeDeterm
iner as default ...
[15:53:09.484] WebApp[http://localhost:80/resin-doc] starting
15:53:02,546 INFO [XmlWebApplicationContext] Bean factory for application conte
xt [org.springframework.web.context.support.XmlWebApplicationContext@18c56d]: or
g.springframework.beans.factory.support.DefaultListableBeanFactory@16921fd
15:53:03,125 INFO [PropertyPlaceholderConfigurer] Loading properties file from
ServletContext resource [/WEB-INF/hibernate.properties]
15:53:03,250 INFO [DefaultListableBeanFactory] Pre-instantiating singletons in
org.springframework.beans.factory.support.DefaultListableBeanFactory@16921fd: de
fining beans [propertyConfigurer,messageSource,dataSource,jdbcTemplate,sessionFa
ctory,transactionManager,baseTxProxy,UserActionBean,UserDAOBean,UserHelperImplBe
an]; root of factory hierarchy
15:53:04,062 INFO [LocalSessionFactoryBean] Building new Hibernate SessionFacto
ry
AbandonedObjectPool is used (org.apache.commons.dbcp.AbandonedObjectPool@cbdb20)
LogAbandoned: true
RemoveAbandoned: true
RemoveAbandonedTimeout: 60
15:53:05,296 WARN [Configurator ] No configuration found. Configuring eh
cache from ehcache-failsafe.xml found in the classpath: jar:file:/E:/dist/easou_
ssh/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
15:53:05,671 INFO [HibernateTransactionManager] Using DataSource [org.apache.co
mmons.dbcp.BasicDataSource@32060c] of Hibernate SessionFactory for HibernateTran
sactionManager
15:53:05,671 INFO [ContextLoader ] Root WebApplicationContext: initializa
tion completed in 4328 ms
15:53:06,281 INFO [XmlConfigurationProvider] Parsing configuration file [struts
-default.xml]
15:53:06,812 INFO [XmlConfigurationProvider] Parsing configuration file [struts
-plugin.xml]
15:53:06,843 INFO [XmlConfigurationProvider] Parsing configuration file [struts
.xml]
15:53:07,171 INFO [StrutsSpringObjectFactory] Initializing Struts-Spring integr
ation...
15:53:07,171 INFO [SpringObjectFactory ] Setting autowire strategy to name
15:53:07,171 INFO [StrutsSpringObjectFactory] ... initialized Struts-Spring int
egration successfully15:53:09,015 INFO [XmlConfigurationProvider] Unable to verify action class [Use
rActionBean] exists at initialization15:53:09,046 INFO [ObjectTypeDeterminerFactory] Setting DefaultObjectTypeDeterm
iner as default ...
[15:53:09.484] WebApp[http://localhost:80/resin-doc] starting
- 16:13
- 浏览 (345)
- 论坛浏览 (614)
- 评论 (2)
- 相关推荐
评论
相关配置文件
web.xml
<display-name>spring hibernate webwork framework</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml,classpath*:META-INF/spring-beans.xml</param-value>
</context-param>
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>*.do</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.do</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>
web.xml
<display-name>spring hibernate webwork framework</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml,classpath*:META-INF/spring-beans.xml</param-value>
</context-param>
<filter>
<filter-name>struts-cleanup</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ActionContextCleanUp
</filter-class>
</filter>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts-cleanup</filter-name>
<url-pattern>*.do</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.do</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>
我配置了一个UserActionBean,
<bean name="UserActionBean" class="com.test.modules.user.action.UserAction" singleton="false">
<property name="userHelper">
<ref bean="UserHelperImplBean"/>
</property>
</bean>
web.xml加载后UserActionBean初始化成功,可是到下面的action中要用时,就报找不到action了,检查了几天都没找到准确原因,大家认为可能是哪个环节出错了啊?
<bean name="UserActionBean" class="com.test.modules.user.action.UserAction" singleton="false">
<property name="userHelper">
<ref bean="UserHelperImplBean"/>
</property>
</bean>
web.xml加载后UserActionBean初始化成功,可是到下面的action中要用时,就报找不到action了,检查了几天都没找到准确原因,大家认为可能是哪个环节出错了啊?
发表评论
该博客是同时发布到论坛的,无法评论在论坛已被锁定的帖子
最近加入圈子
最新评论
-
struts2+spring配置后bean ...
相关配置文件 web.xml <display-name>spring ...
-- by geniuslph -
struts2+spring配置后bean ...
我配置了一个UserActionBean, <bean name="Use ...
-- by geniuslph







评论排行榜