On Apr 5, 2005 9:42 AM, Bryan Stevenson <[EMAIL PROTECTED]> wrote:
> One thing this crowd will be VERY interested in is deploying a CF app on J2EE 
> servers (so enhancing productivity through rapid dev in CF and deploying as 
> Java).

I demo'd this at Fusebox 2004 so I can walk you through it (contact me
off-list if you need more details).

> I want to clarify exactly what the EAR/WAR file deployment option does in CF.
> 
> AFAIK....
> -compiles an entire CF app as and EAR/WAR file

Inside the CF Administrator, you can select J2EE packaging and pick a
directory (containing your application) to package up. At that point
you have the option to include the CF Administrator or not and to
include source or not.
- including the CF Administrator means that the deployed application
will also have a regular CF Administrator included, with the same
password as yours initially
- omitting the CF Administrator means that the deployed application
will have all the same settings as your CF Administrator but you will
only be able to change settings programmatically via the new CF Admin
API, using some code in your application
- including source code means your CFM / CFC files will be included in
the deployed application (just as if you'd copied them manually)
- omitting source code means that CF will couple all of your CFM / CFC
files to Java bytecode and include only the compiled bytecode files in
the deployed application (as if you'd manually run the cfcompile batch
file)
I recommend naming the WAR archive to match the top-level directory
name containing your application (so if you have webroot/myapp then
call the WAR file myapp.war). That makes it easier to deploy on most
J2EE servers if your code relies on /myapp as its home.

> -EAR/WAR file can be deployed on a J2EE server without installing CF

Correct. For the Fusebox 2004 demo, I created the WAR archive, used
JRun to create a clean server instance, then deployed the WAR file to
that clean server instance (which had never seen ColdFusion). When I
started the server instance, the CF runtime started up (from the
packaged archive) and I ran my application.

For the demo, I did not include source (so I could show that the
foo.cfm files were Java bytecode rather than source code) and I did
not include the CF Administrator. I had a first-run wizard in my
application that offered a mini-admin console (using a tabbed Flash
form) to allow the user to type in database connectivity information
etc. Behind the scenes it used the Admin API to setup the data source
appropriately.

> 1) When you choose the EAR/WAR file option during CF install...

This is for initial installation of CF itself and has nothing to do
with J2EE packaging for application deployment. You can do J2EE
packaging on *any* edition, including Developer Edition but the
resulting EAR/WAR is effectively an Enterprise Edition since J2EE
*deployment* is an Enterprise feature.

> 2) How is the EAR/WAR file "deployed" on the J2EE server (remember I'm a Java 
> newb)

It depends on the J2EE server. For JRun, you must manually explode the
WAR into a server instance. For example, if you have a server instance
called foo, go to {jrun.home}/servers/foo/ and unpack the WAR there,
using the command:

jar xvf /path/to/the/myapp.war

This should create {jrun.home}/servers/foo/myapp/ containing your
application. Start that server instance and you can access your
application using:

http://{server}:{port}/myapp/

where {server} is the machine name (e.g., localhost) and {port} is the
appropriate port for the foo server instance, e.g., 8200.

Tomcat, on the other hand , auto-deploys war files for you. Just put
the war file in {tomcat.home}/webapps/ and start Tomcat. It will
unpack myapp.war automatically into {tomcat.home}/webapps/myapp/ and
you can access it using the same sort of URL as shown above, e.g.,

http://localhost:8180/myapp/

Rob asked about licensing. When you create the J2EE package (the
EAR/WAR file), you can optionally enter a serial number for a new
Enterprise Edition of CFMX (you need to buy the license from
Macromedia). If you do that, the deployed application will be a
fully-licensed, fully-functional copy of CFMX Enterprise Edition
(although it will only have a CF Administrator if you opted to include
it in the packaging).

If you omit a serial number, the deployed application will be
Developer Edition. You can turn it into Enterprise Edition by buying a
license and doing either of the following after deployment:
- if you included a CF Administrator, go in and enter the new serial
number under System Information
- if you did not include a CF Administrator, you can only update the
serial number through the Admin API so your application will need to
provide a way to do that

Feel free to ask further questions, either on cf-talk or privately.
-- 
Sean A Corfield -- http://corfield.org/
Team Fusebox -- http://fusebox.org/
Got Gmail? -- I have 50, yes 50, invites to give away!

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:201546
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to