Blog

Category Filtering: 'ColdFusion'

Remove Filter


Could not resolve CFC datatype: Error when viewing a cfc?wsdl

Posted by Luis Majano
Feb 06, 2006 00:00:00 UTC
Here is a little tricky bug on CFMX 7 dealing with web services and our favorite buddies, Coldfusion Mappings. 100% reproducible and I think Macromedia had a fix for 6.1, but not for 7, at least I don't know about it.

Here is what it comes down to. Let's say you have a CFC on your server on the following physical location:

/data/cfcs/remotes/giftshop/products.cfc

And the apache or IIS web root points to "remotes", thus, to call this webservice wsdl you would use

http://myurl/giftshop/products.cfc?wsdl

Now let's say that you have a CFMX mapping to any directory, it actually doesn't matter, but with the name "giftshop".

When you go now to the wsdl URL you get this nasty error:

AXIS error

Sorry, something seems to have gone wrong... here are the details:

Fault - Error attempting to create Java skeleton for CFC web service; nested exception is:

coldfusion.xml.rpc.CFCInvocationException: [coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeException : Could not resolve CFC datatype: /giftshop/webProducts.cfc]

AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException

faultSubcode:

faultString: Error attempting to create Java skeleton for CFC web service; nested exception is:

coldfusion.xml.rpc.CFCInvocationException: [coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeException : Could not resolve CFC datatype: /giftshop/webProducts.cfc]

faultActor:

faultNode:

faultDetail:

{http://xml.apache.org/axis/}hostname:ibm-1.sandals.com

The problem lies that CFMX confuses the webroot path with the coldfusion mapping, it can't distinguish between them and actually follows the mapping. Once you remove or rename the CFMX mapping, the error disappears and you have a wsdl compilation.

Does anybody now if a fix is on the way? or already out? Please let me know.

cflogin and the Application.cfc

Posted by Luis Majano
Jan 12, 2006 00:00:00 UTC
I have been fooling around a bit with cflogin for the past day and found an interesting note on it. In order for the cfauthorization to take effect, the cflogin take must be called on every request.

For example I was trying to do a login and implementing the cflogin on a cfc. When I returned to my template, my cfauthorization variable was set on session, but my isAuthUser() was returning blank.

After an hour of basically playing around, I returned the cflogin to the Application.cfc and wallah. The security functions return values. So that's a relief.

So if you want to implement a cflogin security, make sure you are calling the cflogin tag on every request, in order for the security variables to take effect.

Lighthouse Pro by Raymond Camden

Posted by Luis Majano
Jan 06, 2006 00:00:00 UTC
I just recently downloaded LightHouse Pro by Raymond Camden. Lighthouse pro is a ColdFusion bug tracking application. It is incredibly easy to install and best of all it runs on a MySQL backbone. Actually you can also use access and MS SQL.

It can create different project loci and assign the loci to the projects. You can create different users that will be involved in the projects. Every time an issue is created/revised, emails can be send out to different users. A great statistics page where you can see the QA progress of your projects.

Overall this utility has organized all my debugging and enhancements for my projects. I truly recommend this utility in order to better organize yourselves in your software development.

It is very hard to loose track of bugs and enhancements over the life time of a project and this utility really brings this issues to a close.

Keep up the good work Ray!! I am a true fan!!

LightHouse Pro Project Page

How to install the new MySQL JDBC driver on Coldfusion MX7

Posted by Luis Majano
Nov 29, 2005 00:00:00 UTC
I needed to upgrade my coldfusion JDBC drivers for MySQL since I upgraded my release to 5.0 and here is the little how to.

1) Donwload the JDBC drivers from here:

http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-3.1.11.zip/from/pick

2) Extract the archive and copy the following file:

mysql-connector-java-3.1.11-bin.jar

to the following destination:

J2EE

{j2ee path}/servers/lib

If you want it available to all servers or just for the Coldfusion app then:

{cfmx instance path}/cfusion-ear/cfusion-war/WEB-INF/lib

Standalone

{cfmx path}/wwwroot/WEB-INF/lib

3) Restart your CFMX instance or server.

4) Go to your Datasources in your coldfusion administrator to register a new datasource:

Name: {Your datasource name}

JDBC URL: jdbc:mysql://{your host}:3306/{your database}

Driver Class: com.mysql.jdbc.Driver

Driver Name: MySQL 5.0

User Name: {Username}

Password: {Your Password}

And that is it.

Ray Camden's New Blog CFC 4.0

