Erro =[MessagingError message='Destination

4 respostas
W

Ola estou tentanto fazer um exemplo de video aula do Prf Neri da comunicaçãoi de Flex+Java+blazeds porem ja tentei de tudo por varios dias por cristo nao consigo resolver quando clico no botao da a mensgane de erro =[MessagingError message=‘Destination ‘java_teste’ either does not exist or the destination has no channels defined (and the application does not define any default channels.)’] estou usando ecplise Ganymede e Adobe Flex 3

abaixo segue meus codigos

services-config.xml

<?xml version="1.0" encoding="UTF-8"?>
<services>
    <service-include file-path="remoting-config.xml" />
    <service-include file-path="proxy-config.xml" />
    <service-include file-path="messaging-config.xml" />        
</services>

<security>
    <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
    <!-- Uncomment the correct app server
    <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss">
	<login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>        
    <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
    <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
    -->

    <!-- 
    <security-constraint id="basic-read-access">
        <auth-method>Basic</auth-method>
        <roles>
            <role>guests</role>
            <role>accountants</role>
            <role>employees</role>
            <role>managers</role>
        </roles>
    </security-constraint>
     -->
</security>

<channels>

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

    <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
        <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
        <properties>
            <add-no-cache-headers>false</add-no-cache-headers>
        </properties>
    </channel-definition>

    <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
        <properties>
            <polling-enabled>true</polling-enabled>
            <polling-interval-seconds>4</polling-interval-seconds>
        </properties>
    </channel-definition>

    <!--
    <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel">
        <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
    </channel-definition>

    <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
        <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
        <properties>
            <add-no-cache-headers>false</add-no-cache-headers>
        </properties>
    </channel-definition>
    -->
</channels>

<logging>
    <target class="flex.messaging.log.ConsoleTarget" level="Error">
        <properties>
            <prefix>[Integra_java_flex_blazeds] </prefix>
            <includeDate>false</includeDate>
            <includeTime>false</includeTime>
            <includeLevel>false</includeLevel>
            <includeCategory>false</includeCategory>
        </properties>
        <filters>
            <pattern>Endpoint.*</pattern>
            <pattern>Service.*</pattern>
            <pattern>Configuration</pattern>
        </filters>
    </target>
</logging>

<system>
    <redeploy>
        <enabled>false</enabled>
        <!-- 
        <watch-interval>20</watch-interval>
        <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
        <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
        <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
        <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
        <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
        <touch-file>{context.root}/WEB-INF/web.xml</touch-file>
         -->
    </redeploy>
</system>

remoting-config

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

<adapters>
    <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/>
</adapters>

<default-channels>
    <channel ref="my-amf"/>
    <destination id="java_teste">
      <properties>
          <source>java.teste_java</source>
              </properties>
</default-channels>

teste_java.java

package java;

public class teste_java {

public void teste()
	{
		System.out.println("conectou");


	}
}

teste_java.mxml

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

<mx:Application xmlns:mx=“http://www.adobe.com/2006/mxml” layout=“absolute”>

<mx:RemoteObject id=teste_java destination=java_teste  fault=faultservico(event)>

<mx:method name=teste fault=faultservico(event)/>

</mx:RemoteObject>

<a>mx:Script</a>

<![CDATA[

import mx.controls.Alert;

import mx.rpc.events.FaultEvent;

import mx.rpc.events.ResultEvent;

public function teste():void

{

teste_java.teste();

}

{

public function faultservico(event:FaultEvent)

{

Alert.show(erro =+event.fault.faultString);

}

}
]]>
 </mx:Script>


<mx:Panel x="10" y="10" width="437" height="330" layout="absolute">

	<mx:DataGrid x="40" y="106">
		<mx:columns>
			<mx:DataGridColumn headerText="Column 1" dataField="col1"/>
			<mx:DataGridColumn headerText="Column 2" dataField="col2"/>
			<mx:DataGridColumn headerText="Column 3" dataField="col3"/>
		</mx:columns>
	</mx:DataGrid>
	<mx:Button x="71" y="23" label="Button" click="{teste()}"/>
</mx:Panel>

</mx:Application>

4 Respostas

renzonuccitelli

2 coisas:

  1. Poste seu código entre as tags code (aperte o botão code logo acima do post quando estiver escrevendo). Assim o código fica mais legível e vc ajuda os outros a te ajudarem.
  2. Poste o conteudo do se arquivo remote-config.xml. Nele vc tem que ter declarado seus serviços (se não estiver usando nenhum framework), particulamente indicando o mesmo destination que está no flex: “java-test”.

Precisando de um curso Flex, dê uma olhada na Nuccitec.

F

Verifique qual a url está sendo chamada, utilize o Addon HttpFox https://addons.mozilla.org/en-US/firefox/addon/6647/ para o FireFox talvez o contexto da aplicação está errado dé uma lida nos links abaixo:

http://fabiophx.blogspot.com/2010/03/context-root.html
http://fabiophx.blogspot.com/2010/05/context-root-ii.html

[]s

F

Acesse o site http://{server.name}:{server.port}/{context.root}/messagebroker/amf
Se aparecer uma tela em branco é pq o serviço do blaze está no ar.
Verifique tb as logs do Tomcat.

W

Obrigado a todos pela ajuda poren acabei resolvondo o problema da seguinte forma ao clikar no meu projeto em proprietes flex complier alterei para -locale en_US -services “…/WebContent/WEB-INF/flex/services-config.xml” e no arquivo web.xml alerei a primeira linha feito essas duas coisas ficaram tudo bem .
mais uma vez obrigado a todos<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app>

Criado 14 de novembro de 2010
Ultima resposta 17 de nov. de 2010
Respostas 4
Participantes 3