📄 ch13s72.html
字号:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Deployment on JBoss</title><link rel="stylesheet" href="styles.css" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets Vimages/callouts/"><link rel="home" href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html" title="JBoss 3.0 Documentation"><link rel="up" href="ch13.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch13.html" title="Chapter 13. HOWTO"><link rel="previous" href="ch13s58.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch13s58.html" title="How To use the Timer MBean and Scheduler Service on JBoss 3"><link rel="next" href="ch13s78.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch13s78.html" title="JAAS Based Security in JBoss"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="jboss.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/jboss.gif" border="0"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch13.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch13.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch13s58.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch13s58.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch13s78.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch13s78.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table><div class="section"><a name="deployment-on-JBoss"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="deployment-on-JBoss"></a>Deployment on JBoss</h2></div><div><h3 class="author">Daniel Schulze</h3><div class="affiliation"><div class="address"><tt><<a href="mailto:daniel.schulze@telkel.com">daniel.schulze@telkel.com</a>></tt></div></div></div></div><div class="section"><a name="d0e10603"></a><div class="titlepage"><div><h3 class="title"><a name="d0e10603"></a>Introduction</h3></div></div><p>The application deployment on JBoss is managed by the J2eeDeployer MBean. The
J2eeDeployer is able
to deploy ejb.jar packages, webapplication.war packages and j2ee
application.ear packages.
Furthermore he is able to deploy unpacked ejb.jar files for development
purposes.</p><p>The deployment is url based, so it is possible to deploy from whatever source
as long as there is
a url handler for that source available in your environment.
(ie. http://somehost/applications/app.ear or
file:///home/user/development/myapp.ear)</p></div><div class="section"><a name="d0e10610"></a><div class="titlepage"><div><h3 class="title"><a name="d0e10610"></a>J2EE Deployer</h3></div></div><p>The J2eeDeployer currently provides 3 methods: </p><div class="itemizedlist"><ul><li><p><a name="d0e10616"></a>void deploy (URL)
this method starts the deployment process for the application this URL points
to. The URL can be a
file: or a http:// or any other type of url your environment is capable to
handle. In case of
deploying a unpacked ejb.jar package the URL type is currently limited to file.
The deployment of an already deployed application (the name of the app is
significant) will result in an
undeployment of this app followed by a redeployment. </p></li><li><p><a name="d0e10619"></a>void undeploy (URL or Application name)
use this to undeploy an application. the parameter can be the URL that was
used to deploy this application or just the name (application name = file name
of the app package or directory name in case of unpacked) of the application. </p></li><li><p><a name="d0e10622"></a>boolean isDeployed (URL or Application name)
use this method to ask for the state of an application. The argument follows
the same rules as for the undeploy method. </p></li></ul></div><p>These 3 methods can be used via the web interface of JBoss at port 8082 at the
host JBoss is running on.</p></div><div class="section"><a name="d0e10627"></a><div class="titlepage"><div><h3 class="title"><a name="d0e10627"></a>The AutoDeployer as helper</h3></div></div><p>The AutoDeployer MBean is a helper for the J2eeDeployer to allow doing
administration smoothly via drag and drop
or to automate the redeployment in case of development. He observes the given
directories for changes and calls
the appropriate methods on the J2eeDeployer. </p><p>The AutoDeployer observes the timestamps of the application packages or the
timestamp of the META-INF/ejb-jar.xml
file in case of unpacked ejb.jar files.</p><p>The AutoDeployer is configured whether static by the MLET configuration or
dynamic by adding urls to watch for
in its web interface (port 8082 at the host JBoss is running on).</p><p>In its current version the AutoDeployer supports only local directories to
observe.</p><p>To deploy an ejb, web or ear package simply drop it in one of the observed
directories.
To autodeploy an unpacked ejb application, add the base directory of that
application
(base directory = the directory which containes the META-INF directory) to the
AutoDeployers
observed urls.</p><p>Note: There is still a misbehavior when the autodeployer thread wins the race
against the copy thread
which modifies a package! </p></div><div class="section"><a name="d0e10642"></a><div class="titlepage"><div><h3 class="title"><a name="d0e10642"></a>Creating J2EE applications</h3></div></div><p>j2ee applications or .ear files are jar archives containing a collection of
ejb, web, client, connector and/or
other library packages. Currently JBoss only supports ejb, web and other
library packages (client and connector
packages are ignored if present).</p><p>Other Library packages are class packages that are needed by your application
and are not provided by the j2ee
runtime environment (ie: some xml tools)</p><p>This document will only describe the JBoss relevant stuff in creating j2ee
packages for a detailed description
of how to build such applications see the J2EE specification under chapter 8!</p><p>First create all ejb, war and library archives you want to put together to
make up your application. Make sure
that all dependencies are solved, means: all classes that are needed by your
application must be contained in
your application (besides the classes that made up the J2EE platform (java
core, javax.transaction,
javax.sql, javax.servlet ...). Its up to you to create an arbitrary directory
structure for your application
to make it easier to maintain. Once you ve created your structure and moved
all files on their place you have
to create a deployment descriptor. This file must reside in the <your_app_dir>/META-INF directory and must be
named application.xml.
</p><div class="figure"><p><a name="sample-application-xml"></a><b>Figure 13.5. Example of application.xml file</b></p><pre class="programlisting">
<application>
<display-name>My Application</display-name>
<module>
<web>
<web-uri>web-app.war</web-uri>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -