Author Login
Post Reply
user Digest 2 Apr 2008 22:35:34 -0000 Issue 7960
Topics (messages 184968 through 184979):
Re: Actionerrors & the Store Interceptor
184968 by: Laurie Harper
184972 by: Chris Pratt
184973 by: Lukasz Lenart
184975 by: Chris Pratt
Re: Using sets of objects with tags
184969 by: jstraub.altec.org
184970 by: Dave Newton
184974 by: jstraub.altec.org
184976 by: Dave Newton
Re: [s2] conversion validator and repopulateField
184971 by: Kevin Wade
xml based validation vs Annotations based validation
184977 by: akash agrawal
Re: Optiontransferselect list issue
184978 by: Ryan
Re: [OT] Struts - Spring - hibernate and lazy initialization
184979 by: Yayo
Administrivia:
---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)
----------------------------------------------------------------------

Attachment:
user_184968.ezm (zipped)Lukasz Lenart wrote:
> Hi,
>
> I think the best solution is to develop two Interceptors, one will run
> after action invocation and will store messages in session or some
> other objects from given request key. And second one, which will be
> run before action invocation, that will retrieve such stored messages
> from session and put them in to the request.
Umm, that's what the Store Interceptor is.
> We have some similar solution but for Struts1. We subclassed
> DispatchAction and after invocking execute() method we storing in
> session messaged from given request key. And before next execute(), we
> are checking such key in session and retrieving them back to the
> request.
I thought Struts1 handled that automatically, but ok, if what you have
works...
L.

Attachment:
user_184972.ezm (zipped)Thanks Laurie, any ideas on the original problem?
(*Chris*)
On Wed, Apr 2, 2008 at 2:19 PM, Laurie Harper <laurie@(protected):
> Lukasz Lenart wrote:
>
> > Hi,
> >
> > I think the best solution is to develop two Interceptors, one will run
> > after action invocation and will store messages in session or some
> > other objects from given request key. And second one, which will be
> > run before action invocation, that will retrieve such stored messages
> > from session and put them in to the request.
> >
>
> Umm, that's what the Store Interceptor is.
>
>
>
> > We have some similar solution but for Struts1. We subclassed
> > DispatchAction and after invocking execute() method we storing in
> > session messaged from given request key. And before next execute(), we
> > are checking such key in session and retrieving them back to the
> > request.
> >
>
> I thought Struts1 handled that automatically, but ok, if what you have
> works...
>
> L.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184973.ezm (zipped)> Umm, that's what the Store Interceptor is.
Not exactly, you have to specify for which action store the messages,
and for which retrieve them back. There is no magic, everything hand
coded ;-)
Regards
--
Lukasz
http://www.linkedin.com/in/lukaszlenart

Attachment:
user_184975.ezm (zipped)Sorry Lucas, I'm still not seeing how that will help differentiate
between which result's need the messages collected and which don't?
And I have to agree with Laurie, that I don't understand the
difference between the store interceptor and what you're proposing.
(*Chris*)
On Wed, Apr 2, 2008 at 2:47 PM, Lukasz Lenart
<lukasz.lenart@(protected):
> > Umm, that's what the Store Interceptor is.
>
> Not exactly, you have to specify for which action store the messages,
> and for which retrieve them back. There is no magic, everything hand
> coded ;-)
>
>
>
> Regards
> --
> Lukasz
>
> http://www.linkedin.com/in/lukaszlenart
>
> ---------------------------------------------------------------------
>
>
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184969.ezm (zipped)
>
> You don't need to 'parse the stream', Struts does that for you. Struts
> will call the setters on the objects in your set to pass the form inputs
> into them. In other words, the result you want to achieve is what
> happens automatically, provided you specify your input fields correctly.
>
> L.
>
Hmmmm, thought I had tried that. How do I retrieve those objects then?
For example, in the first Action I create a set named 'students', and fill
it with Student objects.
In the .jsp, I iterate over the set of students, like so:
(please ignore the table, this is just preliminary formatting, .css is on
the way)
<s:form action="TheNextOne"
<table>
<s:iterator status="stat" value="students">
<tr>
<s:hidden name="userId" />
<td><s:property value="#stat.index + 1" />.</td>
<td><s:textfield name="lastName" /></td>
<td><s:textfield name="firstName" /></td>
<td><s:textfield name="userName" /></td>
<td><s:textfield name="userPassword" /></td>
</tr>
</s:iterator>
</table>
<s:submit/>
</s:form>
Is this incorrect? If not, how then do I retrieve the set of modified
student objects in the submit Action?
-Jared

