Could not find the ColdFusion component or interface? - facebook

I am using ColdFusion 10, Windows 7 64bit, Railo 4 and installed the Facebook CF SDK. When I try to test the installation, it is throwing this error:
Could not find the ColdFusion component or interface facebook.sdk.FacebookApp.
Ensure that the name is correct and that the component or interface exists.
The error occurred in C:/ColdFusion10/cfusion/wwwroot/facebook-cf-sdk/examples/website/index.cfm: line 34
32 : } else {
33 : // Create facebookApp instance
34 : facebookApp = new FacebookApp(appId=APP_ID, secretKey=SECRET_KEY);
35 :
36 : // See if there is a user from a cookie or session
How do I fix this error and integrate this Facebook API with ColdFusion?

It looks like an error in the instructions, instead of having the folder be called facebook-cf-sdk rename it to facebook as that's where it's looking for the cfc at.

Busches' answer should definitely solve the problem. The other alternative is to modify the imports to match your directory structure:
facebook-cf-sdk / examples / website / index.cfm
<cfscript>
import "facebook-cf-sdk.sdk.FacebookApp";
import "facebook-cf-sdk.sdk.FacebookGraphAPI";
facebook-cf-sdk / examples / website / tags.cfm
<cfimport taglib="/facebook-cf-sdk/sdk/tags" prefix="facebook" />
<cfscript>
import "facebook-cf-sdk.sdk.FacebookApp";
import "facebook-cf-sdk.sdk.FacebookGraphAPI";
The quotes are needed for component paths that contain hyphens.
Hope this helps,
- Minh

Related

Setting up SimpleSAMLphp as a SP for CodeIgniter

I have to continue on an already existing CodeIgniter 3 application (not written by me) which contains multiple applications for different customers, the project structure looks a little like this:
root/
applications/
customer1/
config/, controllers/, models/, views/, ...
third_party/
SimpleSAMLphp/
config/, metadata/, www/, ...
lib/
_autoload.php
customer2/
...
assets/, bundle/, ...
customers/
customer1/
assets/, index.php, ...
customer2/
...
system/
vendor/
composer/
autoload.php
Now for one of the applications I have to replace the ion_auth system with an SSO (setup as a Service Provider from their IdP metadata). I googled a lot and tought SimpleSAMLphp would be my best option.
But I am really struggling just even putting the SimpleSAMLphp SP API into my application and the documentation isn't great.
-I "include_once" the third_party/SimpleSAMLphp/lib/_autoload.php file in the customers/customer1/index.php file (before require_once BASEPATH...)
-I modified third_party/SimpleSAMLphp/lib/_autoload.php so it finds the vendor/autoload.php file
I expect to be able to use the methods of the SimpleSAMLphp library but instead I get the following errors:
-If I follow the code in this guide:
Fatal error: Call to undefined function SimpleSAML\Auth\Simple()
-If use include APPPATH . 'third_party\SimpleSAMLphp\www\index.php in my controller just above the code from above tutorial:
Fatal error: Class 'SimpleSAML\Error\Assertion' not found in
What am I doing wrong in my setup?

matchOnUriPrefix=true does not seem to be working

I am using:
wildlfy 10.1.0 final
Camel 2.19.1
Camel Java DSL RouteBuilder
In my RouteBuilder.configure I have the following from:
from("undertow:http://localhost:" + portNum + "/DataplatformESB/v3?matchOnUriPrefix=true&httpMethodRestrict=post,get,put,options,patch,delete")
When I test to "localhost:8080/DataplatformESB/v3" with GET, PUT, or PATCH, they all work fine. But when I test to "localhost:8080/DataplatformESB/v3/anythingelse" I'll get a 404 (page not found) in return. In the Wildfly log it stats: "Matched prefix path /DataplatformESB for path /DataplatformESB/v3/anythingelse". So for me it looks like the "matchOnUriPrefix=true" is not working.
I have already tested with from("restlet:http://localhost:" + portNum + "/DataplatformESB/v3?matchOnUriPrefix=true&httpMethodRestrict=post,get,put,options,patch,delete"), but that does not work as well.
I have also tried it with the restConfiguration and .componentProperty("matchOnUriPrefix", "true") but also no luck.
Does anyone has an idea why the matchOnUriPrefix=true does not seem to work for me?
I have done some further research and found out the folliwing:
I got the undertow test project from https://github.com/apache/camel/tree/master/components/camel-undertow/src/test/java/org/apache/camel/component/undertow/UndertowPrefixMatchingTest.java and run/tested in it in my NetBeans.
The code is:
from("undertow:http://localhost:{{port}}/bar?matchOnUriPrefix=true")
.transform(bodyAs(String.class).append(" Matching prefix"))
.to("mock:bar");
This runs fine and returns OK when the URL starts with the prefix: "bar". So "bar/foo" returns OK as well.
But when I paste this code into the Wildfly Camel Rest Swagger example (there is no Wildfly Camel Rest example) from the website https://github.com/wildfly-extras/wildfly-camel-examples/tree/master/camel-rest-swagger, then I only get an OK when testing with "bar" as path.
Using "bar/foo" result in a 404 return code.
Im still using Wildfly 10.1 final and Camel 2.19.1.
So what is causing the difference in output? What do I have to change in Wildfly to get it working?
Is the option matchOnUriPrefix default disabled/ignored on Wildfly?
When using the Wildfly-Camel 2.18.3 on the Wildlfly installation it seems to work.
It looks like the default value for matchOnUriPrefix is changed or the handling of this property.
In that case it seems to me that this introduced the bug as described above.

Mail configuration in Bugzilla

I've installed bugzilla in my local machine (Windows 7) and its working good. But when I try to create a new account it says:
Traceback:
at Bugzilla/Mailer.pm line 179.
Bugzilla::Mailer::MessageToMTA(...) called at Bugzilla/Token.pm line 89
Bugzilla::Token::issue_new_user_account_token(...) called at Bugzilla/User.pm line 2423
Bugzilla::User::check_and_send_account_creation_confirmation(...) called at C:/bugzilla/createaccount.cgi line 39
I followed the documentation provided in bugzilla. But unable to resolve this issue. Can anyone help this?

How to integrate tesseract-ocr with tika?

I need to integrate the tesseract-ocr which converts scanned image as pdf to text.
There is tesseractOCRParser already available.
But there is no invoke method given.
When I am trying to build tika with tesseract-ocr referral path I am getting the following error
Results:
Failed tests:
testNoConfig(org.apache.tika.parser.ocr.TesseractOCRConfigTest):
Invalid default tesseractPath value expected:<[]> but was:
<[/home/serendio/tesseract-ocr/]>
Tests run: 569, Failures: 1, Errors: 0, Skipped: 7
Can anyone help me out ???
Or any other-way to resolve this problem??
I think this can help :
https://wiki.apache.org/tika/TikaOCR
I followed this guide and I was able to easily extract the content!
I simply installed Tesseract and then Tika.
Using Tika 1.9 I was easily able to :
- extract the content directly calling a local Tika server
- extract the content in a custom application ( you can use the tika-example project) with no effort .
No modification was needed. Everything working out of the box.

Moodle 2.6 mailer not working properly

I'm having trouble with moodle mailer , problem is that moodle is not sending mail after registration to student and when somebody click forgotten password mail doesnt come to user also.
Error logs are empty
I tried to change to send via smtp servers but is not working
My moodle version is 2.6.1 and i cannot upgrade to higher version.
Can somebody please help me with this trouble ?
This is error log:
Error code: filenotfound
* line 463 of /lib/setuplib.php: moodle_exception thrown
* line 1948 of /lib/filelib.php: call to print_error()
* line 1201 of /lib/outputlib.php: call to send_file_not_found()
* line 94 of /theme/essential/lib.php: call to theme_config->setting_file_serve()
* line 4628 of /lib/filelib.php: call to theme_essential_pluginfile()
* line 37 of /pluginfile.php: call to file_pluginfile()
Edit your config.php and enter this
$CFG->debugsmtp = true;
Or go to site admin -> development -> debugging -> and check 'Debug email sending'
It will show verbose messages when sending email so might show what's wrong.
Alternatively, use an editor with xdebug enabled (I use Netbeans IDE) - then add a breakpoint at the start of the function email_to_user() in /lib/moodlelib.php - Then step through until it fails.
Problem Solved
I had to set port in lib/moodlelib.php to 465 (My provider want me to use 587)