[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-1832) Exception appeares while trying to expand newly created Hibernate configuration in Hibernate Configurations View

Anton Klimkovich (JIRA) jira-events at lists.jboss.org
Mon Mar 3 13:09:58 EST 2008


    [ http://jira.jboss.com/jira/browse/JBIDE-1832?page=comments#action_12401145 ] 
            
Anton Klimkovich commented on JBIDE-1832:
-----------------------------------------

If set path to created mapping file on Mappings tab while edit hibernate configuration in Hibernate Configuration View it will be found.
But when I type <mapping file=" {Path to hbm.xml} "/> in  cfg.xml I get such exception.
And also if it will be visible we get another exception: 

org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\jbdevstudio\eclipse\ws\NewJSFProject\WebContent\pages\NewMapping.hbm.xml
Could not parse mapping document from file C:\jbdevstudio\eclipse\ws\NewJSFProject\WebContent\pages\NewMapping.hbm.xml
  org.hibernate.MappingException: must specify an identifier type: demo.User
  must specify an identifier type: demo.User
    org.hibernate.MappingException: must specify an identifier type: demo.User
    must specify an identifier type: demo.User

To solve this we need to add to mapping file such strings for example:
<id name="id">
  	<column name="UserId"/>
  	<generator class="increment"></generator>
  </id>
and in our class:
private Long id;
public Long getId(){
	    return id;
	  }    

	public void setId(Long id) {
		this.id = id;
	}

And also a lot of other exceptions fall in PDE Runtime Error log while use mapping file or try to use class with incomplete annotations and set path to this class in cfg.xml ...
And I expect that will be design any model to  handle such exceptions.
If such model will not be designed we can put all this exceptions to jira one after another. :(


> Exception appeares while trying to expand newly created Hibernate configuration in Hibernate Configurations View
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: JBIDE-1832
>                 URL: http://jira.jboss.com/jira/browse/JBIDE-1832
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Hibernate
>    Affects Versions: 2.0.1
>            Reporter: Anton Klimkovich
>         Assigned To: Anton Klimkovich
>         Attachments: exception.txt
>
>
> EXECUTE: Create JSF KickStart project
> EXECUTE: Create Hibernate XML Mapping file(hbm.xml)
> EXECUTE: Type in mapping file :
> <class name="demo.User">
>   <id/>
>   <property name="name" type="string">
>    <column name="registration"/>
>   </property>
>  </class>
> EXECUTE:  Create Hibernate Configuration file(cfg.xml)
> EXECUTE: Type in cfg.xml
> <session-factory name="Registration">
>   <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
>   <property name="hibernate.connection.url">jdbc:hsqldb:hsql://localhost</property>
>   <property name="hibernate.connection.username">sa</property>
>   <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
>   <mapping file=" {Path to hbm.xml} "/>
>  </session-factory>
> EXECUTE: Open Hibernate Configurations View
> EXECUTE: From context menu select Add configuration..
> EXECUTE: In field Project select your JSF project
> EXECUTE: In field Configuration file select your created cfg.xml
> ASSERT:    New Hibernate configuration appeares in  Hibernate Configurations View
> EXECUTE: Expand new Hibernate configuration
> FAILURE:   org.hibernate.MappingNotFoundException: file: \NewMapping.hbm.xml not found 
> Log attached.

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

        



More information about the jbosstools-issues mailing list