Posted by Luis Majano
Nov 10, 2005 00:00:00 UTC
Ray Camden has just released his new BlogCFC 4.0. I will be shortly implementing his software and updating my blog.

I truly recommend this blog software. It is incredibly easy to install and customize to your own needs.

Keep up the great work Ray!!

ASP vs CFMX!! CFMX by far beats ASP in functionality

Posted by Luis Majano
Nov 10, 2005 00:00:00 UTC
I have just finished installing a custom DHTML editor for a friend on his ASP website. However, I had to actually make the javascript work with his ASP backend. And phew!!! Let me tell you, WHAT A PAIN ASP IS!!!

I had completely forgotten how incredibly painful ASP is. Coldfusion is by far a more robust and simpler web application framework than ASP.

I practically had to build my own JSStringFormat function, already available in Coldfusion, for ASP. Basically, breaks and carriage returns in ASP were completely throwing Javascript off. So I had to build a small function to string replace these characters into "escaped" Javascript friendly items.

For those ASP users, which I believe are in the dark ages, here is the little snippet.

Private Function Strip(byVal string)

Strip = Trim( Replace( Replace( Replace( string, vbCrLf, "\n" ), chr(10), "\n" ), chr(13), "\n" ) )

End Function

I had to also try to remember how simple recordsets worked in ASP, OHH MY GOD, the dreaded ADODB.recordset.

Anyways, this post is to enlighted the ASP community to please see the light, COLDFUSION!!

Java's gettickcount(), How to get the current time in milliseconds

Posted by Luis Majano
Nov 07, 2005 00:00:00 UTC
Coldfusion has a great function called "gettickcount()" which basically gives you the current time in milliseconds. This is a great function to time code. Look at the example below:

<cfset stime = getTickCount()>

<!--- All my code to time here --->

<cfloop from="1" to="100" index="i">

<cfoutput>testing #i#</cfoutput>

<!--- Make a call here --->

</cfloop>

<cfset totalTime = getTickCount() - stime>

<cfoutput>The total time of execution for the code was: #totalTime#</cfoutput>

This utility is great. The question is, how do I do this in Java?? Well very simple, we use the System class. The following is a simple snippet of how to time in java.

double stime = System.currentTimeMillis();

//My Code Here


for(int i=0;i< 1000; i++){

System.out.println(i);

}

double TotalTime = System.currentTimeMillis() - stime;

//Display Total Time


System.out.println("Total Time of Execution: " + TotalTime + "ms.");

There you go!! Now you can time your java code.

Flash Forms Illegal usage of actionscript

Posted by Luis Majano
Oct 18, 2005 00:00:00 UTC
I have been recently using flash forms in several different locations of my new Textus Coldfusion framework which I have been developing for work. I will soon be placing entries about Textus, to give you an insight into this simple but powerful coldfusion framework.

Anyways, I have been implementing a backup system on Textus and decided to use flash forms to populate a cftree with the backups directory contents. Then from here I can open/delete files. What seemed strange was all these errors I kept receiving, that seemed totally out of place, since my code was straightforward. These were the errors:

Illegal usage of actionscript org.apache.oro.text.regex.Perl5Pattern@1e3621b.

The following actionscript commands are not allowed: "import, new, delete, createChild, loadmovie, duplicateMovieClip, AttachMovie, registerclass, createTextField, __proto__, uiobjectdescriptor, createclassobject, createemptyobject, createchildatdepth, createchildren, createclasschildatdepth, createobject, createchild, webservice, httpservice, remoteobject".

Eclipse and CFECLIPSE in use.

Posted by Luis Majano
Sep 27, 2005 00:00:00 UTC
I finally have made my complete move for CF development to eclipse. Yesterday, while I was installing a fresh copy of eclipse, I realized the new updated download of ftp and web-dav support.

Eclipse's support for FTP has been moderate of some sorts, but it seems that now they got it.

I finished my installation of CFEclipse, connected to my dev server and started working.

This is a great development platform for true developers.

Eclipse

CFEclipse

Coldfusion-Java Snippet: Get your Operating System's File Separator.

Posted by Luis Majano
Sep 27, 2005 00:00:00 UTC
Every wonder a nice, quick and easy way of getting your Operating System's file separator character??

Well, I have several times. Thanks to our collaborator Ariel Gonzalez, and his java expertise. We take a look at the java.lang.System class and its getProperty() Method.

There are several useful properties that you can get from this class, some of them are listed below:

Site Updates

Archives

Entries Search