Entries Tagged as 'ColdFusion'

My new blog

ColdFusion 1 Comment »
I decided it was high time I had my blog hosted on my own servers and had full control over it rather than using blogger.com, so I decided to use Ray Camdens blogCFC. And here it is.

Using connector/J drivers with MySQL

ColdFusion No Comments »
Further to my other posts, I have now discovered what the problem is with most of the other driver versions, they cause a conflict with the Logger and existing drivers in CFMX causing a log4 error. The below solution should allow you to use the new drivers. Thanks to Stephen Moretti for this info. The solution is to add this connection string logger=com.mysql.jdbc.log.StandardLogger to the end of the JDBC URL. For example : jdbc:mysql://localhost:3306/mydatabase?logger=com.mysql.jdbc.log.StandardLogger Other useful additions to the connection string are useUnicode=true
and
characterEncoding=UTF8
for internationalisation, giving you : jdbc:mysql://localhost:3306/mydatabase?logger=com.mysql.jdbc.log.StandardLogger&useUnicode=true&characterEncoding=UTF8
NOTE: Don't use the connection string box in the datasource form as this doesn't work for "other" type datasources.

Flash Remoting (gateway services) bug

ColdFusion No Comments »
I was having a problem this week on the cfdeveloper server, members were reporting that flash remoting was not working. Having then tested on a few other CF 7 servers, it was not working there either. And I did a bit of googling to no avail, only to find that a lot of people seem to have problems getting flash remoting to work. In ColdFusion MX 6 you could go to http://domain/flashservices/gateway to test if it was working, and if you got a blank page back, all was ok. On ColdFusion MX 7 this does not work, so the only way you can test is by writing some code to test the service. Here is a simple script you can use to test the flash remoting services. http://www.asfusion.com/blog/entry/remoting-for-coldfusion-flash-forms Well here is the answer. After checking the coldfusion runtime logs (C:\CFusionMX7\runtime\logs\coldfusion-out.log), I found it was full of errors like this. [Flash Remoting MX]-> Unable to load configuration. Reason: The element type
"service-adapters" must be terminated by the matching end-tag
"".27/02 16:22:17 user failed to load:
flashgateway.controller.GatewayServlet
So I checked the gateway-config.xml file (\wwwroot\WEB-INF\gateway-config.xml) and found it had the following errors in it. <service-adapters>
<adapter>flashgateway.adapter.resultset.PageableResultSetAdapter</adapter>
<adapter>coldfusion.flash.adapter.ColdFusionAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFCAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFSSASAdapter</adapter>
<!--<adapter type="stateful-class">flashgateway.adapter.java.JavaBeanAdapter</adapter>-->
<!--<adapter type="stateless-class">flashgateway.adapter.java.JavaAdapter</adapter>-->
<!--<adapter type="ejb">flashgateway.adapter.java.EJBAdapter</adapter>-->
<!--<adapter type="servlet">flashgateway.adapter.java.ServletAdapter</adapter>-->
adapter>coldfusion.flash.adapter.CFWSAdapter</adapter>
</service-adapters>
should be <service-adapters>
<adapter>flashgateway.adapter.resultset.PageableResultSetAdapter</adapter>
<adapter>coldfusion.flash.adapter.ColdFusionAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFCAdapter</adapter>
<adapter>coldfusion.flash.adapter.CFSSASAdapter</adapter>
<!--<adapter
type="stateful-class">
flashgateway.adapter.java.JavaBeanAdapter</adapter>-->
<!--<adapter
type="stateless-class">
flashgateway.adapter.java.JavaAdapter</adapter>-->
<!--<adapter
type="ejb">flashgateway.adapter.java.EJBAdapter</adapter>-->

<!--<adapter
type="servlet">flashgateway.adapter.java.ServletAdapter</adapter>-->

<adapter>coldfusion.flash.adapter.CFWSAdapter</adapter>
</service-adapters>
Notice the last tag, has a missing opening chevron.

MySQL Drivers, DSN's and Security Sandboxes

ColdFusion No Comments »
I have been having a problem with a CFMX6.1 server that just would not maintain connections to MySQL DSN's, if you added the DB username/password into the DSN, it would work for a while, but would eventually timeout and give the error below. Specifying the username/password in your code just did not work at all, always causing the below error. Cannot connect to MySQL server on servername:3306. Is there a MySQL server
running on the machine/port you are trying to connect to?
(java.security.AccessControlException)
It turns out this is caused if you have security sandboxes enabled. Even if you have NOTHING specified in your server/ports section which whould thus mean no restrictions, ColdFusion still disallows access to the MySQL Server. In my case I have a default sandbox on the folder where all the web sites are located. So I explicity allowed the Server/Port of the MySQL server here, and it has solved the problem. The Explanation as to the reason for this behaviour goes something like this:- When you create a DSN via the CFADMIN with a username/password, it creates a pooled connection which works because the CFADMIN has access to the Server/Port of MySQL. Any code that now uses that DSN uses the already verified pooled connection. This connection will however be closed after 20 minutes of inactivity. If you pass the username/password in your code, a new connection is created, which does not have access to the Server/Port because of the sandbox, thus it fails to connect. This behaviour does not however seem to be consistent, as I have other CFMX servers using sandboxing where MySQL DSN's work fine without neeidng to explicity specify the Server/Port of the MySQL Server in any sandbox. You would also expect the same problem to affect SQL Server DSN's, but it doesn't. On top of these problems, I also couldn't get the alternate connector/J MySQL driver to work on this server. After solving the above problem, I then started getting the below error. This was using the 3.2.0-alpha driver, which was the only one that I could previously get to work on other servers. But this was supposedly causing conflicts with log4j libraries in the newer 3.1.8 jar and greater and the CFMX own log4j interface. So I changed to the 3.0.16ga driver, which now appears to be working. Connection verification failed for data source: jf1[]java.sql.SQLException:
Unable to instantiate logger class 'com.mysql.jdbc.log.Log4JLogger', exception
in constructor?The root cause was that: java.sql.SQLException: Unable to
instantiate logger class 'com.mysql.jdbc.log.Log4JLogger', exception in
constructor?
Thanks to Nick Watson @ Adobe for his help in resolving this issue.

cfindex.dll: Can't find dependent libraries

ColdFusion No Comments »
Had a new error today that I have not experienced before on a CFMX7 server. In the server logs it said: C:\CFusionMX\lib\cfindex.dll: Can't find dependent libraries. After checking the dependencies for the cfindex.dll I discovered that "MSVCP60.DLL" was missing from the system32 folder. So I just copied it over from another server and this fixe dthe problem. The library file msvcp60.dll contains program code used to run programs written using Microsoft Visual C++. msvcp60.dll is required for programs written with Visual C++ to function correctly.
Powered by Mango Blog. Design and Icons by N.Design Studio
RSS Feeds