You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Jean-Francois Poilpret <jf...@hcm.vnn.vn> on 2006/03/01 14:15:56 UTC

RE: Hivetranse/Hibernate/Tapestry troubles

Hi Andreas,

>> Just to make sure: META-INF also resides in /context/?

I don't know what /context/ is, but I suppose it is not correct. META-INF
should be at the root of your classpath (or root of jar file).


>> Well, actually I don't create a jar file at all... I just configured
my tomcat context to use the docBase directly from my eclipse workspace.
Perhaps this has something to do with the classpath problem?

Could be, hard to tell until we know exactly what can be found in your
workspace (ie the docBase) and at which exact position. 


>> I _think_ I use HiveMindFilter ;) How can I check that?

Just take a look at WEB-INF/web.xml and search for presence of
HiveMindFilter.
I think you use Tapestry right? I am not a Tapestry user so I don't know if
Tapestry uses HiveMindFilter or some other way to build the HiveMind
registry.

Cheers

	Jean-Francois

-----Original Message-----
From: Andreas Bulling [mailto:andreas@phoenix.hadiko.de] On Behalf Of
Andreas Bulling
Sent: Sunday, February 26, 2006 6:23 PM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivetranse/Hibernate/Tapestry troubles

Hi Jean-Francois,

thanks _a lot_ for your long answer and your very useful explanations!
Now, I'm in the know a little bit more and after playing around with
the configuration at least the problems reported first are gone ;)

| 3. By default hivemodule.xml files are expected in META-INF by HiveMind,
| there is normally no need to change them.

Just to make sure: META-INF also resides in /context/?
It seems as if my whole classpath is broken as also "ehcache.xml" and
"log4j.properties" are not found inside META-INF. Do you know how
to change the classpath/where those two files should be copied to/how
to enable log4j (I already enabled show_sql in hivemodule.xml)?

| - did you check that after the build, the jar for your module includes
your
| config file (that is a common mistake...)?

Well, actually I don't create a jar file at all... I just configured
my tomcat context to use the docBase directly from my eclipse workspace.
Perhaps this has something to do with the classpath problem?

| Other question: for building registry, do you use HiveMindFilter? Or do
you
| use your own sevlet filter?

I _think_ I use HiveMindFilter ;) How can I check that?

Sincerly,
  Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Hivetranse/Hibernate/Tapestry troubles

Posted by Andreas Bulling <sp...@phoenix.hadiko.de>.
On 02. Mär 2006 - 10:23:01, James Carman wrote:
| I would probably use the code from Honeycomb, as it is based on what I have
| written and is more likely to be maintained.  I only put that out there as
| an example.  I'm actually not using HiveUtils anymore.  I'm the crazy guy
| who's trying to get Spring's classes to work in HiveMind! :-o

Well, then GOOD LUCK (I'm quite happy to at least be able to
do some database queries, now) ;)

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: Hivetranse/Hibernate/Tapestry troubles

Posted by James Carman <ja...@carmanconsulting.com>.
I would probably use the code from Honeycomb, as it is based on what I have
written and is more likely to be maintained.  I only put that out there as
an example.  I'm actually not using HiveUtils anymore.  I'm the crazy guy
who's trying to get Spring's classes to work in HiveMind! :-o



-----Original Message-----
From: Andreas Bulling [mailto:andreas@phoenix.hadiko.de] On Behalf Of
Andreas Bulling
Sent: Thursday, March 02, 2006 10:18 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivetranse/Hibernate/Tapestry troubles

Hi James,

thanks a lot for your explanations! Perhaps I will use your code but
as somebody on the tapestry-user list mentioned perhaps I will also
use the code from honeycomb. I will see ;)

Sincerly,
  Andreas

On 01. Mär 2006 - 19:14:28, James Carman wrote:
| 1.  The reason to use the EntityPropertyPersistenceStrategy is so that you
| avoid trying to access "detached" objects.  The objects themselves are not
| stored in the session (if they're actually persistent), their identities
are
| (classname and id value).  Then, when your request comes in, the
identities
| are resolved back into the real object in the current session.
| 
| 2.  The same sort of thing is true for the "squeezer."  The squeezer
doesn't
| write the entire object out to the client, it only writes its identity.
The
| main reason for this (besides detached objects) is that you want to avoid
| writing the entire object graph out to the client.  Imagine a highly
| connected domain model where each object is connected to other objects and
| so on and so on (and they tell two friends, and so on, and so on).
Anyway,
| when you go to serialize that, all of the references to other objects will
| be serialized to and you could end up with the entire database (worst case
| of course) being serialized out to the client.  YUCK!
| 
| 3.  As far as the OpenSessionInViewFilter, it really shouldn't be needed
| with HiveUtils.  The session is supposed to be opened "as needed", but in
my
| experience, it wasn't. 

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Hivetranse/Hibernate/Tapestry troubles

Posted by Andreas Bulling <sp...@phoenix.hadiko.de>.
Hi James,

thanks a lot for your explanations! Perhaps I will use your code but
as somebody on the tapestry-user list mentioned perhaps I will also
use the code from honeycomb. I will see ;)

