Re: Linux OpenAMF - Configuration Question

Mark Williamson <[email protected]> Tue, 25 Oct 2005 10:17:25 -0700 (PDT)
Newsgroups gmane.comp.java.openamf.user
Message-ID <[email protected]>

--- Mark Williamson <[email protected]> wrote:

> Hello everyone,
> 
> I am trying to get OpenAMF to work properly on a
> Linux
> machine with Apache 2, Tomcat 5.5.9, and Mod_JK
> (ajp13).  The connector is working properly, which
> is
> verified by correct behavior of my JSP applications.
> 
> The trick for me was getting the configuration right
> for the example context.  Note:  If you set up
> OpenAMF
> for the site before reverting to the example(s) that
> the readme guides you through, be sure not to repeat
> entries in the server's web.xml file that appear in
> the context's web.xml (namely the DefaultGateway
> stuff).
> 
> I have worked with tomcat's debug mode to narrow
> down
> my configuration errors (one of which was adding  an
> include for "DataGlue.as" in each example
> ActionScript
> file tested).  But now that I have no more server
> errors of any kind, and just when I would have
> thought
> I had it working, the flash application still fails
> to
> do anything eventful.  I can enter and change text
> in
> the client side, but there seems to be absolutely no
> response from the server.  When I examine Tomcat's
> catalina.out log, I receive these entries:
> 
> //------- From Catalina.out -------//
> [DEBUG] ChannelSocket - Accepted socket
> Socket[addr=/127.0.0.1,port=33142,localport=8009]
> [DEBUG] ThreadPool - Getting new thread data
> [DEBUG] ChannelSocket - receive() 
> [DEBUG] MsgAjp - Received 446 18
> [DEBUG] ChannelSocket - Call next 0
> org.apache.jk.common.HandlerRequest@15fadcf
> [DEBUG] HandlerRequest - Handling 2
> [DEBUG] Registry - Managed=
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2
> [DEBUG] BaseModelMBean - default constructor
> [DEBUG] BaseModelMBean - preRegister
> org.apache.coyote.RequestInfo@1542a75
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2
> [DEBUG] MapperListener - Handle
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2
> type : JMX.mbean.registered
> [DEBUG] MapperListener - Handle
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest2
> type : JMX.mbean.registered
> [DEBUG] ChannelSocket - receive() 
> [DEBUG] ChannelSocket - Accepted socket
> Socket[addr=/127.0.0.1,port=33144,localport=8009]
> [DEBUG] ThreadPool - Getting new thread data
> [DEBUG] ChannelSocket - receive() 
> [DEBUG] MsgAjp - Received 446 18
> [DEBUG] ChannelSocket - Call next 0
> org.apache.jk.common.HandlerRequest@15fadcf
> [DEBUG] HandlerRequest - Handling 2
> [DEBUG] Registry - Managed=
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest3
> [DEBUG] BaseModelMBean - default constructor
> [DEBUG] BaseModelMBean - preRegister
> org.apache.coyote.RequestInfo@156b6b9
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest3
> [DEBUG] MapperListener - Handle
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest3
> type : JMX.mbean.registered
> [DEBUG] MapperListener - Handle
>
Catalina:type=RequestProcessor,worker=jk-8009,name=JkRequest3
> type : JMX.mbean.registered
> [DEBUG] ChannelSocket - receive() 
> [DEBUG] MsgAjp - Received 0 18
> [DEBUG] MsgAjp - Received 0 18
> [INFO] JkInputStream - Receiving: getting request
> body
> chunk 0 0
> [INFO] JkInputStream - Receiving: getting request
> body
> chunk 0 0
> [DEBUG] HandlerRequest - Calling next container
> org.apache.jk.server.JkCoyoteHandler
> [DEBUG] HandlerRequest - Calling next container
> org.apache.jk.server.JkCoyoteHandler
> [DEBUG] JkCoyoteHandler - Invoke R(
> /openamf/gateway)
> org.apache.coyote.Response@1f66cff /openamf/gateway
> [DEBUG] JkCoyoteHandler - Invoke R(
> /openamf/gateway)
> org.apache.coyote.Response@16de49c /openamf/gateway
> [DEBUG] JkCoyoteHandler - COMMIT 
> [DEBUG] JkCoyoteHandler - COMMIT sending headers
> org.apache.coyote.Response@16de49c === MimeHeaders
> ===
> 
> [DEBUG] JkCoyoteHandler - doWrite 0 998 0
> [DEBUG] JkCoyoteHandler - CLOSE 
> [DEBUG] REQ_TIME - Time pre=3214/ service=4 998
> /openamf/gateway
> [DEBUG] HandlerRequest - Invoke returned 0
> [DEBUG] ChannelSocket - receive() 
> [DEBUG] JkCoyoteHandler - COMMIT 
> [DEBUG] JkCoyoteHandler - COMMIT sending headers
> org.apache.coyote.Response@1f66cff === MimeHeaders
> ===
> 
> [DEBUG] JkCoyoteHandler - doWrite 0 998 0
> [DEBUG] JkCoyoteHandler - CLOSE 
> [DEBUG] REQ_TIME - Time pre=2385/ service=19 998
> /openamf/gateway
> [DEBUG] HandlerRequest - Invoke returned 0
> [DEBUG] ChannelSocket - receive() 
> 
> //------- End: Catalina.out -------//
> 
> If anyone has any further suggestions or comments,
> please let me know.  Thanks, and have a nice day.
> 
> -Mark Williamson
> 
> 

Well, we found a solution.  As it turns out (and
something I haven't seen mentioned before), the
examples for both Macromedia's flash-java remoting and
openAMF are created in Flash MX.  Our version of flash
is Flash MX 2004.  I don't really know the technical
details with regard to Flash and its versions, but
this ultimately appears to be the source of our
problem.  I can say this because I discovered that our
setup was exactly correct, and the only thing causing
trouble was the samples that accompanied OpenAMF.

We created our own simple sample consisting of a small
Flash app that communicated with the OpenAMF gateway
and a small Java class that reacted.  Without any
modifications to our setup, they both worked like a
charm.

So, if you are curious about our setup, here's the
rundown:

-RedHat Linux
-Apache 2
-Tomcat 5.5.9
-modJK connector (ajp13)
-JDK 5.0

For OpenAMF:
-openamf.jar (and other jars) must be in
[(context)/WEB-INF/lib] (for application) use or
[(common)/lib] (for server-wide use)
-build-webservice.xml & openamf-config.xml must be in
[(context)/WEB-INF] for every application using the
gateway
-each application's web.xml should have gateway
entries similar to these:--------

	<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>
	</servlet>

	<servlet-mapping>
		<servlet-name>DefaultGateway</servlet-name>
		<url-pattern>/gateway</url-pattern>
	</servlet-mapping>


End web.xml
entries--------------------------------------------------------------
(These entries are for the default gateway. There is
also an advanced gateway available.)

Beyond the fact that we created our own application,
this was all that was needed.  I wish I knew more
about the difficulties with the examples, but as it
stands, you should make your own if those don't work. 
Good luck, and have a nice day.

-Mark Williamson






-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information