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
Andrea
Andrea Campolonghi
and...@getrailo.org
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.
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
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
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.
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...
http://groups.google.com/group/coldspring-users/browse_thread/thread/6df650a74e171765
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
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.
>
>
>
The same issue exists for ACF. Anytime you use a virtual directory, there are always mappings to be concerned with.