作者Laviathan ()
看板java
标题[J2EE] 使用BIRT时无法解析jndi url??
时间Sun Mar 20 10:41:04 2011
现在我在BIRT中的每张报表都要设定一次jdbc
我的问题是:当报表要从测试机转到正式机时
都要重新调整每张报表data source设定,才能连到想要连的DB
网路上查到似乎改成使用jndi後
只要修改一次context.xml中的资料
就可以解决要修改每张报表data source这个问题
所以马上google到几个类似以下的作法:
http://www.cublog.cn/u/13625/showart_399384.html
可是这些google到的作法,只要BIRT报表只使用jndi url时
就会出现以下这个错误:
org.eclipse.birt.report.data.oda.jdbc.JDBCException: The selected driver
cannot parse the given JNDI Data Source URL.
http://www.badongo.com/pic/12302370
这个错误google了老半天好像全天下程式设计师只有我会犯这个错误似的 = =
究竟是我google错关键字,还是我眼残?? 囧rz
请各位大德拔刀相助解决小弟的困扰..... 甘温啊~~~~
补充:
web.xml内容如下
<resource-ref>
<description>test</description>
<res-ref-name>jdbc/my_app</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
context.xml内容如下
<Resource name="jdbc/my_app"
global="jdbc/my_app"
auth="Container"
type="javax.sql.DataSource"
username="root"
password="root"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test"
maxActive="8" maxIdle="4" />
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 180.176.21.166
※ 编辑: Laviathan 来自: 180.176.21.166 (03/20 10:45)
1F:→ pico2k:你的web.xml的内容? 03/20 10:46
2F:→ Laviathan:我是将resource-ref的内容嵌入到web-app内 03/20 10:53
※ 编辑: Laviathan 来自: 180.176.21.166 (03/20 10:56)
3F:→ Laviathan:补充我的web.xml与context.xml内容 03/20 10:57
4F:→ pico2k:你另外写一支程式去测试一下jndi... 03/20 20:55