You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Aleksandr Ivanov <al...@gmail.com> on 2010/07/06 17:50:24 UTC

Include / Exclude problem

Hello list,

I'm using openejb  (build: 20100626-11:59) to unit test one project.
It was all going smooth and fine before we decided to split the ejb
code into 2 separate jars (persistence.jar and controller.jar).
For testing controller.jar ejbs we have to remove persistence.jar from
classpath completely. I was following the quide
(http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html),
but seems that I'm missing some obvious thing.

I provide the startup properties to the InitialContext, the relevant
properties are:
    p.put("openejb.deployments.classpath.exclude", ".*persistence*.");
    p.put("openejb.deployments.classpath.include", ".*controller*.");
    p.put("openejb.deployments.classpath.filter.descriptors", "true");

Here is the log output:

WARN - ADJUST THE EXCLUDE/INCLUDE!!!.  Current settings:
openejb.deployments.classpath.exclude='.*persistence*.',
openejb.deployments.classpath.include='.*controller*.'
INFO - Found EjbModule in classpath:
[...]\persistence\persistence\1.0-SNAPSHOT\persistence-1.0-SNAPSHOT.jar
INFO - Found EjbModule in classpath: [...]\controller\target\classes
INFO - Found EjbModule in classpath: [...]\controller\target\test-classes
INFO - Found EjbModule in classpath: [...]\controller-common-ejb\target\classes
WARN - Searched 76 classpath urls in 6118 milliseconds.  Average 80
milliseconds per url.
WARN - Consider adjusting your openejb.deployments.classpath.exclude
and openejb.deployments.classpath.include settings.  Current settings:
exclude='.*persistence*.', include='.*controller*.'
INFO - Beginning load:
[...]\persistence\persistence\1.0-SNAPSHOT\persistence-1.0-SNAPSHOT.jar
INFO - Beginning load: [...]\controller\target\classes
INFO - Beginning load: [...]\controller\target\test-classes
INFO - Beginning load: [...]\controller-common-ejb\target\classes



As visible from the logs, the persistence project is still loading.

Any ideas how to overcome this?


Thank you in advance,



-- 
Aleksandr Ivanov

Re: Include / Exclude problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
No problem, and again apologize for the delay.

Jean-Louis


Aleksandr Ivanov wrote:
> 
> :)
> 
> You saved my day.
> yes, there was a bug in the regexp, now it's excluding the persistence
> flawlessly.
> 
> 
> Thanks for the help,
> 
> 
> 
> 
> -- 
> Aleksandr Ivanov
> 
> 
> 2010/7/12 Jean-Louis MONTEIRO <je...@atosorigin.com>:
>>
>>
>> Aleksandr Ivanov wrote:
>>>
>>>>>     p.put("openejb.deployments.classpath.exclude", ".*persistence*.");
>>>>>     p.put("openejb.deployments.classpath.include", ".*controller*.");
>>>>>     p.put("openejb.deployments.classpath.filter.descriptors", "true");
>>>
>>
>> Sorry if the question seems stupid, but did you test with those regexp?
>> Cause in my opinion, it should not match what you want it to match.
>>
>> IMHO, you should put the dot before the star at the end.
>>
>> Can you give it a try?
>>
>> Thanks in advance.
>> Jean-Louis
>>
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Include-Exclude-problem-tp2279769p2286603.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
> 
> 

-- 
View this message in context: http://openejb.979440.n4.nabble.com/Include-Exclude-problem-tp2279769p2287046.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Include / Exclude problem

Posted by Aleksandr Ivanov <al...@gmail.com>.
:)

You saved my day.
yes, there was a bug in the regexp, now it's excluding the persistence
flawlessly.


Thanks for the help,




-- 
Aleksandr Ivanov


2010/7/12 Jean-Louis MONTEIRO <je...@atosorigin.com>:
>
>
> Aleksandr Ivanov wrote:
>>
>>>>     p.put("openejb.deployments.classpath.exclude", ".*persistence*.");
>>>>     p.put("openejb.deployments.classpath.include", ".*controller*.");
>>>>     p.put("openejb.deployments.classpath.filter.descriptors", "true");
>>
>
> Sorry if the question seems stupid, but did you test with those regexp?
> Cause in my opinion, it should not match what you want it to match.
>
> IMHO, you should put the dot before the star at the end.
>
> Can you give it a try?
>
> Thanks in advance.
> Jean-Louis
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Include-Exclude-problem-tp2279769p2286603.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Include / Exclude problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.

Aleksandr Ivanov wrote:
> 
>>>     p.put("openejb.deployments.classpath.exclude", ".*persistence*.");
>>>     p.put("openejb.deployments.classpath.include", ".*controller*.");
>>>     p.put("openejb.deployments.classpath.filter.descriptors", "true");
> 

Sorry if the question seems stupid, but did you test with those regexp?
Cause in my opinion, it should not match what you want it to match.

IMHO, you should put the dot before the star at the end.

Can you give it a try?

Thanks in advance.
Jean-Louis

-- 
View this message in context: http://openejb.979440.n4.nabble.com/Include-Exclude-problem-tp2279769p2286603.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Include / Exclude problem

Posted by Aleksandr Ivanov <al...@gmail.com>.
Hello Jean-Louis,

Nope, I wasn't able to solve that.

It either includes everything in the classpath or excludes everything.
The behavior is identical for running the unit test in eclipse and
using maven test. So this is not an IDE related bug.

Can you spread some light on it?

Best,



