-->
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.  [ 5 posts ] 
Author Message
 Post subject: Having problems with the JPA Hibernate Tools Eclipse plugin
PostPosted: Tue Feb 06, 2007 11:42 am 
Newbie

Joined: Fri Oct 17, 2003 11:31 am
Posts: 19
I'm trying to create a JPA based hibernate console configuration in Eclipse, but I keep getting the following error when I try to use the console configuration :

Code:
org.hibernate.console.HibernateConsoleRuntimeException: Could not load JPA Configuration
  org.hibernate.console.HibernateConsoleRuntimeException: Could not create JPA based Configuration
    org.hibernate.console.HibernateConsoleRuntimeException: Could not create JPA based Configuration
    java.lang.reflect.InvocationTargetException: <no message>
    javax.persistence.PersistenceException: org.hibernate.MappingException: Could not parse mapping document in input stream
    org.hibernate.MappingException: Could not parse mapping document in input stream
    org.dom4j.DocumentException: Error on line -1 of document  : Premature end of file. Nested exception: Premature end of file.


Here is the persistence.xml file I'm using :

Code:
<?xml version='1.0' encoding='utf-8'?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
   http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
   version="1.0">
   <persistence-unit name="test">
      <provider>org.hibernate.ejb.HibernatePersistence</provider>
      <jta-data-source>jdbc/test</jta-data-source>
      <exclude-unlisted-classes>false</exclude-unlisted-classes>
      <properties>
         <!-- This property will autoload all annotated class files, as
            well as and .hbm.xml file it finds in the classpath -->
         
         <property name="hibernate.show_sql" value="false" />
         <property name="hibernate.max_fetch_depth" value="1" />
         <property name="hibernate.format_sql" value="true" />
         
         <!-- JTA Transaction setup -->
         <property name="hibernate.current_session_context_class" value="jta" />
         <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.SunONETransactionManagerLookup" />
         <property name="hibernate.connection.datasource" value="jdbc/soso" />

         <property name="hibernate.jdbc.use_streams_for_binary" value="true" />
         <property name="hibernate.query.substitutions" value="true 1, false 0, yes 'Y', no 'N'" />
         <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle9Dialect" />
         <property name="hibernate.default_schema" value="SOSO" />
         <property name="hibernate.jdbc.batch_size" value="0" />
         <property name="hibernate.bytecode.provider" value="cglib" />
         <property name="hibernate.connection.release_mode" value="after_statement" />
         <property name="hibernate.connection.pool_size" value="0" />

         <!-- If enabled, the session will be automatically closed
         during the after completion phase of the transaction  -->
         <property name="hibernate.transaction.auto_close_session" value="true" />

         <!--If enabled, the session will be automatically flushed
         during the before completion phase of the transaction. -->
         <property name="hibernate.transaction.flush_before_completion" value="true" />

         <!-- Disable the second-level cache  -->
         <property name="hibernate.cache.provider_class" value="org.hibernate.cache.NoCacheProvider" />
      
      </properties>
   </persistence-unit>   
   
</persistence>


Is there something simple I'm missing here? I know that it's finding my persistence.xml in the classpath, because if I enter invalid tags it gives me a parse exception.

I'm using hibernate-tools 3.2 beta9 with the latest JBossIDE.

Any help would be greatly appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 08, 2007 5:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...weeird error. please report in jira since I in any case want to improve that not really usefull error message: "Could not parse mapping document in input stream" ...what document ? :)

When that is said, please check if you got caught by a bug where the tooling automatically add all hbm.xml's it finds to the Mappings tab even though you are using JPA and hence it is not needed.

If yes; try and remove all of them and try again.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 08, 2007 11:45 am 
Newbie

Joined: Fri Oct 17, 2003 11:31 am
Posts: 19
Here's a little more information that may or may not be useful :

The window that the error pops up in is titled 'Lazy tree error' with the top error being 'Error while fetching children'.

I looked in my mappings tab, and none of the .hbm.xml files are listed.

Also, I'm assuming that when I'm in the Console Configuration screen, and after I check JPA (jdk 1.5+), that the only other information I need to supply is the name of the persistence Unit I want to use.

Let me know if you still want me to open a Jira ticket on this issue.

I'm hoping that the additional information from the error window might help to track down what's happening.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 09, 2007 5:37 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no unfortunately not.

the "lazy tree error" just hints when it occurs (namely when you expand the node).

for some reason Hibernate EntityManager finds something it wants to read and opens an inputstream that results in -1 bytes ;(

can you try and minimize your project the simplest possible and still trigger the error? if that is possbile then attaching it to a jira case would allow me to look into it ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 14, 2007 1:36 pm 
Newbie

Joined: Wed Feb 14, 2007 12:56 pm
Posts: 4
Same problem here...

My persistence.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence">
    <persistence-unit name="portaltecnico" transaction-type="RESOURCE_LOCAL">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <properties>
            <property name="hibernate.connection.driver_class" value="org.firebirdsql.jdbc.FBDriver"/>
            <property name="hibernate.connection.url" value="jdbc:firebirdsql:path2db"/>
            <property name="hibernate.dialect" value="org.hibernate.dialect.FirebirdDialect"/>
            <property name="hibernate.connection.username" value="user"/>
            <property name="hibernate.connection.password" value="pass"/>
        </properties>
    </persistence-unit>
</persistence>



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