You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ken in Nashua <kc...@live.com> on 2013/05/16 16:58:28 UTC
Re : Unknown entity and SessionFactory null
well its trying to configure from hibernate.cfg.xml
did you spell it out properly in the config file ?
Re: Unknown entity and SessionFactory null
Posted by Andjela Djenic <an...@yahoo.com>.
Thanks Robert, I will take a look.
Angela
________________________________
From: Robert Lentz <ro...@teksolv.de>
To: Tapestry users <us...@tapestry.apache.org>
Sent: Thursday, May 16, 2013 9:40 PM
Subject: Re: Unknown entity and SessionFactory null
Angela,
have a look at
https://github.com/rlentz/tahi_jndi.
This is a very simple tapestry-hibernate-jndi-demo setup for using
hibernate in tapestry using tomcat or jetty.
The database/hibernate configuration is solely done via a jndi
environment without a hibernate.cfg.xml at all and automatically creates
test-data in development mode. The hibernate entity class PHEUser is
automatically retrieved from the entities packages.
Have a look at it and you might find the difference why it isn't working
for you.
Hope it is helpful.
Aloha
Robert
Andjela Djenic schrieb:
> 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 <lp...@hope.nyc.ny.us>
> To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Unknown entity and SessionFactory null
Posted by Robert Lentz <ro...@teksolv.de>.
Angela,
have a look at
https://github.com/rlentz/tahi_jndi.
This is a very simple tapestry-hibernate-jndi-demo setup for using
hibernate in tapestry using tomcat or jetty.
The database/hibernate configuration is solely done via a jndi
environment without a hibernate.cfg.xml at all and automatically creates
test-data in development mode. The hibernate entity class PHEUser is
automatically retrieved from the entities packages.
Have a look at it and you might find the difference why it isn't working
for you.
Hope it is helpful.
Aloha
Robert
Andjela Djenic schrieb:
> 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 <lp...@hope.nyc.ny.us>
> To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Unknown entity and SessionFactory null
Posted by Andjela Djenic <an...@yahoo.com>.
Hvala! :)
________________________________
From: Boris Horvat <ho...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <an...@yahoo.com>
Sent: Friday, May 17, 2013 12:06 AM
Subject: Re: Unknown entity and SessionFactory null
Srecno u projektu... Zanimljivo da se tapestry radi sada na fon-u ja sam ga
radio u 4toj....
On Fri, May 17, 2013 at 12:02 AM, Andjela Djenic <an...@yahoo.com>wrote:
> It was wrong hibernate mapping. It works now without adding entities to
> hibernate.config.xml and without adding the contribution
> to HibernateEntityPackageManager class.
>
> I know that tapestry-hibernate covers tapestry-core and
> tapestry-hibernate-core, but for some reason my app won't work with that
> dependency.
>
> Thanks so much for the help!
>
> Angela
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Boris Horvat <ho...@gmail.com>.
Srecno u projektu... Zanimljivo da se tapestry radi sada na fon-u ja sam ga
radio u 4toj....
On Fri, May 17, 2013 at 12:02 AM, Andjela Djenic <an...@yahoo.com>wrote:
> It was wrong hibernate mapping. It works now without adding entities to
> hibernate.config.xml and without adding the contribution
> to HibernateEntityPackageManager class.
>
> I know that tapestry-hibernate covers tapestry-core and
> tapestry-hibernate-core, but for some reason my app won't work with that
> dependency.
>
> Thanks so much for the help!
>
> Angela
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Andjela Djenic <an...@yahoo.com>.
It was wrong hibernate mapping. It works now without adding entities to hibernate.config.xml and without adding the contribution to HibernateEntityPackageManager class.
I know that tapestry-hibernate covers tapestry-core and tapestry-hibernate-core, but for some reason my app won't work with that dependency.
Thanks so much for the help!
Angela
Re: Unknown entity and SessionFactory null
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Thu, 16 May 2013 18:18:37 -0300, Boris Horvat
<ho...@gmail.com> wrote:
> This error looks to be generic to hibernate. Basically you have mapped
> the objects wrong do the inheritance.
Definitely a pure Hibernate error (specifically mapping) completely
unrelated to Tapestry.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Unknown entity and SessionFactory null
Posted by Boris Horvat <ho...@gmail.com>.
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 <an...@yahoo.com>wrote:
> Here's the link to console output http://justpaste.it/2n2r
>
> Thanks,
> Angela
>
>
> ________________________________
> From: Boris Horvat <ho...@gmail.com>
> To: Andjela Djenic <an...@yahoo.com>
> Cc: Tapestry users <us...@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 <andjela88@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 <ho...@gmail.com>
> > *To:* Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <
> > andjela88@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 <andjela88@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 <ho...@gmail.com>
> > To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <
> > andjela88@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 <an...@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 <lp...@hope.nyc.ny.us>
> > > To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> >
> >
> >
> > --
> > Sincerely
> > *Boris Horvat*
> >
> >
> >
> >
> > --
> > Sincerely
> > *Boris Horvat*
> >
> >
> >
>
>
> --
> Sincerely
> *Boris Horvat*
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Andjela Djenic <an...@yahoo.com>.
Here's the link to console output http://justpaste.it/2n2r
Thanks,
Angela
________________________________
From: Boris Horvat <ho...@gmail.com>
To: Andjela Djenic <an...@yahoo.com>
Cc: Tapestry users <us...@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 <an...@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 <ho...@gmail.com>
> *To:* Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <
> andjela88@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 <an...@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 <ho...@gmail.com>
> To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <
> andjela88@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 <an...@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 <lp...@hope.nyc.ny.us>
> > To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
>
>
> --
> Sincerely
> *Boris Horvat*
>
>
>
>
> --
> Sincerely
> *Boris Horvat*
>
>
>
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Boris Horvat <ho...@gmail.com>.
What exception?
On Thu, May 16, 2013 at 10:01 PM, Andjela Djenic <an...@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 <ho...@gmail.com>
> *To:* Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <
> andjela88@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 <an...@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 <ho...@gmail.com>
> To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <
> andjela88@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 <an...@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 <lp...@hope.nyc.ny.us>
> > To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
>
>
> --
> Sincerely
> *Boris Horvat*
>
>
>
>
> --
> Sincerely
> *Boris Horvat*
>
>
>
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Andjela Djenic <an...@yahoo.com>.
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 <ho...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <an...@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 <an...@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 <ho...@gmail.com>
>To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <an...@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 <an...@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 <lp...@hope.nyc.ny.us>
>> To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
>
>--
>Sincerely
>*Boris Horvat*
--
Sincerely
Boris Horvat
Re: Unknown entity and SessionFactory null
Posted by Boris Horvat <ho...@gmail.com>.
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 <an...@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 <ho...@gmail.com>
> To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <
> andjela88@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 <an...@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 <lp...@hope.nyc.ny.us>
> > To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
>
>
>
> --
> Sincerely
> *Boris Horvat*
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Andjela Djenic <an...@yahoo.com>.
<!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 <ho...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org>; Andjela Djenic <an...@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 <an...@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 <lp...@hope.nyc.ny.us>
> To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Boris Horvat <ho...@gmail.com>.
Can you provide hibernate.cfg.xml now?
On Thu, May 16, 2013 at 9:28 PM, Andjela Djenic <an...@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 <lp...@hope.nyc.ny.us>
> To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
--
Sincerely
*Boris Horvat*
Re: Unknown entity and SessionFactory null
Posted by Andjela Djenic <an...@yahoo.com>.
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 <lp...@hope.nyc.ny.us>
To: Tapestry users <us...@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 <kc...@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Unknown entity and SessionFactory null
Posted by Lenny Primak <lp...@hope.nyc.ny.us>.
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 <kc...@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Re : Unknown entity and SessionFactory null
Posted by Boris Horvat <ho...@gmail.com>.
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 <kc...@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*
RE: Re : Unknown entity and SessionFactory null
Posted by Ken in Nashua <kc...@live.com>.
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>