-- 
Aleksandr Ivanov

2010/7/12 Jean-Louis MONTEIRO <je...@atosorigin.com>:
>
> Hi Aleksandr,
>
> Apologize for the late answer.
> Did you solve your issue.
>
> Jean-Louis
>
>
>
>
> Aleksandr Ivanov wrote:
>>
>> Hello list,
>>
>> I'm using openejb  (build: 20100626-11:59) to unit test one project.
>> It was all going smooth and fine before we decided to split the ejb
>> code into 2 separate jars (persistence.jar and controller.jar).
>> For testing controller.jar ejbs we have to remove persistence.jar from
>> classpath completely. I was following the quide
>> (http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html),
>> but seems that I'm missing some obvious thing.
>>
>> I provide the startup properties to the InitialContext, the relevant
>> properties are:
>>     p.put("openejb.deployments.classpath.exclude", ".*persistence*.");
>>     p.put("openejb.deployments.classpath.include", ".*controller*.");
>>     p.put("openejb.deployments.classpath.filter.descriptors", "true");
>>
>> Here is the log output:
>>
>> WARN - ADJUST THE EXCLUDE/INCLUDE!!!.  Current settings:
>> openejb.deployments.classpath.exclude='.*persistence*.',
>> openejb.deployments.classpath.include='.*controller*.'
>> INFO - Found EjbModule in classpath:
>> [...]\persistence\persistence\1.0-SNAPSHOT\persistence-1.0-SNAPSHOT.jar
>> INFO - Found EjbModule in classpath: [...]\controller\target\classes
>> INFO - Found EjbModule in classpath: [...]\controller\target\test-classes
>> INFO - Found EjbModule in classpath:
>> [...]\controller-common-ejb\target\classes
>> WARN - Searched 76 classpath urls in 6118 milliseconds.  Average 80
>> milliseconds per url.
>> WARN - Consider adjusting your openejb.deployments.classpath.exclude
>> and openejb.deployments.classpath.include settings.  Current settings:
>> exclude='.*persistence*.', include='.*controller*.'
>> INFO - Beginning load:
>> [...]\persistence\persistence\1.0-SNAPSHOT\persistence-1.0-SNAPSHOT.jar
>> INFO - Beginning load: [...]\controller\target\classes
>> INFO - Beginning load: [...]\controller\target\test-classes
>> INFO - Beginning load: [...]\controller-common-ejb\target\classes
>>
>>
>>
>> As visible from the logs, the persistence project is still loading.
>>
>> Any ideas how to overcome this?
>>
>>
>> Thank you in advance,
>>
>>
>>
>> --
>> Aleksandr Ivanov
>>
>>
>
> --
> View this message in context: http://openejb.979440.n4.nabble.com/Include-Exclude-problem-tp2279769p2286564.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Include / Exclude problem

Posted by Jean-Louis MONTEIRO <je...@atosorigin.com>.
Hi Aleksandr,

Apologize for the late answer.
Did you solve your issue.

Jean-Louis




Aleksandr Ivanov wrote:
> 
> Hello list,
> 
> I'm using openejb  (build: 20100626-11:59) to unit test one project.
> It was all going smooth and fine before we decided to split the ejb
> code into 2 separate jars (persistence.jar and controller.jar).
> For testing controller.jar ejbs we have to remove persistence.jar from
> classpath completely. I was following the quide
> (http://openejb.apache.org/3.0/application-discovery-via-the-classpath.html),
> but seems that I'm missing some obvious thing.
> 
> I provide the startup properties to the InitialContext, the relevant
> properties are:
>     p.put("openejb.deployments.classpath.exclude", ".*persistence*.");
>     p.put("openejb.deployments.classpath.include", ".*controller*.");
>     p.put("openejb.deployments.classpath.filter.descriptors", "true");
> 
> Here is the log output:
> 
> WARN - ADJUST THE EXCLUDE/INCLUDE!!!.  Current settings:
> openejb.deployments.classpath.exclude='.*persistence*.',
> openejb.deployments.classpath.include='.*controller*.'
> INFO - Found EjbModule in classpath:
> [...]\persistence\persistence\1.0-SNAPSHOT\persistence-1.0-SNAPSHOT.jar
> INFO - Found EjbModule in classpath: [...]\controller\target\classes
> INFO - Found EjbModule in classpath: [...]\controller\target\test-classes
> INFO - Found EjbModule in classpath:
> [...]\controller-common-ejb\target\classes
> WARN - Searched 76 classpath urls in 6118 milliseconds.  Average 80
> milliseconds per url.
> WARN - Consider adjusting your openejb.deployments.classpath.exclude
> and openejb.deployments.classpath.include settings.  Current settings:
> exclude='.*persistence*.', include='.*controller*.'
> INFO - Beginning load:
> [...]\persistence\persistence\1.0-SNAPSHOT\persistence-1.0-SNAPSHOT.jar
> INFO - Beginning load: [...]\controller\target\classes
> INFO - Beginning load: [...]\controller\target\test-classes
> INFO - Beginning load: [...]\controller-common-ejb\target\classes
> 
> 
> 
> As visible from the logs, the persistence project is still loading.
> 
> Any ideas how to overcome this?
> 
> 
> Thank you in advance,
> 
> 
> 
> -- 
> Aleksandr Ivanov
> 
> 

-- 
View this message in context: http://openejb.979440.n4.nabble.com/Include-Exclude-problem-tp2279769p2286564.html
Sent from the OpenEJB User mailing list archive at Nabble.com.