ssh配置error

tomcat启动时包了这样的错误

ERROR [org.springframework.web.context.ContextLoader] - <context initialization="" failed="">

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)

at javax.servlet.GenericServlet.init(GenericServlet.java:211)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

... 40 more

2008-09-15 11:13:02,694 INFO [org.apache.struts.action.ActionServlet] - <loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml="">

2008-09-15 11:13:03,882 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - <contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started="">

2008-09-15 11:13:03,898 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - <context initialization="" failed="">

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)

at javax.servlet.GenericServlet.init(GenericServlet.java:211)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

... 40 more

我的applicationContext.xml是这样配置的

<bean id="dataSource" <br="">class="org.springframework.jndi.JndiObjectFactoryBean">

<property name="jndiName" value="java:comp/env/jdbc/mldn"></property>

</bean>

<bean id="sessionFactory" <br="">class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="dataSource">

<ref bean="dataSource">

</property>

<property name="hibernateProperties">

<props>

<prop key="hibernate.dialect">

org.hibernate.dialect.MySQLDialect

</prop>

<prop key="hibernate.show_sql">true</prop>

<prop key="hibernate.autocommit">true</prop>

</props>

</property>

<property name="mappingResources">

<list>

<value>com/db/mznt/vo/TUser.hbm.xml</value>

</list>

</property>

</bean>

<bean id="hibernateTemplate" <br="">class="org.springframework.orm.hibernate3.HibernateTemplate">

<property name="sessionFactory">

<ref bean="sessionFactory">

</property>

</bean>

<bean id="t_userdao" class="com.db.mznt.dao.t_userDAO" <br="">abstract="true">

</bean>

<bean id="t_userdaoimpl" class="com.db.mznt.daoimpl.t_userDAOImpl" <br="">parent="t_userdao">

<property name="hibernateTemplate">

<ref bean="hibernateTemplate">

</property>

</bean>

<bean name="/jsp/user" <br="">class="com.db.mznt.struts.action.UserAction">

<property name="t_userdao">

<ref bean="t_userdaoimpl">

</property>

</bean>

</beans>
问题补充:
我在web.xml中是这样啊应该没错啊

<context-param>

<param-name>contxtConfigLocation</param-name>

<param-value>

/WEB-INF/classes/applicationContext.xml

</param-value>

</context-param>

<servlet>

<servlet-name>context</servlet-name>

<servlet-class>

org.springframework.web.context.ContextLoaderServlet

</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>
问题补充:
做了和原来一样错误
问题补充:
我是这样写的啊

<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
问题补充:
我是这样写的没错啊

但不知道为什么报错时说我写的是/WEB-INF/applicationContext.xml

其实我一直是这样写的

<context-param>

<param-name>contxtConfigLocation</param-name>

<param-value>

/WEB-INF/classes/applicationContext.xml

</param-value>

</context-param>

<servlet>

<servlet-name>context</servlet-name>

<servlet-class>

org.springframework.web.context.ContextLoaderServlet

</servlet-class>

<load-on-startup>1</load-on-startup>
问题补充:
我是按你说的那样做的

就是包的这个错误

不知道是不是其他别的地方的错误
问题补充:
按你说的做了

结果是

ERROR [org.springframework.web.context.ContextLoader] - <context initialization="" failed="">

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans".

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)

at javax.servlet.GenericServlet.init(GenericServlet.java:211)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

Caused by: org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans".

at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)

... 41 more

2008-09-15 16:19:03,468 INFO [org.apache.struts.action.ActionServlet] - <loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml="">

2008-09-15 16:19:04,625 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - <contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started="">

2008-09-15 16:19:04,640 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - <context initialization="" failed="">

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans".

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)

at javax.servlet.GenericServlet.init(GenericServlet.java:211)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

Caused by: org.xml.sax.SAXParseException: Document root element "bean", must match DOCTYPE root "beans".

at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)

at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)

at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)

at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)

at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)

at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)

... 41 more

2008-09-15 16:19:04,656 WARN [org.apache.struts.util.PropertyMessageResources] - < Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.>

2008-09-15 16:19:04,656 WARN [org.apache.struts.util.PropertyMessageResources] - < Resource org/apache/struts/action/ActionResources_zh.properties Not Found.>

2008-9-15 16:19:04 org.apache.catalina.core.StandardHostDeployer install
问题补充:
全部是meeclipse自动运行配置的我只补充了部分内容
问题补充:
我配置了问题任然存在
问题补充:
刚才这个beans的问题是我刚才该了东西该错了
问题补充:
这是现在的错误

ERROR [org.springframework.web.context.ContextLoader] - <context initialization="" failed="">

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)

at javax.servlet.GenericServlet.init(GenericServlet.java:211)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

... 40 more

2008-09-15 16:43:26,453 INFO [org.apache.struts.action.ActionServlet] - <loading chain="" catalog="" from="" jar:file:="" c:="" program%20files="" apache%20software%20foundation="" tomcat%205.0="" webapps="" mzntdemo="" web-inf="" lib="" struts-core-1.3.8.jar!="" org="" apache="" struts="" chain="" chain-config.xml="">

