# Java / web.xml Remoting problem

**URL:** https://forum.kirupa.com/t/java-web-xml-remoting-problem/83832
**Category:** programming
**Created:** [March 22, 2005, 2:35pm UTC](https://forum.kirupa.com/t/java-web-xml-remoting-problem/83832 "2005-03-22T14:35:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![snapple](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@snapple](https://forum.kirupa.com/u/snapple)
#### Post date: [March 22, 2005, 2:35pm UTC](https://forum.kirupa.com/t/java-web-xml-remoting-problem/83832/1 "2005-03-22T14:35:45Z")

</div>

Hello. Thanks in advance for any help or advice.

I am using; Java 1.5, Tomcat 5.5, openamf, fmx 2004 pro.

I bought “Flash Remoting, the definitive guide by Tom Muck”. However, most documentation directly relates to the bought version of Flash Remoting and JRun 4. So i am having a little trouble getting things working myself.

I have actually got some remoting to work in Flash, a simple HelloWorld example. However, i only got this working by actually puting and compiling my Java class inside openamf (the following directory structure):

Tomcat  
-------\>Tomcat 5.5  
--------------------\>webapps  
------------------------------\>openamf  
----------------------------------------\>WEB-INF  
--------------------------------------------------\>classes

This worked. However, from what i understand, this is not how it should acuatlly be achieved. What i should actually have (i think) is, my own completely self-contained webapp, and point it to the remoting gateway.

So what i did was:

1. Copy openamf.jar file into the lib directory of my webapp.
2. add the following XML to my own webapps web.xml file (inside WE-INF).

> 

[font=Courier New]  
\<?xml version=“1.0” encoding=“UTF-8”?\>  
\<!DOCTYPE web-app  
PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN”  
“[Oracle Java Technologies | Oracle](http://java.sun.com/j2ee/dtds/web-app_2.2.dtd)”\>  
\<web-app\>

```
&lt;servlet&gt;
    &lt;servlet-name&gt;foo&lt;/servlet-name&gt; **&lt;!-- mapping name below --&gt;**
    &lt;servlet-class&gt;ByeByeWorld&lt;/servlet-class&gt; **&lt;!-- name of class --&gt;**
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;foo&lt;/servlet-name&gt; **&lt;!-- finds same name above and looks up the class --&gt;**
    &lt;url-pattern&gt;/ByeByeWorld&lt;/url-pattern&gt; **&lt;!-- the url that can be typed in the browser --&gt;**
&lt;/servlet-mapping&gt;

```

**\<!-- this is what i added –\>**  
[color=Red]  
\<servlet\>  
\<servlet-name\>FlashGatewayServlet\</servlet-name\>  
\<servlet-class\>…/openamf/gateway\</servlet-class\>[/color][/font][font=Courier New][color=Red]\<!-- HOW DO I GET INTO OEPNAMF FROM HERE? –\>[/color][/font]  
[font=Courier New][color=Red] \</servlet\>  
\<servlet-mapping\>  
\<servlet-name\>FlashGatewayServlet\</servlet-name\>  
\<url-pattern\>…/…/openamf/org.openamf.DefaultGateway\</url-pattern\>  
\</servlet-mapping\>

\</web-app\>  
[/color]  
[/font]

**Area of confusion…**

How come i can type [http://localhost/openamf/gateway](http://localhost/openamf/gateway) into my browser and it (as it should do) return a blank page (Where is the gateway, i can’t see anything directly relating to it inside the openamf servlet?) Secondly, inside the \<servlet-class\>\</servlet-class\> tag, is this what points to the actual remoting gateway, is this what makes remoting work and hence i should ‘point’ my webapp to it?

So i suppose my main question is:

What goes inside the \<servlet-class\>\</servlet-class\> tags that are meant to find the remtoing gateway, inside my webapps web.xml? (assuming i already have the other \<servlet-class\> tags set-up to point to the actual Java class that i wrote) ?

Massive thanks for any help, really is appreciated.

Regards, snapple 🙂
