SSH集成,报错,请指点
    我是用myeclipse6.6先引入struts1.3,然后是spring2.0,最后是Hibernate3.2的,让myeclipse把 hibernate配置文件删除,把hibernate的配置信息写在spring的applicationContext.xml中,我配置了 sessionFactory和dataSource,最开始报错,我上网上查要删除asm.jar这个包,还是不好使,我就又看一篇文章,要删除 asm.jar,asm-attrs.jar,cglib-2.1.3.jar,我都删了,就好使了,我就传到svn上了,我剪出下来就好使,可我同事一剪出下来发布到tomcat6.0上就报这个错(但她只要改项目中的任何一个文件,做一点改动,就好使了,每回剪出后都要这样,同事和我的myeclipse和svn得版本都相同,这是为什么啊,请各位大哥大姐帮我研究一下,很着急呀!!!)

严重: 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 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [com/transport/aviation/model/Aviation.hbm.xml] cannot be opened because it does not exist
Caused by: java.io.FileNotFoundException: class path resource [com/transport/aviation/model/Aviation.hbm.xml] cannot be opened because it does not exist
at org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:135)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:656)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:285)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:189)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
2009-8-26 10:43:55 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2009-8-26 10:43:55 org.apache.catalina.core.StandardContext start
严重: Context [/transport] startup failed due to previous errors
2009-8-26 10:43:55 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2009-8-26 10:43:55 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8090
2009-8-26 10:43:55 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-8-26 10:43:55 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/47 config=null
2009-8-26 10:43:55 org.apache.catalina.startup.Catalina start
信息: Server startup in 20271 ms

补充问题,在svn中我剪出她的和我的都好使,然后发布到tomcat上都好使,她剪出她自己的和我的在她机器上必须改点东西才好使,不管改什么都好使,不改就是不行,我俩不但myeclipse,svn版本一样机器都是一样的

7个回答

LZ看一下发不到Tomcat时有没有这个文件:

com/transport/aviation/model/Aviation.hbm.xml

因为你改了项目中的东西,Myeclipse会自动传输的。

编译问题。

工程右键properties-->java compiler 看下用哪个jdk编译的

java.io.FileNotFoundException: class path resource [com/transport/aviation/model/Aviation.hbm.xml] cannot be opened because it does not exist

没有更新到这些文件嘛,找不到文件呢

org.springframework.beans.factory.BeanCreationException: [color=red]Error creating bean with name 'sessionFactory'[/color] defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is [color=red]java.io.FileNotFoundException: class path resource [com/transport/aviation/model/Aviation.hbm.xml[/color]] cannot be opened because it does not exist

[size=medium]通过上面的异常,可以发现'sessionFactory'没有创建成功,没有成功的主要原因是找不到com/transport/aviation/model/Aviation.hbm.xml配置文件,

楼主检查一下你的这个配置文件路径是否正确,配置文件一定要放在com/transport/aviation/model目录下。[/size]

文件名称一定要和你的配置文件中的名称一致

jar包的问题,

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问