2008-09-15 16:43:27,921 INFO [org.springframework.web.struts.ContextLoaderPlugIn] - <contextloaderplugin for="" struts="" actionservlet="" 'action,="" module="" '':="" initialization="" started="">

2008-09-15 16:43:27,937 ERROR [org.springframework.web.struts.ContextLoaderPlugIn] - <context initialization="" failed="">

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:349)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124)

at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:92)

at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)

at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)

at org.springframework.web.context.ContextLoaderServlet.init(ContextLoaderServlet.java:81)

at javax.servlet.GenericServlet.init(GenericServlet.java:211)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)

at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)

at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)

at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:277)

at org.apache.catalina.core.StandardHost.install(StandardHost.java:832)

at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:701)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:432)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:983)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:349)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1091)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)

at org.apache.catalina.core.StandardService.start(StandardService.java:480)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)

at org.apache.catalina.startup.Catalina.start(Catalina.java:556)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)

Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116)

at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

... 40 more

2008-09-15 16:43:27,937 WARN [org.apache.struts.util.PropertyMessageResources] - < Resource org/apache/struts/action/ActionResources_zh_CN.properties Not Found.>

2008-09-15 16:43:27,937 WARN [org.apache.struts.util.PropertyMessageResources] - < Resource org/apache/struts/action/ActionResources_zh.properties Not Found.>

2008-9-15 16:43:27 org.apache.catalina.core.StandardHostDeployer install
问题补充:
这是我的web.xml



<web-app xmlns="http://java.sun.com/xml/ns/j2ee" <br=""> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"

xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

<filter>

<filter-name>encoding</filter-name>

<filter-class>com.db.mznt.filter.EncodingFilter</filter-class>

<init-param>

<param-name>charset</param-name>

<param-value>utf-8</param-value>

</init-param>

</filter>

<filter-mapping>

<filter-name>encoding</filter-name>

