Setting up Taffy with Railo

453 views
Skip to first unread message

cra

unread,
Nov 4, 2015, 2:20:33 PM11/4/15
to Taffy Users
Hello all,

I am attempting to set up Taffy with Railo. I have seen several posts about editing the web.xml file to get the API working but to the point none of the solutions have worked. This could be because I am misunderstanding the location of the proper web.xml file.

Here is how my application is setup:

the path to my api is: 

/webroot/myapp/api

My resources are:
/webroot/myapp/api/resources

taffy is located at:
webroot/myapp/taffy

I have an entry in my hosts file:
127.0.0.1    myapp.local

So that I can create a site in IIS and use a host header.

This all works fine. The application responds just fine with any normal CF code.

I have a single resource (employeeCollection.cfc)

With very simple code to map the URI to /employees (/api/employees)

However when I open the API dashboard I received this:

invalid component definition, can't find component [resources.employeeCollection] 

Any ideas?

Thanks all.

Irvin Wilson

unread,
Nov 4, 2015, 4:52:25 PM11/4/15
to taffy...@googlegroups.com
Not sure and maybe better to wait for someone more knowledgeable than me but my setup in Railo/Lucee works and is as follows:

webroot/myapp/api
webroot/myapp/api/resources
webroot/myapp/api/taffy

webroot/myapp/api has the following 3 files

application.cfc
index.cfm (empty)
ioc.cfc

webroot/myapp/api/application.cfc  has....

component
extends="taffy.core.api"
{
    //the name can be anything you like
    this.name = 'myapp';
    this.mappings['/resources'] = expandPath('./resources');
    this.mappings['/taffy'] = expandPath('./taffy');

.....
}

