Railo 3.3.1 on Mac OS X Lion - How to enable the Remoting?

133 views
Skip to first unread message

Vicente Maciel Junior

unread,
Dec 8, 2011, 12:43:42 PM12/8/11
to ra...@googlegroups.com
Hi people,

I have Railo running OK on my Mac OS X Lion machine, but can't find a way to enable the "Flash Remoting / BlazeDS / AMF" to work.

Sorry if I missed something, but prior to posting here I did a lot of searches (Google/Groups previous messages) but coudnt find something to help me out, so I hope to be able to find here someone that had this experience before me and had successfully putted it to work.

All the contents I've found had some references that doesn't matches what I have on my installation here. But also, none of them seemed to be written for the Mac OS X install and/or referencing the 3.3.1 Railo's version. 

I'm running it locally on port 8080 for development purposes.

Thanks a lot for any help.

(and for the Railo team: Congratulations for the great job! 13 years using another CFML engine and now I feel very confortable using Railo)  
 
 
Vicente Maciel Junior - @macieljr
========================================
Engenheiro de Software / Consultor
---------------------------------------------------------------------------------
+55 21 8087-8506 MSN: maci...@gmail.com
---------------------------------------------------------------------------------
Software Engineer At: http://www.adpix.com.br
Personal Blog: http://teclandoalto.blogspot.com
Google Profile: http://www.google.com/profiles/macieljr
========================================

Sean Daniels

unread,
Dec 8, 2011, 1:11:15 PM12/8/11
to ra...@googlegroups.com
Vicente,

Did you use the installer to get Railo on your Mac? Just wondering if you are running it on Tomcat vs Resin. You may need to add or uncomment some lines in Tomcat's web.xml file to enable removing:

<!--
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<init-param>
<param-name>messageBrokerId</param-name>
<param-value>MessageBroker</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
-->

Someone else can chime in on where exactly the web.xml lives on Mac OS, in Ubuntu it's /opt/railo/tomcat/conf/web.xml.

Restart Tomcat after you make the change.

Vicente Maciel Junior

unread,
Dec 8, 2011, 1:48:47 PM12/8/11
to ra...@googlegroups.com
Hi Sean! Thanks for your reply!

Yes, made use of this installer railo-3.3.1-osx-installer.zip (68 MB) available here: http://www.getrailo.org/index.cfm/download/

Actually, the web.xml is available at /Applications/Railo/tomcat/webapps/ROOT/WEB-INF/web.xml. The installer defaults it to /Library/Railo/tomcat/webapps/ROOT/WEB-INF/web.xml, but during the installation, I chose a different home folder. Don't think (I hope) if interferes on the functionality as I have Railo working pretty fine (but Remoting) this way.

This web.xml file doesn't have this content you mentioned to uncomment, so I just pasted it uncommented, saved it, restarted Railo and Remoting is still not working.

Trying to access the following URLs to test for something working, results on a HTTP Status 404 error:

I know I was supposed to have a blank white page here as an indication the servlet is working, right?

So I believe there's something to do to have it working yet...

Thanks for your attention on this!
 
 
Vicente Maciel Junior - @macieljr
========================================
Engenheiro de Software / Consultor
---------------------------------------------------------------------------------
+55 21 8087-8506 MSN: maci...@gmail.com
---------------------------------------------------------------------------------
Software Engineer At: http://www.adpix.com.br
Personal Blog: http://teclandoalto.blogspot.com
Google Profile: http://www.google.com/profiles/macieljr
========================================



2011/12/8 Sean Daniels <daniel...@gmail.com>

Sean Daniels

unread,
Dec 8, 2011, 2:19:11 PM12/8/11
to ra...@googlegroups.com
> /Applications/Railo/tomcat/webapps/ROOT/WEB-INF/web.xml

That is actually not the file you are looking for. Is there a /Applications/Railo/tomcat/conf/web.xml?

Vicente Maciel Junior

unread,
Dec 8, 2011, 2:54:21 PM12/8/11
to ra...@googlegroups.com
Hmmmm... Sorry!
Yes, there is! Moved that portion of XML entries to there, restarted the server and:

http://localhost:8080/flex2gateway, still returns HTTP Status 404

but, http://localhost:8080/flashservices/gateway gives me a HTTP Status 500 with the following:

(What is the correct URL on Railo to test if the servlet is working?)

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.io.EOFException
	java.io.DataInputStream.readUnsignedShort(DataInputStream.java:323)
	org.openamf.io.AMFDeserializer.readHeaders(AMFDeserializer.java:98)
	org.openamf.io.AMFDeserializer.<init>(AMFDeserializer.java:80)
	railo.runtime.engine.AMFEngine.deserializeAMFMessage(AMFEngine.java:62)
	railo.runtime.engine.AMFEngine.service(AMFEngine.java:48)
	railo.runtime.engine.CFMLEngineImpl.serviceAMF(CFMLEngineImpl.java:364)
	railo.loader.servlet.AMFServlet.service(AMFServlet.java:34)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.


Apache Tomcat/6.0.24

