-
Jun 27th, 2012, 10:54 AM
#1
GWT RPC With Muliple Inheritance
I am using GWT spring. The server side has a BaseService, BaseImplementation ( Abstract class) and BaseServiceAsync classes, and I have couple of child Classes which extend the above 3 classes respectively. The problem I am having is whenever I call the BaseService methods spring is throwing exception saying "org.springframework.beans.factory.NoSuchBeanDefini tionException: No unique bean of type [BaseService] is defined: expected single bean but found 2" if I call any child methods I am getting results back from server.
Below is the sample code
public interface BaseService extends RemoteService {
Integer init( String id) throws Exception;
}
@Service
public class BaseServiceImpl implements BaseService {
public Integer init( String id) throws Exception {
// Implementation
}
}
public interface BaseServiceAsync {
void init( String id, AsyncCallback callback );
}
@RemoteServiceRelativePath("childService1")
public interface ChildService1 extends BaseService {
myMethod1();
}
public interface ChildService1Async extends BaseServiceAsync {
myMethod1();
}
@Service
public class ChildService1Impl extends BaseServiceImpl implements ChildService1 {
myMethod1();
}
@RemoteServiceRelativePath("childService2")
public interface ChildService2 extends BaseService {
myMethod2();
}
public interface ChildService2Async extends BaseServiceAsync {
myMethod2();
}
@Service
public class ChildService2Impl extends BaseServiceImpl implements ChildService2 {
myMethod2();
}
In GWT
GWT.create( ChildService1.class ).method1() works
GWT.create( ChildService1.class ).init(1) throws exception
org.springframework.beans.factory.NoSuchBeanDefini tionException: No unique bean of type [BaseService] is defined: expected single bean but found 2
Thanks in Advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules