我试图在tomcat中配置JNDI以在BIRT报告中使用。
它可以在装有Windows 10的本地计算机上运行,但不能在Unix上运行。
Tomcat:apache-tomcat-7.0.69
BIRT:4.8.0
Jar已经存在,并且使用ip,用户名和密码可以正常工作,但不能与JNDI一起使用。
之后是Setps:
在context.xml中创建资源
<Resource name="jdbc/dbConnection" auth="Container" type="javax.sql.DataSource"
maxTotal="500" maxIdle="30" maxWaitMillis="10000"
username="abc" password="abc123" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://127.0.0.1:3306"/>
在Web.xml中创建的资源引用
<resource-ref> <description>DB Connection</description>
<res-ref-name>jdbc/dbConnection</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>
在使用JNDI url的rptdesign文件中,例如: java:comp / env / jdbc / dbConnection
我遵循了这个参考: https://tomcat.apache.org/tomcat-8.0-doc/jndi-datasource-examples-howto.html
它抛出以下异常:
org.eclipse.birt.report.engine.api.EngineException:处理期间发生异常。有关详细信息,请参见以下消息: 无法打开驱动程序的连接:org.eclipse.birt.report.data.oda.jdbc。 org.eclipse.birt.report.data.oda.jdbc.JDBCException:get连接出错,URL不能为null。 在org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1245) 在org.eclipse.birt.report.engine.executor.ExecutionContext.addException(ExecutionContext.java:1224) 在org.eclipse.birt.report.engine.executor.QueryItemExecutor.executeQuery(QueryItemExecutor.java:96) 在org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:62).......
请帮助