DWR and Spring

View: New views
2 Messages — Rating Filter:   Alert me  

DWR and Spring

by JSP :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have a class with the @Service("TeamService") and the @Scope("session") annotations specified.  These are obviously picked up by the annotation processor - there is no xml definition of the bean.  I would like to put an entry in my spring config file so that I can tell dwr to use this bean.  Is there any way to do this?

Here is what I have tried so far without success:

<bean id="dwrTeamService" class="org.ibm.test.TeamServiceImpl" scope="session" parent="TeamService" >
        <dwr:remote javascript="TeamService" >
                <dwr:include method="deleteTeam" />
                <dwr:include method="loadTeams" />
                <dwr:include method="saveTeam" />
        </dwr:remote>
        <aop:scoped-proxy />
</bean>

So the existing annotated bean has an id/name of TeamService whose implementation class is org.ibm.test.TeamServiceImpl.  I am trying to expose the deleteTeam, loadTeams, saveTeam operations from this class to dwr.

Note that the TeamService bean is session scope and so is the dwrTeamService.

I get this error when I try it:
Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'targetBeanName' of bean class [org.ibm.test.TeamServiceImpl]: No property 'targetBeanName' found
        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:382)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1288)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1249)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)


I don't have the luxury of redefining the target bean but I would like dwr to expose its methods.  Is there a way to do this?

Re: DWR and Spring

by XMaNIaC :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Look for @RemoteProxy and @RemoteMethod annotations and <dwr:annotation-config /> tag

On Fri, Jun 26, 2009 at 9:25 PM, JSP <jperkins@...> wrote:

I have a class with the @Service("TeamService") and the @Scope("session")
annotations specified.  These are obviously picked up by the annotation
processor - there is no xml definition of the bean.  I would like to put an
entry in my spring config file so that I can tell dwr to use this bean.  Is
there any way to do this?

Here is what I have tried so far without success:

<bean id="dwrTeamService" class="org.ibm.test.TeamServiceImpl"
scope="session" parent="TeamService" >
       <dwr:remote javascript="TeamService" >
               <dwr:include method="deleteTeam" />
               <dwr:include method="loadTeams" />
               <dwr:include method="saveTeam" />
       </dwr:remote>
       <aop:scoped-proxy />
</bean>

So the existing annotated bean has an id/name of TeamService whose
implementation class is org.ibm.test.TeamServiceImpl.  I am trying to expose
the deleteTeam, loadTeams, saveTeam operations from this class to dwr.

Note that the TeamService bean is session scope and so is the
dwrTeamService.

I get this error when I try it:
Caused by: org.springframework.beans.InvalidPropertyException: Invalid
property 'targetBeanName' of bean class [org.ibm.test.TeamServiceImpl]: No
property 'targetBeanName' found
       at
org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:382)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1288)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1249)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
       at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)


I don't have the luxury of redefining the target bean but I would like dwr
to expose its methods.  Is there a way to do this?
--
View this message in context: http://www.nabble.com/DWR-and-Spring-tp24225939p24225939.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...