The full stack trace (since server startup):
(found this entry interesting: INFO: Marking servlet MessageBrokerServlet as unavailable)

/Applications/Railo/tomcat/logs/localhost.2011-12-08.log:
================================================================
Dec 8, 2011 5:47:35 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet MessageBrokerServlet as unavailable
Dec 8, 2011 5:47:35 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet  threw load() exception
javax.servlet.UnavailableException: MessageBroker already defined from MessageBrokerServlet with init parameter messageBrokerId = 'MessageBroker'
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:163)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:680)
Dec 8, 2011 5:47:36 PM org.apache.catalina.core.ApplicationContext log
INFO: Marking servlet MessageBrokerServlet as unavailable
Dec 8, 2011 5:47:36 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /docs threw load() exception
javax.servlet.UnavailableException: MessageBroker already defined from MessageBrokerServlet with init parameter messageBrokerId = 'MessageBroker'
at flex.messaging.MessageBrokerServlet.init(MessageBrokerServlet.java:163)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:680)
Dec 8, 2011 5:47:36 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Dec 8, 2011 5:47:36 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()
Dec 8, 2011 5:47:36 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Dec 8, 2011 5:47:36 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Dec 8, 2011 5:47:36 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('LCDS_HTTP_TO_FLEX_SESSION_MAP', '{}')
Dec 8, 2011 5:47:44 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextDestroyed()
Dec 8, 2011 5:47:44 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextDestroyed()

 

Vicente Maciel Junior - @macieljr
========================================
Engenheiro de Software / Consultor
---------------------------------------------------------------------------------
+55 21 8087-8506 MSN: maci...@gmail.com
---------------------------------------------------------------------------------
Software Engineer At: http://www.adpix.com.br
Personal Blog: http://teclandoalto.blogspot.com
Google Profile: http://www.google.com/profiles/macieljr
========================================



2011/12/8 Sean Daniels <daniel...@gmail.com>
> /Applications/Railo/tomcat/webapps/ROOT/WEB-INF/web.xml

Koofka

unread,
Dec 8, 2011, 2:55:06 PM12/8/11
to Railo
Hey Vincente.

On a few setups with Flash Remoting, Railo / Tomcat I found the need
to add a ProxyPassMatch to the apache httpd.conf in order to properly
route amf calls. Tend to install from jars and mainly focus on Linux,
so not quite sure if this isn't covered by your installer or if it
directly applies. Have Railo running on Snow leopard for dev, forget
if I needed this tweak there.

ProxyPreserveHost On
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://localhost:8009/$1$2
ProxyPassMatch ^/flashservices/gateway(/.*)?$ ajp://localhost:8009/flashservices/gateway/$1$2

HTH. Cheers.


On Dec 8, 12:43 pm, Vicente Maciel Junior <macie...@gmail.com> wrote:
> Hi people,
>
> I have Railo running OK on my Mac OS X Lion machine, but can't find a way
> to enable the "Flash Remoting / BlazeDS / AMF" to work.
>
> Sorry if I missed something, but prior to posting here I did a lot of
> searches (Google/Groups previous messages) but coudnt find something to
> help me out, so I hope to be able to find here someone that had this
> experience before me and had successfully putted it to work.
>
> All the contents I've found had some references that doesn't matches what I
> have on my installation here. But also, none of them seemed to be written
> for the Mac OS X install and/or referencing the 3.3.1 Railo's version.
>
> I'm running it locally on port 8080 for development purposes.
>
> Thanks a lot for any help.
>
> (and for the Railo team: Congratulations for the great job! 13 years using
> another CFML engine and now I feel very confortable using Railo)
>
> Vicente Maciel Junior - @macieljr
> ========================================
> Engenheiro de Software / Consultor
> --------------------------------------------------------------------------- ------

> +55 21 8087-8506 MSN: macie...@gmail.com
> --------------------------------------------------------------------------- ------

Vicente Maciel Junior

unread,
Dec 8, 2011, 3:26:59 PM12/8/11
to ra...@googlegroups.com
Hi Koofka!

Maybe it really doesn't applies to my current installation because I wasn't able to find the "httpd.conf" anywhere inside the Railo's installation folder.

I'm aware it applies to the Apache's web server, but I think Tomcat has its own web-server implementation that doesn't uses "httpd.conf" and at this time, I'm using exactly the configuration present on the latest installer available for Mac that delivers me only the Tomcat and Railo.war already configured/deployed (but unfortunately, without Flash Remoting running out-of-the-box as well).

But I was never usual to the Apache/Tomcat world, so please correct me if I'm wrong, ok?

Thanks
 
 
Vicente Maciel Junior - @macieljr
========================================
Engenheiro de Software / Consultor
---------------------------------------------------------------------------------
+55 21 8087-8506 MSN: maci...@gmail.com
---------------------------------------------------------------------------------
Software Engineer At: http://www.adpix.com.br
Personal Blog: http://teclandoalto.blogspot.com
Google Profile: http://www.google.com/profiles/macieljr
========================================



2011/12/8 Koofka <koo...@gmail.com>

Koofka

