eclipse Java项目访问、发布出现问题,输入地址找不到资源页面不显示

星辰_mya 2017-01-16 10:55:25
10:41:32,458 ERROR ContextLoader:307 - Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean name 'userDao' is already used in this <beans> element
Offending resource: class path resource [applicationContext.xml]

一月 16, 2017 10:41:32 上午 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean name 'userDao' is already used in this <beans> element
Offending resource: class path resource [applicationContext.xml]


严重: Error listenerStart
一月 16, 2017 10:41:32 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/Shop] startup failed due to previous errors
一月 16, 2017 10:41:32 上午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
10:41:32,466 INFO XmlWebApplicationContext:1042 - Closing Root WebApplicationContext: startup date [Mon Jan 16 10:41:31 CST 2017]; root of context hierarchy
10:41:32,470 WARN XmlWebApplicationContext:1052 - Exception thrown from ApplicationListener handling ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Mon Jan 16 10:41:31 CST 2017]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347)

10:41:32,471 WARN XmlWebApplicationContext:1060 - Exception thrown from LifecycleProcessor on context close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Mon Jan 16 10:41:31 CST 2017]; root of context hierarchy
at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)

严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:172)

...全文
611 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
星辰_mya 2017-01-17
  • 打赏
  • 举报
回复
不行,上面的错误是启动tomcat server时的,打开页面之前的就有的,应该对页面有影响吧
星辰_mya 2017-01-17
  • 打赏
  • 举报
回复
您能说一下这是什么原理,为什么吗?问题显示的应该是配置文件的问题;Bean name 'userDao' is already used in this <beans> element Offending resource: class path resource [applicationContext.xml] 这个是什么意思,我看了一下没有used吧?
星辰_mya 2017-01-17
  • 打赏
  • 举报
回复
是我的Tomcat没有弄好,重装了一下,这些问题消失了;不过出现了新的问题,查了一下大概是端口被占用;
星辰_mya 2017-01-17
  • 打赏
  • 举报
回复
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> <!-- 配置连接池: --> <!-- 引入外部属性文件 --> <context:property-placeholder location="classpath:jdbc.properties"/> <!-- 配置C3P0连接池: --> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${jdbc.driver}"/> <property name="jdbcUrl" value="${jdbc.url}"/> <property name="user" value="${jdbc.user}"/> <property name="password" value="${jdbc.password}"/> </bean> <!-- Hibernate的相关信息 --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <!-- 注入连接池 --> <property name="dataSource" ref="dataSource"/> <!-- 配置Hibernate的其他的属性 --> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.format_sql">true</prop> <prop key="hibernate.connection.autocommit">false</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> </props> </property> <!-- 配置Hibernate的映射文件 --> <property name="mappingResources"> <list> <value>cn/itcast/shop/user/vo/User.hbm.xml</value> </list> </property> </bean> <!-- 事务管理: --> <!-- 事务管理器 --> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- 开启注解事务 --> <tx:annotation-driven transaction-manager="transactionManager"/> <!-- Action的配置 ===================================================--> <!-- 首页访问的Action --> <bean id="indexAction" class="cn.itcast.shop.index.action.IndexAction" scope="prototype"> </bean> <!-- 配置验证码Action --> <bean id="checkImgAction" class="cn.itcast.shop.user.action.CheckImgAction" scope="prototype"> </bean> <!-- 用户模块的action --> <bean id="userAction" class="cn.itcast.shop.user.action.UserAction" scope="prototype"> <!-- 注入service --> <property name="userService" ref="userService"/> </bean> <!-- service配置===================================================== --> <bean id="userDao" class="cn.itcast.shop.user.dao.UserDao"> </bean> <!-- Service的配置 ===========================--> <bean id="userService" class="cn.itcast.shop.user.service.UserService"> <property name="userDao" ref="userDao"/> </bean> <!-- Dao的配置 ===========================--> <bean id="userDao" class="cn.itcast.shop.user.dao.UserDao"> <property name="sessionFactory" ref="sessionFactory"/> </bean> </beans>
  • 打赏
  • 举报
回复
配置文件贴出来看看
  • 打赏
  • 举报
回复
地址中去掉一个/试试能访问不能
星辰_mya 2017-01-16
  • 打赏
  • 举报
回复
第一发帖,多多关照
星辰_mya 2017-01-16
  • 打赏
  • 举报
回复

58,452

社区成员

发帖
与我相关
我的任务
社区描述
Java Eclipse
社区管理员
  • Eclipse
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