pf » Tag: java on Pete Freitag's Blog
August 16, 2007
Web Services Problems with ColdFusion 8 on a Mac
I just got a brand new Mac Pro yesterday - I spent most of yesterday installing stuff, but today I was trying to get a little work done... I ran into a problem when trying to invoke web services on CF8 - it threw the following error:coldfusion.jsp.
August 06, 2007
Serializing CFC's in ColdFusion 8
One of the handy new features in ColdFusion 8 is that CFC's are now serializable. There isn't a whole lot of information about this new feature in the docs, but I did some playing around and it does appear that they have used Java's serialization API. This means that you can use java's java.io.
January 11, 2007
Finding the Last Modified Date on a File
This question came up on my local CFUG mailing list yesterday: how can I get the time last updated of the two
documents? I know you can do this with uploaded files using
FILE.TimeLastModified.
January 10, 2007
Reverse IP Address Lookup with ColdFusion + Java
I needed to do a reverse lookup on some IP addresses in a database today. I found that you can do this pretty easily with java, and just as easily with ColdFusion. Here it is:<cfset inet_address = CreateObject("java", "java.net.
November 14, 2006
Java GPL'd
In case you missed it, Java has been open sourced with a GPL2 license. You could actually get Java source code for a while, but the license was restrictive.
November 02, 2006
Happy Birthday Eclipse - 5!
The Eclipse Project Turns 5 years old on Nov 7th. Go over to their birthday site and send a greeting.
March 20, 2006
How to Design a Good API and Why it Matters
Joshua Bloch has a good presentation outline called How to Design a Good API and Why it Matters. Joshua is a Principal Software Engineer for Google, before that an architect in Sun's Core Java Platform Group (he designed several of the standard java API's). Josh also wrote Effective Java.
March 18, 2006
ColdFusion on the TIOBE index
My brother sent me a link to the TIOBE index which has ColdFusion at #13 (up from #26 last year). According to the site:The TIOBE Programming Community index gives an indication of the popularity of programming languages.
January 10, 2006
Null Java References in CF 6 vs 7
ColdFusion 7 appears to be much better at passing null values to a java object. ColdFusion 6 however likes to block you from doing it, even when you want to.I am tring to work with a java API that requires me to pass a null value to a method.
December 07, 2005
Java Performance Tuning Guide
Sun recently published a new whitepaper called Java Tuning. It should be of interest to anyone doing performance tuning on ColdFusion server and ofcourse any java application.
October 27, 2005
DNS Query with ColdFusion
It has been a while since I've posted one of these java + cfml tricks, so here's a neat one for ya'.You can use the Java Naming and Directory Interface (JNDI) to perform a DNS query in ColdFusion.
September 01, 2005
Cheat Sheet Roundup - Over 30 Cheatsheets for developers
Lets face it, unless you have a photographic memory, no developer can remember all the different functions, options, tags, etc. that exist. Documentation can be cumbersome at times, thats why I like cheat sheets.
August 18, 2005
Dynamic Java Class Loading with ColdFusion
Doug Hughes has posted a very clever technique for allowing you to run Java classes without adding them to your classpath. This means that people who build ColdFusion apps that include java classes can make them super easy to install.
August 16, 2005
Parsing, Modifying, and outputting XML Documents with Java
I have been doing a lot of XML parsing, and manipulation in java lately because I'm building a super dynamic configuration editor for XMS. Its going to be pretty cool once its done because you can even configure third party modules with it.
August 12, 2005
Servlet API Call for Features
Greg Murray, the Servlet specification lead is asking how do you use the Java Servlet API, and where would you like it to go:As part of Java EE 5.0 servlets will be undergoing a maintenance release.
May 02, 2005
Tiger (Java 1.5/5) on Tiger (Mac OSX 10.4)
Apple has released Java 1.5 as a manual download with no plans to release J2SE 5.0 for earlier releases of Mac OS X. Which I guess means that its not going to show up in Software Update for quite some time. Additionally applications requiring J2SE 5.0 / JDK 1.5 must explicitly request version 1.5.
April 06, 2005
Thread Priority, and Yielding
Suppose you have a page that is only run by background processes, or a page that can take a lot of resources, but you don't want it to. Since ColdFusion MX is written in Java, you can access the thread object that your CFML request is running as.
March 30, 2005
SanOS
SanOS is a minimalistic 32-bit x86 OS kernel for Java based server appliances running on standard PC hardware.This enables you to run java server applications without the need to install a traditional host operating system like Windows or Linux.
March 21, 2005
Regular Expressions - Named Capture Groups
I am porting some code from .NET to Java today, and found out about a very cool feature in regular expressions called Named Groups. Most regular expression implementations let you group text (which can then be used for back-references) using parenthesis, for example: my name is (pete).
March 18, 2005
Prepared Statements with JDBC
To prevent SQL Injection Hacking with JDBC, you simply just need to use Prepared Statements, this is pretty easy to, just use a PreparedStatement object instead of a Statement Object, in your SQL replace your variables with ?
February 22, 2005
Bea JRockit 5 JVM Released
Bea has released JRockit 5.0 JVM. Here is a link to some release notes.JRockit 5.0 is a J2SE 5.0 compatible Java Runtime Environment. The JRockit JVM main design goal is performance, and the 5.0 version shows a 5-10% performance increase over their previous version on linux.
February 18, 2005
Java 1.5 for FreeBSD Patchset Released
The first patchset for Java 1.5 on FreeBSD has been released.Greg Lewis has released the first patchset (patchlevel 1) for the JDK" 1.5.0 software. This is initial patchset and suitable for early testers and developers.
November 29, 2004
Converting an unsigned byte array to an integer
I found myself today needing to deal with unsigned integers, and shorts in java. In Java there is no unsigned keyword like in C, or other languages. All primitives are signed (meaning they can hold negative values).
November 19, 2004
Robi Sen on Hung Servers, java.lang.OutOfMemory errors and Tuning CF JVM
Robi Sen a while back posted a blog entry with some useful tips on solving java.lang.OutOfMemory exceptions, and tuning the JVM for ColdFusion MX. He has recently posted a follow up to that entry.
October 07, 2004
Good tutorial on Java 1.5 Generics
Sun has published a great tutorial on generics in Java 1.5. It covers all the pitfalls, and special cases as well as brings you up to speed on generics.
June 08, 2004
Visualize Garbage Collection
Sun has released (for free) a very cool program called Visual GC 2.0 in their jvmstat toolkit (via: Moazam Raja). The tool will show you graphically how memory is organized into generation in your JVM.
June 03, 2004
ColdFusion Garbage
Now that you have had a chance to read my outline of garbage collection tuning in java. You should be asking yourself how does this relate to my ColdFusion server. Or maybe you just wondered what Garbage Collection has to do with ColdFusion Servers.
June 03, 2004
Tuning Garbage Collection
Every so often I come across the document: Tuning Garbage Collection, and I attempt to read all of it. The document is kind of hard to digest, so this time I created an outline of the Tuning Garbage Collection on the Java 1.4.2 Hotspot JVM document.
May 12, 2004
Bookmarklets and Search Plugins for javadocs.org
Many people have been posting bookmarklets for searching javadocs.org, and some have asked about a Mozilla/Firefox search plugin. So I though I would create a bookmarklets, and mozilla search plugins page.This page has bookmarklets that work in IE, Mozilla, FireFox, and Safari.
May 11, 2004
javadocs.org launched!
I am launching javadocs.org today! The site is strikingly similar to my cfdocs.org site for CFML, but just as useful.The site is basically a URL shortcut to java documentation, for example if you want the documentation for the String class, simply type: javadocs.org/string.
March 31, 2004
Checking your JDBC Driver Version
Macromedia recently updated their JDBC driver technote, but I wasn't sure if I already had the 3.3 driver installed (since they may have just updated the text in the technote).
March 29, 2004
Signing Jar Files (converting pvk to p12)
We recently renewed our code signing certificate for signing java applets, this is the first year we have had to renew it, and the process is a bit different from when we generated it. When we first received the key we did it with a CSR, and the java keytool.
March 15, 2004
ColdFusion Memory Usage Stats
Here are some code to find out some info about the memory usage of CFMX or BlueDragon. The Java API provides three methods in the java.lang.Runtime class: freeMemory, totalMemory, and maxMemory.
December 10, 2003
Determining the size of objects in memory
Someone asked for a method to find out how much memory their cached queries, and components are using on the cf-talk mailing list today. In CFMX and in java there are no build in methods for determining the size of an object.
November 14, 2003
Making Jar files Run
I recently had to reinstall my OS, and more recently had to use a Java Application called JEdit. JEdit's installer didn't create any shortcuts for me, so I had to run JEdit from the command line by invoking it's jar file with java -jar jEdit.jar.
October 14, 2002
How to make ColdFusion MX go to sleep
Many people have had the need for a ColdFusion page to sleep, typically between iterations of a loop. There is a tag called CFX_Sleep in the Tag Gallery, but in ColdFusion MX you don't need a CFX tag to make the current processing thread sleep using the static sleep method on the java.lang.
September 25, 2002
Have you tuned your JVM on ColdFusion MX yet?
ColdFusion's move to java gives developers and system administrators a wealth of performance tuning options.
Subscribe to my RSS Feed:
RSS
RSS
Pete Freitag is a software engineer, and web developer located in




