You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Lance V <la...@yahoo.com> on 2004/03/28 19:11:29 UTC

Spring framework and abstract method question

Hello,

In my component class I have:

public abstract ManagerUserImpl getUserService();

When I request the tapestry servlet, I get the
exception:
Method "setUserService" failed for object.

There was no set method in the docs at:
http://www.springframework.org/docs/reference/view.html#view-tapestry-context

Is it still valid to just implement one of the two
accessors?

Thanks,
Lance



__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Spring framework and abstract method question

Posted by Lance V <la...@yahoo.com>.
Thanks a lot, that fixed the problem. 

Lance

--- "Julio C. Rivera" <ju...@ya.com> wrote:
> It seems to be a property type problem.
> 
> In your page specification, the userService property
> type has to be 
> "UserService":
> 
>    <property-specification name="userService"
>      
>
type="com.whatever.services.service.user.UserService">
>          global.appContext.getBean("userService")
>    </property-specification>
> 
> and in your page class, the abstract method has to
> return an UserService:
> 
>    public abstract UserService getUserService();
> 
> If you has renamed the UserService to ManagerUser,
> you property has to be 
> of type ManagerUser, not ManagerUserImpl.
> 
> Regards
>    Julio
> 
> 
> At 11:10 28/03/2004 -0800, you wrote:
> >These are the erros I am getting:
> >
> >Unable to initialize property userService of
>
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]:
> >Unable to update
> >expression '<parsed expression>' of
>
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
> >to services.ManagerUserImpl@257b34.
> >location:      
> context:/WEB-INF/ComponentLogin.jwc, line
> >14, column 102
> >
> >org.apache.tapestry.ApplicationRuntimeException
> >Unable to update expression '<parsed expression>'
> of
>
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
> >to services.ManagerUserImpl@257b34.
> >
> >ognl.MethodFailedException
> >Method "setUserService" failed for object
>
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
> >
> >java.lang.NoSuchMethodException
> >setUserService($Proxy0)
> >
> >--- Colin Sampaleanu <co...@exis.com> wrote:
> > > The java class only needs to declare the getter
> or
> > > setters you actually
> > > need to use from your code. If you are not going
> to
> > > use a setter, you
> > > don't have to declare the abstract stub for it.
> The
> > > enhanced class will
> > > still have it of course.
> > >
> > > What specific error are you getting? I think the
> set
> > > is probably not
> > > failing, but rather, what is failing is getting
> a
> > > valid value to set...
> > >
> > >
> > > Lance V wrote:
> > >
> > > >Hello,
> > > >
> > > >In my component class I have:
> > > >
> > > >public abstract ManagerUserImpl
> getUserService();
> > > >
> > > >When I request the tapestry servlet, I get the
> > > >exception:
> > > >Method "setUserService" failed for object.
> > > >
> > > >There was no set method in the docs at:
> > >
> >
>
>http://www.springframework.org/docs/reference/view.html#view-tapestry-con
> 
> > text
> > > >
> > > >Is it still valid to just implement one of the
> two
> > > >accessors?
> > > >
> > > >Thanks,
> > > >Lance
> > > >
> > > >
> > >
> > >
> > >
> > >
>
>---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> > > tapestry-user-help@jakarta.apache.org
> > >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Finance Tax Center - File online. File on
> time.
> >http://taxes.yahoo.com/filing.html
> >
>
>---------------------------------------------------------------------
> >To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Spring framework and abstract method question

Posted by "Julio C. Rivera" <ju...@ya.com>.
It seems to be a property type problem.

In your page specification, the userService property type has to be 
"UserService":

   <property-specification name="userService"
      type="com.whatever.services.service.user.UserService">
         global.appContext.getBean("userService")
   </property-specification>

and in your page class, the abstract method has to return an UserService:

   public abstract UserService getUserService();

If you has renamed the UserService to ManagerUser, you property has to be 
of type ManagerUser, not ManagerUserImpl.

Regards
   Julio


