2011-09-13 10 views
0

私は、同じLinode(vpsプロバイダ)データセンターに2つのVPSを設定しています。内部の静的IPの中に見えます。Tomcatを使用しているhibernate + spring + mysqlとのリモートトランザクション?

VPS.1.- Apacheプロキシ。これは、mod_jkを使用してVPS.2のTomcatに接続されています。

私は、VPS.2のtomcats springアプリケーションでVPS.1でmysqlデータベースを使用します。

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 Caused by: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

は、誰かがこの暗いにいくつかの光を投げてくださいだろう:私はエラーを得た方法今まで

<?xml version="1.0" encoding="UTF-8"?> 
<Context path="/" override="true" reloadable="false" swallowOutput="false"> 

    <Resource name="jdbc/catWDB" auth="Container" type="javax.sql.DataSource" 
       driverClassName="com.mysql.jdbc.Driver" 
       factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" 

url="jdbc:mysql://VPS.1_IP:3306/database_name?zeroDateTimeBehavior=convertToNull&amp;autoReconnect=true" 
       username="user_name" 
       password="pass_name" 
       validationQuery="select 1" 
       maxActive="20" 
       maxIdle="10" 
       maxWait="-1"/> 
</Context> 

:私はそのデータベースへの印字を行うMETA-INF/context.xmlにを変えてみました

問題?ありがとうございました!

答えて

関連する問題