-->
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.  [ 12 posts ] 
Author Message
 Post subject: ArrayIndexOutOfBoundsException deploying on JBoss 3.2.2
PostPosted: Mon Nov 10, 2003 4:39 pm 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
I'm getting an ArrayIndexOutOfBoundsException: 1 error trying to deploy hibernate as a service on Jboss 3.2.2. This occurs at server startup when it's trying to deploy my hibernate service.

Here's the pertinent part of the exception stack trace:

java.lang.ArrayIndexOutOfBoundsException: 1
at net.sf.hibernate.persister.EntityPersister.initPropertyPaths(EntityPersister.java:918)
at net.sf.hibernate.persister.EntityPersister.initPropertyPaths(EntityPersister.java:888)
at net.sf.hibernate.persister.EntityPersister.postInstantiate(EntityPersister.java:113)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:223)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:627)
at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:162)
at net.sf.hibernate.jmx.HibernateService.start(HibernateService.java:131)


I'm using the example service descriptor from the documentation. Here it is:
<server>
<mbean code="net.sf.hibernate.jmx.HibernateService" name="jboss.jca:service=HibernateFactory, name=HibernateFactory">
<!--<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=LocalTxCM,name=NETPROFILER_ALPHA_DATABASE</depends>-->
<!-- Make it deploy ONLY after DataSource had been started -->
<depends>jboss.jca:service=RARDeployer</depends>
<depends>jboss.jca:service=LocalTxCM,name=NETPROFILER_ALPHA_DATABASE</depends>
<attribute name="MapResources">mappings/TblUser.hbm.xml</attribute>
<attribute name="JndiName">java:/hibernate/HibernateFactory</attribute>
<attribute name="Datasource">java:/NETPROFILER_ALPHA_DATABASE</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.SybaseDialect</attribute>
<attribute name="TransactionStrategy">net.sf.hibernate.transaction.JTATransactionFactory</attribute>
<attribute name="TransactionManagerLookupStrategy">net.sf.hibernate.transaction.JBossTransactionManagerLookup</attribute>
<attribute name="UseOuterJoin">false</attribute>
<attribute name="ShowSql">true</attribute>
<attribute name="UserTransactionName">UserTransaction</attribute>
</mbean>
</server>


Has anyone ever seen this before or know how to fix it?

Thanks,
Rich


Top
 Profile  
 
 Post subject: I'm generating everything from a DB schema via middlegen
PostPosted: Mon Nov 10, 2003 6:47 pm 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
Perhaps it's not generating everything correctly?

I'm only trying to load one table mapping as a test. Here's the mapping file:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping>
<!--
Created by Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class
name="com.gm.netprofiler.server.hibernate.TblUser"
table="tblUsers"
>

<composite-id name="comp_id" class="com.gm.netprofiler.server.hibernate.TblUserPK">
<key-property
name="userId"
column="UserID"
type="java.lang.Object"
length="8"
/>
<key-property
name="orgId"
column="orgID"
type="int"
length="10"
/>
</composite-id>

<property
name="userNumber"
type="int"
column="UserNumber"
not-null="true"
length="10"
/>
<property
name="lastName"
type="java.lang.Object"
column="LastName"
not-null="true"
length="50"
/>
<property
name="firstName"
type="java.lang.Object"
column="FirstName"
not-null="true"
length="50"
/>
<property
name="userPwd"
type="java.lang.String"
column="UserPWD"
not-null="true"
length="30"
/>
<property
name="userMail"
type="java.lang.Object"
column="UserMail"
length="255"
/>
<property
name="roleCode"
type="java.lang.String"
column="roleCode"
length="1"
/>
<property
name="disabled"
type="java.lang.String"
column="disabled"
not-null="true"
length="1"
/>

<!-- associations -->

</class>
</hibernate-mapping>


Is there something wrong with this mapping?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 7:47 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
A tip: run under latest release of Hibernate 2.1 and I believe that you will get a more meaningful exception message.


Top
 Profile  
 
 Post subject: Now getting MappingException using 2.1b6
PostPosted: Tue Nov 11, 2003 1:06 pm 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
When I try to start a session using the mbean service, I get an exception. Here's the pertinent part of the stack trace:

Caused by: net.sf.hibernate.MappingException: identifier mapping has wrong number of columns: net.sf.hibernate.mapping.R
ootClass
at net.sf.hibernate.mapping.PersistentClass.validate(PersistentClass.java:231)
at net.sf.hibernate.cfg.Configuration.validate(Configuration.java:555)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:712)
at net.sf.hibernate.jmx.HibernateService.buildSessionFactory(HibernateService.java:162)
at net.sf.hibernate.jmx.SessionFactoryStub.getImpl(SessionFactoryStub.java:74)

I'm researching this now...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 11, 2003 1:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This looks wrong:


Code:
<key-property
name="userId"
column="UserID"
type="java.lang.Object"
length="8"
/>



java.lang.Object??


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 11, 2003 2:43 pm 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
That's what middlegen generated for me. I'm using sqlserver and the database column is type nvarchar with a size of 8. Is there a problem with this field type?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 11, 2003 6:25 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Middlegen does its best to guess the type but you can use the GUI to fine tune the options. You will still need a reasonable amount of knowledge of hibernate even when using Middlegen to do the bulk of the work for you. I don't use sqlserver (about to for a job I have just started though) but I assume its are variable string length field so try changing it to a string type. Then regenerate.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 11, 2003 6:50 pm 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
I need to investigate this GUI. I run my middlegen stuff from an ant script and it pops up a gui that only has one button that says 'Generate'. There must be a more full featured gui that you are referring to.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 12, 2003 1:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
The GUI has many options. It depends on where you click.
You should see the a graph representation of the database schema in the top half of the screen. If you select a table then all the options for the table will appear in the lowedr half. The same applies if you select a field in the table, rg, all the field options (including changing the type) will be in the lower half. It wil rememmber the options that you have selected and set so you can change all sorts of things and it will be there each time you bring up the GUI. Once you have fine tuned the settings then click the generate button.

I have been doing a small article on the Middlegen and the bottom up process. It will get announced once it is completed (and the Guys have pulled it appart :-)).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 12, 2003 10:19 am 
Newbie

Joined: Mon Nov 10, 2003 4:27 pm
Posts: 13
I don't see a graph of the database on my gui. I must have something configured incorrectly. My gui display has a 'generate' button and the rest is blank. I'll play with it some today to see if I can fix the issue.

Thanks -


Top
 Profile  
 
 Post subject: Drag border
PostPosted: Wed Nov 12, 2003 12:15 pm 
Newbie

Joined: Wed Nov 12, 2003 12:12 pm
Posts: 2
Location: Sweden
I would guess that the GUI (which is 2 panes separated horizontally) isn't updated ok (you only see the bottom pane). It usually does this for me anyway.

// Mikael


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 12, 2003 8:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Im using JDK1.4.2 . Look at the MIddlegen JIRA for a screenshot of r1 or the Middlegen web site. I could also send you an image for reference purposes. If inmterested send me an email david@hibernate.org .


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.