为什么我会从SAP HANA JDBC Driver获取java.lang.ArrayIndexOutOfBoundsException?

时间:2014-10-02 20:33:10

标签: java jdbc sap hana

我按如下方式配置连接池:

dataSource = new BasicDataSource();
dataSource.setUrl("jdbc:sap://********:30015");
dataSource.setDriverClassName("com.sap.db.jdbc.Driver");
dataSource.setMaxActive(20);
dataSource.setMaxIdle(0);
dataSource.setMaxIdle(0);
dataSource.setUsername("*******");
dataSource.setPassword("*******");

但是,当连接初始化时,我得到了这个例外:

java.lang.ArrayIndexOutOfBoundsException: 10
        at com.sap.db.util.StructuredBytes.putBigUnicode(StructuredBytes.java:568)
        at com.sap.db.util.MemIndirection.putBigUnicode(MemIndirection.java:186)
        at com.sap.db.jdbc.packet.DataPartAuthentication.putBigUnicode(DataPartAuthentication.java:192)
        at com.sap.db.util.security.AuthenticationManager.addClientProofPart(AuthenticationManager.java:139)
        at com.sap.db.util.security.AbstractAuthenticationManager.connect(AbstractAuthenticationManager.java:39)
        at com.sap.db.jdbc.ConnectionSapDB.openSession(ConnectionSapDB.java:586)
        at com.sap.db.jdbc.ConnectionSapDB.doConnect(ConnectionSapDB.java:436)
        at com.sap.db.jdbc.ConnectionSapDB.<init>(ConnectionSapDB.java:195)
        at com.sap.db.jdbc.ConnectionSapDBFinalize.<init>(ConnectionSapDBFinalize.java:13)
        at com.sap.db.jdbc.Driver.connect(Driver.java:255)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
        at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556)
        at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545)
        at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)

正如您所看到的,SAP HANA JDBC驱动程序代码中存在异常,而不是我的代码。但我也不明白在这种情况下我可能做错了什么?

非常感谢任何有关如何调试此操作的帮助和建议。

1 个答案:

答案 0 :(得分:1)

根据对AuthenticationManager的堆栈跟踪引用来判断,您的用户名和密码是否正确? stacktrace上的方法名称putBigUnicode让我觉得可能有一些无效的字符,比如“在那里