新手,第一次发帖,接触JAVAWEB一个半月。eclipse用的够呛,基本是自学阶段。
问题:tomcat可以启动,程序加载不了!
我的操作:有一个搭好的SSH框架,我填完代码,启动tomcat,运行工程,成功。关闭tomcat,关闭这个工程。然后我想实现另外的一个功能,就复制这个工程,在里面改代码,启动tomcat,运行工程,出错。出错代码:2011-6-3 9:26:03 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.BeanCreationException: Error creating bean with name 'specimenManagerAction': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'specimenManagerService': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'specimenManagerDao': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/config/spring-main.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/config/spring-main.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: persistent class not known: jky.culicidae.specimen.pojo.Student
问题:tomcat可以启动,程序加载不了!
我的操作:有一个搭好的SSH框架,我填完代码,启动tomcat,运行工程,成功。关闭tomcat,关闭这个工程。然后我想实现另外的一个功能,就复制这个工程,在里面改代码,启动tomcat,运行工程,出错。出错代码:2011-6-3 9:26:03 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.BeanCreationException: Error creating bean with name 'specimenManagerAction': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'specimenManagerService': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'specimenManagerDao': Injection of resource methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/config/spring-main.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/config/spring-main.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: persistent class not known: jky.culicidae.specimen.pojo.Student
解决方案 »
- 求大家一个问题 急急急
- 求教一个简单的Javascript程序
- 谁做过把整个检索的结果集生成一个有格式的文件,并把这个文件发送邮件?
- 一个JSP网页求和问题
- 高手们,一个棘手的问题(关于post)通常你们是怎么解决的?
- 简单问题:那个国外很有名的开源web项目叫什么(hibernate+struts的)?回答了立刻揭帖...
- 在英文版WIN2K Pro里,Tomcat5.5怎样让jsp页面缺省用中文显示呢?
- 执行完一个页面后返回原来的页面
- 能否介绍几个JSP的技术群?
- 有谁愿意把tomcat\bin\下的startup.bat这个文件用的东西用记事本打开!在线wait..
- IE6 innerHTML问题。
- 一张图片地址连接N次tomcat
我比较感慨啊,才一个月自学就开始SSH了。。牛人
还有persistent class not known: jky.culicidae.specimen.pojo.Student
看看hibernate的配置文件配置是否正确...
<context-param>
<param-name>contextConfigLocation</param-name>
<!-- <param-value>classpath:beans.xml</param-value> -->
<param-value>/WEB-INF/config/spring-main.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- log4j -->
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>microblog.root</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/config/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener>
<!-- struts2 configuration -->
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>config</param-name>
<param-value>struts-default.xml,struts-plugin.xml,struts.xml</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
我检查了下spring 的jar 包也都在,因为我是拷贝的工程。这是出错的下半段代码
2011-6-3 10:33:58 org.apache.catalina.core.ApplicationContext log
信息: Set web app root system property: 'microblog.root' = [C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\kayxmjxxxt\]
2011-6-3 10:33:58 org.apache.catalina.core.ApplicationContext log
信息: Initializing log4j from [C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\kayxmjxxxt\WEB-INF\config\log4j.properties]
log4j:WARN No such property [sqlname] in org.apache.log4j.jdbc.JDBCAppender.
2011-6-3 10:33:58 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2011-6-3 10:33:58 org.apache.catalina.core.StandardContext start
严重: Context [/kayxmjxxxt] startup failed due to previous errors
2011-6-3 10:33:58 org.apache.catalina.core.ApplicationContext log
信息: Shutting down log4j
2011-6-3 10:33:58 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2011-6-3 10:34:00 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2011-6-3 10:34:00 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2011-6-3 10:34:00 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/78 config=null
2011-6-3 10:34:00 org.apache.catalina.startup.Catalina start
信息: Server startup in 18857 ms
问题大概就出在拷贝的工程的身上。这个问题我想大概可能还得去弄明白Spring的监听原理。郁闷!还有我的学习方法是不是有问题啊?
我是先能填action了,在看深层次的东西,还是看完原理再写代码?哎纠结。不过还是要谢谢大家。