I concur on all that you said. On *nix, you also need to run the command
through `su` to the user account that CF runs as, so that it can later
overwrite the compiled templates when they change.
Also on *nix, you can redirect standard out to /dev/null so you don't have
to watch the template list (especially now that it's ugly), but still can
see any compilation errors that the script generates. You can do the same
redirection on windows, but I don't know what the equivalent of /dev/null
is.
Here's the script that I use on Linux. It will not work on CFMX 6, only
6.1.
------------------------------------------------------------------------
#!/bin/sh
#
# set up the variables that will drive the precompilation process
#
CF_INSTALL=/opt/coldfusionmx
CF_USER=nobody
#
# if we don't have a directory, display usage
#
if [ $# -eq 0 ]; then
echo "Usage: $0 /dir/to/compile"
exit
fi
#
# do the precomilation. This will automatically look into
# subdirectories
#
su $CF_USER -c "$CF_INSTALL/runtime/jre/bin/java \
-classpath
$CLASSPATH:$CF_INSTALL/lib/cfusion.jar:$CF_INSTALL/runtime/lib/jrun.jar \
coldfusion.tools.Compiler -webroot $1 \
-webinf $CF_INSTALL/wwwroot/WEB-INF $1" > /dev/null
------------------------------------------------------------------------
---
Barney Boisvert, Senior Development Engineer
AudienceCentral
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax : 360.647.5351
www.audiencecentral.com
> -----Original Message-----
> From: John Paul Ashenfelter [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 08, 2003 12:12 PM
> To: CF-Talk
> Subject: fixing precompile.bat for CFMX 6.1 --
> java.lang.NoClassDefFoundError for javax/servlet
>
>
> Folks,
>
> I've always used the precompile.bat file from Charlie Aerheart's
> blog as part of the nightly build/release tool for our CFMX
> development and integration sites, but the version I'm running
> dies with a java.lang.NoClassDefFoundError for javax.servlet.*
> classes. Easy enough to find the library -- javax.servlet.* is in
> the \runtime\lib\jrun.jar file. Maybe other places as well...
>
> So the batch file I now have working looks like this:
>
> REM precompile.bat for CFMX 6.1 Windows
> set MX_INSTALL=c:\CFusionMX
> set PATH=%MX_INSTALL%\runtime\bin;%MX_INSTALL%\runtime\jre\bin;%PATH%
> java -classpath
> %MX_INSTALL%\lib\cfusion.jar;%MX_INSTALL%\runtime\lib\jrun.jar;
> coldfusion.tools.Compiler -webroot %1 -webinf
> %MX_INSTALL%\wwwroot\WEB-INF %1
>
> LINUX NOTE: I'm guessing on linux you'd need to use -classpath
> %MX_INSTALL%\lib\cfusion.jar:%MX_INSTALL%\runtime\lib\jrun.jar
> instead to be consistent with classpath on that platform, at
> least the way I remember it. Not near a linux box to check today.
>
> And it can be used like this:
>
> precompile c:\cfusionmx\wwwroot
>
> One difference though is that there is no compile time for each
> page, or linebreak after each page. And I could have done this
> wrong :) Any other folks have input/comments?
>
> Regards,
>
> John Paul Ashenfelter
> CTO/Transitionpoint
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4