employeeCollection.cfc goes in "resources" obviously (sorry, wasn't clear to me from your post)


--
You received this message because you are subscribed to the Google Groups "Taffy Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to taffy-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Irvin Wilson

unread,
Nov 4, 2015, 5:02:13 PM11/4/15
to taffy...@googlegroups.com
Actually you may want to scratch my reply.  I was messing with a couple different things.  The ioc.cfc is part of an fw/1 test I was doing.  If no reply for awhile I can separate out what's what and re-reply if you aren't getting anywhere.  I remember just thinking of it as its own app rather than part of larger one helped get it set up. 



On Wed, Nov 4, 2015 at 12:20 PM, cra <christopher...@gmail.com> wrote:

--

Cage Sarin

unread,
Nov 11, 2015, 4:14:18 PM11/11/15
to Taffy Users
I am having exact same error with lucee + taffy (both most recent stable releases). Any thoughts on what is happening?

Irvin Wilson

unread,
Nov 12, 2015, 3:28:27 PM11/12/15
to taffy...@googlegroups.com
I just set up a really plain one and everything seems fine.  Is set up as follows:

myapp/
myapp/wwwroot/
myapp/wwwroot/api/

myapp/application.cfc is plain and is like

component
{
    this.name = 'myapp';

    function onApplicationStart()
    {
    return true;
    }

    function onRequestStart()
    {
    if (StructKeyExists( URL, "reset" )){
    this.OnApplicationStop();
    }
    return true;
    }
    
    function onApplicationStop(){
   
}

}


myapp/wwwroot/api/application.cfc is like


component
extends="taffy.core.api"
{

    //the name can be anything you like
    this.name = 'myappAPI';
    this.mappings['/resources'] = expandPath('./resources');
    this.mappings['/taffy'] = expandPath('./taffy');

    function onApplicationStart()
    {
    application.constants ={};
        variables.framework.reloadKey = "somethingelse";
    variables.framework.reloadPassword = "test";
    variables.framework.reloadOnEveryRequest = false;
        
        return super.onApplicationStart();
    }
    
    
    function onAplicationStop(){
}


    function onRequestStart()
    {
        return super.onRequestStart();
    }
    
    function onTaffyRequest(verb, cfc, requestArguments, mimeExt, headers, methodMetadata, matchedURI) {

//get basic auth data, if any, and pass it into the resources
local.credentials = getBasicAuthCredentials();
arguments.requestArguments.username = local.credentials.username;
arguments.requestArguments.password = local.credentials.password;

if (structKeyExists(arguments.requestArguments, "refuse") and arguments.requestArguments.refuse)
{
return noData().withStatus(405);
}
else
{
return true;
}
}

}


myapp/wwwroot/api/ has the following
     myapp/wwwroot/api/taffy/
     myapp/wwwroot/api/resources


web.config in myapp/wwwroot/ is very plain as well.  Is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <defaultDocument>
            <files>
                <remove value="index.php" />
                <remove value="default.aspx" />
                <remove value="index.html" />
                <remove value="Default.asp" />
                <remove value="Default.htm" />
                <remove value="index.jsp" />
            </files>
        </defaultDocument>
        <httpErrors existingResponse="PassThrough" />
        <security>
            <authorization>
                <add accessType="Allow" users="*" verbs="PUT" />
            </authorization>
        </security>
    </system.webServer>
</configuration>


Tests out fine.  Used with Taffy 3.1.0 (also 3.0.2) on Lucee / Windows.


Does this work for you?



On Wed, Nov 11, 2015 at 2:14 PM, Cage Sarin <warp...@gmail.com> wrote:
I am having exact same error with lucee + taffy (both most recent stable releases). Any thoughts on what is happening?

Cage Sarin

unread,
Nov 13, 2015, 10:47:50 AM11/13/15
to Taffy Users
Sadly, not working. I did a clean install with core lucee (4.5) and taffy and i get:

				An unhandled exception occurred:  
				<pre>
ERROR WHEN LOGGING EXCEPTION 
Catch

    additional Struct

    Detail 
        string 
    ErrNumber 
        number 0 
    ErrorCode 
        string 0 
    Extended_Info 
        string 
    ExtendedInfo 
        string 
    Message 
        string key [_TAFFY] doesn't exist (existing keys:applicationname) 
    StackTrace 
        string key [_TAFFY] doesn't exist (existing keys:applicationname)
	at lucee.commons.collection.AbstractMapPro.invalidKey(AbstractMapPro.java:753):753
	at lucee.commons.collection.concurrent.ConcurrentHashMapPro$Segment.getE(ConcurrentHashMapPro.java:392):392
	at lucee.commons.collection.concurrent.ConcurrentHashMapPro.g(ConcurrentHashMapPro.java:891):891
	at lucee.runtime.type.StructImpl.get(StructImpl.java:116):116
	at taffy.core.api_cfc$cf.udfCall1(/var/www/html/taffy/core/api.cfc:116):116
	at taffy.core.api_cfc$cf.udfCall(/var/www/html/taffy/core/api.cfc):-1
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:642):642
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1761):1761
	at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:405):405
	at lucee.runtime.listener.ModernAppListener.onError(ModernAppListener.java:392):392
	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2273):2273
	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2225):2225
	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
	at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:47):47
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729):729
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291):291
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239):239
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217):217
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106):106
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502):502
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142):142
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79):79
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88):88
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518):518
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091):1091
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673):673
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500):1500
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456):1456
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
	at java.lang.Thread.run(Thread.java:745):745
 
    TagContext Array

        1 Struct

            codePrintHTML 
                string 114: 			&lt;/cfif&gt;<br>
115: <br>
<b>116: 			&lt;cfset logger = createObject(&quot;component&quot;, application._taffy.settings.exceptionLogAdapter).init(</b><br>
117: 				application._taffy.settings.exceptionLogAdapterConfig<br>
118: 			) /&gt;<br>
 
            codePrintPlain 
                string 114: 			</cfif>
115: 
116: 			<cfset logger = createObject("component", application._taffy.settings.exceptionLogAdapter).init(
117: 				application._taffy.settings.exceptionLogAdapterConfig
118: 			) />


(STUFF IN MIDDLE DELETED)


