No service for ....

jake <[email protected]>
Newsgroups gmane.comp.java.openamf.user
Message-ID <[email protected]>
Hmmm... not quite so smooth after all.

 Client code now seems fine:
////////////////////////////////

import mx.remoting.NetServices;


class Test
{


private var gatewayPath:String = "";
private var servicePath:String = "";
private var serviceConnection:Object = new Object();
private var serviceObject:Object = new Object();

function Test()
{
		
	this.gatewayPath =
"http://localhost:8080/openamf/gateway";
	this.servicePath = "com.jakestone.bm.Test";
	this.setServiceObject();
	trace("Directory Created");
}


// Methods
function setServiceObject() {
	NetServices.setDefaultGatewayUrl(this.gatewayPath);
	this.serviceConnection =
NetServices.createGatewayConnection();
	this.serviceObject =
this.serviceConnection.getService(this.servicePath,
this);
}
function setGatewayPath (gatewayPath) {
	this.gatewayPath = gatewayPath;
	this.setServiceObject();
	trace("gateway: "+this.gatewayPath);
}

function setServicePath(servicePath) {
	this.servicePath = servicePath;
	this.setServiceObject();
	trace("service: "+this.servicePath);
}

function sayHello(msg:String) {
	
	this.setServiceObject();
	this.serviceObject.sayHello(msg);
}


	
}
---------------------------------------------

openamf gateway servlet starts up within my webapp
just fine. My web.xml is as per the README. The
config.xml is modified as follows:


///////////////////////////

<service>
		<name>Test</name>
	
<service-location>com.jakestone.bm.Test</service-location>
		<invoker-ref>Java</invoker-ref>
		<method>
			<!-- Operation's are matched by the name and
parameters -->
			<name>sayHello</name>
			<state-bean-ref>
				<name>Authentication</name>
			</state-bean-ref>
			<parameter>
				<!--
					type can be the the name of the class,
					a * for any types,
					or a ? any 1 type
				-->
				<type>*</type>
			</parameter>
		</method>

	</service>

--------------------------------


My server side code is as follows:


////////////////////////////////////////
package com.jakestone.bm;


import com.jakestone.bm.utils.BMLogManager;

import java.util.logging.Level;
import java.io.Serializable;

public class Test     implements Serializable
{
    public void sayHello(String msg)
    {
       
BMLogManager.getDefaultLogger().log(Level.INFO,  msg+"
to you too");
    }
}
----------------------------------------

Yet the call to the server creates the following
server side error:

///////////////////////////////////////////


May 5, 2005 11:50:48 PM org.openamf.DefaultGateway
logRequestException
SEVERE: Error in service, detail=[AMFBody:
{serviceName=com.jakestone.bm.Test, serviceMethodNam
e=sayHello, response=/1, type=ARRAY,
value=[boopoodeedoo]}], AMFBody=[AMFBody:
{serviceName=com
.jakestone.bm.Test, serviceMethodName=sayHello,
response=/1, type=ARRAY, value=[boopoodeedoo]}]

org.openamf.invoker.ServiceInvocationException:
java.lang.Exception: No service for 'com.jakest
one.bm.Test'
        at
org.openamf.DefaultGateway.invokeBody(DefaultGateway.java:203)
        at
org.openamf.DefaultGateway.processMessage(DefaultGateway.java:190)
        at
org.openamf.DefaultGateway.service(DefaultGateway.java:95)

----------------------------------


Can anyone advise me ?

Thanks in advance. 


Jake


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.