[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1339) empty property name in mapping file gives imcomprehensible error message

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:00:25 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-1339.
-------------------------------


Closing stale resolved issues

> empty property name in mapping file gives imcomprehensible error message
> ------------------------------------------------------------------------
>
>                 Key: HHH-1339
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1339
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 3.1
>         Environment: hibernate 3.1
>            Reporter: Loren Rosen
>            Assignee: Steve Ebersole
>            Priority: Minor
>             Fix For: 3.1.1
>
>
> If you have a line in a hibernate mapping file like this:
>     <property name="" />
> the result is this error message:
> Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 0
> 	at java.lang.String.charAt(String.java:444)
> 	at org.hibernate.mapping.Column.setName(Column.java:60)
> 	at org.hibernate.cfg.HbmBinder.bindColumns(HbmBinder.java:1033)
> 	at org.hibernate.cfg.HbmBinder.bindColumnsOrFormula(HbmBinder.java:1437)
> 	at org.hibernate.cfg.HbmBinder.bindSimpleValue(HbmBinder.java:1069)
> 	at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1982)
> 	at org.hibernate.cfg.HbmBinder.createClassProperties(HbmBinder.java:1940)
> 	at org.hibernate.cfg.HbmBinder.bindRootPersistentClassCommonValues(HbmBinder.java:324)
> 	at org.hibernate.cfg.HbmBinder.bindRootClass(HbmBinder.java:238)
> 	at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:109)
> 	at org.hibernate.cfg.Configuration.add(Configuration.java:385)
> 	at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:426)
> 	at org.hibernate.cfg.Configuration.addResource(Configuration.java:481)
> 	at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1443)
> 	at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1411)
> 	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1392)
> 	at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1368)
> 	at org.hibernate.cfg.Configuration.configure(Configuration.java:1288)
> 	at org.hibernate.cfg.Configuration.configure(Configuration.java:1274)
> 	at com.loren.SimpleExample.startHibernate(SimpleExample.java:37)
> 	at com.loren.SimpleExample.main(SimpleExample.java:45)
> The user should get a clearer error message, not a strack trace that looks like an internal hibernate
> programming error.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list