consegui fazer a integração galera.. mais tive que adicionar mais código nas
configurações..

tive que adicionar um destination e um source..

no ejb também adicionei uma propriedade source

as alterações estão em negrito..

*service-config.xml:*

<?xml version="1.0" encoding="UTF-8"?>

<services-config>


    <services>
        <service id="granite-service"
            class="flex.messaging.services.RemotingService"
            messageTypes="flex.messaging.messages.RemotingMessage">
           *  <destination id="produtoService">
                <channels>
                    <channel ref="my-graniteamf"/>
                </channels>
                <properties>
                    <scope>session</scope>

<source>br.com.project.produto.ProdutoServiceBean</source>
                </properties>

            </destination>*


        </service>
    </services>

    <!--
     ! Declares ejbFactory service factory.
     !-->
    <factories>
        <factory id="ejbFactory"
class="org.granite.messaging.service.EjbServiceFactory">
            <properties>
                <lookup>bbc-web/{capitalized.destination.id
}Bean/local</lookup>
            </properties>
        </factory>
    </factories>

    <!--
     ! Declares my-graniteamf channel.
     !-->
    <channels>
        <channel-definition id="my-graniteamf"
class="mx.messaging.channels.AMFChannel">
            <endpoint
                uri="http://{server.name
}:{server.port}/{context.root}/graniteamf/amf"
                class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
    </channels>

</services-config>

*ejb:*

@Stateless
@Local(IProduto.class)
@RemoteDestination(id="produtoService"*,source="produtoService"*)
public class ProdutoServiceBean implements IProduto {

    @Override
    public void funcionando(Produto produto) {

        System.out.println("deu certo");

    }

}

*mxml:*

srv = new RemoteObject();

*srv.destination = "produtoService";*
srv.channelSet = new ChannelSet();
srv.channelSet.addChannel(ServerConfig.getChannel("my-graniteamf"));

srv.showBusyCursor = true;
var operation:Operation = new Operation();
operation.name = "funcionando";
operation.addEventListener(ResultEvent.RESULT, onFindAllPersonsResult);

srv.operations = {funcionando: operation};
srv.addEventListener(FaultEvent.FAULT, onRemoteFault);
srv.funcionando();



abraço!



Em 8 de abril de 2011 12:39, Leonardo Cesar Borges
<[email protected]>escreveu:

> Galera..
>
> será que estou esquecendo algum parâmetro de compilação do flex?
>
> alguem já fez essa integração entre ejb e o flex?
>
> valeu!
>
> Em 7 de abril de 2011 21:09, Leonardo Cesar Borges 
> <[email protected]>escreveu:
>
> Fala pessoal..
>>
>> estou tentando usar estas tecnologias citadas acima em um projeto.. porem
>> não estou conseguindo fazer a integração entre o ejb e o flex,
>> O erro abaixo acontece tanto com o compilado do FlashBuilder, quanto com o
>> ear fechado pelo maven..
>>
>> *fault:*
>>
>> "Destination not found: produto";
>>
>> *segue os detalhes do fault:*
>>
>> nullorg.granite.messaging.service.ServiceException
>>     at
>> org.granite.messaging.service.ServiceFactory.getFactoryInstance(ServiceFactory.java:59)
>>
>> *meu ejb:*
>>
>> import javax.ejb.Local;
>> import javax.ejb.Stateless;
>>
>> import org.granite.messaging.service.annotations.RemoteDestination;
>>
>> @Stateless
>> @Local(IProduto.class)
>> @RemoteDestination(id="produto")
>> public class ProdutoBean implements IProduto {
>>
>>     @Override
>>     public void funcionando() {
>>         System.out.println("deu certo");
>>
>>     }
>>
>> }
>>
>> *a interface:*
>> public interface IProduto{
>>
>>     void funcionando();
>> }
>>
>> *meu código flex no qual chamo o ejb:*
>>
>> var srv: RemoteObject = new RemoteObject();
>>
>> srv.destination = "produto";
>> srv.channelSet = new ChannelSet();
>> srv.channelSet.addChannel(ServerConfig.getChannel("my-graniteamf"));
>>
>> srv.showBusyCursor = true;
>> var operation:Operation = new Operation();
>> operation.name = "funcionando";
>> operation.addEventListener(ResultEvent.RESULT, onFindAllPersonsResult);
>>
>> srv.operations = {funcionando: operation};
>> srv.addEventListener(FaultEvent.FAULT, onRemoteFault);
>> srv.funcionando();
>>
>> *meu service-config.xml*
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <services-config>
>>     <services>
>>         <service id="granite-service"
>>             class="flex.messaging.services.RemotingService"
>>             messageTypes="flex.messaging.messages.RemotingMessage">
>>         </service>
>>     </services>
>>
>>     <!--
>>      ! Declares ejbFactory service factory.
>>      !-->
>>     <factories>
>>         <factory id="ejbFactory"
>> class="org.granite.messaging.service.EjbServiceFactory">
>>             <properties>
>>                 <lookup>bbc-web/{capitalized.destination.id
>> }Bean/local</lookup>
>>             </properties>
>>         </factory>
>>     </factories>
>>
>>     <!--
>>      ! Declares my-graniteamf channel.
>>      !-->
>>     <channels>
>>         <channel-definition id="my-graniteamf"
>> class="mx.messaging.channels.AMFChannel">
>>             <endpoint
>>                 uri="http://{server.name
>> }:{server.port}/{context.root}/graniteamf/amf"
>>                 class="flex.messaging.endpoints.AMFEndpoint"/>
>>         </channel-definition>
>>     </channels>
>>
>> </services-config>
>>
>> se precisar de mais alguma informação, é so pedir,
>>
>> desculpe-me se não segui algum padrão..
>>
>> também gostaria de saber.. qual a melhor forma de integrar flex com ejb..
>> ou se todas as opções são boas..
>>
>> obrigado pela ajuda!
>>
>> abraço!
>>
>>
>>
>

-- 
Você recebeu esta mensagem porque está inscrito na lista "flexdev"
Para enviar uma mensagem, envie um e-mail para [email protected]
Para sair da lista, envie um email em branco para 
[email protected]
Mais opções estão disponíveis em http://groups.google.com/group/flexdev

Responder a