BlazeDS problem

171 views
Skip to first unread message

Mor

unread,
Nov 22, 2008, 12:33:47 PM11/22/08
to Flex India Community
This is my first experience with BlazeDS.

I have installed BlazeDS on Tomcat 6.0.18.
Since last 3 days I am trying to resolve this problem but I can not
work on it. I am just trying to get one very simple Remote Object
example.

I have given all possible details here, please look into it and guide
me how to resolve this error.


WebApplication : http://192.168.6.221:8400/mywebsitename/myindex.html
http://localhost:8400/mywebsitename/myindex.html
My PC IP is : 192.168.6.221
same on : localhost


Tomcat structure
-----------------------------
Tomcat (dir)
webapps (dir)
mywebsitename (dir)
WEB-INF (dir)
myindex.html
myindex.swf
classes (dir)
demo.DemoFlexJava
flex (dir)
4 flex config files

**** Fault Error *****************

FAULT : (mx.messaging.messages::ErrorMessage)#0
body = (Object)#1
clientId = (null)
correlationId = "3B598FB4-AF0F-B98B-3E9A-C51DE95CFEFF"
destination = ""
extendedData = (null)
faultCode = "Client.Error.MessageSend"
faultDetail = "Channel.Connect.Failed error
NetConnection.Call.Failed: HTTP: Status 404: url: 'http://
192.168.6.221:8400/mywebsitename/messagebroker/amf'"
faultString = "Send failed"
headers = (Object)#2
messageId = "89D7340D-765C-37AB-D902-C51DE96B0388"
rootCause = (mx.messaging.events::ChannelFaultEvent)#3
bubbles = false
cancelable = false
channel = (mx.messaging.channels::AMFChannel)#4
authenticated = false
channelSets = (Array)#5
[0] (mx.messaging::ChannelSet)#6
authenticated = false
channelIds = (Array)#7
[0] "my-amf"
channels = (Array)#8
[0] (mx.messaging.channels::AMFChannel)#4
clustered = false
connected = false
currentChannel = (mx.messaging.channels::AMFChannel)#4
initialDestinationId = (null)
messageAgents = (Array)#9
[0] (mx.rpc::AsyncRequest)#10
authenticated = false
autoConnect = true
channelSet = (mx.messaging::ChannelSet)#6
clientId = (null)
connected = false
defaultHeaders = (null)
destination = "MyRODestination"
id = "AA4D300D-C37B-C8FD-19C4-C51DDF3CF648"
reconnectAttempts = 0
reconnectInterval = 0
requestTimeout = -1
subtopic = ""
connected = false
connectTimeout = -1
enableSmallMessages = true
endpoint = "http://192.168.6.221:8400/mywebsitename/
messagebroker/amf"
failoverURIs = (Array)#11
id = "my-amf"
mpiEnabled = false
netConnection = (flash.net::NetConnection)#12
client = (mx.messaging.channels::AMFChannel)#4
connected = false
objectEncoding = 3
proxyType = "none"
uri = "http://192.168.6.221:8400/mywebsitename/messagebroker/
amf"
piggybackingEnabled = false
polling = false
pollingEnabled = true
pollingInterval = 3000
protocol = "http"
reconnecting = false
recordMessageSizes = false
recordMessageTimes = false
requestTimeout = -1
uri = "http://192.168.6.221:8400/mywebsitename/messagebroker/
amf"
url = "http://192.168.6.221:8400/mywebsitename/messagebroker/
amf"
useSmallMessages = false
channelId = "my-amf"
connected = false
currentTarget = (mx.messaging.channels::AMFChannel)#4
eventPhase = 2
faultCode = "Channel.Connect.Failed"
faultDetail = "NetConnection.Call.Failed: HTTP: Status 404: url:
'http://192.168.6.221:8400/mywebsitename/messagebroker/amf'"
faultString = "error"
reconnecting = false
rejected = false
rootCause = (Object)#13
code = "NetConnection.Call.Failed"
description = "HTTP: Status 404"
details = "http://192.168.6.221:8400/mywebsitename/messagebroker/
amf"
level = "error"
target = (mx.messaging.channels::AMFChannel)#4
type = "channelFault"
timestamp = 0
timeToLive = 0

