For those interested and following this thread (D Jencks had a similar NPE), both these issues are now resolved.
We can now have a ejb-jar.xml free deployment and openejb-jar.xml free deployment. Cheers Prasad On 1/23/07, Prasad Kashyap <[EMAIL PROTECTED]> wrote:
On 1/22/07, David Blevins <[EMAIL PROTECTED]> wrote: > Ok. All of these issues should be fixed. I did a complete clean Geronimo (& OpenEJB) build. I am still having issues here - 1) http://issues.apache.org/jira/browse/GERONIMO-2770. An ejb-module with a missing ejb-jar.xml will not be recognized and deployed. 2) http://issues.apache.org/jira/browse/OPENEJB-452 An ejb-module with a missing openejb-jar.xml will throw an NPE 11:40:53, 611 WARN [OPENEJB] Auto-deploying ejb Calculator: EjbDeployment (deployment-id=Calculator, container-id=Default Stateless Container) 11:40:58, 068 ERROR [Deployer] Deployment failed due to java.lang.NullPointerException at org.apache.geronimo.openejb.deployment.EjbDeploymentBuilder.initContext(EjbD eploymentBuilder.java:107) at org.apache.geronimo.openejb.deployment.EjbModuleBuilder.initContext(EjbModul eBuilder.java:381) Since the NPE position has now changed, I believe I have the latest code in the server. Cheers Prasad > > -David > > On Jan 22, 2007, at 4:46 PM, David Blevins wrote: > > > > > On Jan 21, 2007, at 1:03 PM, Prasad Kashyap wrote: > >> I was able to deploy the app successfully but only after using an > >> openejb-jar.xml. > >> > >> Dain & Blevins, > >> On the irc discussion on Sat, 01/20, we thought that an > >> openejb-jar.xml is not mandatory. I debugged the builder and realized > >> the contrary. > >> > >> In the EJBModuleBuilder.java, it doesn't check to see if the > >> openejb-jar.xml is null or not. > >> String openejbJarXml = XmlUtil.loadOpenejbJarXml(object, moduleFile); > >> OpenejbJar openejbJar = XmlUtil.unmarshal(OpenejbJar.class, > >> openejbJarXml); > >> > >> http://svn.apache.org/viewvc/geronimo/server/trunk/modules/ > >> geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/ > >> deployment/EjbModuleBuilder.java?view=log > > > > On Jan 22, 2007, at 8:56 AM, Prasad Kashyap wrote: > >> Jarek, > >> > >> I had the same error. > >> > >> Try something like the following in your openejb-jar.xml > >> > >> <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1"> > >> <ejb-deployment ejb-name="Calculator" > >> deployment-id="samples/calculator/stateless/ > >> CalculatorLocal" > >> container-id="Default Stateless Container"/> > >> </openejb-jar> > > > > First, a very big thank you to Prasad for really digging in this > > weekend helping to find things that needed to be fixed. All > > because if his input I was able to find what I think are the the > > last remaining gotchas in the EJB deployment system. I've tried to > > file jiras for everything, so here goes: > > > > The first issue he discovered is with deploying an ejb app with no > > ejb-jar.xml. Geronimo needs that file to determine it's an ejb app, > > so at least an empty one is required to make deployment work. > > Here's the jira for that: > > http://issues.apache.org/jira/browse/GERONIMO-2770 > > > > So to fix that I need to see if there are any annotated beans in > > the jar, which will be hard to do as there is no classloader > > available in the 'createModule' section of the Geronimo deployment > > system. I racked my brain for a bit and think with a little work > > to my xbean-finder ClassFinder I can do the required sniffing with > > no classloader as it's all ASM-based. I just need to add a couple > > methods to report that data. I've filed a jira for that as well: > > http://issues.apache.org/jira/browse/XBEAN-70 > > > > The second issue that Prasad found is that you have to had to have > > an openejb-jar element in your geronimo-openejb.xml or the > > EjbModuleBuilder will fail with a null pointer. This is the issue > > he posted above. Dain as already fixed that issue and now you can > > have an empty openejb-jar element in your geronimo-openejb.xml. > > > > But I was still surprised about one thing (issue number three). > > Even having an empty openejb-jar, which is something he tried, > > *should* work. So I dug a bit more in the code on the openejb side > > and found that the logic goes "if you have an openejb-jar, use it. > > If you don't have one, create it automatically." I.e. so adding > > the empty openejb-jar element effectively shut off the auto deploy > > functionality. We do have the code that can augment an existing > > openejb-jar and add missing definitions automatically, so I've > > created an issue for that one as well. > > http://issues.apache.org/jira/browse/OPENEJB-452 > > > > Hope to get these fixed in a couple hours. Big thank you to Prasad > > for playing detective and finding *all* of these issues. Rather > > than stopping at the first one, he kept going all the way to the > > end and did what it took to get something working. Very > > appreciated and very big time saver for me at least as I spent the > > weekend working on the conversion tool and wouldn't have been able > > to do that without all his work on this. > > > > Nice Job, Prasad! > > > > -David > > > > > > > > > > > > > > > >