<url-pattern>/*</url-pattern>

</filter-mapping>

<context-param>

<param-name>contxtConfigLocation</param-name>

<param-value>

/WEB-INF/classes/applicationContext.xml

</param-value>

</context-param>

<context-param>

<param-name>log4jConfigLocation</param-name>

<param-value>/WEB-INF/classes/log4j.properties</param-value>

</context-param>

<servlet>

<servlet-name>context</servlet-name>

<servlet-class>

org.springframework.web.context.ContextLoaderServlet

</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

<servlet>

<servlet-name>action</servlet-name>

<servlet-class>

org.apache.struts.action.ActionServlet

</servlet-class>

<init-param>

<param-name>config</param-name>

<param-value>/WEB-INF/struts-config.xml</param-value>

</init-param>

<init-param>

<param-name>debug</param-name>

<param-value>3</param-value>

</init-param>

<init-param>

<param-name>detail</param-name>

<param-value>3</param-value>

</init-param>

<load-on-startup>0</load-on-startup>

</servlet>

<servlet-mapping>

<servlet-name>action</servlet-name>

<url-pattern>*.do</url-pattern>

</servlet-mapping>

<welcome-file-list>

<welcome-file>jsp/register.jsp</welcome-file>

</welcome-file-list>

</web-app>




问题补充:
这是我的applicationContext.xml



<beans xmlns="http://www.springframework.org/schema/beans" <br=""> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">





<bean id="dataSource" <br=""> class="org.springframework.jndi.JndiObjectFactoryBean">

<property name="jndiName" value="java:comp/env/jdbc/mldn"></property>

</bean>

<bean id="sessionFactory" <br=""> class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

<property name="dataSource">

<ref bean="dataSource">

</property>

<property name="hibernateProperties">

<props>

<prop key="hibernate.dialect">

org.hibernate.dialect.MySQLDialect

</prop>

<prop key="hibernate.show_sql">true</prop>

<prop key="hibernate.connection.autocommit">true</prop>

</props>

</property>

<property name="mappingResources">

<list>

<value>com/db/mznt/vo/TUser.hbm.xml</value>

</list>

</property>

</bean>

<bean id="hibernateTemplate" <br=""> class="org.springframework.orm.hibernate3.HibernateTemplate">

<property name="sessionFactory">

<ref bean="sessionFactory">

</property>

</bean>

<bean id="t_userdao" class="com.db.mznt.dao.t_userDAO" <br=""> abstract="true">

</bean>

<bean id="t_userdaoimpl" class="com.db.mznt.daoimpl.t_userDAOImpl" <br=""> parent="t_userdao">

<property name="hibernateTemplate">

<ref bean="hibernateTemplate">

</property>

</bean>

<bean name="/jsp/user" <br=""> class="com.db.mznt.struts.action.UserAction">

<property name="t_userdao">

<ref bean="t_userdaoimpl">

</property>

</bean>

</beans>
问题补充:
这是我的struts-config.xml







<struts-config>

<form-beans>

<form-bean name="userForm" <br=""> type="com.db.mznt.struts.form.UserForm" />



</form-beans>



<global-exceptions>

<global-forwards>

<action-mappings>

<action attribute="userForm" input="/jsp/errors.jsp" <br=""> name="userForm" parameter="status" path="/jsp/user" scope="request"

type="com.db.mznt.struts.action.UserAction">

<forward name="registersuccess" <br=""> path="/jsp/registerSuccess.jsp">

</forward>

<forward name="registerfalure" path="/jsp/register.jsp"></forward>

</action>



</action-mappings>



<controller <br=""> processorClass="org.springframework.web.struts.DelegatingRequestProcessor">

</controller>

<message-resources <br=""> parameter="com.db.mznt.struts.ApplicationResources" />

<plug-in <br=""> className="org.springframework.web.struts.ContextLoaderPlugIn">

<set-property property="contxtConfigLocation" <br=""> value="/WEB-INF/classes/applicationContext.xml" />

</plug-in>



</struts-config>




问题补充:
改了还是包那个错
问题补充:
都该了
问题补充:
先在错误编程了

ERROR [org.springframework.web.context.ContextLoader] - <context initialization="" failed="">

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1336)
问题补充:
我这样写的好像还是有点问题



<context path="/mldn">

<resource name="java:comp/env/jdbc/mldn" type="javax.sql.DataSource" <br=""> username="root" password="ads" driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost:3306/mldn" maxActive="4" maxIdle="2" />

</context>


问题补充:
改后怎么还是包这个错

ERROR [org.springframework.web.context.ContextLoader] - <context initialization="" failed="">

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
问题补充:
applicationContext.xml中我用的是

<bean id="dataSource" <br=""> class="org.springframework.jndi.JndiObjectFactoryBean">

<property name="jndiName" value="java:comp/env/jdbc/mldn"></property>

</bean>
问题补充:
现在的问题是

ERROR [org.hibernate.util.JDBCExceptionReporter] - <cannot create="" jdbc="" driver="" of="" class="" ''="" for="" connect="" url="" 'null'="">

2008-09-15 20:37:40,015 WARN [org.hibernate.cfg.SettingsFactory] - <could not="" obtain="" connection="" metadata="">

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
问题补充:
这个问题一直没解决了

ERROR [org.hibernate.util.JDBCExceptionReporter] - <cannot create="" jdbc="" driver="" of="" class="" ''="" for="" connect="" url="" 'null'="">

2008-09-15 21:56:56,687 WARN [org.hibernate.cfg.SettingsFactory] - <could not="" obtain="" connection="" metadata="">

org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'
问题补充:
放进去了的,任然报这个错误。都快郁闷死了
问题补充:
好的,谢谢你

sxwave@163.com
问题补充:
昨天的问题出在我tomcat中没有配置,但配置好后现在出现了个新问题。问题是

ERROR [org.springframework.web.context.ContextLoader] - <context initialization="" failed="">

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassVisitor.visit(IILjava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V

32个回答

javax.naming.NameNotFoundException: Name jdbc is not bound in this Context 你的数据源没有在JNDI中注册,你可以在META-INF文件夹下新建个context.xml文件,在这个文件里写你的数据源相关信息,在工程启动的时候,Servlet容器会把context.xml中的数据源信息注册到JNDI中,范例
[code="java"] //工程名称
name="jdbc/test" //给你的数据源起个名字
type="javax.sql.DataSource"
username="root"
password="1234"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306/mytest?useUnicode=true&characterEncoding=UTF-8"
maxActive="4"
maxIdle="2"
/>
[/code]
注意,这个name在你用org.springframework.jndi.JndiObjectFactoryBean获取的时候要在前面加上java:comp/env

你去看下你的web.xml有没有配置错误,nested exception is java.io.FileNotFoundException找不到WEB-INF下的applicationContext.xml文件,你的配置文件可以这样来指定你的applicationContext.xml文件
[code="java"]
contextConfigLocation
/WEB-INF/applicationContext.xml
[/code]
还有Lisenter别忘记配置上。

web.xml中的另一种配置方式.要求applicationContext.xml在src目录下.
[code="xml"]

contextConfigLocation
classpath:applicationContext.xml

<listener>
    <listener-class>
        org.springframework.web.context.ContextLoaderListener
    </listener-class>
</listener>

[/code]

你按我说的方法做一下看看有没有效果

找到原因了
/WEB-INF/[color=red]classes/[/color]applicationContext.xml
而不是
/WEB-INF/applicationContext.xml

这个是你的错误信息
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [color=red][/WEB-INF/applicationContext.xml[/color]]
at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:116)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:336)

你看看这个帖子吧
http://www.iteye.com/topic/22252

还有这个帖子
http://www.iteye.com/topic/16495
特别是最后一个回复

你在src目录下新建applicationContext.xml文件后,利用myeclipse不说运行的话,在webinf/classes下面会生成对应的文件的。

你别把applicationContext.xml配置在classes下,把他放在WEB-INF下即可,提示的很清楚了,[color=red]Could not open ServletContext resource [/WEB-INF/applicationContext.xml] [/color]不能在WEB-INF下打开这文件,是你的文件路径指错了,应该是[color=red]/WEB-INF/applicationContext.xml[/color]而不是[color=red]/WEB-INF/classes/applicationContext.xml[/color]

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