Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-24-2006, 07:46 PM   #1
thegreendove
Registered User
 
Join Date: Jun 2005
Posts: 3
Default Flash Remoting with Java: Problems

Hi! I was checking out an example I found on the web. I installed the application as they instructed. I'm using Tomcat server (v5.5.15) on port 8085. My Flash version is 8 and I installed the remoting components for version 8 AS2.0. But I'm getting the following error after I run the app:

Error opening URL "http://localhost:8085/helloworld/gateway"

Here's the codes:

Code on layer 1:
============
Code:
// ON TIMELINE VERSION //////////////////////////////////////////////
import mx.remoting.Service;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.PendingCall;  

mx.remoting.debug.NetDebug.initialize(); // initialize the NetConnection Debugger
var myLogger:Log = new Log( Log.DEBUG, "logger1" );

// override the default log handler
myLogger.onLog = function( message:String ):Void {
 trace( "myLogger-->>>"+message );
}
//Create the service ->based on back-end used, comment/uncoment following arguments
myService = new Service(
	  "http://localhost:8085/helloworld/gateway",
	  myLogger,
	  "com.flashdb.services.HelloWorld",
	  null,
	  null); 
//Handler for results
function onEchoData(msg: ResultEvent){
	mx.remoting.debug.NetDebug.trace({level:"Debug", message:"onEchoData" });
	show.text = msg.result
}
//Handler for errors
function onEchoFault(rs: FaultEvent ){
	mx.remoting.debug.NetDebug.trace({level:"None", message:"There was a problem: " + fault.fault.faultstring });
}
//Buttons handlers
callButton.onPress = function(){
   var pc:PendingCall = myService.makeEcho("Hello World!");
   pc.responder = new RelayResponder(this._parent, "onEchoData", "onEchoFault" );
}
clearButton.onPress = function(){
	show.text = "";
}
stop()
Here's the java code:
Code:
package com.flashdb.services;

public class HelloWorld {
	public String makeEcho(String msg){
		return msg;
	}
}
and Here's the web.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
    "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
<web-app>
	<servlet>
		<servlet-name>DefaultGateway</servlet-name>
		<display-name>DefaultGateway</display-name>
		<description>DefaultGateway</description>
		<servlet-class>org.openamf.DefaultGateway</servlet-class>
		<init-param>
			<param-name>OPENAMF_CONFIG</param-name>
			<param-value>/WEB-INF/openamf-config.xml</param-value>
			<description>Location of the OpenAMF config file.</description>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>DefaultGateway</servlet-name>
		<url-pattern>/gateway</url-pattern>
	</servlet-mapping>
	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
	<welcome-file-list>
		<welcome-file>index.html</welcome-file>
	</welcome-file-list>
</web-app>
I have openamf.jar residing at WEB-INF\lib

Please tell me what's wrong here.
thegreendove is offline   Reply With Quote
Old 05-25-2006, 08:52 PM   #2
hobbis
Senior Member
 
hobbis's Avatar
 
Join Date: May 2002
Location: Faversham, Kent
Posts: 286
Default

From your error, I'd say it just cannot find the gateway. What happens when you put this url into the browser directly?
hobbis is offline   Reply With Quote
Old 05-26-2006, 06:42 AM   #3
thegreendove
Registered User
 
Join Date: Jun 2005
Posts: 3
Default

Quote:
Originally Posted by hobbis
From your error, I'd say it just cannot find the gateway. What happens when you put this url into the browser directly?
No use. It still can't find the gateway servlet.

The requested resource (Servlet DefaultGateway is not available) is not available.

But my other servlets are running fine on my Tomcat server.

Anybody who can come up with a solution, please let me know. This thing is eating my head!
thegreendove is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing Flash Web Sites for Search Engines rockcoastmedia General Chat 19 03-29-2009 09:31 PM
Some Flash Video Converter Tools Compare terry117 Detention 7 05-18-2006 02:08 AM
flash Remoting mayur_vnit Flash Remoting 5 02-24-2006 08:24 AM
flash remoting, Coldfusion, and apostrophes fou99004 Flash Remoting 3 02-07-2006 07:17 PM
java and Flash arun67 ActionScript 1.0 (and below) 0 07-25-2003 10:04 AM


All times are GMT. The time now is 09:07 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.