-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: StringIndexOutofBoundsException
PostPosted: Sat Jun 05, 2004 8:14 am 
Newbie

Joined: Fri Jun 04, 2004 11:03 am
Posts: 3
Location: Montreal
Hello,

I get this exception when configuring my datastore but I have no clue what to do with it;
here's the stack-trace and the mapping file. Any help is welcome.

Thanks

Quote:
Could not configure datastore from file: /home/dubbed/Documents/Work/nUsers/philantrope/target/classes/ca/nusers/philantrope/Contribuable.hbm.xml
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
at java.lang.String.charAt(String.java:444)
at net.sf.hibernate.mapping.Column.setName(Column.java:43)
at net.sf.hibernate.cfg.Binder.bindColumns(Binder.java:328)
at net.sf.hibernate.cfg.Binder.bindValue(Binder.java:362)
at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:273)
at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1095)
at net.sf.hibernate.cfg.Configuration.add(Configuration.java:230)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:155)
at org.apache.maven.hibernate.beans.SchemaExportBean.getConfiguration(SchemaExportBean.java:319)
at org.apache.maven.hibernate.beans.SchemaExportBean.execute(SchemaExportBean.java:246)
at org.apache.maven.hibernate.jelly.SchemaExportTag.execute(SchemaExportTag.java:45)
at org.apache.maven.hibernate.jelly.SchemaExportTag.doTag(SchemaExportTag.java:60)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:78)
at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:99)
at com.werken.werkz.Goal.fire(Goal.java:639)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:126)
at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:279)
at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:233)
at com.werken.werkz.jelly.PostGoalTag$1.firePostGoal(PostGoalTag.java:87)
at com.werken.werkz.Goal.firePostGoalCallbacks(Goal.java:710)
at com.werken.werkz.Goal.fire(Goal.java:654)
at com.werken.werkz.Goal.attain(Goal.java:575)
at com.werken.werkz.WerkzProject.attainGoal(WerkzProject.java:193)
at org.apache.maven.plugin.PluginManager.attainGoals(PluginManager.java:531)
at org.apache.maven.MavenSession.attainGoals(MavenSession.java:265)
at org.apache.maven.cli.App.doMain(App.java:466)
at org.apache.maven.cli.App.main(App.java:1117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.werken.forehead.Forehead.run(Forehead.java:551)
at com.werken.forehead.Forehead.main(Forehead.java:581)

BUILD FAILED
File...... file:/home/dubbed/.maven/plugins/maven-hibernate-plugin-1.0/plugin.jelly
Element... h:schema-export
Line...... 46
Column.... 53
java.lang.StringIndexOutOfBoundsException: String index out of range: 0
Total time: 17 seconds
Finished at: Sat Jun 05 08:17:23 EDT 2004


Code:
<class
        name="ca.nusers.philantrope.Contribuable"
        table="Contribuable"
    >

        <id
            name="id"            column="ID"            type="java.lang.Long"
        >
            <generator class="">
            </generator>
        </id>

        <discriminator
            column=""            type="string"
        />

        <property
            name="courriel"            type="string"            column="courriel"
        />

        <component
            name="adressePostale"            class="ca.nusers.util.Adresse"
        >

        <property
            name="noCivique"            type="integer"            column="noCivique"
        />

        <property
            name="rue"            type="string"            column="rue"
        />

        <property
            name="ville"            type="string"            column="ville"
        />

        <property
            name="province"            type="string"            column="province"
        />

        <property
            name="telephone"            type="string"            column="telephone"
        />

        <property
            name="codePostal"            type="string"            column="codePostal"
        />

        <property
            name="casierPostal"            type="string"            column="casierPostal"
        />

        <property
            name="appartement"            type="integer"            column="appartement"
        />

        </component>

        <property
            name="membre"            type="boolean"            column="membre"
        />

        <set
            role="contributions"
            lazy="true"
            readonly="false"
            cascade="all"
            sort="unsorted"
        >

              <key
                  column="IDCONTRIBUABLE"
              >
              </key>

              <one-to-many
                  class="ca.nusers.philantrope.Contribution"
              />
        </set>

        <subclass
            name="ca.nusers.philantrope.Citoyen"
        >
        <property
            name="nom"            type="string"            column="nom"
        />

        <property
            name="prenom"            type="string"            column="prenom"
        />

        <property
            name="initial"            type="string"            column="initial"
        />

        <property
            name="verifie"            type="boolean"            column="verifie"
        />

        </subclass>

    </class>


Top
 Profile  
 
 Post subject: Re: StringIndexOutofBoundsException
PostPosted: Sat Jun 05, 2004 9:02 am 
Beginner
Beginner

Joined: Thu May 13, 2004 5:51 am
Posts: 28
dubbed wrote:
<generator class="">
</generator>
<discriminator
column="" type="string"
/>



<discriminator type="string"/>
If you dont want to specify the discriminator column, dont provide the attribute either. By default the class will be used as discriminator.

And do specify a generator class=native|identity|assigned|... to avoid a "could not instantiate id generator" Mapping exception soon after u fix above.

--


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.