-->
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.  [ 9 posts ] 
Author Message
 Post subject: Package Not Found?
PostPosted: Wed Nov 16, 2005 3:38 am 
Regular
Regular

Joined: Thu Feb 17, 2005 1:58 am
Posts: 63
I decided to use Annotation and I ran into the below problem. Looks like Hibernate cannot find my myco.mypkg. My config file has the following:

<mapping package=" myco.mypkg"/>

Only some classes in mypkg are annotated. Looks like I am missing some annotations? If I use a mapping per class instead, would I run into the same issue? I don't want to annotate all 50 classes in mypkg yet until I have done a few tests on a few classes.

Thanks...

2005-11-15 23:27:58,195 DEBUG [ROOT] (Configuration.java:1218) - hibernate.dialect=org.hibernate.dialect.MySQLDialect
2005-11-15 23:27:58,195 DEBUG [ROOT] (AnnotationConfiguration.java:363) - null<-org.dom4j.tree.DefaultAttribute@13a317a [Attribute: name package value "myco.mypkg"]
2005-11-15 23:27:58,195 INFO [ROOT] (AnnotationConfiguration.java:114) - Mapping package myco.mypkg
2005-11-15 23:27:58,273 WARN [ROOT] (AnnotationBinder.java:157) - Package not found or wo package-info.java: myco.mypkg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 3:49 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read this again and then search for it in the documentation:

WARN [ROOT] (AnnotationBinder.java:157) - Package not found or wo package-info.java: myco.mypkg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 7:04 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You have to declare the annotated classes.
package is here to declare an annotated package witch is not a package having annotated classes inside.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 2:20 am 
Regular
Regular

Joined: Thu Feb 17, 2005 1:58 am
Posts: 63
emmanuel wrote:
You have to declare the annotated classes.
package is here to declare an annotated package witch is not a package having annotated classes inside.


Now it would be cool with a way to specify "package which has annotated classes inside"...:)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 17, 2005 8:46 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
use hibernate entity manager and the notion of par

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Re: Package Not Found?
PostPosted: Thu Jan 28, 2010 6:11 pm 
Newbie

Joined: Thu Jan 28, 2010 5:51 pm
Posts: 2
Hi,

I made an sample with Hibernate only, it works..

And the same with Spring3 using "org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean" like this:

orm-config.xml:
Code:
<bean id="sessionFactory"
      class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
      <property name="dataSource" ref="datasource"/>
      <property  name="configurationClass">
          <value>org.hibernate.cfg.AnnotationConfiguration</value>
      </property>
      <property name="configLocation">
         <value>classpath:hibernate.cfg.xml</value>
      </property>
      <property name="annotatedClasses">
         <list>
            <value>com.xxx.fcr.domain.User</value>
            <value>com.xxx.fcr.domain.Partition</value>
         </list>
      </property>
   </bean>


and in my hibernate.cfg.xml:
Code:
<!-- configuration-->
...

<!-- CONFIGURATION FOR ANNOTATION-->
      <property name="configurationClass">org.hibernate.cfg.AnnotationConfiguration</property>
<!--mapping-->
      <mapping package="com.xxx.fcr.domain" />
      <mapping class="com.xxx.fcr.domain.User"/>



but it doesn't work... I have exactly the same message (WARN : org.hibernate.cfg.AnnotationBinder - Package not found or wo package-info.java: com.xxx.xxxx.

Thanks by advance if any idea !


Top
 Profile  
 
 Post subject: Re: Package Not Found?
PostPosted: Sun Jan 31, 2010 9:41 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
remove the package:
Code:
<mapping package="com.xxx.fcr.domain" />

is not needed, just list the classes.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject: Re: Package Not Found?
PostPosted: Sun Jan 31, 2010 11:28 am 
Newbie

Joined: Thu Jan 28, 2010 5:51 pm
Posts: 2
Hi,

Thanks for your response. I've just removed it but no change.
I have always the message "WARN : org.hibernate.cfg.AnnotationBinder - Package not found or wo package-info.java: com.xxx.xxxx." while starting tomcat and when I try to persist an entity (User), I received an unknown entity message...

For remember it work with Hibernate alone but when I try to integrate Spring and Hibernate I have this problem.
It seems to be an integration problem between Spring and Hibernate ...


Top
 Profile  
 
 Post subject: Re: Package Not Found?
PostPosted: Wed Feb 03, 2010 6:25 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
It seems to be an integration problem between Spring and Hibernate ...

Then I'd suggest to ask on the Spring forums, as they handle the integration.

_________________
Sanne
http://in.relation.to/


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