******* Error log *********


-----------------------------------------------------
myindex.html
***************************
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="onCrationComplete()">

<!--<mx:Style source="css/main.css"/>-->

<mx:Script>
<![CDATA[
import mx.rpc.Fault;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.controls.Alert;

private function onCrationComplete():void
{
//txtUser.setFocus();
}


public function onROResult(event:ResultEvent):void
{
//txtArea.text += event.returnText.toString();
txtArea.text += event.toString()+'/n';
}

public function goHandler(event:MouseEvent = null):void
{
//ro.returnToFlex.send();
}

public function onROFault(event:FaultEvent = null):void
{
//Alert.show(event.message.toString());
txtArea.text = txtArea.htmlText = '';
var falultRed:String = "<font color='#ff0000'>FAULT : </font>";
txtArea.htmlText = falultRed+event.message;
}
]]>
</mx:Script>

<mx:RemoteObject id="rmtObj" destination="MyRODestination"
showBusyCursor="true" fault="onROFault(event)">
<mx:method name="methodWithoutArgument" result="onROResult(event)" /
>
<mx:method name="methodWithArgument" result="onROResult(event)" />
</mx:RemoteObject>

<mx:Text text="Welcome... Blaze DS ... be happyyyyy" x="80" y="24"
id="txt1"/>
<mx:TextInput top="50" x="106" id="txtUser"/>
<mx:Text text="Enter Text" left="36" top="50"/>
<mx:Button x="274" y="50" label="Go" id="btnGo"
click="rmtObj.methodWithoutArgument()"/>
<mx:TextArea id="txtArea" x="36" y="80" width="570" height="450"
wordWrap="true" />
</mx:Application>
**********
-----------------------------------------------------
DemoFlexJava.java

********************************
package demo;

public class DemoFlexJava
{
public DemoFlexJava()
{
//empty
}

public int woArg = 0;
public int withArg = 0;

public String methodWithoutArgument()
{
System.out.println(woArg++);

return "method Without Argument";
}

public String methodWithArgument(String strArg)
{
System.out.println(withArg++);

return "method WITH Argument : "+strArg;
}

}
************************************************************************************



-------------------------------------------------------------
remoting-config.xml
****************************

<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService">

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

<default-channels>
<channel ref="my-amf"/>
</default-channels>

<destination id="MyRODestination">
<properties>
<source>demo.DemoFlexJava</source>
</properties>
<adapter ref="java-object" />
</destination>

</service>

****************************************************************************************************************

-------------------------------------------
messaging-config
*********************************
<?xml version="1.0" encoding="UTF-8"?>
<service id="message-service"
class="flex.messaging.services.MessageService">

<adapters>
<adapter-definition id="actionscript"
class="flex.messaging.services.messaging.adapters.ActionScriptAdapter"
default="true" />
<!-- <adapter-definition id="jms"
class="flex.messaging.services.messaging.adapters.JMSAdapter"/> -->
</adapters>

<default-channels>
<channel ref="my-polling-amf"/>
</default-channels>

</service>


****************************************************************************************************************

-------------------------------------------
proxy-config
***************************************

<?xml version="1.0" encoding="UTF-8"?>
<service id="proxy-service"
class="flex.messaging.services.HTTPProxyService">

<properties>
<connection-manager>
<max-total-connections>100</max-total-connections>
<default-max-connections-per-host>2</default-max-
connections-per-host>
</connection-manager>
<allow-lax-ssl>true</allow-lax-ssl>
</properties>

<adapters>
<adapter-definition id="http-proxy"
class="flex.messaging.services.http.HTTPProxyAdapter" default="true"/>
<adapter-definition id="soap-proxy"
class="flex.messaging.services.http.SOAPProxyAdapter"/>
</adapters>

<default-channels>
<channel ref="my-amf"/>
</default-channels>

<destination id="DefaultHTTP">
</destination>

</service>
****************************************************************************************************************

-------------------------------------------
services-config

*******************************************************************

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

<services>