Sincerly,
  Andreas

On 01. Mär 2006 - 19:14:28, James Carman wrote:
| 1.  The reason to use the EntityPropertyPersistenceStrategy is so that you
| avoid trying to access "detached" objects.  The objects themselves are not
| stored in the session (if they're actually persistent), their identities are
| (classname and id value).  Then, when your request comes in, the identities
| are resolved back into the real object in the current session.
| 
| 2.  The same sort of thing is true for the "squeezer."  The squeezer doesn't
| write the entire object out to the client, it only writes its identity.  The
| main reason for this (besides detached objects) is that you want to avoid
| writing the entire object graph out to the client.  Imagine a highly
| connected domain model where each object is connected to other objects and
| so on and so on (and they tell two friends, and so on, and so on).  Anyway,
| when you go to serialize that, all of the references to other objects will
| be serialized to and you could end up with the entire database (worst case
| of course) being serialized out to the client.  YUCK!
| 
| 3.  As far as the OpenSessionInViewFilter, it really shouldn't be needed
| with HiveUtils.  The session is supposed to be opened "as needed", but in my
| experience, it wasn't. 

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: Hivetranse/Hibernate/Tapestry troubles

Posted by James Carman <ja...@carmanconsulting.com>.
1.  The reason to use the EntityPropertyPersistenceStrategy is so that you
avoid trying to access "detached" objects.  The objects themselves are not
stored in the session (if they're actually persistent), their identities are
(classname and id value).  Then, when your request comes in, the identities
are resolved back into the real object in the current session.

2.  The same sort of thing is true for the "squeezer."  The squeezer doesn't
write the entire object out to the client, it only writes its identity.  The
main reason for this (besides detached objects) is that you want to avoid
writing the entire object graph out to the client.  Imagine a highly
connected domain model where each object is connected to other objects and
so on and so on (and they tell two friends, and so on, and so on).  Anyway,
when you go to serialize that, all of the references to other objects will
be serialized to and you could end up with the entire database (worst case
of course) being serialized out to the client.  YUCK!

3.  As far as the OpenSessionInViewFilter, it really shouldn't be needed
with HiveUtils.  The session is supposed to be opened "as needed", but in my
experience, it wasn't. 

-----Original Message-----
From: Andreas Bulling [mailto:andreas@phoenix.hadiko.de] On Behalf Of
Andreas Bulling
Sent: Wednesday, March 01, 2006 11:23 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivetranse/Hibernate/Tapestry troubles

On 01. Mär 2006 - 08:53:51, James Carman wrote:
| Tapestry doesn't require HiveMindFilter.  It has its own way of dealing
with
| the registry.  The ehcache.xml and log4j.properties files should be in
| /WEB-INF/classes.  It's okay to have your hivemodule.xml file in /WEB-INF
| also, since that's where Tapestry looks for it by default.  Any
| hivemodule.xml files residing inside jar files in your /WEB-INF/lib
| directory will be picked up automatically.  Also,
| /WEB-INF/classes/WEB-INF/hivemodule.xml will be picked up if you provide
one
| (most just use the one directly in WEB-INF).

OK, I changed this according to your explanations and it seems to work
now (at least I can see some Hibernate outputs in catalina.out).
BTW: Do you know if it's normal that instead of the actual values for
the database fields the queries only show ? instead?

| Did you try my example of using HiveUtils (hivetranse), called Tapernate?

Yes, I even think I must have been the first one having downloaded your
example
after the big problems I had before ;)

But to be honest I didn't use it because I have no clue
- what this EntityPropertyPersistenceStrategy is good for/if I need it
- the same with EntitySqueezer
- why there is a/if I need the OpenSessionInViewFilter

In the meanwhile I got _something_ to work (that means I can
make database queries without any java exceptions so far).
But I don't know if all these demarcations, interceptors actually
work :|

Sincerly,
  Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Hivetranse/Hibernate/Tapestry troubles

Posted by Andreas Bulling <sp...@phoenix.hadiko.de>.
On 01. Mär 2006 - 08:53:51, James Carman wrote:
| Tapestry doesn't require HiveMindFilter.  It has its own way of dealing with
| the registry.  The ehcache.xml and log4j.properties files should be in
| /WEB-INF/classes.  It's okay to have your hivemodule.xml file in /WEB-INF
| also, since that's where Tapestry looks for it by default.  Any
| hivemodule.xml files residing inside jar files in your /WEB-INF/lib
| directory will be picked up automatically.  Also,
| /WEB-INF/classes/WEB-INF/hivemodule.xml will be picked up if you provide one
| (most just use the one directly in WEB-INF).

OK, I changed this according to your explanations and it seems to work
now (at least I can see some Hibernate outputs in catalina.out).
BTW: Do you know if it's normal that instead of the actual values for
the database fields the queries only show ? instead?

| Did you try my example of using HiveUtils (hivetranse), called Tapernate?

Yes, I even think I must have been the first one having downloaded your example
after the big problems I had before ;)

