This error looks to be generic to hibernate. Basically you have mapped the
objects wrong do the inheritance.

Since this is a student project can I assume that your code is not top
secret and that you have a repository for it (e.g. bitbucket)?

Take a look at
http://stackoverflow.com/questions/3615778/can-i-use-compositeid-on-subclasses-of-discriminated-entity-hierarchy

and btw the maven dependency change that I suggested to use, please do so.
As I am sure that the first one was wrong. :)

hibernate-core has dependency on tapestry core so you should use just that


On Thu, May 16, 2013 at 11:08 PM, Andjela Djenic <andjel...@yahoo.com>wrote:

> Here's the link to console output http://justpaste.it/2n2r
>
> Thanks,
> Angela
>
>
> ________________________________
>  From: Boris Horvat <horvat.z.bo...@gmail.com>
> To: Andjela Djenic <andjel...@yahoo.com>
> Cc: Tapestry users <users@tapestry.apache.org>
> Sent: Thursday, May 16, 2013 10:29 PM
> Subject: Re: Unknown entity and SessionFactory null
>
>
> What exception?
>
>
> On Thu, May 16, 2013 at 10:01 PM, Andjela Djenic <andjel...@yahoo.com
> >wrote:
>
> > I'm getting an exception when I do that way.
> > I'm not satisfied with solution to add entities in config file, since it
> > should be done automatically, by convention.
> > It actually worked fine few days ago, and I don't know which changes
> could
> > disrupt that.
> >
> > Thanks,
> > Angela
> >
> >   ------------------------------
> >  *From:* Boris Horvat <horvat.z.bo...@gmail.com>
> > *To:* Tapestry users <users@tapestry.apache.org>; Andjela Djenic <
> > andjel...@yahoo.com>
> > *Sent:* Thursday, May 16, 2013 9:46 PM
> > *Subject:* Re: Unknown entity and SessionFactory null
> >
> > Can you try adding in AppModule.java
> >
> >
> >     @Contribute(HibernateEntityPackageManager.class)
> >     public static void
> > addHibernateEntityPackageManager(Configuration<String> configuration) {
> >         configuration.add("rs.fon.master.onlinelibrary.entities");
> >     }
> >
> > (and remove the mapping tag from the xml).
> >
> > Since this is a student project if you are happy with the result then you
> > dont have to. I am just curious as to why it is not working
> >
> >
> > On Thu, May 16, 2013 at 9:42 PM, Andjela Djenic <andjel...@yahoo.com
> >wrote:
> >
> > <!DOCTYPE hibernate-configuration PUBLIC
> >         "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
> >         "
> http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
> > ">
> > <hibernate-configuration>
> >     <session-factory>
> >         <property
> > name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
> >         <property
> >
> name="hibernate.connection.url">jdbc:mysql://localhost:3306/library</property>
> >         <property
> > name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
> >         <property name="hibernate.connection.username">root</property>
> >         <property name="hibernate.connection.password">books</property>
> >         <property name="hbm2ddl.auto">update</property>
> >         <property name="hibernate.show_sql">true</property>
> >         <property name="hibernate.format_sql">true</property>
> >         <property
> >
> name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
> >
> >         <property
> > name="hibernate.current_session_context_class">thread</property>
> >
> >         <mapping class="rs.fon.master.onlinelibrary.entities.City"/>
> >     </session-factory>
> > </hibernate-configuration>
> >
> > I added only one entity to try if it works.
> >
> > ________________________________
> >  From: Boris Horvat <horvat.z.bo...@gmail.com>
> > To: Tapestry users <users@tapestry.apache.org>; Andjela Djenic <
> > andjel...@yahoo.com>
> > Sent: Thursday, May 16, 2013 9:32 PM
> > Subject: Re: Unknown entity and SessionFactory null
> >
> >
> > Can you provide hibernate.cfg.xml now?
> >
> >
> > On Thu, May 16, 2013 at 9:28 PM, Andjela Djenic <andjel...@yahoo.com>
> > wrote:
> >
> > > I added entity class in hibernate.cfg.xml and it works. I don't get why
> > > Tapestry won't automatically see my entities package.
> > >
> > > Thanks for the help folks!
> > >
> > > Angela
> > >
> > >
> > > ________________________________
> > >  From: Lenny Primak <lpri...@hope.nyc.ny.us>
> > > To: Tapestry users <users@tapestry.apache.org>
> > > Sent: Thursday, May 16, 2013 9:14 PM
> > > Subject: Re: Unknown entity and SessionFactory null
> > >
> > >
> > > I don't know about Hibernate, but JPA has an option to either scan for
> > all
> > > the entities,
> > > or provide them in configuration.  Perhaps there is the same thing for
> > > Hibernate,
> > > or it's turned off somewhere....
> > >
> > > On May 16, 2013, at 3:10 PM, Boris Horvat wrote:
> > >
> > > > I would be more interested in seeing why doesn't this work out of the
> > > box.
> > > > I also dont provide entities in config.xml instead I let tapestry
> grab
> > > them
> > > > from my package...
> > > >
> > > >
> > > > On Thu, May 16, 2013 at 8:42 PM, Ken in Nashua <kcola...@live.com>
> > > wrote:
> > > >
> > > >> Hi Angela,
> > > >>
> > > >> Looks liek you didnt specify any entities in your hibernate cfg
> > mapping
> > > >> file.
> > > >>
> > > >> If you model an entity under your model/entity package, yes you need
> > to
> > > >> tell your AppModule.JAVA about that directory...
> > > >>
> > > >> But you also need to tell hibernate about those entities.
> > > >>
> > > >> We do this by specifying them in our hibernate.cfg.xml
> > > >>
> > > >> Here is mine..
> > > >>
> > > >>
> > > >>
> > > >> <?xml version="1.0" encoding="UTF-8"?>
> > > >> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
> > > >> Configuration DTD 3.0//EN"
> > > >>        "
> > > http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd
> > > >> ">
> > > >> <hibernate-configuration>
> > > >>    <session-factory>
> > > >>        <!-- for more Database configuration options check:
> > > >>
> http://org.tynamo.examples.pphl.org/Sample+database+configurations-->
> > > >>        <property
> > > >>
> > >
> name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
> > > >>        <property
> > > >>
> > >
> >
> name="hibernate.connection.url">jdbc:mysql://localhost:3306/thibernatetest?autoReconnect=true</property>
> > > >>        <property
> > > >>
> name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
> > > >>        <property
> name="hibernate.connection.username">root</property>
> > > >>        <property
> name="hibernate.connection.password">admin</property>
> > > >>        <property name="hbm2ddl.auto">update</property>
> > > >>        <property name="hibernate.show_sql">false</property>
> > > >>        <property name="hibernate.format_sql">true</property>
> > > >>        <property name="hibernate.connection.pool_size">90</property>
> > > >>        <property name="autoReconnect">true</property>
> > > >>
> > > >>        <property name="hibernate.c3p0.min_size">5</property>
> > > >>        <property name="hibernate.c3p0.max_size">20</property>
> > > >>        <property name="hibernate.c3p0.timeout">300</property>
> > > >>        <property name="hibernate.c3p0.max_statements">50</property>
> > > >>        <property
> > name="hibernate.c3p0.idle_test_period">3000</property>
> > > >>        <property
> > > >>
> > >
> >
> name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property>
> > > >>        <property
> > > >>
> > >
> >
> name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
> > > >>
> > > >>
> > > >>        <mapping class="org.tynamo.common.model.HibernateEntity"/>
> > > >>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.AdminLayout"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.PhotoGroup"/>
> > > >>        <mapping
> > class="org.tynamo.examples.pphl.model.PhotoGroupPhoto"/>
> > > >>        <mapping
> > class="org.tynamo.examples.pphl.model.UploadableMedia"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Person"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Sponsor"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.BroadCast"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Coach"/>
> > > >>        <mapping
> class="org.tynamo.examples.pphl.model.Demographics"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Director"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.HitCounter"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.League"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.MetaTag"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Officer"/>
> > > >>        <mapping
> class="org.tynamo.examples.pphl.model.Organization"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Payment"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Player"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.PlayerStats"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.TeamStats"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Inquiry"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Team"/>
> > > >>        <mapping class="org.tynamo.examples.pphl.model.Year"/>
> > > >>
> > > >>    </session-factory>
> > > >> </hibernate-configuration>
> > > >>
> > > >>
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Sincerely
> > > > *Boris Horvat*
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> > > For additional commands, e-mail: users-h...@tapestry.apache.org
> > >
> >
> >
> >
> > --
> > Sincerely
> > *Boris Horvat*
> >
> >
> >
> >
> > --
> > Sincerely
> > *Boris Horvat*
> >
> >
> >
>
>
> --
> Sincerely
> *Boris Horvat*




-- 
Sincerely
*Boris Horvat*

Reply via email to