ColdFusion giving "template denied access" error using cfajaxproxy - coldfusion

I need an cfajaxproxy interface to my server (to pass it data without having to do a submit on a page). Hopefully cfajaxproxy is the correct way to go?
To learn this, I first modified an example tutorial shown at http://tutorial13.learncf.com/, but after getting an "template denied access" error, I decided to simply use the tutorial directly as is, which just has two small files (that can be cut and pasted right from his tutorial). Unfortunately I get the same error with his tutorial (even though he has it running on his site as a demo). So ??
I'm putting the proxy.cfc file right in the (main) wwwroot directory I am accessing (first time using a cfc). Do I need to ask the hosting company to allow something on the server (which is running ColdFusion 8)?
Thanks. Error Details are:
Error Occurred While Processing Request
Security: The requested template has been denied access to C:/Coldfusion8/wwwroot/WEB-INF/cfclasses/cfproxy2ecfc771136334.class.
The following is the internal exception message: access denied (java.io.FilePermission C:/Coldfusion8/wwwroot/WEB-INF/cfclasses/cfproxy2ecfc771136334.class read)
ColdFusion cannot determine the line of the template that caused this error. This is often caused by an error in the exception handling subsystem.
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.0) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17
Remote Address 72.201.113.149
Referrer
Date/Time 22-Feb-13 12:42 AM
Stack Trace
java.security.AccessControlException: access denied (java.io.FilePermission C:/Coldfusion8/wwwroot/WEB-INF/cfclasses/cfproxy2ecfc771136334.class read) at cfdemo2ecfm1260454926.runPage(C:/Websites/202350mu7/wwwroot/sf/demo.cfm:1)
java.security.AccessControlException: access denied (java.io.FilePermission C:\Coldfusion8\wwwroot\WEB-INF\cfclasses\cfproxy2ecfc771136334.class read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:374)
at java.security.AccessController.checkPermission(AccessController.java:546)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
...

This is a security sandbox issue, you need to contact your host and make sure you have a sandbox with access to this folder.

Related

How do I get Alexa Voice Service registration code?