StackTrace 
        string the service [RuntimeService] is currently missing. At the moment you can use cfadmin tag instead
	at coldfusion.server.ServiceFactory.missingService(ServiceFactory.java:106):106
	at coldfusion.server.ServiceFactory.getRuntimeService(ServiceFactory.java:57):57
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method):-2
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62):62
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43):43
	at java.lang.reflect.Method.invoke(Method.java:497):497
	at lucee.runtime.reflection.pairs.MethodInstance.invoke(MethodInstance.java:55):55
	at lucee.runtime.java.JavaObject.call(JavaObject.java:237):237
	at lucee.runtime.java.JavaObject.call(JavaObject.java:259):259
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1590):1590
	at taffy.core.api_cfc$cf.udfCall3(/var/www/html/taffy/core/api.cfc:930):930
	at taffy.core.api_cfc$cf.udfCall(/var/www/html/taffy/core/api.cfc):-1
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
	at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:766):766
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1590):1590
	at taffy.core.api_cfc$cf.udfCall3(/var/www/html/taffy/core/api.cfc:948):948
	at taffy.core.api_cfc$cf.udfCall(/var/www/html/taffy/core/api.cfc):-1
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
	at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:766):766
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1590):1590
	at taffy.core.api_cfc$cf.udfCall1(/var/www/html/taffy/core/api.cfc:530):530
	at taffy.core.api_cfc$cf.udfCall(/var/www/html/taffy/core/api.cfc):-1
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
	at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:766):766
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1590):1590
	at taffy.core.api_cfc$cf.udfCall1(/var/www/html/taffy/core/api.cfc:39):39
	at taffy.core.api_cfc$cf.udfCall(/var/www/html/taffy/core/api.cfc):-1
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:642):642
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:532):532
	at lucee.runtime.SuperComponent.call(SuperComponent.java:80):80
	at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:742):742
	at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1590):1590
	at taffy.examples.api.application_cfc$cf.udfCall(/var/www/html/taffy/examples/api/Application.cfc:14):14
	at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:111):111
	at lucee.runtime.type.UDFImpl._call(UDFImpl.java:328):328
	at lucee.runtime.type.UDFImpl.call(UDFImpl.java:229):229
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:642):642
	at lucee.runtime.ComponentImpl._call(ComponentImpl.java:524):524
	at lucee.runtime.ComponentImpl.call(ComponentImpl.java:1761):1761
	at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:405):405
	at lucee.runtime.listener.ModernAppListener.onApplicationStart(ModernAppListener.java:283):283
	at lucee.runtime.PageContextImpl.initApplicationContext(PageContextImpl.java:2842):2842
	at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:118):118
	at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:35):35
	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2262):2262
	at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2225):2225
	at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
	at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:47):47
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729):729
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291):291
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239):239
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:217):217
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106):106
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502):502
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142):142
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79):79
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88):88
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518):518
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091):1091
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673):673
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500):1500
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456):1456
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
	at java.lang.Thread.run(Thread.java:745):745
 
    TagContext Array

        1 Struct

            codePrintHTML 
                string 928: 		&lt;cfelse&gt;<br>
929: 			&lt;!--- check if a server-level mapping exists ---&gt;<br>
<b>930: 			&lt;cfset local.serverMappings = createObject(&quot;java&quot;, &quot;coldfusion.server.ServiceFactory&quot;).getRuntimeService().getMappings() /&gt;</b><br>
931: 			&lt;cfif structKeyExists(local.serverMappings, &quot;/resources&quot;)&gt;<br>
932: 				&lt;cfreturn &quot;/resources&quot; /&gt;<br>
 
            codePrintPlain 
                string 928: 		<cfelse>
929: 			<!--- check if a server-level mapping exists --->
930: 			<cfset local.serverMappings = createObject("java", "coldfusion.server.ServiceFactory").getRuntimeService().getMappings() />
931: 			<cfif structKeyExists(local.serverMappings, "/resources")>
932: 				<cfreturn "/resources" />
 
            column 
                number 0 
            id 
                string ?? 
            line 
                number 930 
            Raw_Trace 
                string taffy.core.api_cfc$cf.udfCall3(/var/www/html/taffy/core/api.cfc:930) 
            template 
                string /var/www/html/taffy/core/api.cfc 
            type 
                string cfml 
        2 Struct

            codePrintHTML 
                string 946: <br>
