remoting problem

24 views
Skip to first unread message

Tom B

unread,
Dec 4, 2011, 5:29:20 PM12/4/11
to Railo
Hi,

I am getting a strange error with using cfajaxproxy with Model-Glue 3
on Railo 3.3.1.000 final. I'm not sure if the problem lies within
Railo or Model-Glue. However it has started after I moved the
application into a directory/context outside of the tomcat webapps/
root directory and main railo web context.

When I try to execute an ajax call to the remoteproxy it throws a 500
internal server error and I can see the following error coming back in
firebug:

Sorry, a ColdSpring BeanFactory named sharedBeanFactory was not found
in application scope. Please make sure your bean factory is properly
loaded. Perhapse your main application is not running?

However, the sharedBeanFactory is set in the application scope
properly as I can dump the following without a problem:

#application.sharedbeanFactory.getbean("modelglue.modelGlueConfiguration")#

I can see quite a bit of Railo generated javascript in the document
head:

<script type="text/javascript" src="/mapping-tag/railo/core/ajax/
JSLoader.cfc?method=get&lib=RailoAjax"></script><!--
_Railo_RemoteProductService --> <script type="text/javascript">
var _Railo_RemoteProductService = Railo.ajaxProxy.init('/myapp/
model/services/proxy/
RemoteProductsService.cfc','RemoteProductService');
_Railo_RemoteProductService.prototype.getLanguageTemplateTitle =
function(productid,languageid){return
Railo.ajaxProxy.invokeMethod(this,'getLanguageTemplateTitle',
{productid:productid,languageid:languageid});};
</script>

I'm thinking perhaps there's an issue with the railo mapping-tag?

Does anyone have any ideas? Should I be asking this on the Model-Glue
groups list?

Any pointers would be very much appreciated.

Tom

Tom B

unread,
Dec 4, 2011, 5:39:40 PM12/4/11
to Railo
PS Am running the app with Apache running through AJP proxy and
mod_rewrite

Andrea Campolonghi

unread,
Dec 5, 2011, 2:42:57 AM12/5/11
to ra...@googlegroups.com
Problem is not in mapping-tag.
I think your ajax call generates an error and model glue renders back an error page.
You probably broke something in your mappings moving the application. Sorry I am not
a MG user but I am sure issue is not in ajaxproxy.

Andrea

Andrea Campolonghi
and...@getrailo.org

Tom B

unread,
Dec 5, 2011, 8:24:58 AM12/5/11
to Railo
Thanks for your response, Andrea.

The AJAX was working perfectly before and as far as I can see it is
hitting the generated remote proxy correctly. The error occurs in the
remote proxy cfc setup() method. There is something going on here with
ColdSpring. However, I believe all my mappings are correct.

Tom B

unread,
Dec 5, 2011, 8:41:47 AM12/5/11
to Railo
Here's a stacktrace:

Might this have something to do with the way AJP routes CF calls? I'm
using Apache with AJP through to Railo.


Sorry, a ColdSpring BeanFactory named sharedBeanFactory was not found
in application scope. Please make sure your bean factory is properly
loaded. Perhapse your main application is not running?

at railo.runtime.tag.Throw._doStartTag(Throw.java:142):142
at railo.runtime.tag.Throw.doStartTag(Throw.java:131):131
at model.services.proxy.remoteproductsservice_cfc$cf.udfCall(C:\wsi
\myapp\model\services\proxy\RemoteProductsService.cfc:103):103
at railo.runtime.type.UDFImpl.implementation(UDFImpl.java:214):214
at railo.runtime.type.UDFImpl._call(UDFImpl.java:418):418
at railo.runtime.type.UDFImpl.call(UDFImpl.java:383):383
at
railo.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:
738):738
at railo.runtime.PageContextImpl.getFunction(PageContextImpl.java:
1444):1444
at model.services.proxy.remoteproductsservice_cfc
$cf.initComponent(C:\wsi\myapp\model\services\proxy
\RemoteProductsService.cfc:56):56
at model.services.proxy.remoteproductsservice_cfc$cf.newInstance(C:
\wsi\myapp\model\services\proxy\RemoteProductsService.cfc):-1
at railo.runtime.ComponentPage.call(ComponentPage.java:105):105
at railo.runtime.PageContextImpl.doInclude(PageContextImpl.java:
762):762
at
railo.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:
179):179
at
railo.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:
23):23
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1991):
1991
at railo.runtime.PageContextImpl.execute(PageContextImpl.java:1958):
1958
at
railo.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:
297):297
at railo.loader.servlet.CFMLServlet.service(CFMLServlet.java:32):32
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722):722
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
304):304
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
210):210
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
224):224
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
185):185
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:
472):472
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
151):151
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
100):100
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
118):118
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
405):405
at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:
193):193
at org.apache.coyote.AbstractProtocol
$AbstractConnectionHandler.process(AbstractProtocol.java:515):515
at org.apache.tomcat.util.net.JIoEndpoint
$SocketProcessor.run(JIoEndpoint.java:300):300
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown
Source):-1
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source):-1
at java.lang.Thread.run(Unknown Source):-1

