Showing posts with label coldfusion. Show all posts
Showing posts with label coldfusion. Show all posts

Wednesday, September 21, 2011

coldfusion: wsdl AXIS error jikesw CompilationFailedException

error when calling wsdl:

Fault - [coldfusion.jsp.CompilationFailedException : Errors reported by Java compiler: /opt/coldfusionmx/runtime/bin/jikesw: error while loading shared libraries: libstdc++-libc6.1-1.so.2: cannot open shared object file: No such file or directory
.][; nested exception is:



to fix, install: compat-libstdc++

Wednesday, September 07, 2011

facebook: cfm application development setup

i tried facebook app development a couple of years back. then, i was following http://developers.facebook.com/get_started.php which doesn't exist now. yep, it was that long time ago. lol i'm sure you can easily find a start up guide in the net.

anyway, i used fbml for my app integration which, as i understood, behaves like this:
user -> fb -> your app
user <- fb <- result

i used cfm and used a set of component codes created by Dominic Watson and Andrew Duckett and updated by Andrew Duckett for a quick kick start.


the files used are listed below:
application.cfm - for vars
FacebookFBMLClient - for Fb api calls
fbfunctions.cfm - for fb functions and styles
fbinvite.cfm - sample fb invite page
fbRoute.cfm - for rerouting if accessed from outside fb
fbstyles.css - fb styles
index.cfm - includes profile box and sample link call

notable notes:
* use fb script for redirection
** links should be called through fb request by using js
*** unlink canvass should point to a file outside facebook client folder (because client folder requires app access)

a week ago, one user reported the app to be not working. i suspected changes in facebook's api was causing it. will post findings soon.

Tuesday, September 06, 2011

coldfusion: update java runtime environment

to update or change your coldfusion's jre edit your java.home in your coldfusionmx/bin/jvm.config

example below

from:
java.home=/opt/coldfusionmx/runtime/jre

to:
java.home=/usr/java/jdk1.6.0_11/jre

coldfusion: display 404 error instead of cf file not found error

to display apache's 404 error instead of coldfusion's file not found error:

coldfusion's file not found error message

edit  coldfusionmx/runtime/servers/default/SERVER-INF/default-web.xml

1. set keepGenerated to true:

 <servlet>
   <servlet-name>JSPServlet</servlet-name>
   <servlet-class>jrun.jsp.JSPServlet</servlet-class>
   <load-on-startup>1</load-on-startup>
   <init-param>
     <param-name>keepGenerated</param-name>
     <param-value>true</param-value>
   </init-param>
   <init-param>
     <param-name>translationDisabled</param-name>
     <param-value>false</param-value>
   </init-param>
   <init-param>
     <param-name>cacheTags</param-name>
     <param-value>true</param-value>
   </init-param>
 </servlet>


2. comment servlet mapping for jsplicenseservlet

<!--
 <servlet-mapping>
   <servlet-name>JspLicenseServlet</servlet-name>
   <url-pattern>*.jsp</url-pattern>
 </servlet-mapping>
-->


3. comment index.jsp in welcome-file-list

 <welcome-file-list>
  <welcome-file>index.html</welcome-file>
<!--
  <welcome-file>index.jsp</welcome-file>
-->
 </welcome-file-list>


edit your apache/httpd.conf

1. remove .jsp from AddHandler

Tuesday, August 23, 2011

coldfusion: copy image from url

to get a local copy of an image in the web using coldfusion, use cfhttp with get method.

<cfhttp url="http://url/directory/file.png" method="get" path="/localdirectory/" file="filename" />

i use this to transfer images on demand, from a server without public access to a server with public access

Friday, August 12, 2011

coldfusion: connecting with postgres as datasource

to setup postgres as coldfusion datasource:

1. download jdbc* driver and place into coldfusion's java lib directory
    (/opt/coldfusionmx/lib or <coldfusion path>/lib)

2. restart cf

3. use dsn details below
    Field Description 
    JDBC URL - jdbc:postgresql://<pgsqlDbHost>/<databaseName> 
    Driver Class - org.postgresql.Driver 
    Driver Name (Optional) (The name of the driver  )
    Username (ColdFusion user account on the database server)
    Password (Password for the user account on the database server )

4. configure postgres to accept tcp/ip connections because java uses tcp/ip connections

    edit postgresql.conf
        set hba_file = '/usr/local/pgsql/data/pg_hba.conf'
        set listen_address = 'localhost,192.168.1.12,etc'

    edit pg_hba.conf, add
        host    all             all     192.168.1.12/32         trust
        host    all             all     192.168.1.13/32         trust
    etc

* using jdbc3

Wednesday, July 20, 2011

coldfusion: sleep

to place a delay in your .cfm application, call a thread sleep function

<cfset createObject('java', 'java.lang.Thread').sleep(5000) />

the code above halts the application for 5000 milliseconds

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...