How do I get a registration code or otherwise solve this problem?
While writing this question, I realized the crux of this problem is the bottom-most part of this question: I'm not getting the popup I'm supposed to get and when I enter the URL in a browser it says invalid registration code.
I'm attempting to develop an Alexa Voice Service application. Website/companion service only. I have gone through the Reference Implementation Guide twice and have double checked that all of the setup has been done correctly.
This is the server error I get: invalid registration code. I never did anything with a registration code and can't seem to find anything about a registration code (relevant to Alexa) anywhere after googling quite a bit.
Listening on port 3000
error: { [InvalidRegistrationCode: The provided registration code was invalid.]
name: 'InvalidRegistrationCode',
message: 'The provided registration code was invalid.',
status: 401 }
Error: Can't set headers after they are sent.
Here's the client output:
vlcj: (DefaultMediaPlayer.java:183)
addMediaPlayerEventListener(listener=com.amazon.alexa.avs.AVSAudioPlayer$1#4b3a4950)
There was a problem connecting to the Companion Service. Trying again in 2 seconds. Please make sure it is up and running.
[DEBUG] joining on thread Thread[Timer-0,5,com.amazon.alexa.avs.AVSApp]
There was a problem connecting to the Companion Service.
Trying again in 2 seconds. Please make sure it is up and running.
The AVS launcher opens too, and when I record something and send it I get:
com.amazon.alexa.avs.AVSException: 403 Invalid Access Token
The instructions mention (at the very bottom of the reference guide) that I need to:
Please register your device by visiting the following website on any system and following the instructions: https://localhost:3000/provision/************** That URL is supposed to pop something up once the companion service but that hasn't happened.
Any thoughts on how can I fix this?
I was following a good document Project: Raspberry Pi + Alexa Voice Service at https://github.com/amzn/alexa-avs-raspberry-pi . It describes all steps very well.
Please take a look at the following steps:
3 - Getting started with Alexa Voice Service
3.1 Register for a free Amazon Developer Account
3.4 Register your product and create a security profile.
6 - Enable Security Profile
This thread on the Amazon developer forums seems related: http://forums.developer.amazon.com/forums/thread.jspa?threadID=11327&tstart=0
Quoted response:
There are a number of potential issues causing that error.
You might be sending an invalid scope. Are you sending "alexa:all" as
the scope? Or, your security profile might not be correctly linked. Is
it selected in the dropdown on the developer portal?
Are you getting an access token from the companion service, or is the
text box blank? If you're not getting an access token, check that your
device serial number matches between the companion service and the
java client. If you're getting an access token, the problem is more
likely with your security profile.
You should also look at these threads to see if they're helpful...
(links removed due to reputation requirement)
If that doesn't help, you'll probably have more luck asking the AVS team directly on their forum site.

Requested template has been denied access

Recently, a migration from CF8 to CF10 has caused some issues. Both environments are sandboxed. The developers are moving their CF8 production code to the CF10 development environment to test and refine before moving to CF10 production.
The CF8 data areas were hosted locally on the server. The CF10 data areas are hosted on a NAS device. This is the code that is referenced in the error:
<cfinvoke component="popup/ListComponent" method="diaplayDivNavigazione" form=search_files page=#JavaCast("int",page)# recordCount=#fatFileData.RecordCount# maxRows=#maxrow# field=page>
The error is produced in the CF10 dev environment but performs as expected in the CF8 production environment. The error is:
Security: The requested template has been denied access to C:/ColdFusion10/cfusion3/gateway/cfc.
The following is the internal exception message: access denied (java.io.FilePermission C:/ColdFusion10/cfusion3/gateway/cfc read)
The error makes me think the app cannot read C:/Coldfusion10/cfusion3/gateway/cfc. This mapping is present in the CF Admin for the overall server. Must it be specified in the individual sandbox as well? As far as the sandbox access, I added R/W/E/D access to the "popup" directory listed in the code using "FULLPATH\popup\" and "FULLPATH\popup-"
I cannot access the page to test and must wait for the developer. Is there anything else that I could add, modify or enable to resolve this?
Thank you.
Promoted from the comments
The error that is being reported - access denied (java.io.FilePermission ... - is coming from the sandbox security. If I understand correctly, you have a mapping named "popup" that you are using in the code. The sandbox however requires physical paths. I do not see the folder "popup" in the error message you provided. It looks like you added a sandbox entry for the "popup" mapping. That won't work. Add an entry for the physical path instead.
And by the way, from the error, that piece of code only requires READ access.
And you are also missing a trailing slash "\" in your sandbox setting.
C:\FULLPATH\popup-
should be
C:\FULLPATH\The_Real_Folder_Name\-
and you also need the other (without the hyphen)
C:\FULLPATH\The_Real_Folder_Name\
You don't need access to the code to test this but you do need access to the page. If you can browse to the page that is throwing the error then that will test it. Modifying the sandbox settings does not require a restart.

Website is up and running but parsing it results in HTTP Error 503

I want to crawl a webpage using urllib2 library and extract some information according to my need. I am able to freely navigate the site(going from one link to another and so on), but when I try to parse-it I am getting an error
HTTP Error 503 : Service Temporarily Unavailable
I searched about it on net and found out that this error occurs when "web site's server is not available at that time"
I am confused after reading this, if website server is down then how come its up and running(since I am able to navigate the webpage), and if the server is not down then why I am getting this 503 Error.
Is their a possibility that the server has done something to prevent the parsing of web-page
Thanks in advance.
Most probably your user-agent is banned from the server, so as to avoid, well, web crawlers. Therefore some websites, including Wikipedia, show up a 50x error when using an unwanted user-agent (such as wget, curl, urllib, …)
However, changing the user-agent might be enough. At least, it's the case for Wikipedia, which works just fine when using Firefox user agent. (The "bann" most probably only relies on the user-agent).
Finally, there must be a reason for those websites to ban web crawlers. Depending on what you're working on, you might want to use another solution. For example, wikipedia provides database dumps, which can be convenient if you intend to make an intensive use of it.
PS. Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11 is the user-agent I use for wikipedia on a project of mine.

recieving error The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6

After building and deploying, checked the solution management from Central administration and it's up, a simple web service method that only created a Document Library list with a few columns when trying to retrieve the wsdl or even just by calling the WS fromt the adress since its a void method I recieve some error:
The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.<nativehr>0x800401e6</nativehr><nativestack></nativestack>
The very same method runs fine when called from another web service project that is already deployed so there's nothing wrong with the code. I'm most probably doing something wrong but can't figure.
The system is running on a win server 2008 with sharepoint 2010, framework 3.5 and "ANY" cpu mode.
thank you!
[edit]
Managed to get rid of the previous error by removing asmx extention from the blocked file list in central administration now instead I'm recieving a 404 error:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /_layouts1/my2claims/tt_claims.asmx
it must run under the same application pool as SharePoint

Server.Transfer to internal virtual application

My question is how to manage several virtual applications, located at the same host
firstdomain.com is redirected to firstdomain.com/1
seconddomain.com is redirected to seconddomain.com/2
and so on...
each new domain must be located at different folder, and for now it is working fine.
But it causes some inconvenient, for example seconddomain.com/1 is showing firstdomain.com web site.
i'm trying to create something like dispatch at root directory "/" to transfer necesary domain with Server.Transfer("").
but it is not working like I thought:
Server.Transfer("/" + folder + "");
causes this error:
Server Error in '/' Application. Error
executing child request for
/web_folder.
Description: An unhandled
exception occurred during the
execution of the current web request.
Please review the stack trace for more
information about the error and where
it originated in the code.
Exception Details:
System.Web.HttpException: Error
executing child request for
/web_folder.
Server.Execute("/" + folder + "");
causes error too:
Error executing child request for
/web_folder.
Description: An unhandled exception
occurred during the execution of the
current web request. Please review the
stack trace for more information about
the error and where it originated in
the code.
Exception Details:
System.Web.HttpException: Error
executing child request for
/web_folder.
both applications works fine accessed by its specified url.
and also there is a problem with two applications, if I use HttpModules from root web.config, it causes compilation error inside virtual application. It may be passed, if I add reference to same project in virutal site.
Any suggestions ?
i think there must be any solution, many people need to redirect any subdomain to a subfolder without Redirect, to keep the original URL dsplay
thanks.
You cannot Server.Transfer to an application that is hosted to a different virtual directory in IIS than the one that's performing the request.
Server.Transfer can only happen for single HttpContext. Each virtual directory or app has its own HttpContext object and they know not that co-exists! so you cannot do that.