Andrea Campolonghi

unread,
Dec 5, 2011, 9:02:44 AM12/5/11
to ra...@googlegroups.com
Hi,

I think this has something to do with how coldspring remote works.
You can even try to submit the question to the Coldspring mailing list (on google groups).

Andrea

Andrea Campolonghi
and...@getrailo.org

Tom B

unread,
Dec 5, 2011, 9:15:50 AM12/5/11
to Railo
Hi Andrea,

Yes, upon doing some more research this issue has arisen before. If
anyone else gets this error please see this thread:

http://www.mail-archive.com/coldspr...@coldspringframework.org/msg01233.html

This is, at the moment, still unresolved.

I will try the coldspring group.

Thanks for your help Andrea.

Tom B

unread,
Dec 5, 2011, 5:26:52 PM12/5/11
to Railo
OK, I have had quite a long conversation with myself (with some input
from Brian Kotek) at this thread (http://groups.google.com/group/
coldspring-users/browse_thread/thread/6df650a74e171765) on the
ColdSpring group and have arrived at the conclusion that having set up
a web context outside of the C:\railo\tomcat\webapps\ROOT is affecting
ColdSpring's ability to perform proxying of remote requests via AJAX.

Why this is I have no idea.

I have tested my code with the application in the default webapps
folder of railo/tomcat and it works fine.

Take it out of the folder and use a virtual host (setup like this in
the server.xml file below) and it stops working.

<Host name="myapp" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="C:\wsi\myapp\wwwroot"
sessionCookieDomain="myapp" />
<Logger
className="org.apache.catalina.logger.FileLogger"/>

</Host>

I am seeing a ColdSpring error and also a JSON parse error (in
firebug)

JSON.parse var Railo=(function(){var _RAILO_...n
b.filter(w,v)};window.Sizzle=b})();

If anyone can help shed some light on this I'd be really grateful...

Tom B

unread,
Dec 5, 2011, 5:27:50 PM12/5/11
to Railo

Tom B

unread,
Dec 5, 2011, 7:37:25 PM12/5/11
to Railo
I worked it out in the end and it was painfully simple:

I had to add a mapping to the proxy in the Railo administrator and
then call it via:

<cfajaxproxy cfc="myMapping.RemoteProductService"
jsclassname="RemoteProductService">

Doh!!!!

Thanks for your help

Matthew Williams

unread,
Dec 5, 2011, 9:45:35 PM12/5/11
to ra...@googlegroups.com
That's bitten me using Apache aliases's as well. If I make a /something
in apache, I need to also create a mapping in railo to /something. Not
sure why, as it's not something you run into with ACF.

--
Matthew Williams
Geodesic GraFX
www.geodesicgrafx.com/blog
twitter.com/ophbalance

> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.1869 / Virus Database: 2092/4617 - Release Date: 11/14/11
> Internal Virus Database is out of date.
>
>
>


Todd Rafferty

unread,
Dec 6, 2011, 7:28:14 AM12/6/11
to ra...@googlegroups.com

The same issue exists for ACF. Anytime you use a virtual directory, there are always mappings to be concerned with.

Reply all
Reply to author
Forward
0 new messages