You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Rahul Kumar <ra...@bhartitelesoft.com> on 2003/01/16 15:57:56 UTC

Exception on Torque.init() - Newbie

Newbie question regarding Standalone tutorial.

I have generated the source code and written a simple program to insert
data. I used the properties file in the tutorial as the base. I get the
following exception on the line containing "Torque.init()".

org.apache.torque.TorqueException: String index out of range: -1
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1480) at
org.apache.torque.Torque.initAdapters(Torque.java:275) at
org.apache.torque.Torque.initialize(Torque.java:236) at
org.apache.torque.Torque.init(Torque.java:406) at
org.apache.torque.Torque.init(Torque.java:386) at
com.test.Mytest.main(Mytest.java:14) rethrown as
org.apache.torque.TorqueException: String index out of range: -1 at
org.apache.torque.Torque.initAdapters(Torque.java:285) at
org.apache.torque.Torque.initialize(Torque.java:236) at
org.apache.torque.Torque.init(Torque.java:406) at
org.apache.torque.Torque.init(Torque.java:386) at
com.test.Mytest.main(Mytest.java:14) 

Then I removed all entries barring the database settings and the adapter
line. I just have the following and they are correct.

services.DatabaseService.database.default=default
services.DatabaseService.database.default.driver=org.gjt.mm.mysql.Driver
services.DatabaseService.database.default.url=jdbc:mysql://rahulk/test
services.DatabaseService.database.default.username=xxx
services.DatabaseService.database.default.password=xxx
services.DatabaseService.database.adapter=DBMM
services.DatabaseService.database.adapter.DBMM=org.gjt.mm.mysql.Driver

The mysql driver is in path, and torque/lib/*.jar are in the classpath.

Help appreciated.

Rahul Kumar

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>