947: 	&lt;cffunction name=&quot;guessResourcesFullPath&quot; access=&quot;private&quot; output=&quot;false&quot; returntype=&quot;string&quot;&gt;<br>
<b>948: 		&lt;cfreturn expandPath(guessResourcesPath()) /&gt;</b><br>
949: 	&lt;/cffunction&gt;<br>
950: <br>
 
            codePrintPlain 
                string 946: 
947: 	<cffunction name="guessResourcesFullPath" access="private" output="false" returntype="string">
948: 		<cfreturn expandPath(guessResourcesPath()) />
949: 	</cffunction>
950: 
 
            column 
                number 0 
            id 
                string ?? 
            line 
                number 948 
            Raw_Trace 
                string taffy.core.api_cfc$cf.udfCall3(/var/www/html/taffy/core/api.cfc:948) 
            template 
                string /var/www/html/taffy/core/api.cfc 
            type 
                string cfml 
        3 Struct

            codePrintHTML 
                string 528: 		/&gt;<br>
529: 		&lt;!--- if resources folder exists, use internal bean factory ---&gt;<br>
<b>530: 		&lt;cfset local.resourcePath = guessResourcesFullPath() /&gt;</b><br>
531: 		&lt;cfset local.noResources = false /&gt;<br>
532: 		&lt;cfif directoryExists(local.resourcePath)&gt;<br>
 
            codePrintPlain 
                string 528: 		/>
529: 		<!--- if resources folder exists, use internal bean factory --->
530: 		<cfset local.resourcePath = guessResourcesFullPath() />
531: 		<cfset local.noResources = false />
532: 		<cfif directoryExists(local.resourcePath)>
 
            column 
                number 0 
            id 
                string ?? 
            line 
                number 530 
            Raw_Trace 
                string taffy.core.api_cfc$cf.udfCall1(/var/www/html/taffy/core/api.cfc:530) 
            template 
                string /var/www/html/taffy/core/api.cfc 
            type 
                string cfml 
        4 Struct

            codePrintHTML 
                string 37: 		&lt;cfset var before = getTickCount() /&gt;<br>
38: 		&lt;cfset var after = 0 /&gt;<br>
<b>39: 		&lt;cfset setupFramework() /&gt;</b><br>
40: 		&lt;cfset after = getTickCount() /&gt;<br>
41: 		&lt;cfheader name=&quot;X-TIME-TO-RELOAD&quot; value=&quot;#(after-before)#&quot; /&gt;<br>
 
            codePrintPlain 
                string 37: 		<cfset var before = getTickCount() />
38: 		<cfset var after = 0 />
39: 		<cfset setupFramework() />
40: 		<cfset after = getTickCount() />
41: 		<cfheader name="X-TIME-TO-RELOAD" value="#(after-before)#" />
 
            column 
                number 0 
            id 
                string ?? 
            line 
                number 39 
            Raw_Trace 
                string taffy.core.api_cfc$cf.udfCall1(/var/www/html/taffy/core/api.cfc:39) 
            template 
                string /var/www/html/taffy/core/api.cfc 
            type 
                string cfml 
        5 Struct

            codePrintHTML 
                string 12: <br>
13: 		function onApplicationStart(){<br>
<b>14: 			return super.onApplicationStart();</b><br>
15: 		}<br>
16: <br>
 
            codePrintPlain 
                string 12: 
13: 		function onApplicationStart(){
14: 			return super.onApplicationStart();
15: 		}
16: 
 
            column 
                number 0 
            id 
                string ?? 
            line 
                number 14 
            Raw_Trace 
                string taffy.examples.api.application_cfc$cf.udfCall(/var/www/html/taffy/examples/api/Application.cfc:14) 
            template 
                string /var/www/html/taffy/examples/api/Application.cfc 
            type 
                string cfml 
    type 
        string application </pre>

Adam Tuttle

unread,
Nov 13, 2015, 11:16:32 AM11/13/15
to Taffy Users
Just in case you didn't know, that page shows 2 errors: the top one is the error encountered when attempting to log the first error, and the bottom one is the first error. Since you snip out the middle and don't indicate that you knew this, I'm wondering if you've combined the two?

