Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[TJDO] Class Enhancer liefert IndexOutOfBoundsException

0 views
Skip to first unread message

Oliver Kalz

unread,
May 6, 2003, 9:57:40 AM5/6/03
to
Hallo,

ich habe mir gerade das TJDO-Tutorial angesehen und - in dem Glauben es
würde einfach funktionieren - ausprobiert.
Ich bin zimelich genau bis Schritt 4 gekommen, dem Ausführen des Class
Enhancers.

Ich habe es sowohl an der Konsole (ohne Ant) als auch aus Eclipse heraus
mit einem Ant-Skript versucht, ich bekomme von Ant eine

[java] java.lang.StringIndexOutOfBoundsException: String index out of
range: -1

Die Konsole ist da etwas gesprächiger und sagt:

Exception in thread "main" java.lang.StringIndexOutOfBoundsException:
String index out of range: -1
at java.lang.String.substring(String.java:1480)
at
com.triactive.jdo.enhance.SunReferenceEnhancer.callExternalEnhancer(S
unReferenceEnhancer.java:79)
at com.triactive.jdo.enhance.Enhancer.enhance(Enhancer.java:66)
at
com.triactive.jdo.enhance.SunReferenceEnhancer.main(SunReferenceEnhan
cer.java:145)


Mein Ant-Skript liegt im Projekt-Verzeichnis und sieht wie folgt aus:

<?xml version="1.0" encoding="iso-8859-1" ?>

<project name="tjdo_enhancer" default="enhance" basedir=".">

<property name="libdir" location="${basedir}/lib" />
<property name="bindir" location="${basedir}/bin" />

<target name="enhance">
<java classname="com.triactive.jdo.enhance.SunReferenceEnhancer">
<classpath>
<pathelement location="${libdir}/jdo.jar" />
<pathelement location="${libdir}/tjdo.jar" />
<pathelement location="${libdir}/jdori.jar" />
<pathelement location="${libdir}/xercesImpl.jar" />
<pathelement location="${libdir}/xmlParserAPIs.jar" />
<pathelement location="${bindir}" />
</classpath>
<arg line="-d ${bindir} ${bindir}/test/Person.tjdo" />
</java>
</target>

</project>

Es hat sich ja schon beim Lesen der TJDO-Dokumentation gezeigt, daß da
noch ein -d als Parameter fehlte, hat aber keinen Effekt, das Ergebnis
bleibt...

Ich wäre dankbar, wenn jemand eine Lösung parat hätte

Bye
Oliver
=/\=

Tobias Joch

unread,
May 7, 2003, 2:47:29 AM5/7/03
to
"Oliver Kalz" <ka...@fh-brandenburg.de> schrieb im Newsbeitrag
news:b98evp$l6d$1...@bacchus.ai.fh-brandenburg.de...

Hallo Oliver,

ich habe mir auch das Beispiel von TJDO angeschaut. Es ist schon eine Weile
her, aber ich bin mir sicher, dass es damals auch bei mir Probleme mit dem
Enhancer gab. Meine Sourcen habe ich noch. Ich kann sie Dir gerne schicken,
wenn Du das möchtest.

Das ANT-Target sieht bei mir aber anders aus:

<!-- ================================================================== -->

<!-- jdo enhancer - enhancing Product class -->

<!-- ================================================================== -->

<target name="enhance-tjdo">

<java fork="true" failonerror="yes"
classname="com.triactive.jdo.enhance.SunReferenceEnhancer"
classpathref="build.classpath">

<arg line="test/*.jdo"/>

</java>

</target>

wobei die Variable build.classpath folgenden Wert hat:

<path id="build.classpath">

<pathelement location="${base.dir}"/>

<pathelement location="${lib.dir}/jdo.jar"/>

<pathelement location="${lib.dir}/tjdo.jar"/>

<pathelement location="${lib.dir}/jdori.jar"/>

<pathelement location="${lib.dir}/xercesImpl.jar"/>

<pathelement location="${lib.dir}/xmlParserAPIs.jar"/>

</path>

Gruß,

Tobias Joch


0 new messages