tomcat6.0
以下是spring的配置文件
<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean id="YqgxDAO" class="dao.YqgxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="QxDAO" class="dao.QxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CjDAO" class="dao.CjDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="GkthDAO" class="dao.GkthDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DwDAO" class="dao.DwDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="YmDAO" class="dao.YmDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="XhDAO" class="dao.XhDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="PpDAO" class="dao.PpDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CkDAO" class="dao.CkDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ZtDAO" class="dao.ZtDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DlDAO" class="dao.DlDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="JqgxDAO" class="dao.JqgxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ChkDAO" class="dao.ChkDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DbmxDAO" class="dao.DbmxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="GgDAO" class="dao.GgDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="RkmxDAO" class="dao.RkmxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="RkDAO" class="dao.RkDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="JsDAO" class="dao.JsDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="YhDAO" class="dao.YhDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="WpDAO" class="dao.WpDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DbDAO" class="dao.DbDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ChkmxDAO" class="dao.ChkmxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CjthDAO" class="dao.CjthDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CdDAO" class="dao.CdDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean></beans>在以下是hibernate配置文件
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration> <session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/kucun
</property>
<property name="connection.username">aaa</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">kucun</property>
<mapping resource="dao/Yqgx.hbm.xml" />
<mapping resource="dao/Qx.hbm.xml" />
<mapping resource="dao/Cj.hbm.xml" />
<mapping resource="dao/Gkth.hbm.xml" />
<mapping resource="dao/Dw.hbm.xml" />
<mapping resource="dao/Ym.hbm.xml" />
<mapping resource="dao/Xh.hbm.xml" />
<mapping resource="dao/Pp.hbm.xml" />
<mapping resource="dao/Ck.hbm.xml" />
<mapping resource="dao/Zt.hbm.xml" />
<mapping resource="dao/Dl.hbm.xml" />
<mapping resource="dao/Jqgx.hbm.xml" />
<mapping resource="dao/Chk.hbm.xml" />
<mapping resource="dao/Dbmx.hbm.xml" />
<mapping resource="dao/Gg.hbm.xml" />
<mapping resource="dao/Rkmx.hbm.xml" />
<mapping resource="dao/Rk.hbm.xml" />
<mapping resource="dao/Js.hbm.xml" />
<mapping resource="dao/Yh.hbm.xml" />
<mapping resource="dao/Wp.hbm.xml" />
<mapping resource="dao/Db.hbm.xml" />
<mapping resource="dao/Chkmx.hbm.xml" />
<mapping resource="dao/Cjth.hbm.xml" />
<mapping resource="dao/Cd.hbm.xml" /> </session-factory></hibernate-configuration>在以下是tomcat里的server。xml文件配置
以下是spring的配置文件
<?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:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
<bean id="YqgxDAO" class="dao.YqgxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="QxDAO" class="dao.QxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CjDAO" class="dao.CjDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="GkthDAO" class="dao.GkthDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DwDAO" class="dao.DwDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="YmDAO" class="dao.YmDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="XhDAO" class="dao.XhDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="PpDAO" class="dao.PpDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CkDAO" class="dao.CkDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ZtDAO" class="dao.ZtDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DlDAO" class="dao.DlDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="JqgxDAO" class="dao.JqgxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ChkDAO" class="dao.ChkDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DbmxDAO" class="dao.DbmxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="GgDAO" class="dao.GgDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="RkmxDAO" class="dao.RkmxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="RkDAO" class="dao.RkDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="JsDAO" class="dao.JsDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="YhDAO" class="dao.YhDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="WpDAO" class="dao.WpDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="DbDAO" class="dao.DbDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="ChkmxDAO" class="dao.ChkmxDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CjthDAO" class="dao.CjthDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="CdDAO" class="dao.CdDAO">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean></beans>在以下是hibernate配置文件
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration> <session-factory>
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/kucun
</property>
<property name="connection.username">aaa</property>
<property name="connection.password">123456</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="myeclipse.connection.profile">kucun</property>
<mapping resource="dao/Yqgx.hbm.xml" />
<mapping resource="dao/Qx.hbm.xml" />
<mapping resource="dao/Cj.hbm.xml" />
<mapping resource="dao/Gkth.hbm.xml" />
<mapping resource="dao/Dw.hbm.xml" />
<mapping resource="dao/Ym.hbm.xml" />
<mapping resource="dao/Xh.hbm.xml" />
<mapping resource="dao/Pp.hbm.xml" />
<mapping resource="dao/Ck.hbm.xml" />
<mapping resource="dao/Zt.hbm.xml" />
<mapping resource="dao/Dl.hbm.xml" />
<mapping resource="dao/Jqgx.hbm.xml" />
<mapping resource="dao/Chk.hbm.xml" />
<mapping resource="dao/Dbmx.hbm.xml" />
<mapping resource="dao/Gg.hbm.xml" />
<mapping resource="dao/Rkmx.hbm.xml" />
<mapping resource="dao/Rk.hbm.xml" />
<mapping resource="dao/Js.hbm.xml" />
<mapping resource="dao/Yh.hbm.xml" />
<mapping resource="dao/Wp.hbm.xml" />
<mapping resource="dao/Db.hbm.xml" />
<mapping resource="dao/Chkmx.hbm.xml" />
<mapping resource="dao/Cjth.hbm.xml" />
<mapping resource="dao/Cd.hbm.xml" /> </session-factory></hibernate-configuration>在以下是tomcat里的server。xml文件配置
解决方案 »
- ibatis连接oracle数据库,调用过程返回游标值为空
- 急:请教Cookies的中文问题
- 用ictclas和lucene产生的日志文件什么意思?
- 请问JSP用什么方法才能生成HTML页?
- session取不到参数得问题
- 有使用intelliJ IDEA的吗?
- Groovy & Grails 目前发展状况如何?
- 高手快进!高分求购 用于生成 股票走势图的servlet源程序。350!!!
- jdbc数据库连接问题
- 读取文件,替换一定的内容后给另外的一个页面(document.write),字符转换的问题
- s:select 设置默认值问题
- 很妖孽的现象:jsp class文件执行时报错,但浏览器竟然没有显示错误页面,而是将正常页面显示了一半
define subcomponents such as "Valves" at this level.
Documentation at /docs/config/server.html
-->
- <Server port="8005" shutdown="SHUTDOWN">
- <!-- APR library loader. Documentation at /docs/apr.html
-->
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
- <!-- Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html
-->
<Listener className="org.apache.catalina.core.JasperListener" />
- <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html
-->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
- <!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
- <GlobalNamingResources>
- <!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
- <!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" Note: A "Service" is not itself a "Container",
so you may not define subcomponents such as "Valves" at this level.
Documentation at /docs/config/service.html
-->
- <Service name="Catalina">
- <!-- The connectors can use a shared executor, you can define one or more named thread pools
-->
- <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
maxThreads="150" minSpareThreads="4"/>
-->
- <!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Documentation at :
Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
Java AJP Connector: /docs/config/ajp.html
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="8800" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />
- <!-- A "Connector" using the shared thread pool
-->
- <!-- <Connector executor="tomcatThreadPool"
port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
-->
- <!-- Define a SSL HTTP/1.1 Connector on port 8443
This connector uses the JSSE configuration, when using APR, the
connector should be using the OpenSSL style configuration
described in the APR documentation
-->
- <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
- <!-- Define an AJP 1.3 Connector on port 8009
-->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
- <!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host).
Documentation at /docs/config/engine.html
-->
- <!-- You should set jvmRoute to support load-balancing via AJP ie :
<Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1">
-->
- <Engine name="Catalina" defaultHost="localhost">
- <!-- For clustering, please take a look at documentation at:
/docs/cluster-howto.html (simple how to)
/docs/config/cluster.html (reference documentation)
-->
- <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
-->
- <!-- The request dumper valve dumps useful debugging information about
the request and response data received and sent by Tomcat.
Documentation at: /docs/config/valve.html
-->
- <!-- <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
- <!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm.
-->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase" />
- <!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
- <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false">
- <!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html
-->
- <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
-->
- <!-- Access log processes all example.
Documentation at: /docs/config/valve.html
-->
- <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
<Context docBase="D:\LYT\workspace\toolquery\WebRoot" path="/query" reloadable="true">
<Resource name="tjdb" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver" password="tjdata"
maxIdle="2" maxWait="5000" username="tjdata"
url="jdbc:oracle:thin:@192.168.8.101:1521:finance" maxActive="4"/>
</Context>
<Context docBase="D:\LYT\workspace\sparepart\app" path="/sparepart" reloadable="true">
<Resource name="jdbc/sparepart" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver" password="cinda"
maxIdle="2" maxWait="5000" username="cinda"
url="jdbc:oracle:thin:@192.168.8.244:1521:xe" maxActive="4"/>
</Context>
<Context docBase="D:\LYT\workspace\cinda\app" path="/cinda" reloadable="true">
<Resource name="jdbc/cinda" type="javax.sql.DataSource"
driverClassName="oracle.jdbc.driver.OracleDriver" password="cinda"
maxIdle="2" maxWait="5000" username="cinda"
url="jdbc:oracle:thin:@192.168.8.244:1521:xe" maxActive="4"/>
</Context>
-->
</Host>
</Engine>
</Service>
</Server>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="dataSource">
<ref bean="dataSource" />
</property>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jdbc/cinda">
</property>
</bean>
<?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.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
2010-1-27 10:46:17 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;F:\Tomcat6.0\bin
2010-1-27 10:46:17 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8800
2010-1-27 10:46:17 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 670 ms
2010-1-27 10:46:17 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2010-1-27 10:46:17 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.14
log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
log4j:WARN Please initialize the log4j system properly.
2010-1-27 10:46:19 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2010-1-27 10:46:21 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 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext-common.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:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
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.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3830)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4337)
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:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
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:566)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context
at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)
at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)
at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200)
at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 39 more
2010-1-27 10:46:21 org.apache.catalina.core.StandardContext start
严重: Error listenerStart
2010-1-27 10:46:21 org.apache.catalina.core.StandardContext start
严重: Context [/spares] startup failed due to previous errors
2010-1-27 10:46:21 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2010-1-27 10:46:21 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8800
2010-1-27 10:46:21 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2010-1-27 10:46:21 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/31 config=null
2010-1-27 10:46:21 org.apache.catalina.startup.Catalina start
信息: Server startup in 4267 ms
是这个吧,用12楼写的配置
<property name="dialect">
org.hibernate.dialect.MySQLDialect
</property>
<property name="connection.url">
jdbc:mysql://localhost:3306/你所用的数据库
</property>
<property name="connection.username">链接数据的用户名</property>
<property name="connection.password">链接数据库的密码 </property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
法1,把tomcat中的数据源去掉,使用hibernate的数据库连接,用户名不对哟法2,把hibernate配置中的数据库连接去掉,在WEB-INF/applicationContext-common.xml中映射tomcat的数据源,同6楼
<property name="jndiName" value="jdbc/cinda">
</property> 去掉:
java:comp/env/
value="classpath:hibernate.cfg.xml">
</property>
这个地方路径有问题
都用spring去注入 'dataSource' 在试下在web.xm中配置
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listenerclass>
</listener>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext-common.xml]: Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: Name jdbc is not bound in this Context }
在 spring 的applicationContext.xml文件 配置:
<bean id="jndiDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jndi/mySQL"></property>
</bean><bean id="jndiDataSource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:comp/env/jndi/mySQL"></property>
</bean>
试试