blob: 0f8e25f9fbd4f1b58aa3f604b97a8d9d436740f9 [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 - Annoyances</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">
<SCRIPT language="JavaScript" src="http://cwiki.apache.org/confluence/pages/viewpage.action?spaceKey=OPENEJB&title=functions.js" type="text/javascript"></SCRIPT>
<META http-equiv="Content-Type" content="text/html;charset=UTF-8">
</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" 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="mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI>
<LI><A href="source-code.html" title="Source Code">Source Code</A></LI>
</UL>
<H3><A name="Navigation-General"></A>General</H3>
<UL class="alternate" type="square">
<LI><A href="../OPENEJBx30/deploy-tool.html" title="Deploy Tool">Deployment</A></LI>
<LI><A href="../OPENEJBx30/startup.html" title="Startup">Startup</A></LI>
</UL>
<H3><A name="Navigation-Configuration"></A>Configuration</H3>
<UL class="alternate" type="square">
<LI><A href="configuration.html" title="Configuration">General</A></LI>
<LI><A href="../OPENEJBx30/deployments.html" title="Deployments">Deployments</A></LI>
<LI><A href="containers.html" title="Containers">Containers</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="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="" title="Annoyances">Annoyances</A></LI>
<LI><A href="irc://irc.freenode.net/#openejb" 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/" rel="nofollow">ActiveMQ</A></LI>
<LI><A href="http://openjpa.apache.org/" rel="nofollow">OpenJPA</A></LI>
<LI><A href="http://cxf.apache.org/" 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.apache.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 -->
Annoyances
</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">
<P>That's right, let us know what annoys you when using OpenEJB. Big or small, doesn't matter, let us know and let other users know. You can help other OpenEJB users get around annoying things you've faced and help us find ways to keep improving OpenEJB.</P>
<P>Most people assume that many of the annoying things they face when using open source software are their fault or intentionally hard. Not true. We do the best we can with the feedback we get just like you. Let us know, let others know and we can make things better&#33;</P>
<P>Click the <A href="http://docs.codehaus.org/pages/editpage.action?spaceKey=OPENEJB&title=Annoyances" rel="nofollow">Edit</A> link in the upper right and let it rip.</P>
<P>If this takes off, we will create a JIRA category for this so people can vote for the ones that annoy them the most.</P>
<H1><A name="Annoyances-Youcallthatafeature%3F"></A>You call that a feature?</H1>
<UL class="alternate" type="square">
<LI><B>CMP Config</B> The fact that I have to muck with so many xml files to configure a CMP Container is completely annoying. What's with the Local and Global transaction database.xml files&#33; Why can't I just have a mapping file and that's it&#33;</LI>
</UL>
<UL class="alternate" type="square">
<LI><B>openejb-jar.xml</B> I hate having to fill in all the CMP finder OQL evertime I redeploy my beans. Why can't you just update the existing openejb-jar.xml</LI>
</UL>
<H1><A name="Annoyances-Whatastrangeerror..."></A>What a strange error...</H1>
<P>Ever encounter an error that was less than clear? Let us know.</P>
<H1><A name="Annoyances-Tookmeforevertofindthisanswer..."></A>Took me forever to find this answer...</H1>
<P>Ever spend forever searching the archives for answer? Save people some time and put it here. Put a link, put the whole answer, anything.</P>
<P><B>If you have EJBs that extend from a base class that is in your classpath, you may get the &quot;mislocated class&quot; error incorrectly.</B>&nbsp;</P>
<P>Suppose we have a base class</P>
<P><EM>public abstract class AbstractSessionBase implements SessionBean</EM></P>
<P>and all our stateless session EJBs extend this class.&nbsp; For example,</P>
<P><EM>public class LookupBean extends AbstractSessionBase</EM></P>
<P>We build AbstractSessionBase into base-classes.jar in our classpath, and LookupBean into its own EJB jar, lookup-ejb.jar.&nbsp; When we attempt to validate or deploy the EJB using the command line:&nbsp;</P>
<P><EM>java &#45;classpath lib/base-classes.jar &#45;jar %OPENEJB_HOME%/lib/openejb-core-1.0.jar validate lookup-ejb.jar</EM></P>
<P>We get:</P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp; [java] java.lang.NoClassDefFoundError: com/xyz/system/AbstractSessionBase</EM><BR>
<EM>&nbsp;&nbsp;&nbsp;</EM><BR>
<EM>&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp; ERROR ... Cannot validate jar</EM></P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; com/xyz/system/AbstractSessionBase</EM></P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp; FAIL ... LookupBean: Misslocated class</EM></P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp; [java]&nbsp;&nbsp;&nbsp;&nbsp; The class com.xyz.business.LookupBean was found in a parent classloader and was loaded from there rather than this jar.&nbsp; However, a dependent class com/xyz/system/AbstractSessionBase was not found in the parent classloader.</EM></P>
<P>&nbsp;This is message is misleading; there is a classloading problem, but it's not what is described in the message.&nbsp;<BR>
&nbsp;<BR>
&nbsp;The real issue is that, when we use the &#45;jar parameter on the java command line, the executable jar gets its own classloader, which is separate from the one that loads the &#45;classpath.&nbsp; So OpenEJB can't find the AbstractSessionBase class from its classloader, and gives the NoClassDefFoundError.<BR>
&nbsp;<BR>
&nbsp;The solution is to run the OpenEJB command with the OpenEJB jar in the classpath, and the class name on the command line,&nbsp;like this:<BR>
&nbsp;<BR>
&nbsp; <EM>java &#45;classpath lib/base-classes.jar;%OPENEJB_HOME%/lib/openejb-core-1.0.jar org.openejb.cli.Main validate lookup-ejb.jar</EM><BR>
&nbsp;<BR>
&nbsp;This way, the OpenEJB classes share the same classloader with our base class, and all is well.<BR>
&nbsp;</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) - <A href="http://openejb.apache.org/privacy-policy.html">Website Privacy Policy</A> -
</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="http://cwiki.apache.org/confluence/pages/editpage.action?spaceKey=OPENEJB&title=Annoyances">[ 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>
</SPAN>
<SCRIPT type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</SCRIPT>
<SCRIPT type="text/javascript">
var pageTracker = _gat._getTracker("UA-2717626-1");
pageTracker._initData();
pageTracker._trackPageview();
</SCRIPT>
</BODY>
</HTML>