【问题标题】:User Access Denied when viewing BIRT Report查看 BIRT 报告时用户访问被拒绝
【发布时间】:2014-05-16 18:38:03
【问题描述】:

我已经使用 Tomcat 8.0.5 在 Microsoft Server 2012 上设置了 BIRT 4.3.2 Web 查看器。尝试通过 BIRT 查看器连接到数据库时,出现以下错误。

org.eclipse.birt.report.engine.api.EngineException: An exception occurred during processing.
Please see the following message for details:
Cannot open the connection for the driver: org.eclipse.birt.report.data.oda.jdbc.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: Failed to get connection.
SQL error #1:Access denied for user 'webuser'@'10.3.2.50' (using password: YES)

我可以确认我可以在同一台机器上使用 Eclipse Designer 连接到数据库...我还在 Tomcat 服务器上设置了一个测试应用程序,它使用相同的凭据从同一个数据库连接和检索数据.我的驱动放在root\webapps\Birt\WEB-INF\lib 文件夹下。

【问题讨论】:

    标签: mysql tomcat jdbc birt


    【解决方案1】:

    您的网络用户似乎无权连接到 10.3.2.50 上的数据库。请将您的凭据更改为有效凭据。

    您可以使用 mysql 验证哪些凭据正确:mysql -u webuser 10.3.2.50

    【讨论】:

    • 我可以通过我为 Tomcat 服务器编写的一个小应用程序从 10.3.2.50 连接到数据库。
    【解决方案2】:

    我为 Tomcat 6.0.39 配置了 JNDI 连接,并且能够连接到数据源。以下是我采取的步骤:

    安装 Tomcat [6.0.39[(http://tomcat.apache.org/download-60.cgi)。

    安装Birt 4.2.3 Viewer

    将 WebViewerExample 放在 $TOMCAT_INSTALL/webapps/ 文件夹中,并将文件夹重命名为 Birt。 将 JDBC mysql jar 放在 $TOMCAT_INSTALL/lib/ 文件夹中。 将以下xml添加到Birt/WEB-INF/web.xml文件中:

    <resource-ref>
      <description>[description]</description>
      <res-ref-name>jdbc/MySqlDB</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
    </resource-ref>
    

    将 context.xml 文件添加到 BIRT/META-INF/,我必须在 Birt 项目中创建 META-INF 文件夹。

    <Context>
      <Resource name="jdbc/MySqlDB" auth="Container" type="javax.sql.DataSource" 
        maxActive="5" maxIdle="=1" maxWait="10000" username="[username]" 
        password="[password]" driverClassName="com.mysql.jdbc.Driver" 
        url="jdbc:mysql://[host]:[port]/[dbname]
      </Resource>
    </Context>
    

    在 RPTDesign 中编辑数据源并包含以下 JNDI Url:

    java:comp/env/jdbc/MySqlDB
    

    重新启动 Tomcat 服务并将其指向 RPTDesign 的相应 URL。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多