Attachment:
user_184970.ezm (zipped)You're not relating the fields to the students collection in any way.
You'd need a collection of students in your action (probably mapped by ID),
and each field would use something like "student[id].firstname" as the field
name.
The code you've provided (below) will just create a bunch of fields named
"lastName", "firstName", etc. rather than being associated with your
"students" set.
Dave
--- jstraub@(protected):
> > You don't need to 'parse the stream', Struts does that for you. Struts
> > will call the setters on the objects in your set to pass the form inputs
> > into them. In other words, the result you want to achieve is what
> > happens automatically, provided you specify your input fields correctly.
>
> Hmmmm, thought I had tried that. How do I retrieve those objects then?
>
> For example, in the first Action I create a set named 'students', and fill
> it with Student objects.
>
> In the .jsp, I iterate over the set of students, like so:
> (please ignore the table, this is just preliminary formatting, .css is on
> the way)
>
> <s:form action="TheNextOne"
> <table>
> <s:iterator status="stat" value="students">
> <tr>
> <s:hidden name="userId" />
> <td><s:property value="#stat.index + 1" />.</td>
> <td><s:textfield name="lastName" /></td>
> <td><s:textfield name="firstName" /></td>
> <td><s:textfield name="userName" /></td>
> <td><s:textfield name="userPassword" /></td>
> </tr>
> </s:iterator>
> </table>
> <s:submit/>
> </s:form>

Attachment:
user_184974.ezm (zipped)> You're not relating the fields to the students collection in any way.
>
> You'd need a collection of students in your action (probably mapped by
> ID),
> and each field would use something like "student[id].firstname" as the
> field
> name.
>
> The code you've provided (below) will just create a bunch of fields named
> "lastName", "firstName", etc. rather than being associated with your
> "students" set.
>
> Dave
>
I was curious about that. The code snippet I provided does actually
properly prefill the text fields from the proper members of the set as
long as the text field name matches the string fields of the Student
object.
However, as you indicated, once filled, there was no connection to the set.
I think I understand now. That being said, by using the
"setname[id].fieldname" format above, would I simply be able to access the
entire set in the following Action by a getter and setter with a like
named set (i.e. "setname")?
--Jared

Attachment:
user_184976.ezm (zipped)--- jstraub@(protected):
> by using the "setname[id].fieldname" format above, would I simply
> be able to access the entire set in the following Action by a getter
> and setter with a like named set (i.e. "setname")?
Yep.
You might want to check out the type conversion docs [1] if you haven't
already. It gives a rough overview of this functionality.
Dave
[1] http://struts.apache.org/2.0.11.1/docs/type-conversion.html

Attachment:
user_184971.ezm (zipped)Ok, I think I have the solution to my own problem. Since reviewdate
is a date field, I was using the s:date tag in my jsp, like this:
<s:date name="moviereview.reviewdate" format="%
{getText('struts.date.format')}" id="reviewdateFormatted"/>
<s:textfield value="%{reviewdateFormatted}"
name="moviereview.reviewdate" size="12" maxlength="10"/
I gather that reviewdate can't be set properly when I use the date tag
like this since what's being repopulated most likely won't be a valid
date.
To get around this, I just added a test for the presence of
fielderrors before using the s:date tag. If none are there, then use
the date tag. If it is there, then just display the reviewdate field
directly.
Kevin
On Apr 2, 2008, at Wednesday, April 2, 2008 - 5:02 PM, Kevin Wade
wrote:
> Hello. I am having a problem getting "repopulateField" to work. In
> short, I have added date validation to one of my actions. In my
> validation xml file, I have this:
>
> <field name="moviereview.reviewdate">
> <field-validator type="conversion" short-circuit="true">
> <param name="repopulateField">true</param>
> <message>Date of Review entered is not a valid date.</message>
> </field-validator>
> <field-validator type="date">
> <param name="min">01/01/2007</param>
> <param name="max">12/31/2008</param>
> <message>Date of Review is out of range. </message>
> </field-validator>
> </field>
>
> My problem is that "repopulateField" is not actually repopulating
> the moviereview.reviewdate field on a conversion error. The field
> is blank.
>
> In my action, I have a "moviereview" object that has a getter and
> setter (i.e. "setMoviereview() and getMoviereview()"). So,
> "reviewdate" is a Date that belongs to that parent object. I don't
> know if that's related at all, though.
>
> Any idea why this isn't working?
>
> Kevin
>

