CFC Mapping
Hi All,
I see this link:
http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_4.html#202412
I want to use cfc in my flex app.
1. I already enable mapping for CF8 under C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml
2. I have a main app and my flex app is in a folder inside my app:
My App D:\MyApp (In IIS I have a site pointing to this folder)
My Flex App D:\MyApp\MyFlexApp
3. My IIS folder is C:\inetpub\wwwroot
4. I have my cfc's in this folder:
D:\MyApp\MyFlexApp\cfcs
5. I create a mapping in my cf9 admin as:
Logical Path = /Flex
Directory Path = D:\MyApp
6. I my Flex app I call the cfc like this:
<mx:RemoteObject id="my_RO" destination="ColdFusion" source="myflexapp.cfcs.budget">
<mx:method name="getBudgets" result="getBudgetsRO_Handler(event)" />
</mx:RemoteObject>
where my cfc file is = D:\MyApp\MyFlexApp\cfcs\budget.cfc
This should work but it's not, I'm getting this error:
[RPC Fault faultString="Unable to invoke CFC - Could not find the ColdFusion Component or Interface myflexapp.cfcs.budget." faultCode="Server.Processing" faultDetail="Ensure that the name is correct and that the component or interface exists."]
Any ideas why it's not working?
Thanks
Johnny
Create a mapping for /mycfcs in the CFIDE administrator then
put your common components there. I think, someone correct me if
I'm wrong, you could also put them in your CustomTags
directory.
Similar Messages
-
Simple cfc mapping issue = I am a muppet
Right, there's something blissfully simple that I'm just missing here, but I've had by C# hat on for weeks and now have had to come back to CF and I've gotten stuck on a simple issue.
Yes, I've trawled Google and the search on here but I just can't spend any more time on this, so thought I'd post on here so someone can abuse my noobishness.
All I want is a simple mapping to a cfc directory for creating components. In order to avoid issues with mappings coinciding with physical directories, I've made them a little more unique but still nothing. My folder structure is currently thus (simplified):
/htdocs
/badgers
Something.cfc
/quotenew
index.cfm
What I want to do is to create an Application-level mapping (ie not in CF admin) to the cfc directory. My Application.cfc has the following lines at the top:
THIS.Mappings = {} ;
THIS.Mappings["horses"] = 'badgers' ;
Then in /quotenew/index.cfm I have the following line:
<cfset a = createObject("component","horses.Something") />
But I'm getting the dreaded "Could not find the ColdFusion Component or Interface horses.Something." error.
I've tried everything I can think of but just can't figure out whether I've done something stupid or whether it would never work in the first place but as I said, I'm well out of practise. If anyone can point me in the right direction, I'd be most appreciative.
O.Ah, it seems I'd done two things wrong.
Firstly, I needed a forward slash at the start of the mapping, which I believe is what Adam was getting at.
Secondly when doing mappings it seems you can only do them to physical directories, not CFC paths. At first I thought this was odd (and it's caught me out before) as if I can do createObject("system.cfc.classes.MyClass") then why can't I have a mapping to "system.cfc.classes"?
I can only assume this is to keep mappings generic - they can be used for physical directories and component paths so I guess the physical path is required.
All sorted now with this:
THIS.Mappings["/horses"] = 'g:\websites\mywebsite\htdocs\badgers' ;
Not quite as clean as I would have liked but still, if it's what needs doing.
Cheers Adam
O. -
Invoking CFCs that extend mapped CFCs through the flex2gateway
Hello all,
I’ve run into an issue with my CFCs and I’m hoping someone can tell me why this is happening.
Here is my setup in this scenario:
I have a mapping for my CFCs on my local CF Server where Logical Path /CFC maps to C:\ColdFusion8\common\CFC
The folder C:\ColdFusion8\common\CFC contains one file test.cfc. The file test.cfc is an empty component (<cfcomponent></cfcomponent>)
I have a proxy CFC in my webroot’s proxy folder at C:\ColdFusion8\wwwroot\proxy\pxTestMapping.cfc pxTestMapping.cfc extends CFC.Test which uses the logical path CFC referenced above pointing specifically to the file test.cfc.
I have created a service in Flex that works with pxTestMapping.cfc On load of the application I run a method HelloWorld from pxTestMapping.cfc. The helloWorld method just returns the string “Hello World”. I have a button that you can click to see the resulting string in Flex.
I can load the method directly in the browser and it works, I can also test and confirm that the Flex application works and the expected string does alert when the button is clicked. If I then go into the pxTestMapping.cfc file and update the string returned to read “Hello World Updated” and hit save, the CFC will error the next time I run the flex application. The error message states “Unable to invoke CFC – Could not find the ColdFusion Component or Interface CFC.Test”. If I then run the Hello World Method directly in the browser (http://localhost:8500/proxy/pxTestMapping.cfc?method=HelloWorld) The component does not error, instead it returns the expected string. From that point forward the flex app will also work, until I make another change to pxTestMapping at which time I will receive the above message until I manually access the webservice through a web browser. I have duplicated this issue on both my local development environment and on my staging server.
How can I get the CFC to invoke correctly after modification without having to directly access the webservice in my browser?
Thanks,
ChristineI started with an empty Data/Services view and clicked the link "Connect to Data/Service" I selected ColdFusion, browsed to the CFC in the ColdFusion Component section and used the default service name and package that it created. I clicked next, entered my login information and clicked Finish on the screen that showed the operations in the service.
I tried this with the original beta SDK, 4.0.0.10434 and 4.0.0.4904
The original issue described used the original beta SDK
4.0.0.4904 & 4.0.0.10434 errored with VerifyError #1014: Class IVisualELement could not be found, ReferenceError: #1065: Variable CrossFade_CrossFadeShaderClass is not defined, ReferenceError: #1065: Variable Wipe_WipeShaderClass is not defined, and ReferenceError: Error #1065: Variable _2e124f77eedc07babaa6f5d7b8f173c364f54221c2a0cd01c6886c90f93a6fbf_flash_display_Sprite is not defined. Additionally, every time I edited anything, the Flash Builder app returned an error that said "An internal build error has occurred. Right-click for more information" which seems to require a restart of Flash Builder to resolve.
I didn't have time to continue trying to figure out what about my code, setup or plugin was causing all those problems with the SDKs, so I gave up with testing in them.
I attached the MXML file I used and the cfc I used in my tests.
Thanks!
Christine -
I am getting coldfusion 8 ERROR using cfajaxproxy:
"The path to the CFC must be specified as a full path, or as a relative path from the current template, without the use of mappings."
"The specified CFC vindexer_server_ver3 could not be found. "
at line 2, in template="C:\ColdFusion8\wwwroot\dei-ideas_org\wwwroot\chapter0-2\vindexer_client.cfm"
Any idea on how to fix this error?
Also, in another thread, someone mentioned turning on "extended error information". How do I turn this on?
FACTS:
I do NOT want to add a CFC mapping using coldfusion administrator because I am on a shared coldfusion hosting site (hostek.com).
I can NOT change hosts at this time.
Tested using firefox 3.6.17 and IE8
I use jrun on my "ColdFusion Server Standard 8,0,1,195765" test server
In my test coldfusion server, I have "/dei-ideas_org" mapped to "C:\ColdFusion8\wwwroot\dei-ideas_org\wwwroot"
In application.cfc I have the following;
<!--- application.cfc mappings START --->
THIS.mappings= {};
THIS.mappings["/CFC_CustomTags"]= GetDirectoryFromPath( GetCurrentTemplatePath() ) & "inc\CFC_CustomTags";
THIS.customTagPaths = getDirectoryFromPath(getCurrentTemplatePath()) & "inc\CFC_CustomTags" ;
THIS.customtagpaths=ListAppend(THIS.customtagpaths, "inc\CFC_CustomTags");
<!--- application.cfc mappings END --->
I can access: http://192.168.1.128:8500/CFIDE/Scripts/wddx.js
client template is located at:
"C:\ColdFusion8\wwwroot\dei-ideas_org\wwwroot\chapter0-2\vindexer_client.cfm?cfdebug" aka
"http://192.168.1.128:8500/dei-ideas_org/chapter0-2/vindexer_client.cfm"
CFC (server template) is located at:
"C:\ColdFusion8\wwwroot\dei-ideas_org\wwwroot\chapter0-2\vindexer_server_ver3.cfc" aka
"http://192.168.1.128:8500/dei-ideas_org/chapter0-2/vindexer_server_ver3.cfc"
if I go to url: "http://192.168.1.128:8500/dei-ideas_org/chapter0-2/vindexer_server_ver3.cfc?method=serverf n_ver3&arg_ver3=test_string&cfdebug",
I do NOT get any errors. I also do not get any data back, should I?
/chapter0-2/vindexer_client.cfm source code:
<!--- file: "/chapter0-2/vindexer_client.cfm" --->
<cfajaxproxy cfc="chapter0-2.vindexer_server_ver3" jsclassname="vindexer_proxy_ver3" >
<script>
var myProxy_ver3= new vindexer_proxy_ver3();
function processClick() {
var myArgStr_ver3= document.getElementById('form_arg_ver3').value;
var result= myProxy_ver3.serverfn_ver3( myArgStr_ver3 );
alert("the result from the server was" + result );
</script>
<cfform>
<p>Enter form_arg_ver3:<cfinput type="text" name="form_arg_ver3" id="form_arg_ver3"></p>
<p><cfinput type="button" name="f_btn_ver3" id="f_btn_ver3" onClick="processClick()" value="Get Data From Server"></p>
</cfform>
</body></html>
<!--- file: "/chapter0-2/vindexer_server.cfc" ---><cfcomponent output="no">
<cffunction name="serverfn_ver3" access="remote" returntype="string">
<cfargument name="arg_ver3" type="string" required="false" default="Error No arg_ver3 Supplied" >
<cfset var retStr= "returned_data">
<cfreturn retStr >
</cffunction>
</cfcomponent>
/chapter0-2/vindexer_server.cfc source code:SOLVED: if Coldfusion 8, and have OnRequest() in application.cfc, this will not work --it is a known cf8 bug. For a workaround, see
http://www.coldfusionjedi.com/index.cfm/2008/3/19/Ask-a-Jedi-Ajaxbound-requests-and-onRequ est -
CF9: How to force recompile?
I have an odd problem with CF9. Code sometimes runs, sometimes errors out when initializing an app.
When the app starts, several objects get created and their init routines invoked. Suddenly and inexplicably, I started getting this error:
"The OEMAIL argument passed to the init function is not of type console.objects.Email"
Line xx8: <cfset oTasks.init(cDSN, oEmail)>
Line xx9: <cfset oRedirect.init(cDSN,oEmail, oLib)>
But the error comes from line xx9, not line xx8. In fact, oEmail gets passed to several init routines before CF complains about it on Line xx9. This is all code that has worked for months with CF8 and since July 14th with CF9.
First I tried deleting all C:\ColdFusion9\wwwroot\WEB-INF\cfclasses\cfEmail.*.class files. Same error. Then I made a white space change in email.cfc and saved it. No more error on Line xx9, but now I got a similar error with another object. I had to make white space changes to about 5 of them, and finally no more error messages.
Is there some way, besides touching all these cfc files, that CF can be forced to recompile them to hopefully eliminate these erroneous error messages?Un-installing and reinstalling CF8 didn't help. I finally narrowed the problem down to:
if I specify the argument as:
<cfargument name="someObject" type="directory1.directory2.objectName" required="yes">
I get the error. But if I specify it as
<cfargument name="someObject" type="objectName" required="yes">
it
works. The cfc with this argument is in a different directory than
objectName and so it was a little surprising to me that it didn't
require the full path, although it is in a subdirectory of directory2..
The big mystery is why this has suddenly stopped working.
You can avoid that completely. Use mappings.
The following saves me a lot of headache. In the Administrator, I register a mapping to my CFC directory -- or mappings, if there are two or more groups of CFCs.
Now suppose order.cfc is in the client directory and salary.cfc in the employee directory. Suppose further that both client and employee are subdirectories of the CFC directory. Register CFC mapping in the administrator.
Logical Path: /cfc
Directory Path: C:\ColdFusion9\wwwroot\cfc
You can then specify the types as follows, without confusion or ambguity:
<cfargument name="orderObject" type="cfc.client.order">
<cfargument name="salaryObject" type="cfc.employee.salary">
In fact, you might decide to register separate mappings for the different component types, like this
Logical Path: /clientcfc
Directory Path: C:\ColdFusion9\wwwroot\cfc\client
Logical Path: /employeecfc
Directory Path: C:\ColdFusion9\wwwroot\cfc\employee
You would then specify the types as:
<cfargument name="orderObject" type="clientcfc.order">
<cfargument name="salaryObject" type="employeecfc.salary"> -
Google Maps - cf_googlemaps.cfc
I have seen a reference to cf_googlemaps.cfc and a mention of
a Google Maps cfc in another blog post but I can't seem to locate
it anywhere. Does anyone know where information on this can be
found?
Also, has anyone had experience with creating a route using
Google Maps? For example, laying out a route from one location, to
another location, to another?http://cfgooglemap.riaforge.org/index.cfm
http://www.blayter.com/john/cf_googleMap/
Ken Ford
Adobe Community Expert - Dreamweaver
Fordwebs, LLC
http://www.fordwebs.com
"drmaves" <[email protected]> wrote in message
news:fgfbh7$puk$[email protected]..
>I have seen a reference to cf_googlemaps.cfc and a
mention of a Google Maps
> cfc in another blog post but I can't seem to locate it
anywhere. Does anyone
> know where information on this can be found?
>
> Also, has anyone had experience with creating a route
using Google Maps? For
> example, laying out a route from one location, to
another location, to another?
>
> -
How can I send a mapping based CFC object?
I got an exception on sending a CFC object through
EventGateway for Flex Messaging. The result of SendGatewayMessage
says
FALSE: Error on server: java.rmi.UnmarshalException: error
unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: coldfusion.runtime.Array (no
security manager: RMI class loader disabled)
If the CFC is under web root, it works... I changed
eventgateway config (e.g. use-structs, use-accessors, adding
use-mappings) and tried them. But it does not work at all.
Is this a bug?Well the OO theory says that objects comunicate via messages, now that information must be taken as knowledge only, not for programming issues really. What you need to know is that when you need to pass any data from onw object to another you can send them via parameters of defined methods.
For example you have an Object called R of a receiver class and that object needs to pass a String (text message) to another object. you can do it via a method. -
Hi Everyone,
I am having some issues accessing the methods in the datasource.cfc in the adminAPI.
I can successfully load the administrator CFC and am told that I have successsfuly logged in;
But when I try to subsequently load the datasource.cfc I get an error that the current user is unable to access the method.
/* Create an Admin API object and call the login method */
var local = {};
local.adminObj = createObject("component", "cfide.adminapi.administrator");
/* Enter your password for the CF Admin */
/* if you dump this - TRUE is returned */
local.adminObj.login(adminPassword="my_admin_user_password");
/* Create an object of datasource component */
local.dsnObj = createObject("component", "cfide.adminapi.datasource");
writeDump(local.dsnObj.getDataSources());
I tried creating separate admin users and passwords - yhinking that perhaps a revent hotfix had stopped the "admin" user from being allowed to use the adminAPI - but changing to a new adminuser yielded the same results.
I could login to the admin API with the new username and passsword - but could not access the datasource.cfc after that.
Here is the debug output from the error...
The current user is not authorized to invoke this method.
The error occurred in accessmanager.cfc: line 48
Called from datasource.cfc: line 52
Called from C:/inetpub/wwwroot/projectDir/trunk/Application.cfc: line 155
Called from C:/inetpub/wwwroot/projectDir/trunk/Application.cfc: line 52
Called from C:/inetpub/wwwroot/projectDir/trunk/Application.cfc: line 45
Called from C:/inetpub/wwwroot/projectDir/trunk/Application.cfc: line 1
-1 : Unable to display error's location in a CFML template.
Resources:
Check the ColdFusion documentation to verify that you are using the correct syntax.
Search the Knowledge Base to find a solution to your problem.
Browser
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31
Remote Address
127.0.0.1
Referrer
Date/Time
22-Apr-13 01:09 PM
Stack Trace
at cfaccessmanager2ecfc974154242$funcCHECKADMINROLES.runFunction(E:/cf10_final/cfusion/wwwro ot/CFIDE/adminapi/accessmanager.cfc:48) at cfdatasource2ecfc1679861966$funcGETDATASOURCES.runFunction(E:/cf10_final/cfusion/wwwroot/ CFIDE/adminapi/datasource.cfc:52) at cfApplication2ecfc498167235$funcPREREQUISITESTART.runFunction(C:/inetpub/wwwroot/projectD ir/trunk/Application.cfc:155) at cfApplication2ecfc498167235$funcINIT.runFunction(C:/inetpub/wwwroot/projectDir/trunk/Appl ication.cfc:52) at cfApplication2ecfc498167235._factor5(C:/inetpub/wwwroot/projectDir/trunk/Application.cfc: 45) at cfApplication2ecfc498167235.runPage(C:/inetpub/wwwroot/projectDir/trunk/Application.cfc:1 )
coldfusion.runtime.CustomException: The current user is not authorized to invoke this method. at coldfusion.tagext.lang.ThrowTag.doStartTag(ThrowTag.java:142) at coldfusion.runtime.CfJspPage._emptyTcfTag(CfJspPage.java:2799) at cfaccessmanager2ecfc974154242$funcCHECKADMINROLES.runFunction(E:\cf10_final\cfusion\wwwroot\CFIDE\adminapi\accessmanager.cfc:48) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432) at cfdatasource2ecfc1679861966$funcGETDATASOURCES.runFunction(E:\cf10_final\cfusion\wwwroot\CFIDE\adminapi\datasource.cfc:52) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:655) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:444) at coldfusion.runtime.TemplateProxy.invoke(TemplateProxy.java:414) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2432) at cfApplication2ecfc498167235$funcPREREQUISITESTART.runFunction(C:\inetpub\wwwroot\projectDir\trunk\Application.cfc:155) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:405) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659) at cfApplication2ecfc498167235$funcINIT.runFunction(C:\inetpub\wwwroot\projectDir\trunk\Application.cfc:52) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:472) at coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:368) at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:55) at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:321) at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:220) at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:2659) at cfApplication2ecfc498167235._factor5(C:\inetpub\wwwroot\projectDir\trunk\Application.cfc:45) at cfApplication2ecfc498167235.runPage(C:\inetpub\wwwroot\projectDir\trunk\Application.cfc:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244) at coldfusion.runtime.TemplateProxyFactory.resolveComponentHelper(TemplateProxyFactory.java:538) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:234) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:159) at coldfusion.runtime.TemplateProxyFactory.resolveFile(TemplateProxyFactory.java:120) at coldfusion.cfc.CFCProxy.<init>(CFCProxy.java:138) at coldfusion.cfc.CFCProxy.<init>(CFCProxy.java:84) at coldfusion.runtime.AppEventInvoker.<init>(AppEventInvoker.java:64) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:232) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:112) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:94) at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:219) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:414) at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:204) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)
And here is the listed exceptions, beneath the stack trace;
13:09:56.056 - cfadminapiSecurityError Exception - in E:/cf10_final/cfusion/wwwroot/CFIDE/adminapi/accessmanager.cfc : line 48
The current user is not authorized to invoke this method.
13:09:56.056 - cfadminapiSecurityError Exception - in E:/cf10_final/cfusion/wwwroot/CFIDE/adminapi/accessmanager.cfc : line 48
The current user is not authorized to invoke this method.
13:09:56.056 - java.io.FileNotFoundException - in C:/ColdFusion10/cfusion/wwwroot/WEB-INF/exception/errorcontext.cfm : line 44
E:/cf10_final/cfusion/wwwroot/CFIDE/adminapi/accessmanager.cfc (The system cannot find the path specified)
This perspn seems to be having the same issue;
http://forums.adobe.com/message/5051892
and I agree I don't have "E" drive either!I've found a solution to my plight - I don't know if it'll work for you or help you try something that MAY fix it.
I use a common code set which includes the Application.cfc from a CF Mapping - So, in the application.cfc in the actual website I do this:-
<cfinclude template="/UberDirectory/Application.cfc">
Then, in the /UberDirectory/Application.cfc, I was initialising a CFC which checks if the datasource was created for the website. The datasource checking code attempts to log into the Admin API and check & create if necessary the datasource.
This has previously worked without fail for me - But in this instance it failed!! I was doing two things wrong - Firstly, the CFC should only be called in the Application.cfc in the onRequestStart section as the Application had to be initialised first - This is maybe because I've invoked the application.cfc in a "non-standard" manner.
Secondly, once I'd moved the CFC invocation into oNRequestStart I saw the following error:-
The string COOKIE.CFAUTHORIZATION_uber-directory is not a valid ColdFusion variable name.
I had this as the app name .... <cfset this.name = 'uber-directory'>
Changedthe dash to an underscore and I was away and could once again check the datasources
Hope it helps
Martin -
Hi everyone,
I have a CF9 ORM problem that I haven't been able to figure out and thought I'd see if you had any idea. I have seen a few postings talking about a "similar" problem but none of them correctly resolved this particular issue. I appreciate any help you can offer.
I recently created a CF9 app where I generated scripted ORM CFCs for my app using ColdFusion Builder. It worked great and my app was completely working. However, when I was adding some enhancements, I ran into an error when I restarted the CF app server. Here's the message I keep getting:
"Id field not defined for cfc Path.to.my.ORMCfCPage. Either the table should have a PK column mapped to a cfc field OR at least one field should be specified as id."
My App.cfc file only had orm enabled (no other mappings) when it was working. I've since tried specifying things like the cfc location etc. and it still hasn't helped.
// MORE DETAILS:
- When my app was working, I had moved it to 2 other servers. I had this error on both of those but not on my local copy. They all use the exact same database.
- The last change I made before the error was adding a generator="identity" field to my generated ORM beans. Once I got the message, I tried changing it back and restarting again but still got the error.
- I've also made sure all of the Adobe tags are in my web root (as suggested in a prior posting about this problem). I've search all over for a solution and nobody has a solution posted online that works so far.
Do you have any idea why this is happening?
Thanks!
JeffQuick thought and probably not relevant, but do you have this.ormsettings.savemapping set to true in your Application.cfc? I've fallen foul of this before - once CF has generated the hbmxml files and saved them to disk you can make all kinds of changes to your code which won't make a difference as it'll continue to read from the file versions, but only for certain properties and methods at times it seems.
Long shot I know, but I found CF ORM to be a nightmare for seemingly random caching. -
Error Invoking CFC... but it's there! I see it!
Greetings all -
I'm hoping someone can help explain why this following attempt at binding a CFC is not working:
1. I set up a CF Server Mapping to my cfc folder:
Logical path = /testcfc
Physical path = E:\ColdFusion8\Components\testcfc
2. I set up a virtual directory to my cfc folder:
Virtual path: /testcfc
Physical path: E:\ColdFusion8\Components\testcfc
3. If I use CFINVOKE to call the CFC, it works as expected.
<cfinvoke component="testcfc.testRequests" method="get_Clients" returnvariable="var">
<cfinvokeargument name="fiscal_year" value="#year(now())#">
</cfinvoke>
<cfdump var="#var#">
4. If I attempt to bind the CFC, I get the error "Error Invoke CFC /testResults.cfc: Not Found"
<cfselect name="tstClientID" id="tstClientID" bind="cfc:testcfc.tstRequests.get_Clients('#year(now())#')" bindonload="true" value="client_id" display="client_name" />
Debugging the error, I see that CF is attempting to find the CFC in the root directory of the app... it is disregarding the directory path ("testcfc") specified entirely. Why??
The bizarre thing is, I've set up the same structure on my PC/dev environment, and it works fine.
How can I further debug this issue? It's got to be a mapping problem, but can;t see what I've done wrong. Any help truly appreciated!
DougI recently stumbled upon this post:
http://www.codersrevolution.com/index.cfm/2008/9/10/ColdFusion-CFC-Binding-Ajax-Proxy-and- Updater-1#comments
Sure enough, my prod environment is running 8.0.0. I'm going to apply to apply the patch to 8.0.1 and see if that corrects the issue. I hope.
Doug -
CF Mapping not working on linux
We installed CF8 on linux, and my app ran fine. Then
*something* happened, and now CF mappings are not getting
recognised. I am not the admin for the box, and unfortunately there
was a delay betwen it getting broken and me being able to look into
it. Subsequently, no-one can remember doing anything which might
have caused this.
I have in index.cfm which includes a test include.cfm file
using a CF mapping. But instead of including the include.cfm the
index.cfm includes itself.
Here's my mapping, which points to the webroot:
/testmapping1
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-something-/
The contents of the webroot:
[bdawson@cfusion-tng -wvr-en-something-]$ pwd
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-something-
[bdawson@cfusion-tng -wvr-en-something-]$ ls -l
-rwxrwxrwx 1 bdawson likewise 59 Apr 2 09:53 Application.cfc
-rwxrwxrwx 1 bdawson likewise 59 Apr 2 09:53 include.cfm
-rwxrwxrwx 1 bdawson likewise 301 Apr 2 10:26 index.cfm
Application.cfc and include.cfm both contain the following:
<br>>>><br>
<cfoutput>#getcurrenttemplatepath()#</cfoutput>
<br><<<<br>
index.cfm has:
<cfoutput>
<cfparam name="request.counter" default="0">
<cfset request.counter = request.counter + 1>
<cfif request.counter GT 3>
<br>Aborted in #getcurrenttemplatepath()# to prevent
infinite loop
<cfabort>
</cfif>
<br>>>><br>
#getcurrenttemplatepath()#
<br>
<cftry>
include #request.counter#: <cfinclude
template="/testmapping1/include.cfm">
<cfcatch><cfdump
var="#cfcatch.message#"></cfcatch>
</cftry>
<br><<<<br>
</cfoutput>
And here's the output i get:
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/Application.cfc
<<<
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm
include 1:
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm
include 2:
>>>
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm
include 3:
Aborted in
/home/bdawson/trips/trunk/trips2/www_versions/-wvr-en-homeaway-/index.cfm
to prevent infinite loop
It looks like the file is being not found, but in stead of
throwing an exception it is including the index.cfm
If I change the cfinclude to be <cfinclude
template="testmapping1/include.cfm"> then it throws a file not
found exception as expected.You tell us that the files are in the web root, -wvr-en-something-, but Coldfusion tells us they're actually in -wvr-en-homeaway-.
-
Moving to CF10, Need help with Application.cfc
I've been googling about how to work with Application.cfc since last week but I still have some questions and I can't find the answers.
My application is under the root (in unix) and there are many subfolders underneath it. Each sub-folder is hosting a different web application.
From what I read, I can create 1 root Application.cfc and then on subsequent sub-folder, when I need to have another Application.cfc on that level, I can create ProxyApplication (see below) and then create a sub-folder level Applicatin.cfc
So, when I set an application.DSN on my root Application.cfc, using proxyApplication I don't have to reset this dsn again in my sub folder level Application.cfc
Since my loginform.cfm and loginaction.cfm is right under root directory too, I also set OnsessionStart in the root Application.cfc to handle user login. Then this means, I don't have to reset session variable again anywhere because session.username, etc has been set on the highest level.
Is this correct?
In addition, Am I correct when I do the following:
1. Since I have root level and sub-folder level Application.cfc, I should set this.name with a different name, am I right?
On the root Application.cfc I set this.name = "StudentServices" because this represent the global application
On the sub-folder level's Application.cfc, I set this.name to "StudentServices_stdLoad" becaus this sub-folder only handle student load application.
2. On the root Application.cfc, I set the DSN to the application scope. So on the sub-folder level Application.cfc I can check if a particular db is working or not
because as awhole, in the global sense, this web application uses more than one Databases. Each sub-folder may use a database that is dfferent than the other sub folder.
Am I doing the right thing? Please advice
Below is example of what I have, Thank you!
I created a root Application.cfc under the root directory:
<CFCOMPONENT displayname="Application" output="true" hint="My Root Application component">
<!--- Set up the application ---> <cfset THIS.Name = "StudentServices" /> <cfset THIS.ApplicationTimeout = CreateTimeSpan(0,0,30,0) /> <cfset THIS.SessionManagement = true /> <cfset THIS.SetClientCookies = false />
<cffunction name="OnApplicationStart" access="public" returntype="boolean" output="false">
<cfset application.MainDSN = "DSN1">
<cfset application.ReportDSN = "DSN2">
<cfreturn true/>
</cffunction>
<cffunction name="onApplicationEnd" output="false">
<cfargument name="applicationScope" required="true"> </cffunction>
<cffunction name="onSessionEnd">
</CFCOMPONENT>
Then, in this root directory I also created a ProxyApplication:
<!--- it's empty and it Serves merely to create an alias for your root /Application.cfc --->
<cfcomponent name="ApplicationProxy" extends="AdvancementServices.Application">
</cfcomponent>
Then in the Sub-Directory, I can create a sub-folder level Application.cfc extending the root Application.cfc:
<CFCOMPONENT displayname="Application" extends="ApplicationProxy">
<!--- Set up the sub-folder application --->
<cfset THIS.Name = "StudentServices_stdLoad"/>
<cfset THIS.ApplicationTimeout = CreateTimeSpan(0,0,30,0) />
<cfset THIS.SessionManagement = true/>
<cfset THIS.SetClientCookies = false/>
<cffunction name="OnApplicationStart" access="public" returntype="boolean" output="false">
<!--- ****** Testing whether the ADVUPGRD is accessible by selecting some data.****** --->
<cftry>
<cfquery name="TestMain_DSN" datasource="#application.MainDSN#" maxrows="2">
SELECT Count(*) FROM MyTable
</cfquery>
<!--- If we get a database error, report an error to the user, log the error information, and do not start the application. --->
<cfcatch type="database">
<cflog file="#this.name#" type="error" text="Main DSN is not available. message: #cfcatch.message# Detail: #cfcatch.detail# Native Error: #cfcatch.NativeErrorCode#" >
<cfthrow message="This application encountered an error when connecting to the Main Database. Please contact support." />
<cfreturn false>
</cfcatch>
</cftry>
<cflog file="#this.name#" type="Information" text="Application #this.name# Started">
<cfreturn true/>
</cffunction>
</CFCOMPONENT>
<cfargument name = "SessionScope" required=true/> <cfargument name = "AppScope" required=true/>
</cffunction>
<cffunction name="OnSessionStart" access="public" returntype="void" output="false">
<CFSET session.UserGroup = ""/>
<CFSET session.UserName = ""/>
<CFSET session.currentPage = ""/>
<CFSET session.loggedin = "No"/>
<CFSET session.userrights = ""/>
<cfreturn/>
</cffunction>OK. It sounds to me like you really shouldn't be using a single root Application.cfc at all, if all you want to do is share some settings between your "sub-applications". I would look at storing the common settings in an external file that all of the applications can read in. The simplest way is to put the settings in a .CFM file somwhere outside of the web root (so it is not directly web accessible) and load it with <cfinclude> tag into the OnApplicationStart() method of each sub-application's App.cfc. That .CFM file can be as simple as:
<cfset application.myCustomSetting = "blahblah">
<cfset application.myOtherSetting = "foo">
Alternatively, you can look at using a config file like this Ray Camden blog post suggests, and use the GetProfileSection(), GetProfileString(), and SetProfileString() functions as needed within OnApplicationStart(). You could even put ALL of your settings in
A third option is to store your settings in an XML file or in JSON format in a text file. You could then write code to read in the XML file, and use something like xml2struct.cfc to convert the XML into a struct, then append the struct to your application scope. If you go the JSON route, then just read in the JSON file and use DeserializeJSON() to convert it into a struct, and append it to the application scope.
What I think is probably the best approach is to use a community-supported MVC framework like FW/1 or ColdBox (maybe you already are, I don't think you've said so though). One of the many advantages to doing so is that they have built-in "environment" support that can be used to configure common settings, depending on your environment (dev/qa/production). You would handle reading in your external settings through the "environment" mechanism.
One other thing to think about: your login mechanism. I think you want to use one set of login tools that is shared by all of the "sub-applications". You can do this also by putting the login/authentication-related code somewhere outside the webroot of your applications, and then either set up a mapping to that location in CF Admin, or set an application-specific mapping in your various App.cfc files. That way all the "sub-applications" share a common set of code for the login process. I don't know how your login process works (do all users go to the same login page then get redirected into their relevant "sub-application", or does each "sub-application" have a discrete login page that utilizes common back-end processes to authenticate and redirect), so you'll have to judge how that is best accomplished.
Hopefully this gives you some useful ideas.
-Carl V. -
How to you refer to a function in another function in a cfc
HI,
How to you refer to a function in another function in a cfc like so
<cffunction name="getApplicationConstants" access="remote" returntype="struct">
<cfset flash.result.users = [the result from the getUsers function]>
<cfreturn flash.result>
</cffunction>
<cffunction name="getUsers" access="remote" returntype="query">
<cfquery name="q" datasource="#datasource#">
select c.*
from USERS as c WHERE looksLikeUserIsDeleted = 'False'
AND userPrivileges = 1
ORDER BY fullName
</cfquery>
<cfset flash.result = q>
<cfreturn flash.result>
</cffunction>Hi, Nikos,
If the CFCs are in the same directory, you could do the following:
CFCA
<cfcomponent>
<cffunction name="getApplicationConstants" access="remote" returntype="struct">
<cfset flash.result.users = cfcB.getUsers() />
<cfreturn flash.result>
</cffunction>
</cfcomponent>
CFCB
<cfcomponent>
<cffunction name="getUsers" access="remote" returntype="query">
<cfquery name="q" datasource="#datasource#">
select c.*
from USERS as c WHERE looksLikeUserIsDeleted = 'False'
AND userPrivileges = 1
ORDER BY fullName
</cfquery>
<cfset flash.result = q>
<cfreturn flash.result>
</cffunction>
<cfcomponent>
If the CFCs were in different directories, the cfset expression in CFCA would be this:
<cfset flash.result.users = path.to.cfc.cfcB.getUsers() />
Where I have path.to.cfc, you would use either a mapping from CF Admin or the hierarchy of folders to the CFC from the web root.
Does that help? -
Workstation not mapping any network drives
Im having an issue with different workstation not mapping any network drives. The issue to would seem totally random. Each time is over a wired connection. I havent been able to find a TID about this. The issue also just seems to have started, however no changes have been made to any of the workstations Ive seen this on. The errors I get in the login script are below. The servers are all NetWare 6.5SP7. Suggestions?
LOGIN-LGNWNT32.DLL-923: An unexpected error has occurred: 15 (8819).
LOGIN-LGNWNT32.DLL-923: An unexpected error has occurred: 13 (8819).
LOGIN-LGNWNT32.DLL-923: An unexpected error has occurred: 9 (8819).
LOGIN-LGNWNT32.DLL-918: This utility was unable to get connection information. Error code: 8801Hi,
technomoney wrote:
>
> Im having an issue with different workstation not mapping any network
> drives. The issue to would seem totally random. Each time is over a
> wired connection. I havent been able to find a TID about this. The
> issue also just seems to have started, however no changes have been made
> to any of the workstations Ive seen this on. The errors I get in the
> login script are below. The servers are all NetWare 6.5SP7.
> Suggestions?
>
> > LOGIN-LGNWNT32.DLL-923: An unexpected error has occurred: 15 (8819).
> > LOGIN-LGNWNT32.DLL-923: An unexpected error has occurred: 13 (8819).
> > LOGIN-LGNWNT32.DLL-923: An unexpected error has occurred: 9 (8819).
> > LOGIN-LGNWNT32.DLL-918: This utility was unable to get connection
> > information. Error code: 8801
Basic network connectivity issue. One known common culprit for this
error is a workstation firewall, but the raw symptom just means that
unexpected network connectivity problems occured.
CU,
Massimo Rosen
Novell Product Support Forum Sysop
No emails please!
http://www.cfc-it.de -
Mapping for component Not Found Error ?
Hi does anyone know how this error can be fixed I am trying to refer to a compnent called task and it
is saying I have not mapped it yet it has been mapped inside my coldbox framework ?
The error I get is:
Coldfusion.orm.EntityMappingNotFoundException: mapping for component task not found
Any help would greatly be appreciated on this.
ThanksWhen using ORM generator to generate cfcs make sure that Application.cfc has unique app names in order to solve the problem above.
Maybe you are looking for
-
Macbook Restart Loop when trying to install OS X Yosemite
I've tried to update my 10.8.5 to Both Mavericks and Yosemite but in both cases it gets locked in a restart loop. This happens when I press install and it say that it will now restart the computer. My Macbook pro is from late 2008. is that the probl
-
Number of rows in a report, can it only bee set at creation time?
I'm unable to change how pagiation work for a report. If I create a report with the default setting, it will show 15 rows as expected. However if I edit the page, go into the report and change the "Number of Rows" it seems to have no effect. I set it
-
How can I import and edit photos on my laptop and synch with PS Elements?
I have my Photoshop elements library on my desktop. Can Lightroom help with this, or do I need to update to Creative Cloud with Photoshop?
-
Snow Base Station - No IP Address
I have a snow base station that cannot seem to get an IP address from my cable modem. I've tried restarting the base station. Restarting the modem. Restarting both. Hard restart of the base station that put it back to factory settings. It only gets a
-
FF 4.0b9 and Mac OSX 10.6.6 came along the same day, so no surprise it's odd. Curious if anyone else is seeing this. Open most any page and it shows, then goes solid gray; moving the mouse makes individual rectangles pop into view; /view/reload gets