On Dec 5, 2006, at 4:43 PM, David Blevins wrote:


On Dec 5, 2006, at 11:17 AM, David Blevins wrote:

On Dec 5, 2006, at 6:43 AM, Filippo Diotalevi wrote:

Hi,
 I've written two examples of a simplified stateless and stateful
bean to be (hopefully) included in the /examples folder of openejb. To
make them work I had to apply some fixes to openejb...
all the fixes and the two samples are included in the patch attached
to the issue:
https://issues.apache.org/jira/browse/OPENEJB-398

As I explained in the issue, two problems still remain:
1) you still need to have an ejb-jar.xml file (empty, but you need it)
2) the names of the deployed EJBs in the jndi registry are probably
not compliant with the specification. However, trying to fix the names causes dozen of failures in several test cases, so I had to keep them

Nonetheless, now the samples work.

Great! I'll take a look. I swear the deploy with no ejb-jar.xml works, not sure what's going on there....

So what it's looking like is that when the beans are in the beans/ directory, we can pick them up just fine without an ejb-jar.xml. But the functionality that adds deployments available in the classpath is still using the presence of an ejb-jar.xml to come up with the initial list of URLs to consider for addition to the deployments list.

Fixing....

Wow. That was rough :) Searching the classpath is a lot harder when you don't have a specific file you can go after (like ejb-jar.xml). When parsing class definitions looking for class definitions it's a lot easier to bite off more than you can chew.

I've implemented something that will be fine provided you specify an openejb.deployments.classpath.include. The openejb.deployments.classpath=true property is no longer required.

Here are the properties with their new defaults:

  openejb.deployments.classpath=true
  openejb.deployments.classpath.exclude=.*
  openejb.deployments.classpath.include=<empty string>

So essentially looking in the classpath is always on by default (but can be explicitly shut off), but also by default nothing is included in the classpath. You have to either change the exclude or the include to get jars added to the list of classpath entries we should scrape for annotated beans.

We should recommended most people stick with openejb.deployments.classpath.include and don't change the openejb.deployments.classpath.exclude unless they really need to.

If people specify an exclude/include setting that results in too many jars or takes too long to process, we will start logging 'warnings' and eventually 'fatals' with info on what they should adjust. Similarly if you do change openejb.deployments.classpath.include and nothing matches your search pattern, we will also log a warning.

A very very big thanks to you, Filippo, for the excellent patch and examples! They were just what we needed to get these features locked into place!

And congratulations on your first patch!

-David

Reply via email to