At 11:10 28/03/2004 -0800, you wrote:
>These are the erros I am getting:
>
>Unable to initialize property userService of
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]:
>Unable to update
>expression '<parsed expression>' of
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
>to services.ManagerUserImpl@257b34.
>location:       context:/WEB-INF/ComponentLogin.jwc, line
>14, column 102
>
>org.apache.tapestry.ApplicationRuntimeException
>Unable to update expression '<parsed expression>' of
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
>to services.ManagerUserImpl@257b34.
>
>ognl.MethodFailedException
>Method "setUserService" failed for object
>components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
>
>java.lang.NoSuchMethodException
>setUserService($Proxy0)
>
>--- Colin Sampaleanu <co...@exis.com> wrote:
> > The java class only needs to declare the getter or
> > setters you actually
> > need to use from your code. If you are not going to
> > use a setter, you
> > don't have to declare the abstract stub for it. The
> > enhanced class will
> > still have it of course.
> >
> > What specific error are you getting? I think the set
> > is probably not
> > failing, but rather, what is failing is getting a
> > valid value to set...
> >
> >
> > Lance V wrote:
> >
> > >Hello,
> > >
> > >In my component class I have:
> > >
> > >public abstract ManagerUserImpl getUserService();
> > >
> > >When I request the tapestry servlet, I get the
> > >exception:
> > >Method "setUserService" failed for object.
> > >
> > >There was no set method in the docs at:
> >
> >http://www.springframework.org/docs/reference/view.html#view-tapestry-con 
> text
> > >
> > >Is it still valid to just implement one of the two
> > >accessors?
> > >
> > >Thanks,
> > >Lance
> > >
> > >
> >
> >
> >
> >
>---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> > tapestry-user-help@jakarta.apache.org
> >
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Finance Tax Center - File online. File on time.
>http://taxes.yahoo.com/filing.html
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


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


Re: Spring framework and abstract method question

Posted by Lance V <la...@yahoo.com>.
These are the erros I am getting:

Unable to initialize property userService of 
components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]:
Unable to update
expression '<parsed expression>' of
components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
to services.ManagerUserImpl@257b34.
location: 	context:/WEB-INF/ComponentLogin.jwc, line
14, column 102
 
org.apache.tapestry.ApplicationRuntimeException
Unable to update expression '<parsed expression>' of 
components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
to services.ManagerUserImpl@257b34.
 
ognl.MethodFailedException
Method "setUserService" failed for object
components.ComponentLogin$Enhance_0@4a3158[Home/$ComponentLogin]
 
java.lang.NoSuchMethodException
setUserService($Proxy0)

--- Colin Sampaleanu <co...@exis.com> wrote:
> The java class only needs to declare the getter or
> setters you actually 
> need to use from your code. If you are not going to
> use a setter, you 
> don't have to declare the abstract stub for it. The
> enhanced class will 
> still have it of course.
> 
> What specific error are you getting? I think the set
> is probably not 
> failing, but rather, what is failing is getting a
> valid value to set...
> 
> 
> Lance V wrote:
> 
> >Hello,
> >
> >In my component class I have:
> >
> >public abstract ManagerUserImpl getUserService();
> >
> >When I request the tapestry servlet, I get the
> >exception:
> >Method "setUserService" failed for object.
> >
> >There was no set method in the docs at:
>
>http://www.springframework.org/docs/reference/view.html#view-tapestry-context
> >
> >Is it still valid to just implement one of the two
> >accessors?
> >
> >Thanks,
> >Lance
> >  
> >
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

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


Re: Spring framework and abstract method question

Posted by Colin Sampaleanu <co...@exis.com>.
The java class only needs to declare the getter or setters you actually 
need to use from your code. If you are not going to use a setter, you 
don't have to declare the abstract stub for it. The enhanced class will 
still have it of course.

What specific error are you getting? I think the set is probably not 
failing, but rather, what is failing is getting a valid value to set...


Lance V wrote:

>Hello,
>
>In my component class I have:
>
>public abstract ManagerUserImpl getUserService();
>
>When I request the tapestry servlet, I get the
>exception:
>Method "setUserService" failed for object.
>
>There was no set method in the docs at:
>http://www.springframework.org/docs/reference/view.html#view-tapestry-context
>
>Is it still valid to just implement one of the two
>accessors?
>
>Thanks,
>Lance
>  
>



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