I've been trying to migrate from a project with spring mvc, hibernate, blazeds to graniteds.
I have everything setup with the default configuration according with this granite tutorials.
But now I need to use the Tide api , which is the one that is gonna allow my app to manage the lazy loading of detached objects in my flex client.
but i'm having this error =(:
destination: spring
- method: getApplicationSettings
- exception: java.lang.NoSuchMethodException: org.granite.tide.TideServiceInvoker.getApplicationSettings()
<?xml version="1.0" encoding="UTF-8"?>
<!-- ********************** services ********************** -->
<services>
<service id="granite-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage" >
<destination id="spring">
<channels>
<channel ref="my-amf"/>
</channels>
<properties>
<factory>tideSpringFactory</factory>
</properties>
</destination>
</service>
</services>
<!-- ********************** factories ********************** -->
<!--
! Declare tideSpringFactory service factory.
!-->
<factories>
<factory id="tideSpringFactory" class="org.granite.tide.spring.SpringServiceFactory"/>
</factories>
<!-- ********************** channels ********************** -->
<channels>
<channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel" ><!---->
<endpoint uri="http://{server.name}:{server.port}/{context.root}/graniteamf/amf" class="flex.messaging.endpoints.AMFEndpoint" /> <!---->
</channel-definition>
</channels>
<granite-config scan="true">
<tide-components>
<tide-component annotated-with="org.granite.messaging.service.annotations.RemoteDestination"/>
</tide-components>
</granite-config>
from the error what I understand is that the remoteobject cannot match the getApplicationSettings method in my service layer, but i can't understand where is the link between the destination in my service-config and the class that acts like service , which is the one with the method list in the error.
-----------------
ok, I think that what i need to do is to annotate the class that acts like the service layer with : @RemoteDestination, so according to this tutorial, the properties of this annotation are
The annotation supports the following attributes:
id is mandatory and is the destination name
source is mandatory and should be the name of the Spring component
service is optional if there is only one service for RemotingMessage defined in services-config.xml. Otherwise this should be the name of the service.
channel is optional if there is only one channel defined in services-config.xml. Otherwise this should be the id of the target channel.
channels may be used instead of channel to define a failover channel.
factory is optional if there is only one factory in services-config.xml. Otherwise this should be the factory id.
securityRoles is an array of role names for securing the destination.
But even doing this i'm having the same error. I need some help here, the documentation is confuse.
--
---
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes Granite Data Services Forum.
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse graniteds+...@googlegroups.com.
Pour plus d'options, visitez le site https://groups.google.com/groups/opt_out .
So, After follow some suggestions made by Kris, we did the following changes in the client side.
we are using Cairgorn 2, =(.
public class ContainerDelegate{
private var _tideContext:Context; public function ContainerDelegate( responder:IResponder){
this._responder = responder;
this._tideContext = Spring.getInstance().getSpringContext();
}
public function getApplication(url:String):void
{
var call:Object =this._tideContext.spring.getApplicationSettings(url);
call.addResponder(_responder);
}
@RemoteDestination(id = "spring", source = "appListFacade", service = "granite-service",channel = "my-amf")public interface AppListFacade {
public Applications getApplicationSettings(String url) throws ServiceException;}
@Service(value = "appListFacade")public class CatalogFacadeImpl implements CategoryFacade,ContainerFacade,ProductFacade,ProductOptionFacade,ProductValueFacade,ProductStatusFacade,AttributeToValuesFacade,UserFacade,EmailFacade,FileFacade,PaypalTransactionFacade,OrderFacade,AppListFacade,DiscountsFacade{...}
operation=invokeComponentsource=nullmx.messaging.messages.RemotingMessage (@1de441f1)
@RemoteDestination
public interface AppListFacade {
public Applications getApplicationSettings(String url) throws ServiceException;}
public class ContainerDelegate{
private var _tideContext:Context; public function ContainerDelegate( responder:IResponder){
this._responder = responder;
this._tideContext = Spring.getInstance().getSpringContext();
}
public function getApplication(url:String):void
{
var call:Object =this._tideContext.appListFacade.getApplicationSettings(url);
call.addResponder(_responder);
}
public function ContainerDelegate( responder:ITideResponder){
this._responder = responder;
}
public function getApplication(url:String):void
{
_tideContext.appListFacade.getApplicationSettings(url, _responder);
}
Hi!!
I just realize that the person before me was using a customized class as a factory in the service-config.xml, this class implements another class call FlexFactory.here the code:in the service-config.xml<factories><factory id="spring" class="com.bamboo.common.factory.SpringFactory"/></factories>and the class SpringFactory, I think that this is the problem, i'm trying to understand why this person did this, so maybe I can understand why the configuration with tide doesn't work:public class SpringFactory implements FlexFactory {private static final String SOURCE = "source";public SpringFactory(){}public void initialize(String s, ConfigMap configmap){}public FactoryInstance createFactoryInstance(String id, ConfigMap properties){SpringFactoryInstance instance = new SpringFactoryInstance(this,id, properties);instance.setSource(properties.getPropertyAsString("source", instance.getId()));return instance;}public Object lookup(FactoryInstance inst){SpringFactoryInstance factoryInstance = (SpringFactoryInstance)inst;return factoryInstance.lookup();}static class SpringFactoryInstance extends FactoryInstance{public String toString(){return (new ToStringBuilder("SpringFactory instance for id=")).append(getId()).append(" source=").append(getSource()).append(" scope=").append(getScope()).toString();}public Object lookup(){return BeanFactory.getBean(getSource());}SpringFactoryInstance(SpringFactory factory, String id, ConfigMap properties){super(factory, id, properties);}}}but now , with tide we are using the tideSpringFactory
<factories>
<factory id="tideSpringFactory" class="org.granite.tide.spring.SpringServiceFactory"/>
</factories>
Or even better, destroy your services-config.xml and use the spring mvc configuration. http://www.graniteds.org/public/docs/3.0.0/docs/reference/flex/en-US/html/graniteds.spring.html#spring.tidemvcconfig
Basically, you just need to configure the Spring MVC dispatcher servlet in web.xml, create a (mostly) empty dispatcher-servlet.xml file and configure the server-filter in the spring application context.
<factories>
<factory id="tideSpringFactory" class="org.granite.tide.spring.SpringServiceFactory"/>
</factories>
I mentioned that we were implementing the FlexFactory before, because I thought it could be connected with the problem.
and about the MVC configuration I tried as well, but it didn't work at first hand, I could try again anyways. let you know.
thanks!
--
---
Vous recevez ce message car vous êtes abonné à un sujet dans le groupe Google Groupes "Granite Data Services Forum".
Pour vous désabonner de ce sujet, visitez le site https://groups.google.com/d/topic/graniteds/Vr0DyhhYWDo/unsubscribe.
Pour vous désabonner de ce groupe et de tous ses sujets, envoyez un e-mail à l'adresse graniteds+...@googlegroups.com.