simpleMessage例子+tomcat连接数据库

07-07-24 eydp
simpleMessage例子中数据库连接不上

一直报错:

Message create error, maybe it has been existed!

TomCat5.5+Eclipse+MySql

MySql数据库名:simplemessage

dao.xml中

<component name="jdbcTempSource" class="com.jdon.framework.test.dao.JdbcTempSource">

<constructor value="java:comp/env/simplemessage"/>

</component>

-------------------------------------------

tomcat配置:(没有配在service.xml中)

/conf/Catalina/localhost/simpleMessage.xml

内容如下 :

<?xml version='1.0' encoding='utf-8'?>

<Context docBase="E:\workspace\simpleMessage\WebRoot" path="/simpleMessage" reloadable="true" workDir="E:\workspace\simpleMessage\work">

<Resource name="jdbc/simplemessage" auth="Container" type="javax.sql.DataSource"

maxActive="100" maxIdle="30" maxWait="10000"

username="root" password="12345678"

driverClassName="com.mysql.jdbc.Driver"

url="jdbc:mysql://localhost:3306/simplemessage?autoReconnect=true"/>

</Context>

请问下这样写可以吗?

eydp
2007-07-25 09:21
已解决:

dao.xml中

<constructor value="java:comp/env/simplemessage"/>

少了一个jdbc

应为:

<constructor value="java:comp/env/jdbc/simplemessage"/>

猜你喜欢