📄 ch10s25.html
字号:
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Using Verifier in Ant</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="ch10.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10.html" title="Chapter 10. Development Tools and IDE Integration"><link rel="previous" href="ch10s14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10s14.html" title="Integrating NetBeans/Forte for Java Community Edition with JBoss 
for source level debugging"><link rel="next" href="ch10s29.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10s29.html" title="How to generate Enterprise Java Beans with EJBDoclet (XDoclet)"></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="ch10.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch10s14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10s14.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch10s29.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10s29.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="d0e7304"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="d0e7304"></a>Using Verifier in Ant</h2></div></div><p>
When deploying the Enterprise JavaBeans, JBoss attempts to verify
each bean against the specification to make sure the
<span class="emphasis"><i>Bean Developer</i></span> has fulfilled her contract to
implement all the required interfaces. The verifier goes through both
session and entity beans making sure the method descriptors do not
violate the specification, RMI/IIOP requirements are met, the relevant
parts of the deployment descriptor are correct, and so forth.
</p><p>
It is also possible to use the verifier as part of your build process.
Using Ant to build your project enables you to verify your Enterprise
JavaBeans as you compile them. This removes the extra step of deploying
just to verify your <span class="emphasis"><i>ejb-jar</i></span> file is compliant and
deploys correctly in the container. In case of spec violations, you can
optionally stop the build process and rework your files to meet the
specification requirements. This Howto explains the setup you need to
verify your beans early rather than late.
</p><div class="section"><a name="d0e7317"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7317"></a>Getting the required files</h3></div></div><p>
To use the verifier in Ant you will need two jars copied from the
JBoss distribution to your build directory:
<tt>verifier.jar</tt> and <tt>metadata.jar</tt>.
You will find the <tt>verifier.jar</tt> file in the
<tt>/dist/bin</tt> directory of your JBoss installation,
and the <tt>metadata.jar</tt> in the
<tt>/dist/external</tt> directory.
</p><p>
If you are using the CVS version of JBoss, you can build both of the
above mentioned files by executing
</p><p>
<tt>src/build></tt> <b>build verifier</b>
</p><p>
in the <tt>/src/build</tt> directory. This will generate
the required packages to the correct directories.
</p></div><div class="section"><a name="d0e7355"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7355"></a>Edit build.xml</h3></div></div><p>
A custom verifier task for Ant does not exist at the moment but you can
execute the verifier from Ant by creating a new JVM for it using Ant's
built in <tt><java></tt> task. For the most up to date
information of using the <tt><java></tt> tag, see
<a href="javascript:if(confirm('http://jakarta.apache.org/ant/manual/CoreTasks/java.html \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address. \n\nDo you want to open it from the server?'))window.location='http://jakarta.apache.org/ant/manual/CoreTasks/java.html'" tppabs="http://jakarta.apache.org/ant/manual/CoreTasks/java.html" target="_top">
Ant online documentation</a>.
</p><p>
Below is an example of using the <tt><java></tt> tag to
execute the verifier:
<pre class="programlisting">
<!-- verify the EJBs -->
<java classname = "org.jboss.verifier.Main" fork="true">
<classpath refid = "classpath"/>
<arg value = "${dist.home}/admin.jar"/>
</java>
</pre>
</p><p> To be continued... </p></div><div class="section"><a name="d0e7379"></a><div class="titlepage"><div><h3 class="title"><a name="d0e7379"></a>Troubleshooting</h3></div></div><p> How to deal with the most common verifier warnings </p></div></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></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="ch10.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch10s14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10s14.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch10s29.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch10s29.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></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -