| By Phil Cruz | Article Rating: |
|
| October 21, 2005 09:15 PM EDT | Reads: |
16,881 |
Launching from an HTA File
One aspect of the Java/NativeJ launcher that some folks might find undesirable is the appearance of the command window (and perhaps the license fee). On the CFEverywhere mailing list, Adam Haskell shared a great tip on how to use an HTA (HTML Application) file to create a CFE launcher that doesn't create a command line window. You can learn more about HTA at http://msdn.microsoft.com/library/default.asp?url=/
workshop/author/hta/overview/htaoverview.asp (see Listing 4). When you double-click the cfeverywhere.hta file, the VBScript block executes, which instantiates an instance of the Wscript.Shell. This object allows you to execute the batch files to start Jetty and Derby. In order to give the servers time to start, we load a wait.html (Listing 5) in an iframe. Wait.html displays a loading animated gif and uses a meta-fresh to load the application page after a set time. When you want to quit, simply close the application/browser window and the onUnload() event will shutdown Jetty and Derby. It's a Windows-only solution but it works quite nicely and the price is right.
Creating a CFEverywhere CD
Creating a CD is really quite simple. For the entire process, we have been careful to only use relative paths when referring to files. All of the server components are designed to work in a read-only mode. Before we create the CD, let's set it up to automatically run our CFML application when the disc is inserted. Download AutoRun.exe and place it in the cfeverywhere folder. Create a text file called autorun.inf with these contents:
[autorun]
OPEN=autorun.exe cfeverywhere.hta
If you have a custom icon you can add:
icon=myicon.ico
To make a CD, simply create a project that contains everything in the cfeverywhere folder and burn the CD. Insert the CD on another computer (that has a Java runtime) and try it out. Note that starting a J2EE server and database server from CD is not the quickest thing in the world. You may have to set the wait time in wait.html to upwards of 20 seconds or more depending on the system. Regardless, it brings a smile to you face the first time you put a CD of your application in the computer and see your app launch.
Conclusion
Well, now you have all the tools and knowledge to create your own CFEverywhere applications. I hope this sparks your imagination and inspires you to try it out. If you do create a CFEverywhere application please share your experience on the CFEverywhere mailing list.
Resources
- To download the files used in this article go to: http://philcruz.com/cfeverywhere/downloads/ cfeverywhere_files_part3.zip
- NativeJ: www.dobysoft.com/products/nativej/
- Bringing your Java App to Mac OSX: http://java.sun.com/developer/technicalArticles/JavaLP/JavaToMac3/.
- AutoRun: www.tarma.com/products/index.htm#/products/autorun/
- How to Launch CDs with HTML applications: www.devx.com/webdev/Article/7023/0/page/1
Published October 21, 2005 Reads 16,881
Copyright © 2005 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Phil Cruz
Phil Cruz is a Macromedia Certified Advanced ColdFusion developer and has over 12 years of experience in the computing industry. He is responsible for www.mach-ii.info, a community site for the Mach-II framework. As a micro-ISV, he created Tracking Tools, an easy-to-use bug tracking application built with Mach-II (www.tracking-tools.com).
![]() |
Anthony Planavsky 02/08/08 03:44:34 PM EST | |||
Hello, I am trying to implement CFEverywhere, and have everything set up to the point where after clicking the executable icon, the command line window launches and gets to the '..waiting to launch browser...' system print line. But when it tries to run the line 'org.mortbay.jetty.Server.main(myargs);' an error appears in the command line window that says: 'log4j:WARN No appenders could be found for logger (org.mortbay.util.FileResource). The browser window launches, but we get a Page Not Found page because the server did not start due to the error we are getting. If you could give me any help as to why we are getting this error it would be greatly appreciated. I was thinking that maybe it had to do with the build path. In the Java Build Path window, we chose the Libraries tab and clicked Add External JARs and imported the org.mortbay.jetty.jar library. Is this the correct way to reference the build path? Thanks in advance... Anthony Planavsky |
||||
![]() |
CFDJ News Desk 10/21/05 09:22:00 PM EDT | |||
ColdFusion Developer's Journal - CFEverywhere Part 3 |
||||
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Adobe LiveCycle Enterprise Suite 2 for Cloud Computing
- Adobe Betas Target RIAs and Cloud Computing
- Adobe Cans Another 9% of its Workforce
- Moyea DVD4Web Converter V2.0 Converts DVD to FLV Fast and Synchronously with Watermarks
- Adobe Fiddles with its Web Apps
- Adobe & Salesforce Cut Cloud Deal
- Hosting.com Launches ColdFusion 9 in the Cloud
- The Real Time Infrastructure Ultimatum
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Is Microsoft as Free as Open Source?
- Adobe Reader Sued
- The Planet Named “Bronze Sponsor” of Cloud Computing Expo
- Microsoft Expression Web Has Got Game
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Adobe Flex Developer Earns $100K in New York City
- Bruce Chizen Joins Voyager Capital as Venture Partner
- My Top Seven Wishes From Adobe MAX 2009
- The Next Programming Models, RIAs and Composite Applications
- Where Are RIA Technologies Headed in 2008?
- Constructing an Application with Flash Forms from the Ground Up
- AJAX World RIA Conference & Expo Kicks Off in New York City
- CFEclipse: The Developer's IDE, Eclipse For ColdFusion
- Personal Branding Checklist
- Adobe Flex 2: Advanced DataGrid
- Has the Technology Bounceback Begun?
- Building a Zip Code Proximity Search with ColdFusion
- i-Technology Viewpoint: We Need Not More Frameworks, But Better Programmers
- The Asynchronous CFML Gateway
- Web Services Using ColdFusion and Apache CXF



























