Re: java.lang.StringIndexOutOfBoundsException: String index

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: mohan(at)physics(dot)gmu(dot)edu
Cc: pgsql-sql(at)postgresql(dot)org, <torque-user(at)db(dot)apache(dot)org>
Subject: Re: java.lang.StringIndexOutOfBoundsException: String index
Date: 2004-01-30 09:00:44
Message-ID: Pine.LNX.4.44.0401300934240.10193-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc pgsql-sql

O kyrios mohan(at)physics(dot)gmu(dot)edu egrapse stis Jan 29, 2004 :

> Now i a get another wierd error
>
> DEBUG] Transaction - -called safeRollback with null argument
> java.sql.SQLException: ERROR: SET AUTOCOMMIT TO OFF is no longer supported
> at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:131)
> at
> org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:482)
> at
> org.postgresql.jdbc1.AbstractJdbc1Connection.ExecSQL(AbstractJdbc1Connection.java:461)
> at
> org.postgresql.jdbc1.AbstractJdbc1Connection.setAutoCommit(AbstractJdbc1Connection.java:957)
>
> They say its a driver problem i think i am having the right driver. I am
> having RedHat Linux and postgres7.4 and pg73jdbc3.jar and jdbc-2.0.jar in
> my class path. I donot understand what is going wrong

What java version (java -version), os (uname -a) are you running?

What is this jdbc-2.0.jar?

In any case postgres7.4 doesnt match (again!) pg73jdbc3.jar.

You better use :
java 1.4.1 (blackdown in linux, native jdk14 in FreeBSD)
postgresql server 7.4.1
postgresql jdbc 7.4.1

Also as i said check your classpath.

>
> but in my server logs i also see this error for torque
>
> [DEBUG] SharedPoolDataSourceFactory - -Starting initJdbc2Pool
> [DEBUG] TorqueInstance - -getConfiguration() =
> org(dot)apache(dot)commons(dot)configuration(dot)BaseConfiguration(at)f96093
> [DEBUG] AbstractDataSourceFactory - -applyConfiguration(null,
> org(dot)apache(dot)commons(dot)dbcp(dot)datasources(dot)SharedPoolDataSource(at)e046e)
> [DEBUG] AbstractDataSourceFactory -
> -applyConfiguration(org(dot)apache(dot)commons(dot)configuration(dot)BaseConfiguration(at)45105c,
> org(dot)apache(dot)commons(dot)dbcp(dot)datasources(dot)SharedPoolDataSource(at)e046e)
> [DEBUG] ConvertUtils - -Convert string 'SELECT 1' to class 'java.lang.String'
> [ERROR] AbstractDataSourceFactory - -Property: validationQuery value:
> SELECT 1 is not supported by DataSource:
> org.apache.commons.dbcp.datasources.SharedPoolDataSource
> [ERROR] AbstractDataSourceFactory - -Property: defaultMaxActive value: 16
> is not supported by DataSource:
> org.apache.commons.dbcp.datasources.SharedPoolDataSource
>
> please let me know if any has an idea
>
> Thanks in Advance
>
> --Mohan
>
>
>
>
> > O kyrios mohan(at)physics(dot)gmu(dot)edu egrapse stis Jan 29, 2004 :
> >
> >> Hi All
> >>
> >> I am having the torque3.1.jar and postgresql-7.4. I have compiled the
> >> new jdbc driver called as postgresql.jar and have placed it in the lib
> >> directory from where the ant scripts catch the jars. Whenever i try to
> >> access through torque
> >>
> >> gestList = BaseGestlistPeer.doSelect(new Criteria());
> >>
> >> this error arises
> >>
> >> java.lang.StringIndexOutOfBoundsException: String index out of range:
> >> 23
> >> at java.lang.String.charAt(String.java:460)
> >> at
> >> org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653)
> >> at
> >> org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java:398)
> >
> > Just from the above, some one could conclude you are running
> > a 7.2.x postgresql driver.
> >
> > Make sure you havent messed up with the CLASSPATH.
> > Also after ensuring your 7.4.1 postgresql.jar is in the right location,
> > make sure you are running a 7.4.1 backend.
> >
> >>
> >> I have searched all the lists and the answer i got is a jdbc driver
> >> issue. Please let me know what i need to for getting around with this
> >> problem. This happens only with this method in the whole application.
> >> But the same method works when i did not use the new torque 3.1 and
> >> everything happens smoothly.Please let me know if there is a way to
> >> configure jdbc with torque or any other configuration issue for
> >> postgres you know might have been creating this problem. I am having
> >> one heck of a night mare wid this issue.
> >>
> >>
> >> thanks
> >>
> >> --Mohan
> >>
> >>
> >>
> >> ---------------------------(end of
> >> broadcast)--------------------------- TIP 3: if posting/reading
> >> through Usenet, please send an appropriate
> >> subscribe-nomail command to majordomo(at)postgresql(dot)org so that
> >> your message can get through to the mailing list cleanly
> >>
> >
> > --
> > -Achilleus
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 8: explain analyze is your friend
>
>
>

--
-Achilleus

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Paul Thomas 2004-01-30 09:10:42 Re: [SQL] java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Previous Message Patrick Perroud 2004-01-30 08:45:57 Re: connectivity problem

Browse pgsql-sql by date

  From Date Subject
Next Message Alexandra Birch 2004-01-30 09:06:13 Re: limit 1 and functional indexes: SOLVED
Previous Message treeml 2004-01-30 08:19:32 update more than 1 table (mysql to postgres)