You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/12/16 04:11:54 UTC
svn commit: r487751 -
/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
Author: snoopdave
Date: Fri Dec 15 19:11:53 2006
New Revision: 487751
URL: http://svn.apache.org/viewvc?view=rev&rev=487751
Log:
Until we can load both Weblogger and Planet O/R mappings, we still need planet objects in the mapping file
Modified:
incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
Modified: incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml?view=diff&rev=487751&r1=487750&r2=487751
==============================================================================
--- incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml (original)
+++ incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml Fri Dec 15 19:11:53 2006
@@ -67,5 +67,11 @@
<mapping resource="org/apache/roller/pojos/EntryAttributeData.hbm.xml" />
<mapping resource="org/apache/roller/pojos/WeblogCategoryData.hbm.xml" />
+ <!-- Until we can load both Weblogger and Planet config files, we need these -->
+ <mapping resource="org/apache/roller/planet/pojos/PlanetConfigData.hbm.xml" />
+ <mapping resource="org/apache/roller/planet/pojos/PlanetGroupData.hbm.xml" />
+ <mapping resource="org/apache/roller/planet/pojos/PlanetEntryData.hbm.xml" />
+ <mapping resource="org/apache/roller/planet/pojos/PlanetSubscriptionData.hbm.xml" />
+
</session-factory>
</hibernate-configuration>
Re: svn commit: r487751 - /incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
Posted by Dave <sn...@gmail.com>.
On 12/16/06, Allen Gilliland <al...@sun.com> wrote:
> Maybe you have multiple planet.properties files in your classpath
> somehow and it's picking up the wrong one?
Yep. That was it. I had a planet-custom.properties file lingering in
common/classes dir.
Thanks,
- Dave
Re: svn commit: r487751 -
/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
Posted by Allen Gilliland <al...@sun.com>.
Dave wrote:
> On 12/16/06, Allen Gilliland <al...@sun.com> wrote:
>> I don't understand this. Adding the planet pojos back into the Roller
>> Weblogger hibernate mapping file won't do you any good because the
>> Hibernate SessionFactory which manages all the Roller Weblogger objects
>> will never come in contact with the Roller Planet pojos anymore.
>>
>> The way it is designed to work now is that there are 2 SessionFactories,
>> 1 for the Roller Weblogger objects which is managed by the Roller
>> business layer and a 2nd SessionFactory for the Roller Planet objects
>> which is managed by the Planet business layer. So these bits of code ...
>>
>> RollerFactory.getRoller().getXXXManager().doSomething()
>> PlanetFactory.getPlanet().getXXXManager().doSomething()
>>
>> ... are operating on different SessionFactories by design. This is all
>> configured using the planet.properties file and the
>> planet-hibernate.cfg.xml files in the web/WEB-INF/classes directory.
>> The planet.properties file indicates that we want to use
>> planet-hibernate.cfg.xml as our hibernate config resource file and that
>> file is used when loading the SessionFactory used for managing the
>> Planet business layer.
>>
>> I have tested all of this out and it's all working properly, so I'm not
>> sure why you needed this commit or how it could have fixed anything.
>
> (Thanks for the quick review)
>
> I was getting the exception below when doing a save in the Planet
> Config page, so I figured that you had not done all the work necessary
> to read/process both config files. I added the planet POJO mappings
> and the exception went away.
That's strange. I tested out all the planet functions from within the
Roller Weblogger UI a number of times and didn't have any problems with
it, which is why I committed the hibernate config with the planet pojos
commented out.
Did you somehow not get all the updated code or possibly mix some config
files with versions that you have which are changed? What version of
the src are you building?
If you are building from the trunk then the planet business layer code
is all in the new apps/planet app workspace and the code should show
that when it loads the planet manager via PlanetFactory.getPlanet() that
the hibernate resources file used to configure the hibernate mappings
should be the one defined in the planet.properties file. So if the
PlanetConfig is properly loading the planet.properties file from within
the webapp then it should tell the planet code to use
planet-hibernate.cfg.xml as the hibernate resource file.
Maybe you have multiple planet.properties files in your classpath
somehow and it's picking up the wrong one?
Technically there shouldn't be any problems created by what you did, but
it's also not the best way to have things configured.
-- Allen
>
> ERROR 2006-12-16 12:56:14,840 StandardWrapperValve:invoke -
> Servlet.service() for servlet action threw exception
> org.hibernate.MappingException: Unknown entity:
> org.apache.roller.planet.pojos.PlanetConfigData
> at
> org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:513)
>
> at
> org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1321)
> at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:180)
> ... blah blah blah...
> org.apache.roller.planet.business.hibernate.HibernatePlanetManagerImpl.saveConfiguration(HibernatePlanetManagerImpl.java:72)
>
> at
> org.apache.roller.planet.ui.admin.struts.actions.PlanetConfigAction.saveConfig(PlanetConfigAction.java:139)
>
>
> Looks like HibernatePlanetImpl might need some work -- perhaps it's
> still loading the old hibernate.cfg.xml file and not the new planet
> one?
>
> - Dave
>
>
>
>
>> -- Allen
>>
>>
>> snoopdave@apache.org wrote:
>> > Author: snoopdave
>> > Date: Fri Dec 15 19:11:53 2006
>> > New Revision: 487751
>> >
>> > URL: http://svn.apache.org/viewvc?view=rev&rev=487751
>> > Log:
>> > Until we can load both Weblogger and Planet O/R mappings, we still
>> need planet objects in the mapping file
>> >
>> > Modified:
>> >
>> incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
>> >
>> > Modified:
>> incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
>> > URL:
>> http://svn.apache.org/viewvc/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml?view=diff&rev=487751&r1=487750&r2=487751
>>
>> >
>> ==============================================================================
>>
>> > ---
>> incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
>> (original)
>> > +++
>> incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
>> Fri Dec 15 19:11:53 2006
>> > @@ -67,5 +67,11 @@
>> > <mapping
>> resource="org/apache/roller/pojos/EntryAttributeData.hbm.xml" />
>> > <mapping
>> resource="org/apache/roller/pojos/WeblogCategoryData.hbm.xml" />
>> >
>> > + <!-- Until we can load both Weblogger and Planet config
>> files, we need these -->
>> > + <mapping
>> resource="org/apache/roller/planet/pojos/PlanetConfigData.hbm.xml" />
>> > + <mapping
>> resource="org/apache/roller/planet/pojos/PlanetGroupData.hbm.xml" />
>> > + <mapping
>> resource="org/apache/roller/planet/pojos/PlanetEntryData.hbm.xml" />
>> > + <mapping
>> resource="org/apache/roller/planet/pojos/PlanetSubscriptionData.hbm.xml"
>> />
>> > +
>> > </session-factory>
>> > </hibernate-configuration>
>> >
>> >
>>
Re: svn commit: r487751 - /incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
Posted by Dave <sn...@gmail.com>.
On 12/16/06, Allen Gilliland <al...@sun.com> wrote:
> I don't understand this. Adding the planet pojos back into the Roller
> Weblogger hibernate mapping file won't do you any good because the
> Hibernate SessionFactory which manages all the Roller Weblogger objects
> will never come in contact with the Roller Planet pojos anymore.
>
> The way it is designed to work now is that there are 2 SessionFactories,
> 1 for the Roller Weblogger objects which is managed by the Roller
> business layer and a 2nd SessionFactory for the Roller Planet objects
> which is managed by the Planet business layer. So these bits of code ...
>
> RollerFactory.getRoller().getXXXManager().doSomething()
> PlanetFactory.getPlanet().getXXXManager().doSomething()
>
> ... are operating on different SessionFactories by design. This is all
> configured using the planet.properties file and the
> planet-hibernate.cfg.xml files in the web/WEB-INF/classes directory.
> The planet.properties file indicates that we want to use
> planet-hibernate.cfg.xml as our hibernate config resource file and that
> file is used when loading the SessionFactory used for managing the
> Planet business layer.
>
> I have tested all of this out and it's all working properly, so I'm not
> sure why you needed this commit or how it could have fixed anything.
(Thanks for the quick review)
I was getting the exception below when doing a save in the Planet
Config page, so I figured that you had not done all the work necessary
to read/process both config files. I added the planet POJO mappings
and the exception went away.
ERROR 2006-12-16 12:56:14,840 StandardWrapperValve:invoke -
Servlet.service() for servlet action threw exception
org.hibernate.MappingException: Unknown entity:
org.apache.roller.planet.pojos.PlanetConfigData
at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:513)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1321)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:180)
... blah blah blah...
org.apache.roller.planet.business.hibernate.HibernatePlanetManagerImpl.saveConfiguration(HibernatePlanetManagerImpl.java:72)
at org.apache.roller.planet.ui.admin.struts.actions.PlanetConfigAction.saveConfig(PlanetConfigAction.java:139)
Looks like HibernatePlanetImpl might need some work -- perhaps it's
still loading the old hibernate.cfg.xml file and not the new planet
one?
- Dave
> -- Allen
>
>
> snoopdave@apache.org wrote:
> > Author: snoopdave
> > Date: Fri Dec 15 19:11:53 2006
> > New Revision: 487751
> >
> > URL: http://svn.apache.org/viewvc?view=rev&rev=487751
> > Log:
> > Until we can load both Weblogger and Planet O/R mappings, we still need planet objects in the mapping file
> >
> > Modified:
> > incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
> >
> > Modified: incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
> > URL: http://svn.apache.org/viewvc/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml?view=diff&rev=487751&r1=487750&r2=487751
> > ==============================================================================
> > --- incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml (original)
> > +++ incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml Fri Dec 15 19:11:53 2006
> > @@ -67,5 +67,11 @@
> > <mapping resource="org/apache/roller/pojos/EntryAttributeData.hbm.xml" />
> > <mapping resource="org/apache/roller/pojos/WeblogCategoryData.hbm.xml" />
> >
> > + <!-- Until we can load both Weblogger and Planet config files, we need these -->
> > + <mapping resource="org/apache/roller/planet/pojos/PlanetConfigData.hbm.xml" />
> > + <mapping resource="org/apache/roller/planet/pojos/PlanetGroupData.hbm.xml" />
> > + <mapping resource="org/apache/roller/planet/pojos/PlanetEntryData.hbm.xml" />
> > + <mapping resource="org/apache/roller/planet/pojos/PlanetSubscriptionData.hbm.xml" />
> > +
> > </session-factory>
> > </hibernate-configuration>
> >
> >
>
Re: svn commit: r487751 -
/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
Posted by Allen Gilliland <al...@sun.com>.
Dave,
I don't understand this. Adding the planet pojos back into the Roller
Weblogger hibernate mapping file won't do you any good because the
Hibernate SessionFactory which manages all the Roller Weblogger objects
will never come in contact with the Roller Planet pojos anymore.
The way it is designed to work now is that there are 2 SessionFactories,
1 for the Roller Weblogger objects which is managed by the Roller
business layer and a 2nd SessionFactory for the Roller Planet objects
which is managed by the Planet business layer. So these bits of code ...
RollerFactory.getRoller().getXXXManager().doSomething()
PlanetFactory.getPlanet().getXXXManager().doSomething()
... are operating on different SessionFactories by design. This is all
configured using the planet.properties file and the
planet-hibernate.cfg.xml files in the web/WEB-INF/classes directory.
The planet.properties file indicates that we want to use
planet-hibernate.cfg.xml as our hibernate config resource file and that
file is used when loading the SessionFactory used for managing the
Planet business layer.
I have tested all of this out and it's all working properly, so I'm not
sure why you needed this commit or how it could have fixed anything.
-- Allen
snoopdave@apache.org wrote:
> Author: snoopdave
> Date: Fri Dec 15 19:11:53 2006
> New Revision: 487751
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=487751
> Log:
> Until we can load both Weblogger and Planet O/R mappings, we still need planet objects in the mapping file
>
> Modified:
> incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
>
> Modified: incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml
> URL: http://svn.apache.org/viewvc/incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml?view=diff&rev=487751&r1=487750&r2=487751
> ==============================================================================
> --- incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml (original)
> +++ incubator/roller/trunk/metadata/database/hibernate/hibernate.cfg.xml Fri Dec 15 19:11:53 2006
> @@ -67,5 +67,11 @@
> <mapping resource="org/apache/roller/pojos/EntryAttributeData.hbm.xml" />
> <mapping resource="org/apache/roller/pojos/WeblogCategoryData.hbm.xml" />
>
> + <!-- Until we can load both Weblogger and Planet config files, we need these -->
> + <mapping resource="org/apache/roller/planet/pojos/PlanetConfigData.hbm.xml" />
> + <mapping resource="org/apache/roller/planet/pojos/PlanetGroupData.hbm.xml" />
> + <mapping resource="org/apache/roller/planet/pojos/PlanetEntryData.hbm.xml" />
> + <mapping resource="org/apache/roller/planet/pojos/PlanetSubscriptionData.hbm.xml" />
> +
> </session-factory>
> </hibernate-configuration>
>
>