But to be honest I didn't use it because I have no clue
- what this EntityPropertyPersistenceStrategy is good for/if I need it
- the same with EntitySqueezer
- why there is a/if I need the OpenSessionInViewFilter

In the meanwhile I got _something_ to work (that means I can
make database queries without any java exceptions so far).
But I don't know if all these demarcations, interceptors actually
work :|

Sincerly,
  Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


RE: Hivetranse/Hibernate/Tapestry troubles

Posted by James Carman <ja...@carmanconsulting.com>.
Tapestry doesn't require HiveMindFilter.  It has its own way of dealing with
the registry.  The ehcache.xml and log4j.properties files should be in
/WEB-INF/classes.  It's okay to have your hivemodule.xml file in /WEB-INF
also, since that's where Tapestry looks for it by default.  Any
hivemodule.xml files residing inside jar files in your /WEB-INF/lib
directory will be picked up automatically.  Also,
/WEB-INF/classes/WEB-INF/hivemodule.xml will be picked up if you provide one
(most just use the one directly in WEB-INF).

Did you try my example of using HiveUtils (hivetranse), called Tapernate?

 
-----Original Message-----
From: Andreas Bulling [mailto:andreas@phoenix.hadiko.de] On Behalf Of
Andreas Bulling
Sent: Wednesday, March 01, 2006 8:29 AM
To: hivemind-user@jakarta.apache.org
Subject: Re: Hivetranse/Hibernate/Tapestry troubles

Hi Jean-Francois,

| I don't know what /context/ is, but I suppose it is not correct. META-INF
| should be at the root of your classpath (or root of jar file).

OK, /context/ is the docBase directory for Tomcat...

| Could be, hard to tell until we know exactly what can be found in your
| workspace (ie the docBase) and at which exact position. 

... and my directory structure looks like the followinig:

/context (docBase)
	/WEB-INF (contains the Tapestry page/jwc/html/properties files,
web.xml and hivemodule.xml)
		/classes (contains the compiled classes)
		/lib (contains the libraries I need)
	/META-INF (contains ehcache.xml and log4j.properties)
	/images (the images)
	/css (css files)

Actually, ehcache.xml and log4j.properties don't seem to be found/read in
META-INF
and hivemodule.xml resides in WEB-INF because it's also not found in
META-INF :(

| Just take a look at WEB-INF/web.xml and search for presence of
| HiveMindFilter.
| I think you use Tapestry right? I am not a Tapestry user so I don't know
if
| Tapestry uses HiveMindFilter or some other way to build the HiveMind
| registry.

Yes, I use Tapestry and I wasn't able to find a reference to HiveMindFilter
in web.xml.

Sincerly,
  Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Hivetranse/Hibernate/Tapestry troubles

Posted by Andreas Bulling <sp...@phoenix.hadiko.de>.
Hi Jean-Francois,

| I don't know what /context/ is, but I suppose it is not correct. META-INF
| should be at the root of your classpath (or root of jar file).

OK, /context/ is the docBase directory for Tomcat...

| Could be, hard to tell until we know exactly what can be found in your
| workspace (ie the docBase) and at which exact position. 

... and my directory structure looks like the followinig:

/context (docBase)
	/WEB-INF (contains the Tapestry page/jwc/html/properties files, web.xml and hivemodule.xml)
		/classes (contains the compiled classes)
		/lib (contains the libraries I need)
	/META-INF (contains ehcache.xml and log4j.properties)
	/images (the images)
	/css (css files)

Actually, ehcache.xml and log4j.properties don't seem to be found/read in META-INF
and hivemodule.xml resides in WEB-INF because it's also not found in META-INF :(

| Just take a look at WEB-INF/web.xml and search for presence of
| HiveMindFilter.
| I think you use Tapestry right? I am not a Tapestry user so I don't know if
| Tapestry uses HiveMindFilter or some other way to build the HiveMind
| registry.

Yes, I use Tapestry and I wasn't able to find a reference to HiveMindFilter
in web.xml.

Sincerly,
  Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org