ssh搭建的一个小项目,在tomcat 启动时出问题了,初次启动时没问题,可第二次启动时就一直卡在读spring的配置
文件的那地方,不知何故,望有人会,指点指点!
我用的是struts2.1.8 ,spring2.5.6 ,hibernate3.5
再次声明,第一次没问题,但第二次却出问题了!
卡信不动的启动信息如下: 2010-6-12 19:39:06 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
2010-6-12 19:39:06 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-6-12 19:39:06 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 641 ms
2010-6-12 19:39:07 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-6-12 19:39:07 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.10
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-default.xml]
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Unable to locate configuration files of the name struts-plugin.xml, skipping
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-plugin.xml]
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts.xml]
2010-6-12 19:39:10 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
文件的那地方,不知何故,望有人会,指点指点!
我用的是struts2.1.8 ,spring2.5.6 ,hibernate3.5
再次声明,第一次没问题,但第二次却出问题了!
卡信不动的启动信息如下: 2010-6-12 19:39:06 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
2010-6-12 19:39:06 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-6-12 19:39:06 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 641 ms
2010-6-12 19:39:07 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-6-12 19:39:07 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.10
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-default.xml]
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Unable to locate configuration files of the name struts-plugin.xml, skipping
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-plugin.xml]
2010-6-12 19:39:08 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts.xml]
2010-6-12 19:39:10 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
这次居然整个tomcat 停在这儿不动了
你在这个假死的状态下修改下web.xml,保存!看它有没有什么反应
这种时有时无的问题,真不知如何解决????成功启动的信息如下:
望各位给点意见;
2010-6-12 20:35:18 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
2010-6-12 20:35:19 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-6-12 20:35:19 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1422 ms
2010-6-12 20:35:19 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-6-12 20:35:19 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.10
2010-6-12 20:35:21 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-default.xml]
2010-6-12 20:35:22 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Unable to locate configuration files of the name struts-plugin.xml, skipping
2010-6-12 20:35:22 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-plugin.xml]
2010-6-12 20:35:22 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts.xml]
2010-6-12 20:35:24 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
2010-6-12 20:36:27 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
2010-6-12 20:36:45 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2010-6-12 20:36:45 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2010-6-12 20:36:45 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/62 config=null
2010-6-12 20:36:45 org.apache.catalina.startup.Catalina start
信息: Server startup in 86125 ms
启动信息如下:2010-6-12 20:40:33 org.apache.catalina.core.AprLifecycleListener init
信息: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Genuitec\Common\binary\com.sun.java.jdk.win32.x86_1.6.0.013\bin;C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin
2010-6-12 20:40:33 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2010-6-12 20:40:33 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 688 ms
2010-6-12 20:40:33 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-6-12 20:40:33 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.10
2010-6-12 20:40:34 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-default.xml]
2010-6-12 20:40:35 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Unable to locate configuration files of the name struts-plugin.xml, skipping
2010-6-12 20:40:35 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts-plugin.xml]
2010-6-12 20:40:35 com.opensymphony.xwork2.util.logging.jdk.JdkLogger info
信息: Parsing configuration file [struts.xml]
2010-6-12 20:40:37 org.apache.catalina.core.ApplicationContext log
信息: Loading Spring root WebApplicationContext
终于在重启的过程中抛出异常了!
信息如下:
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Line 887 in XML document from URL [file:/C:/Program%20Files/Apache%20Software%20Foundation/Tomcat%206.0/webapps/BlankSSH/WEB-INF/classes/hibernate_spring.xml] is invalid; nested exception is org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
Caused by: org.xml.sax.SAXParseException: XML document structures must start and end within the same entity.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.endEntity(XMLDocumentFragmentScannerImpl.java:902)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.endEntity(XMLDocumentScannerImpl.java:605)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.endEntity(XMLEntityManager.java:1393)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1763)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1064)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:974)
信息: Server startup in 209235 ms
不知是否有版本问题,
<?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: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-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
<aop:aspectj-autoproxy />
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="configLocation" value="classpath:hibernate.cfg.xml">
</property>
</bean> <bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean> <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
<property name="sessionFactory" ref="sessionFactory"></property>
</bean> <!-- more bean definitions go here --></beans>
是spring配置文件的问题.
<!--<beans xmlns="http://www.springframework.org/schema/beans"-->
<!-- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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-2.5.xsd-->
<!-- http://www.springframework.org/schema/aop-->
<!-- http://www.springframework.org/schema/aop/spring-aop-2.5.xsd-->
<!-- http://www.springframework.org/schema/tx-->
<!-- http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">-->上面是原来错误的配置文件,
下面是正确的
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
我每次都是去Spring的包里面现copy.!
LZ以后小心了阿
是因为网速的原因,spring的xsd配置文件要到网上读取,网速过慢,或被路由,
tomcat就会一直卡在哪 , 但不知如何使它读本地的配置文件而不是读取网上的配置文件?????
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">然后呢, 在你的配置文件中, 就直接访问你本地的文件,
比如
file:///d:/xxx/xxx/spring-tx-2.5.xsd