<service-include file-path="remoting-config.xml" />
<service-include file-path="proxy-config.xml" />
<service-include file-path="messaging-config.xml" />

<!--
Application level default channels. Application level default
channels are
necessary when a dynamic destination is being used by a service
component
and no ChannelSet has been defined for the service component. In
that case,
application level default channels will be used to contact the
destination.


<default-channels>
<channel ref="my-amf"/>
</default-channels>

-->

</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://192.168.6.221:8400/mywebsitename/
messagebroker/amf"

class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>

<channel-definition id="my-secure-amf"
class="mx.messaging.channels.SecureAMFChannel">
<endpoint url="https://192.168.6.221:8400/mywebsitename/
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://192.168.6.221:8400/mywebsitename/
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://192.168.6.221:8400/mywebsitename/
messagebroker/http"

class="flex.messaging.endpoints.HTTPEndpoint"/>
</channel-definition>

<channel-definition id="my-secure-http"
class="mx.messaging.channels.SecureHTTPChannel">
<endpoint url="https://192.168.6.221:8400/mywebsitename/
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>[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>true</enabled>
<watch-interval>20</watch-interval>
<watch-file>mywebsitename/WEB-INF/flex/services-
config.xml</watch-file>
<watch-file>mywebsitename/WEB-INF/flex/proxy-config.xml</
watch-file>
<watch-file>mywebsitename/WEB-INF/flex/remoting-
config.xml</watch-file>
<watch-file>mywebsitename/WEB-INF/flex/messaging-
config.xml</watch-file>
<touch-file>mywebsitename/WEB-INF/web.xml</touch-file>
</redeploy>
</system>

</services-config>
*******************************************************************

Thanking you in advance.

Mor

Venkat Viswanathan

unread,
Nov 23, 2008, 12:29:55 AM11/23/08
to flex_...@googlegroups.com
Hi,

While creating the Flex project, what have you given in root URL...? localhost or 192.168.6.221?

Regards,
Venkat

Mor

unread,
Nov 24, 2008, 1:11:39 AM11/24/08
to Flex India Community
Hi, Venkat,

As my Root set : 192.168.6.221

(and actually my local host IP is same as 192.168.6.221)


Looking for solution.

Mor



On Nov 23, 10:29 am, "Venkat Viswanathan" <helloven...@gmail.com>
wrote:
> Hi,
>
> While creating the Flex project, what have you given in root URL...?
> localhost or 192.168.6.221?
>
> Regards,
> Venkat
>
> > messagebroker/amf<http://192.168.6.221:8400/mywebsitename/messagebroker/amf>
> ...
>
> read more »

Nishant Kyal

unread,
Nov 24, 2008, 1:20:56 AM11/24/08
to flex_...@googlegroups.com
Hi,

Try opening the URL 'http://192.168.6.221:8400/mywebsitename/messagebroker/amf' in your browser. It'll most probably give you the same error. But that is a quicker way of seeing if your blazeds is properly configured.

Next, you'll need to share your flex-config files and your web.xml so that I can see what's wrong.

Nishant

Mor

unread,
Nov 24, 2008, 3:12:08 AM11/24/08
to Flex India Community
Hi Nishant,

I am really thank full to you.
I have solved it now.

I could do it with your clue.

:)

Mor



On Nov 24, 11:20 am, "Nishant Kyal" <nishant.k...@gmail.com> wrote:
> Hi,
> Try opening the URL 'http://192.168.6.221:8400/mywebsitename/messagebroker/amf'in your browser.
> It'll most probably give you the same error. But that is a quicker way of
> seeing if your blazeds is properly configured.
>
> Next, you'll need to share your flex-config files and your web.xml so that I
> can see what's wrong.
>
> Nishantwww.itasveer.com
>
> ...
>
> read more »

mtd uit

unread,
Jan 13, 2013, 12:36:40 PM1/13/13
to flex_...@googlegroups.com, me2...@gmail.com
Hi, I have same problem but I can't solve it, can you please tell me how to solve it. Thank

Vào 15:12:08 UTC+7 Thứ hai, ngày 24 tháng mười một năm 2008, Mor đã viết:
Reply all
Reply to author
Forward
0 new messages