You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Mansour Al Akeel <ma...@gmail.com> on 2014/11/21 06:20:11 UTC

Avoid scanning and auto deploy

I need to start EJB container in embedded mode to load JPA Entities
and create tables. The problem I am facing is that it loads any EJBs
in the classpath. I am trying to prevent loading and deploying these
EJBs by the following:

    properties.put("openejb.exclude-include.order", "include-exclude");
    properties.put("openejb.deployments.classpath.include", "");
    properties.put("openejb.deployments.classpath.exclude", ".*");
    properties.put("openejb.deployments.classpath ", false);



Still no luck. Is there a way to prevent auto deployment ??

Thank you.

Re: Avoid scanning and auto deploy

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

you can -Dopenejb.additional.exclude=myjar1,myjar2,....for instance


Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-11-21 6:20 GMT+01:00 Mansour Al Akeel <ma...@gmail.com>:
> I need to start EJB container in embedded mode to load JPA Entities
> and create tables. The problem I am facing is that it loads any EJBs
> in the classpath. I am trying to prevent loading and deploying these
> EJBs by the following:
>
>     properties.put("openejb.exclude-include.order", "include-exclude");
>     properties.put("openejb.deployments.classpath.include", "");
>     properties.put("openejb.deployments.classpath.exclude", ".*");
>     properties.put("openejb.deployments.classpath ", false);
>
>
>
> Still no luck. Is there a way to prevent auto deployment ??
>
> Thank you.

Re: Avoid scanning and auto deploy

Posted by Mansour Al Akeel <ma...@gmail.com>.
I tried both. Something weired is happening. Basically, I am writing a
maven plugin to load JPA entities and create tables. I am doing this
through OpenEJB in order to process persistence.xml identically to
when deployed.
I have added a test EJB class to the maven plugin jar, and I have some
EJBs in the current JPA project I am working on.
If I don't include/exclude anything, EJBs are loaded from anywhere
(the plugin and the current project). I do this:

     properties.put("openejb.exclude-include.order", "exclude-include");
     properties.put("openejb.deployments.classpath.include", "");
     properties.put("openejb.deployments.classpath.exclude", ".*");

Then Only EJBs in the current project are loaded. I tried all other
options like:

    properties.put("openejb.exclude-include.order", "exclude-include");
    properties.put("openejb.deployments.classpath.include", "");
    properties.put("openejb.deployments.classpath.exclude", ".*");
    properties.put("openejb.deployments.classpath ", false);
    properties.put("openejb.deployments.classpath.filter.descriptors", true);
    properties.put("openejb.additional.exclude", "classpath.ear");

But nothing did the trick. The reason I need to prevent auto-deploy
EJBs in the current project is performance, and to avoid compilation
issues while still developing the EJB.
It's not critical now, but I may hit a point where I need to find a solution.

Thank you.



On Fri, Nov 21, 2014 at 4:22 AM, Andy Gumbrecht
<ag...@tomitribe.com> wrote:
> Maybe try reversing the order,
>
> openejb.exclude-include.order=exclude-include
>
> And to exclude even when no descriptors are found,
>
> openejb.deployments.classpath.filter.descriptors=true
>
> But try one at a time, so if it works you know which one.
>
> Andy.
>
>
> On 21/11/2014 06:20, Mansour Al Akeel wrote:
>>
>> I need to start EJB container in embedded mode to load JPA Entities
>> and create tables. The problem I am facing is that it loads any EJBs
>> in the classpath. I am trying to prevent loading and deploying these
>> EJBs by the following:
>>
>>      properties.put("openejb.exclude-include.order", "include-exclude");
>>      properties.put("openejb.deployments.classpath.include", "");
>>      properties.put("openejb.deployments.classpath.exclude", ".*");
>>      properties.put("openejb.deployments.classpath ", false);
>>
>>
>>
>> Still no luck. Is there a way to prevent auto deployment ??
>>
>> Thank you.
>
>
> --
>   Andy Gumbrecht
>   https://twitter.com/AndyGeeDe
>   http://www.tomitribe.com
>

Re: Avoid scanning and auto deploy

Posted by Andy Gumbrecht <ag...@tomitribe.com>.
Maybe try reversing the order,

openejb.exclude-include.order=exclude-include

And to exclude even when no descriptors are found,

openejb.deployments.classpath.filter.descriptors=true

But try one at a time, so if it works you know which one.

Andy.

On 21/11/2014 06:20, Mansour Al Akeel wrote:
> I need to start EJB container in embedded mode to load JPA Entities
> and create tables. The problem I am facing is that it loads any EJBs
> in the classpath. I am trying to prevent loading and deploying these
> EJBs by the following:
>
>      properties.put("openejb.exclude-include.order", "include-exclude");
>      properties.put("openejb.deployments.classpath.include", "");
>      properties.put("openejb.deployments.classpath.exclude", ".*");
>      properties.put("openejb.deployments.classpath ", false);
>
>
>
> Still no luck. Is there a way to prevent auto deployment ??
>
> Thank you.

-- 
   Andy Gumbrecht
   https://twitter.com/AndyGeeDe
   http://www.tomitribe.com