unread,
Dec 8, 2011, 4:18:11 PM12/8/11
to Railo
Shot in the dark based on some experiences I had earlier on with the
installer based setup on Mac.

Did you try openamf/gateway instead of the other options you
mentioned?

I believe Apache is still in the mix on the installer version of Mac
and is proxying to Tomcat. Could be off on that. You httpd.conf
should be in /etc/apache2 on Mac.

On Dec 8, 3:26 pm, Vicente Maciel Junior <macie...@gmail.com> wrote:
> Hi Koofka!
>
> Maybe it really doesn't applies to my current installation because I wasn't
> able to find the "httpd.conf" anywhere inside the Railo's installation
> folder.
>
> I'm aware it applies to the Apache's web server, but I think Tomcat has its
> own web-server implementation that doesn't uses "httpd.conf" and at this
> time, I'm using exactly the configuration present on the latest installer
> available for Mac that delivers me only the Tomcat and Railo.war already
> configured/deployed (but unfortunately, without Flash Remoting running
> out-of-the-box as well).
>
> But I was never usual to the Apache/Tomcat world, so please correct me if
> I'm wrong, ok?
>
> Thanks
>
> Vicente Maciel Junior - @macieljr
> ========================================
> Engenheiro de Software / Consultor

Vicente Maciel Junior

unread,
Dec 12, 2011, 8:32:45 AM12/12/11
to ra...@googlegroups.com
Do you mean install openamf apart? No I didn't... I would like to be able to use what Railo says it offers inside the package as I think it would be the best integration possible... But, if I can't, sure I'll try another way like that you mentioned.

Regarding Apache, I really don't have it on my machine... :(

It's very hard to assume there's no one already running Mac OS X Lion (10.7) together with Railo (3.3.1) and with Flash Remoting running as well. I thought this was a common situation... 

Is there someone from the Railo's team here to add something on this discussion?
 
 
Vicente Maciel Junior - @macieljr
========================================
Engenheiro de Software / Consultor
---------------------------------------------------------------------------------
+55 21 8087-8506 MSN: maci...@gmail.com
---------------------------------------------------------------------------------

Koofka

unread,
Dec 12, 2011, 1:08:58 PM12/12/11
to Railo
Re: openamf/gateway, my meaning was on the client side addressing that
gateway url for Flash Remoting services. With an earlier, installer
based setup of Railo, that did the trick for me with regard to
accessing remoting whereas the other gateway url's were returning 500
errors.

Best of luck.

Generally the gateway setup should be in the tomcat config xml files

On Dec 12, 8:32 am, Vicente Maciel Junior <macie...@gmail.com> wrote:
> Do you mean install openamf apart? No I didn't... I would like to be able
> to use what Railo says it offers inside the package as I think it would be
> the best integration possible... But, if I can't, sure I'll try another way
> like that you mentioned.
>
> Regarding Apache, I really don't have it on my machine... :(
>
> It's very hard to assume there's no one already running Mac OS X Lion
> (10.7) together with Railo (3.3.1) and with Flash Remoting running as
> well. I thought this was a common situation...
>
> Is there someone from the Railo's team here to add something on this
> discussion?
>
> Vicente Maciel Junior - @macieljr
> ========================================
> Engenheiro de Software / Consultor

Vicente Maciel Junior

unread,
Dec 12, 2011, 1:22:02 PM12/12/11
to ra...@googlegroups.com
That you for your attention Koofka!
Already did everything I found mentioning how to config it and no success at all.

My last hope is to find someone who already made it work. 
 
 
Vicente Maciel Junior - @macieljr
========================================
Engenheiro de Software / Consultor
---------------------------------------------------------------------------------
+55 21 8087-8506 MSN: maci...@gmail.com
---------------------------------------------------------------------------------
Software Engineer At: http://www.adpix.com.br
Personal Blog: http://teclandoalto.blogspot.com
Google Profile: http://www.google.com/profiles/macieljr
========================================



2011/12/12 Koofka <koo...@gmail.com>

Sean Coyne

unread,
Dec 19, 2011, 9:46:01 AM12/19/11
to ra...@googlegroups.com
I have never been able to get this to work by altering the global web.xml file in Tomcat.  The only way I have been successful was to create a web.xml file for each context and add this block:

<web-app>
  <servlet>
    <servlet-name>MessageBrokerServlet</servlet-name>
    <servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
    <init-param>
<param-name>services.configuration.file</param-name>    
<param-value>/WEB-INF/flex/services-config.xml</param-value>    
    </init-param>
    <init-param>
<param-name>messageBrokerId</param-name>      
<param-value>MessageBroker-sitename</param-value>    
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>MessageBrokerServlet</servlet-name>
    <url-pattern>/flex2gateway/*</url-pattern>
  </servlet-mapping>
</web-app>

Just change the "MessageBroker-sitename" part to be unique for each context.  I use the domain name of the site, for example.  So within each context's WEB-INF directory, create a web.xml file (or edit it if you find it there already) and add the servlet and servlet-mapping blocks.

Reply all
Reply to author
Forward
0 new messages