blob: f5a0c09770b37f72cf92b633941a28fccaf91ed2 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<!-- $PAGETITLE -->
<TITLE>OpenEJB - Validation Tool</TITLE>
<LINK href="http://openejb.apache.org/all.css" rel="stylesheet" type="text/css">
<!--[if IE]><link rel="stylesheet" type="text/css" media="screen, projection" href="openejb.apache.org/ie.css"><![endif]-->
<LINK rel="SHORTCUT ICON" href="http://openejb.apache.org/images/favicon.ico">
<META http-equiv="Content-Type" content="text/html;charset=UTF-8">
<SCRIPT language="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" type="text/javascript"></SCRIPT>
<SCRIPT language="javascript" src="http://openejb.apache.org/tweet/jquery.tweet.js" type="text/javascript"></SCRIPT>
<SCRIPT type="text/javascript">
$(document).ready(function(){
$(".tweet").tweet({
avatar_size: 32,
count: 4,
fetch:25,
username: "openejb",
list: "contributors",
template:"{avatar}{text}",
filter: function(t){ return /openejb/i.test(t["tweet_raw_text"]); },
loading_text: "loading list..."
});
});
</SCRIPT>
</HEAD>
<BODY>
<!-- Delay the loading of the external javascript file needed for labels (as it takes too long to load and visibly holds loading of the page body) -->
<!-- To do this without javascript errors over undefined functions, we need to declare stubs here (that are overrided later by the proper implementations) -->
<SCRIPT language="JavaScript" type="text/javascript">
function doAddLabel(hideTextfieldAfterAddParam)
{
// stub
}
function onAddLabel()
{
// stub
}
function showLabelsInput()
{
// stub
}
</SCRIPT>
<A name="top"></A>
<TABLE class="frameTable" cellpadding="0" cellspacing="0" border="0">
<TR class="Row1">
<TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col2"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col3"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
</TR>
<TR class="Row2">
<TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col2">&nbsp;</TD>
<TD class="Col3" id="breadcrumbs">
<!-- $TOP_NAV_BAR -->
<A href="index.html" title="Index">Home</A> | <A href="news.html" title="News">News</A> | <A href="faq.html" title="FAQ">FAQ</A> | <A href="download.html" title="Download">Download</A> | <A href="mailing-lists.html" title="Mailing Lists">Lists</A> | <A href="http://issues.apache.org/jira/browse/OPENEJB" class="external-link" rel="nofollow">Issues</A>
</TD>
<TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5">&nbsp;</TD>
</TR>
<TR class="Row3">
<TD class="Col1"><IMG alt="" class="Row3Img" id="thinLine" src="http://openejb.apache.org/images/line_sm.gif"></TD>
<TD class="Col2"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col3"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
</TR>
<TR class="Row4">
<TD class="Col1">
<SPAN id="Navigation">
<H3><A name="Navigation-Overview"></A>Overview</H3>
<UL class="alternate" type="square">
<LI><A href="index.html" title="Index">Home</A></LI>
<LI><A href="news.html" title="News">News</A></LI>
<LI><A href="faq.html" title="FAQ">FAQ</A></LI>
<LI><A href="download.html" title="Download">Download</A></LI>
<LI><A href="../OPENEJBx30/index.html" title="Index">Documentation</A></LI>
<LI><A href="examples.html" title="Examples">Examples</A></LI>
<LI><A href="http://cwiki.apache.org/confluence/display/OPENEJB/Lightening%20Demos" class="external-link" rel="nofollow">Lightning Demos</A></LI>
<LI><A href="mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI>
<LI><A href="source-code.html" title="Source Code">Source Code</A></LI>
<LI><A href="http://blogs.apache.org/openejb" class="external-link" rel="nofollow">Project Blog</A></LI>
</UL>
<H3><A name="Navigation-Servers"></A>Servers</H3>
<UL class="alternate" type="square">
<LI><A href="local-server.html" title="Local Server">Local</A></LI>
<LI><A href="remote-server.html" title="Remote Server">Remote</A></LI>
</UL>
<H3><A name="Navigation-Integrations"></A>Integrations</H3>
<UL class="alternate" type="square">
<LI><A href="../OPENEJBx30/tomcat.html" title="Tomcat">Tomcat</A></LI>
<LI><A href="geronimo.html" title="Geronimo">Geronimo</A></LI>
<LI><A href="webobjects.html" title="WebObjects">WebObjects</A></LI>
</UL>
<H3><A name="Navigation-Community"></A>Community</H3>
<UL class="alternate" type="square">
<LI><A href="team.html" title="Team">Team</A></LI>
<LI><A href="articles.html" title="Articles">Articles</A></LI>
<LI><A href="http://webchat.freenode.net/?channels=openejb" class="external-link" rel="nofollow">IRC</A></LI>
</UL>
<H3><A name="Navigation-RelatedProjects"></A>Related Projects</H3>
<UL class="alternate" type="square">
<LI><A href="http://activemq.apache.org/" class="external-link" rel="nofollow">ActiveMQ</A></LI>
<LI><A href="http://openjpa.apache.org/" class="external-link" rel="nofollow">OpenJPA</A></LI>
<LI><A href="http://cxf.apache.org/" class="external-link" rel="nofollow">CXF</A></LI>
</UL>
<H3><A name="Navigation-Index"></A>Index</H3>
<UL class="alternate" type="square">
<LI><A href="space-index.html" title="Space Index">Site Index</A></LI>
<LI><A href="../OPENEJBx30/space-index.html" title="Space Index">Doc Index</A></LI>
</UL>
<H3>
<A name="Navigation-Feeds"></A>
Feeds
</H3>
<UL class="feeds">
<LI>
<A href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false">
<IMG src="http://openejb.apache.org/images/rss.gif"></A>
<A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false">Site</A>
</LI>
<LI><A href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB">
<IMG src="http://openejb.apache.org/images/rss.gif"></A>
<A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB">News</A>
</LI>
</UL>
</SPAN>
</TD>
<TD class="Col2">&nbsp;</TD>
<TD class="Col3">
<TABLE id="PageHeader" border="0" width="100%">
<TR>
<TD>
<A href="http://openejb.org/">
<IMG hspace="0" src="http://openejb.apache.org/images/logo_openejb.gif" vspace="0">
</A>
</TD>
<TD align="right">
<A href="http://www.apache.org/">
<IMG src="http://www.apache.org/images/asf-logo.gif" width="258" height="66">
</A>
</TD>
</TR>
<TR>
<TD id="page_title">
<!-- $TITLE -->
Validation Tool
</TD>
<TD align="right">
<BR><BR>
<!-- Google CSE Search Box Begins -->
<FORM id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
<INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
<INPUT type="hidden" name="cof" value="FORID:0">
<INPUT name="q" type="text" size="25">
<INPUT type="submit" name="sa" value="Search">
</FORM>
<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>
<!-- Google CSE Search Box Ends -->
</TD>
</TR>
</TABLE>
<P>
<!-- $BODY -->
<DIV id="PageContent">
<H1><A name="ValidationTool-NAME"></A>NAME</H1>
<P>openejb validate - OpenEJB Validation Tool</P>
<H1><A name="ValidationTool-SYNOPSIS"></A>SYNOPSIS</H1>
<P>openejb validate <A href="https://cwiki.apache.org/confluence/pages/createpage.action?spaceKey=OPENEJB&title=options&linkCreation=true&fromPageId=26504" class="createlink">options</A> jarfiles</P>
<H1><A name="ValidationTool-NOTE"></A>NOTE</H1>
<P>The OpenEJB Validation tool must be executed from the OPENEJB_HOME directory. This is the directory where OpenEJB was installed or unpacked. For for the remainder of this document we will assume you unpacked OpenEJB into the directory C:\openejb.</P>
<P>In Windows, the validation tool can be executed as follows:</P>
<P><TT>C:\openejb&gt; openejb validate -help</TT></P>
<DIV class="panelMacro"><TABLE class="warningMacro"><COLGROUP><COL width="24"><COL></COLGROUP><TR><TD valign="top"><IMG src="https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></TD><TD>There is a bug in the openejb.bat script of OpenEJB 0.9.0 that doesn't allow you to execute the validate command as above. For that release, Windows users can execute the following command:<BR>
<TT>C:\openejb&gt; bin\validate.bat -help</TT></TD></TR></TABLE></DIV>
<P>In UNIX, Linux, or Mac OS X, the deploy tool can be executed as follows:</P>
<P><TT><SPAN class="error">&#91;user@host openejb&#93;</SPAN># ./openejb.sh validate -help</TT></P>
<P>Depending on your OpenEJB version, you may need to change execution bits to make the scripts executable. You can do this with the following command.</P>
<P><TT><SPAN class="error">&#91;user@host openejb&#93;</SPAN># chmod 755 openejb.sh bin/*.sh</TT></P>
<P>From here on out, it will be assumed that you know how to execute the right openejb script for your operating system and commands will appear in shorthand as show below.</P>
<P><TT>openejb validate -help</TT></P>
<H1><A name="ValidationTool-DESCRIPTION"></A>DESCRIPTION</H1>
<P>The validation tool currently checks for the following things:</P>
<UL>
<LI>Does the Jar have all the ejb-class class files</LI>
<LI>Does the Jar have all the home class files</LI>
<LI>Does the Jar have all the remote class files</LI>
<LI>Is the ejb-class a sub-interface of SessionBean or EntityBean</LI>
<LI>Is the home a sub-interface of EJBHome</LI>
<LI>Is the remote a sub-interface of EJBObject</LI>
<LI>Are all the methods in the remote interface implemented in the ejb-class</LI>
<LI>Are there create methods in the home interface</LI>
<LI>Are the create methods in the home interface implemented in the ejb-class</LI>
<LI>Are the required post create methods in the ejb-class of EntityBeans</LI>
<LI>Are there any create methods in the ejb-class, but not in the home interface</LI>
</UL>
<P>More checks will be added in the future.</P>
<H1><A name="ValidationTool-OPTIONS"></A>OPTIONS</H1>
<DIV class="table-wrap">
<TABLE class="confluenceTable"><TBODY>
<TR>
<TD class="confluenceTd">-v</TD>
<TD class="confluenceTd">Sets the output level to 1. This will output just the minumum details on each failure.</TD>
</TR>
<TR>
<TD class="confluenceTd">-vv</TD>
<TD class="confluenceTd">Default. Sets the output level to 2. Outputs one line summaries of each failure. This is the default output level.</TD>
</TR>
<TR>
<TD class="confluenceTd">-vvv</TD>
<TD class="confluenceTd">Sets the output level to 3. Outputs verbose details on each failure, usually with details on how to correct the failures.</TD>
</TR>
<TR>
<TD class="confluenceTd">-xml</TD>
<TD class="confluenceTd">Outputs information in well-formed XML.</TD>
</TR>
<TR>
<TD class="confluenceTd">-nowarn</TD>
<TD class="confluenceTd">Suppresses warnings.</TD>
</TR>
<TR>
<TD class="confluenceTd">-version</TD>
<TD class="confluenceTd">Print the version.</TD>
</TR>
<TR>
<TD class="confluenceTd">-help</TD>
<TD class="confluenceTd">Print this help message.</TD>
</TR>
<TR>
<TD class="confluenceTd">-examples</TD>
<TD class="confluenceTd">Show examples of how to use the options.</TD>
</TR>
</TBODY></TABLE>
</DIV>
<H1><A name="ValidationTool-COMMONISSUES"></A>COMMON ISSUES</H1>
<H2><A name="ValidationTool-MisslocatedclassorNoClassDefFoundError"></A>Misslocated class or NoClassDefFoundError</H2>
<P>The short explanation is that the parent doesn't have all the classes it needs as some of them are only in the child classloader, where the parent can't see them.</P>
<P>This would occur, for example, if a class was loaded by the parent classloader, but that class' superclass wasn't visible to the parent classloader, perhaps because it is only in the child classloader.</P>
<P>Here is a more concrete example:</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeContent panelContent">
<PRE class="code-java"><SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> Person <SPAN class="code-keyword">extends</SPAN> EJBObject {
}
<SPAN class="code-keyword">public</SPAN> <SPAN class="code-keyword">interface</SPAN> Employee <SPAN class="code-keyword">extends</SPAN> Person {
}
</PRE>
</DIV></DIV>
<P>Ok, so when we build our ejb jar, we put both the Person and Employee interfaces in the jar, so everything should be good (so we think). But now let's say that for some reason the Employee interface is also in another jar and that jar was loaded into the system classpath.</P>
<P>When a new classloader is create for my ejb-jar at runtime and the system attempts to load the Employee interface, the call goes right through that classloader and down to the system classloader. The Employee interface is found, because it was accidentally added to that extra jar in the system classpath. So now the system classloader goes looking for Employee's superinterface, Person, where it immediatly blows up and throws a NoClassDefFoundError: Person.</P>
<P>Most people will look at their ejb-jar and think, &quot;But all my classes are there!?&quot;, which is true. It really doesn't matter though, because one of those classes is also in the parent classloader. The first call to load that class will bypass your classloader completely and go to the parent. Once there, it is the parent's job to find <B>all</B> the dependent classes. If it can't ... NoClassDefFoundError.</P>
</DIV>
</P>
</TD>
<TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5">
</TD>
</TR>
<TR class="Row5">
<TD class="Col1">&nbsp;</TD>
<TD class="Col2">&nbsp;</TD>
<TD class="Col3">
<BR>
<BR>
<IMG width="100%" height="1" src="http://openejb.apache.org/images/line_light.gif">
<TABLE width="100%">
<TR>
<TD>
<SPAN class="bodyGrey">
<SMALL>
<NOTICE><!-- $FOOTER -->
Apache OpenEJB is an project of The Apache Software Foundation (ASF)
</NOTICE>
<BR>
Site Powered by
<A href="http://atlassian.com/">Atlassian</A>
<A href="http://atlassian.com/confluence/">Confluence</A>
.
</SMALL>
</SPAN>
</TD>
<TD align="right">
<A style="color:#999;font-size:small;font-weight:normal;" href="https://cwiki.apache.org/confluence/pages/editpage.action?spaceKey=OPENEJB&title=Validation%20Tool">[ edit ]</A>
</TD>
</TR>
</TABLE>
<BR>
</TD>
<TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5">&nbsp;</TD>
</TR>
</TABLE>
<!-- Needed for composition plugin -->
<!-- delay the loading of large javascript files to the end so that they don't interfere with the loading of page content -->
<SPAN style="display: none">
<SCRIPT type="text/javascript" language="JavaScript" src="http://cwiki.apache.org/confluence/labels-javascript"></SCRIPT>
<SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</SCRIPT>
<SCRIPT type="text/javascript">
_uacct = "UA-2717626-1";
urchinTracker();
</SCRIPT>
</SPAN>
</BODY>
</HTML>