Adam

--

Cage Sarin

unread,
Nov 13, 2015, 11:41:53 AM11/13/15
to Taffy Users
Yes. there should have have been a note in the middle saying "Stuff in middle deleted". If the whole trace would help, i can paste it here...

Adam Tuttle

unread,
Nov 13, 2015, 12:00:42 PM11/13/15
to Taffy Users

The top exception is something you should ignore in this case. It's there to help debug issues getting your exception logger working; but we know that it's not working because Taffy can't initialize.

All that matters in this case is the bottom exception.

Cage Sarin

unread,
Nov 13, 2015, 12:51:29 PM11/13/15
to Taffy Users
Okay. Any thoughts on why that error? I saw something on Google Groups re: similar message on Railo but sounded like it got fixed (https://groups.google.com/forum/#!topic/railo/SuIZHSE64gY). I didn't understand what the workaround is so any help would be great!

Adam Tuttle

unread,
Nov 13, 2015, 1:06:54 PM11/13/15
to Taffy Users
Please post a gist or pastebin link to the entire error, don't remove any of it.

Adam

Irvin Wilson

unread,
Nov 13, 2015, 1:14:58 PM11/13/15
to taffy...@googlegroups.com
I've got a feeling that if you put mappings in application.cfc to resources and taffy you won't get the error.  Look at the following in your error - 

<cfelse>
929: 			<!--- check if a server-level mapping exists --->
930: 			<cfset local.serverMappings = createObject("java", "coldfusion.server.ServiceFactory").getRuntimeService().getMappings() />
931: 			<cfif structKeyExists(local.serverMappings, "/resources")>
932: 				<cfreturn "/resources" />

It's saying "[some condition]  else use coldfusion.server.ServiceFactory" which if I try to use createObject("java", "coldfusion.server.ServiceFactory").getRuntimeService().getMappings() on a page by itself I get the same error you have.  I'm thinking the "else" part is something like "if mapping exists in application.cfc use it otherwise use the service factory".   I'm thinking if you map /resources and /taffy in application.cfc like below it'll work.

//the name can be anything you like
    this.name = 'test2';
    this.mappings['/resources'] = expandPath('./resources');
    this.mappings['/taffy'] = expandPath('./taffy');



Cage Sarin

unread,
Nov 13, 2015, 1:17:11 PM11/13/15
to Taffy Users

Adam Tuttle

unread,
Nov 13, 2015, 1:34:35 PM11/13/15
to Taffy Users
Please try upgrading to 3.1.0-RC1. I'm using it in production without issue, and it should get around this problem.

The error is that Railo/Lucee doesn't support the ServiceFactory class. We've fixed that in the next version.


Adam

Cage Sarin

unread,
Nov 13, 2015, 1:48:02 PM11/13/15
to Taffy Users
Thanks, will try that. I tried Irvin Wilson's suggestion and it seemed to work with the example code. I will try against my code next and (cross my fingers), that will work too!

Irvin Wilson

unread,
Nov 13, 2015, 1:55:52 PM11/13/15
to taffy...@googlegroups.com
Cage,

While I'm glad that worked I'm sure Adam's suggestion of moving to the RC release is a much better idea.  What I posted only worked because we're skipping over a bug in Lucee (or rather something they don't consider a bug it seems but is different behavior than ACF) by defining the paths directly.  I'd definitely follow Adam's suggestion - especially since he's the author of Taffy!  : )

Regardless, glad it worked for you.

Irv  

Cage Sarin

unread,
Nov 13, 2015, 2:20:15 PM11/13/15
to Taffy Users
I upgraded to the RC-1. With RC-1, i don't need an explicity this.mappings['/taffy'] line. However, I still need the this.mappings['/resources']. Without it, I get the following error (even though i have a resources folder):

It looks like you don't have any resources defined. Get started by creating the folder /var/www/html/taffy/examples/api_LogToEmail/resources, in which you should place your Resource CFC's."
Reply all
Reply to author
Forward
0 new messages