Attachment:
user_184977.ezm (zipped)Hi,
Wanted to get opinion from the struts2 user community if there are any advantages/disadvantages of using one approach over another (Xml vs Annotation based validation).
Thanks,
-Akash
---------------------------------
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.

Attachment:
user_184978.ezm (zipped)Well, I got it working...thanks for the sanity check, Laurie! The
user.groups collection was not getting assigned appropriately at the bottom
of a long, dark path of assignment logic. I suppose a null collection really
isn't technically a collection, hence the exception error message, but the
message could have been a little less obtuse. Apparently null variables
really are useless! </sarcasm> :)
-Ryan
On 4/2/08, Laurie Harper <laurie@(protected):
>
> Have you double-checked that getUser().getGroups() is returning what it
> should be? I.e. getUser() is not returning null; getUser().getGroups() is
> really returning a collection? As a sanity check, what happens if you
> include the following in your JSP:
>
> user:
> <s:property value="user"/>
> <s:property value="getUser()"/>
>
> user.groups:
> <s:property value="user.groups"/>
> <s:property value="getUser().getGroups()"/>
>
> L.
>
> ryangr wrote:
>
> > Are you just missing the getter for user? Struts2 has to call
> > > getUser().getGroups().
> > >
> >
> > The action has getters and setters for both user and groups, and the
> > user
> > object has a getter/setter for its groups attribute.
> >
> > I never have these two attributes pointing to the same property. It
> > > may work, but it's the first place I'd look for type conversion problems.
> > > My list attribute always points to a List with key and value entries
> > > for the select and the name attribute always points to a String[] that will
> > > contain the selected key values.
> > >
> >
> > Thanks for the pointer on that, I was wondering what the difference
> > between
> > them was; however, I don't think that is quite the issue in this case
> > (yet).
> > Taking your advice on having a String[] for the name attribute, I can do
> > an
> > <s:updownselect list="groups" name="groupKeys" /> and that collection
> > displays its data, but when I have <s:updownselect list="user.groups"
> > name="groupKeys" /> the JSP throws the same exception as the
> > <s:optiontransferselect> snippet that is causing headaches.
> >
> > Apr 2, 2008 10:33:18 AM
org.apache.catalina.core.ApplicationDispatcher> > invoke
> > SEVERE: Servlet.service() for servlet jsp threw exception
> > tag 'updownselect', field 'list': The requested list key 'user.groups'
> > could
> > not be resolved as a collection/array/map/enumeration/iterator type.
> > Example: people or people.{name} - [unknown location]
> >
> > It is baffling me at this point because they are the same data type, and
> > getters/setters exist for all the related objects... *scratches head*
> >
> > -Ryan
> >
> >
> > Jeromy Evans - Blue Sky Minds wrote:
> >
> > > ryangr wrote:
> > >
> > > With that being said...I can populate the list "groups" just fine,
> > > > but
> > > > when
> > > > I try to use "user.groups" to get the other list it throws an
> > > > exception
> > > > that
> > > > says: "The requested list key 'user.groups' could not be resolved as
> > > > a
> > > > collection/array/map/enumeration/iterator type." What am I doing
> > > > wrong?
> > > > It's
> > > > probably pretty obvious, but this hasn't exactly been a good week
> > > > for
> > > > concentration so far. ;)
> > > >
> > > >
> > > Are you just missing the getter for user? Struts2 has to call
> > > getUser().getGroups().
> > >
> > >
> > > I have the following for code in my JSP:
> > > >
> > > > <s:optiontransferselect
> > > > name="user.groups"
> > > >
> > > > list="user.groups"
> > > >
> > > I never have these two attributes pointing to the same property. It
> > > may work, but it's the first place I'd look for type conversion problems.
> > > My list attribute always points to a List with key and value entries
> > > for the select and the name attribute always points to a String[] that will
> > > contain the selected key values.
> > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment:
user_184979.ezm (zipped)Oki, thanks, I've posted to Spring mailing list with my problem ^g^
On Wed, Apr 2, 2008 at 11:14 PM, Laurie Harper <laurie@(protected):
> This isn't really a Struts issue, since you're asking how to drive your
> service/dao layout from a thread outside the context of a Struts-served
> request. What you need to do in that case is to manage the Hibernate session
> from your worker thread. The thread needs to setup and open the Hibernate
> session before starting its work, and clean it up afterwards.
>
> Since you're using Spring to wire your dependencies, you probably need to
> go through Spring to setup the Hibernate session for the worker thread. The
> Spring forums are probably the best place to seek advice with that.
>
> L.
>
>
> Yayo wrote:
>
> > Sorry, more explanation is needed... I've got to launch a "batch
> > process"
> > it's not a batch but it's a long lasting process that could raise a
> > timeout
> > and tomcat will kill the worker thread... So I've launched a worker of
> > my
> > own to do the job and inform the user with a progress indicator or the
> > like.
> >
> > Also I may want to launch my workers using Quartz scheduling features
> > but...
> > A new thread doesn't have an Hibernate Session attached to it.
> >
> > Now the circular reference. When I add proxies to my manager layer with
> > an
> > hibernateInterceptor wich needs a sessionFactory. Under the managers
> > there
> > are DAOs which depend on sessionFactory too and that's the cyclic
> > reference.
> >
> > Now the trace. Notice that this is just a cut from it but the "cause" is
> > just the same stack trace
> >
> >
> > Related cause:
> >
org.springframework.beans.factory.BeanCreationException: Error creating
> > bean
> > with name 'filterManager' defined in ServletContext resource
> > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean
> > 'filterManagerTarget' while setting bean property 'target'; nested
> > exception
> > is
org.springframework.beans.factory.BeanCreationException: Error
> > creating
> > bean with name 'filterManagerTarget' defined in ServletContext resource
> > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean
> > 'filterDao'
> > while setting bean property 'filterDao'; nested exception is
> >
org.springframework.beans.factory.BeanCreationException: Error creating
> > bean
> > with name 'filterDao' defined in ServletContext resource
> > [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean
> > 'sessionFactory' while setting bean property 'sessionFactory'; nested
> > exception is
org.springframework.beans.factory.BeanCreationException:
> > Error
> > creating bean with name 'sessionFactory' defined in ServletContext
> > resource
> > [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean
> > 'dataSource' while setting bean property 'dataSource'; nested exception
> > is
> >
org.springframework.beans.factory.BeanCurrentlyInCreationException:
> > Error
> > creating bean with name 'dataSource': FactoryBean which is currently in
> > creation returned null from getObject
> > Related cause:
org.springframework.beans.factory.BeanCreationException:
> > Error creating bean with name 'filterManager' defined in ServletContext
> > resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to
> > bean
> > 'filterManagerTarget' while setting bean property 'target'; nested
> > exception
> > is
org.springframework.beans.factory.BeanCreationException: Error
> > creating
> > bean with name 'filterManagerTarget' defined in ServletContext resource
> > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean
> > 'filterDao'
> > while setting bean property 'filterDao'; nested exception is
> >
org.springframework.beans.factory.BeanCreationException: Error creating
> > bean
> > with name 'filterDao' defined in ServletContext resource
> > [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean
> > 'sessionFactory' while setting bean property 'sessionFactory'; nested
> > exception is
org.springframework.beans.factory.BeanCreationException:
> > Error
> > creating bean with name 'sessionFactory' defined in ServletContext
> > resource
> > [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean
> > 'dataSource' while setting bean property 'dataSource'; nested exception
> > is
> >
org.springframework.beans.factory.BeanCurrentlyInCreationException:
> > Error
> > creating bean with name 'dataSource': FactoryBean which is currently in
> > creation returned null from getObject
> > Related cause:
org.springframework.beans.factory.BeanCreationException:
> > Error creating bean with name 'filterManager' defined in ServletContext
> > resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to
> > bean
> > 'filterManagerTarget' while setting bean property 'target'; nested
> > exception
> > is
org.springframework.beans.factory.BeanCreationException: Error
> > creating
> > bean with name 'filterManagerTarget' defined in ServletContext resource
> > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean
> > 'filterDao'
> > while setting bean property 'filterDao'; nested exception is
> >
org.springframework.beans.factory.BeanCreationException: Error creating
> > bean
> > with name 'filterDao' defined in ServletContext resource
> > [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean
> > 'sessionFactory' while setting bean property 'sessionFactory'; nested
> > exception is
org.springframework.beans.factory.BeanCreationException:
> > Error
> > creating bean with name 'sessionFactory' defined in ServletContext
> > resource
> > [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean
> > 'dataSource' while setting bean property 'dataSource'; nested exception
> > is
> >
org.springframework.beans.factory.BeanCurrentlyInCreationException:
> > Error
> > creating bean with name 'dataSource': FactoryBean which is currently in
> > creation returned null from getObject
> > Related cause:
org.springframework.beans.factory.BeanCreationException:
> > Error creating bean with name 'filterManager' defined in ServletContext
> > resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to
> > bean
> > 'filterManagerTarget' while setting bean property 'target'; nested
> > exception
> > is
org.springframework.beans.factory.BeanCreationException: Error
> > creating
> > bean with name 'filterManagerTarget' defined in ServletContext resource
> > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean
> > 'filterDao'
> > while setting bean property 'filterDao'; nested exception is
> >
org.springframework.beans.factory.BeanCreationException: Error creating
> > bean
> > with name 'filterDao' defined in ServletContext resource
> > [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean
> > 'sessionFactory' while setting bean property 'sessionFactory'; nested
> > exception is
org.springframework.beans.factory.BeanCreationException:
> > Error
> > creating bean with name 'sessionFactory' defined in ServletContext
> > resource
> > [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean
> > 'dataSource' while setting bean property 'dataSource'; nested exception
> > is
> >
org.springframework.beans.factory.BeanCurrentlyInCreationException:
> > Error
> > creating bean with name 'dataSource': FactoryBean which is currently in
> > creation returned null from getObject
> > Related cause:
org.springframework.beans.factory.BeanCreationException:
> > Error creating bean with name 'filterManager' defined in ServletContext
> > resource [/WEB-INF/spring/managers.xml]: Cannot resolve reference to
> > bean
> > 'filterManagerTarget' while setting bean property 'target'; nested
> > exception
> > is
org.springframework.beans.factory.BeanCreationException: Error
> > creating
> > bean with name 'filterManagerTarget' defined in ServletContext resource
> > [/WEB-INF/spring/managers.xml]: Cannot resolve reference to bean
> > 'filterDao'
> > while setting bean property 'filterDao'; nested exception is
> >
org.springframework.beans.factory.BeanCreationException: Error creating
> > bean
> > with name 'filterDao' defined in ServletContext resource
> > [/WEB-INF/spring/daos.xml]: Cannot resolve reference to bean
> > 'sessionFactory' while setting bean property 'sessionFactory'; nested
> > exception is
org.springframework.beans.factory.BeanCreationException:
> > Error
> > creating bean with name 'sessionFactory' defined in ServletContext
> > resource
> > [/WEB-INF/spring/hibernate.xml]: Cannot resolve reference to bean
> > 'dataSource' while setting bean property 'dataSource'; nested exception
> > is
> >
org.springframework.beans.factory.BeanCurrentlyInCreationException:
> > Error
> > creating bean with name 'dataSource': FactoryBean which is currently in
> > creation returned null from getObject
> > at
> >
> >
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference (
BeanDefinitionValueResolver.java:275)
> > at
> >
> >
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary (
BeanDefinitionValueResolver.java:104)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues (
AbstractAutowireCapableBeanFactory.java:1210)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (
AbstractAutowireCapableBeanFactory.java:978)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (
AbstractAutowireCapableBeanFactory.java:462)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> > at
java.security.AccessController.doPrivileged(Native Method)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (
AbstractAutowireCapableBeanFactory.java:375)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (
DefaultSingletonBeanRegistry.java:170)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (
AbstractBeanFactory.java:260)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean (
AbstractBeanFactory.java:1187)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean (
AbstractAutowireCapableBeanFactory.java:617)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch (
AbstractBeanFactory.java:456)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:224)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:202)
> > at
> >
> >
org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors (
BeanFactoryUtils.java:143)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates (
DefaultListableBeanFactory.java:653)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (
DefaultListableBeanFactory.java:611)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType (
AbstractAutowireCapableBeanFactory.java:1039)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (
AbstractAutowireCapableBeanFactory.java:950)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (
AbstractAutowireCapableBeanFactory.java:462)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> > at
java.security.AccessController.doPrivileged(Native Method)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (
AbstractAutowireCapableBeanFactory.java:375)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (
DefaultSingletonBeanRegistry.java:170)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (
AbstractBeanFactory.java:260)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean (
AbstractBeanFactory.java:1187)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean (
AbstractAutowireCapableBeanFactory.java:617)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch (
AbstractBeanFactory.java:456)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:224)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:202)
> > at
> >
> >
org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors (
BeanFactoryUtils.java:143)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates (
DefaultListableBeanFactory.java:653)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (
DefaultListableBeanFactory.java:611)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType (
AbstractAutowireCapableBeanFactory.java:1039)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (
AbstractAutowireCapableBeanFactory.java:950)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (
AbstractAutowireCapableBeanFactory.java:462)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> > at
java.security.AccessController.doPrivileged(Native Method)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (
AbstractAutowireCapableBeanFactory.java:375)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (
DefaultSingletonBeanRegistry.java:170)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (
AbstractBeanFactory.java:260)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean (
AbstractBeanFactory.java:1187)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean (
AbstractAutowireCapableBeanFactory.java:617)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch (
AbstractBeanFactory.java:456)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:224)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:202)
> > at
> >
> >
org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors (
BeanFactoryUtils.java:143)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates (
DefaultListableBeanFactory.java:653)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (
DefaultListableBeanFactory.java:611)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType (
AbstractAutowireCapableBeanFactory.java:1039)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (
AbstractAutowireCapableBeanFactory.java:950)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (
AbstractAutowireCapableBeanFactory.java:462)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> > at
java.security.AccessController.doPrivileged(Native Method)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (
AbstractAutowireCapableBeanFactory.java:375)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (
DefaultSingletonBeanRegistry.java:170)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (
AbstractBeanFactory.java:260)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean (
AbstractBeanFactory.java:1187)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean (
AbstractAutowireCapableBeanFactory.java:617)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch (
AbstractBeanFactory.java:456)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:224)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:202)
> > at
> >
> >
org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors (
BeanFactoryUtils.java:143)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates (
DefaultListableBeanFactory.java:653)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (
DefaultListableBeanFactory.java:611)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType (
AbstractAutowireCapableBeanFactory.java:1039)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (
AbstractAutowireCapableBeanFactory.java:950)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (
AbstractAutowireCapableBeanFactory.java:462)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> > at
java.security.AccessController.doPrivileged(Native Method)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (
AbstractAutowireCapableBeanFactory.java:375)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (
DefaultSingletonBeanRegistry.java:170)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (
AbstractBeanFactory.java:260)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.getTypeForFactoryBean (
AbstractBeanFactory.java:1187)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryBean (
AbstractAutowireCapableBeanFactory.java:617)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.isTypeMatch (
AbstractBeanFactory.java:456)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:224)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType (
DefaultListableBeanFactory.java:202)
> > at
> >
> >
org.springframework.beans.factory.BeanFactoryUtils.beanNamesForTypeIncludingAncestors (
BeanFactoryUtils.java:143)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates (
DefaultListableBeanFactory.java:653)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency (
DefaultListableBeanFactory.java:611)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireByType (
AbstractAutowireCapableBeanFactory.java:1039)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean (
AbstractAutowireCapableBeanFactory.java:950)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean (
AbstractAutowireCapableBeanFactory.java:462)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:404)
> > at
java.security.AccessController.doPrivileged(Native Method)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean (
AbstractAutowireCapableBeanFactory.java:375)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:263)
> > at
> >
> >
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton (
DefaultSingletonBeanRegistry.java:170)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean (
AbstractBeanFactory.java:260)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.getBean (
AbstractBeanFactory.java:184)
> > at
> >
> >
org.springframework.beans.factory.support.AbstractBeanFactory.getBean (
AbstractBeanFactory.java:163)
> > at
> >
> >
org.springframework.context.support.AbstractApplicationContext.getBean (
AbstractApplicationContext.java:881)
> > at
> >
> >
org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors (
AbstractApplicationContext.java:597)
> > at
> >
> >
org.springframework.context.support.AbstractApplicationContext.refresh (
AbstractApplicationContext.java:366)
> > at
> >
> >
org.springframework.web.context.ContextLoader.createWebApplicationContext (
ContextLoader.java:254)
> > at
> >
> >
org.springframework.web.context.ContextLoader.initWebApplicationContext (
ContextLoader.java:198)
> > at
> >
> >
org.springframework.web.context.ContextLoaderListener.contextInitialized (
ContextLoaderListener.java:45)
> > at
> >
> >
org.apache.catalina.core.StandardContext.listenerStart (
StandardContext.java:3827)
> > at
> >
> >
org.apache.catalina.core.StandardContext.start (
StandardContext.java:4334)
> > at
> >
org.apache.catalina.core.ContainerBase.start (
ContainerBase.java:1045)
> > at
org.apache.catalina.core.StandardHost.start (
StandardHost.java:719)
> > at
> >
org.apache.catalina.core.ContainerBase.start (
ContainerBase.java:1045)
> > at
> >
org.apache.catalina.core.StandardEngine.start (
StandardEngine.java:443)
> > at
> >
org.apache.catalina.core.StandardService.start (
StandardService.java:516)
> > at
> >
org.apache.catalina.core.StandardServer.start (
StandardServer.java:710)
> > at
org.apache.catalina.startup.Catalina.start (
Catalina.java:566)
> > at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
> >
> >
sun.reflect.NativeMethodAccessorImpl.invoke (
NativeMethodAccessorImpl.java:39)
> > at
> >
> >
sun.reflect.DelegatingMethodAccessorImpl.invoke (
DelegatingMethodAccessorImpl.java:25)
> > at
java.lang.reflect.Method.invoke (
Method.java:597)
> > at
org.apache.catalina.startup.Bootstrap.start (
Bootstrap.java:288)
> > at
org.apache.catalina.startup.Bootstrap.main (
Bootstrap.java:413)
> >
> >
> >
> > On Wed, Apr 2, 2008 at 10:19 PM, Adam Hardy <
> > ahardy.struts@(protected):
> >
> > Yayo on 02/04/08 20:23, wrote:
> > >
> > > I'm developing a struts - spring based application.
> > > >
> > > > I've got actions-delegates-managers and daos and I use the open
> > > > session
> > > > in
> > > > view filter from hibernate.
> > > >
> > > > In some cases I've got to return lazy results to the user so I've
> > > > got to
> > > > launch a new worker thread and taht new one doesn't have an
> > > > hibernate
> > > > session attached so I've added hibernateInterceptors to my managers.
> > > >
> > > >
> > > Hi Yayo,
> > > that paragraph doesn't sound right. You say 'lazy results' and so I
> > > understand you want your hibernate entities to lazy load - is that
> > > correct?
> > >
> > > If that is correct, I don't see the connection with what you say
> > > 'launches
> > > a new worker thread'. Why do you do that? If you need lazy loading,
> > > you make
> > > sure the Hibernate session is still running, which you have already
> > > because
> > > you use the OpenSessionInViewFilter.
> > >
> > > What is the reason for launching a new thread? The idiomatic
> > > spring/hibernate approach doesn't require that. You just pass your
> > > hibernate
> > > entities around and as long as the session is running, it will be
> > > fine.
> > >
> > >
> > > Regards
> > > Adam
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > > For additional commands, e-mail: user-help@(protected)
> > >
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
--
"Sit tibi terra levis"
http://yayocaturas.blogspot.com/