You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Harald Wellmann <hw...@gmail.com> on 2012/10/10 19:41:07 UTC

Embedded Bean Deployment Archive does not work

I'm experimenting with TomEE 1.5.0 web profile, trying to run a deploy a 
simple sample WAR which works fine with GlassFish or JBoss.

sample.war contains a service.jar in WEB-INF/lib. service.jar contains 
some stateless EJBs and has a META-INF/beans.xml.

When deploying this WAR by copying it to the webapps folder, TomEE does 
not seem to find the EJBs from the service.jar (but it does find EJBs in 
WEB-INF/classes) and fails to @Inject these EJBs into request scoped CDI 
beans in sample.war.

Am I missing some configuration for this setup?

Best regards,
Harald

Re: Embedded Bean Deployment Archive does not work

Posted by Harald Wellmann <hw...@gmail.com>.
Am 12.10.2012 17:09, schrieb Romain Manni-Bucau:
> no issue at all in pax,
>
> we just dont scan it because we know we'll find nothing in it so no need to
> loose IO time scanning it (just a perf optim)
>
> BTW on trunk your sample should work out of the box

Yes, 1.5.1-SNAPSHOT works fine.

Thanks,
Harald


Re: Embedded Bean Deployment Archive does not work

Posted by Romain Manni-Bucau <rm...@gmail.com>.
no issue at all in pax,

we just dont scan it because we know we'll find nothing in it so no need to
loose IO time scanning it (just a perf optim)

BTW on trunk your sample should work out of the box

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/12 Harald Wellmann <hw...@gmail.com>

> I'm not aware of anything in Pax URL that might interfere with Java EE
> annotation scanning - what exactly is the problem you're trying to
> avoid?
>
> Once we know what it is, we can try removing it from Pax URL.
>
> Best regards,
> Harald
>
> 2012/10/12 Romain Manni-Bucau <rm...@gmail.com>:
> > hi,
> >
> > i updated it yesterday (restricted to pax-url)
> >
> > btw, it is common for such framework to allow to rename libs to sthg else
> > for such a reason
>

Re: Embedded Bean Deployment Archive does not work

Posted by Harald Wellmann <hw...@gmail.com>.
I'm not aware of anything in Pax URL that might interfere with Java EE
annotation scanning - what exactly is the problem you're trying to
avoid?

Once we know what it is, we can try removing it from Pax URL.

Best regards,
Harald

2012/10/12 Romain Manni-Bucau <rm...@gmail.com>:
> hi,
>
> i updated it yesterday (restricted to pax-url)
>
> btw, it is common for such framework to allow to rename libs to sthg else
> for such a reason

Re: Embedded Bean Deployment Archive does not work

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

i updated it yesterday (restricted to pax-url)

btw, it is common for such framework to allow to rename libs to sthg else
for such a reason

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/12 Harald Wellmann <hw...@gmail.com>

> 2012/10/12 Romain Manni-Bucau <rm...@gmail.com>:
> >
> > we excluded pax-* jar from scanning since we have some module using it
> but
> > with no mandatory scan
>
> That is going to bite us again... Which Pax modules are you using and
> why exactly do you need to exclude them from scanning? If this is
> really required, the exclude pattern should be as specific as
> possible.
>
> Pax Exam 3.x provides not only OSGi but also Java EE test containers
> (currently for GlassFish, JBoss AS and Resin). TomEE might be another
> candidate, if I can get it to work (I didn't get very far last time I
> tried with 1.0-beta).
>
> Best regards,
> Harald
>

Re: Embedded Bean Deployment Archive does not work

Posted by Harald Wellmann <hw...@gmail.com>.
2012/10/12 Romain Manni-Bucau <rm...@gmail.com>:
>
> we excluded pax-* jar from scanning since we have some module using it but
> with no mandatory scan

That is going to bite us again... Which Pax modules are you using and
why exactly do you need to exclude them from scanning? If this is
really required, the exclude pattern should be as specific as
possible.

Pax Exam 3.x provides not only OSGi but also Java EE test containers
(currently for GlassFish, JBoss AS and Resin). TomEE might be another
candidate, if I can get it to work (I didn't get very far last time I
tried with 1.0-beta).

Best regards,
Harald

Re: Embedded Bean Deployment Archive does not work

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

didnt get you were working on pax :)

well rename in web-inf/lib jar named pax* to foo-xxx.jar and it works :)

we excluded pax-* jar from scanning since we have some module using it but
with no mandatory scan

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/11 Harald Wellmann <hw...@gmail.com>

> The sample webapp is here:
>
> http://search.maven.org/**remotecontent?filepath=org/**
> ops4j/pax/exam/samples/pax-**exam-sample1-web/3.0.0.M4/pax-**
> exam-sample1-web-3.0.0.M4.war<http://search.maven.org/remotecontent?filepath=org/ops4j/pax/exam/samples/pax-exam-sample1-web/3.0.0.M4/pax-exam-sample1-web-3.0.0.M4.war>
>
> Sources:
>
> https://github.com/ops4j/org.**ops4j.pax.exam2/tree/exam3-**
> milestones/samples<https://github.com/ops4j/org.ops4j.pax.exam2/tree/exam3-milestones/samples>
>
> When you copy the Maven WAR to TomEE/webapps, the injection problem is at
> first hidden by an exception caused by an empty faces-config.xml (but this
> should be legal according to the JSF spec.)
>
> After adding some valid XML to the file, deployment fails with this
> exception:
>
> SEVERE: CDI Beans module deployment failed
> javax.enterprise.inject.**UnsatisfiedResolutionException**: Api type
> [org.ops4j.pax.exam.sample1.**service.LibraryService] is not found with
> the qualifiers
> Qualifiers: [@javax.enterprise.inject.**Default()]
> for injection into Field Injection Point, field name :  libraryService,
> Bean Owner : [LibraryBean, Name:library, WebBeans Type:MANAGED, API
> Types:[java.lang.Object,org.**ops4j.pax.exam.sample1.web.**LibraryBean],
> Qualifiers:[javax.enterprise.**inject.Any,javax.enterprise.**
> inject.Default,javax.inject.**Named]]
>         at org.apache.webbeans.util.**InjectionExceptionUtils.**
> throwUnsatisfiedResolutionExce**ption(InjectionExceptionUtils.**java:77)
>
> Best regards,
> Harald
>
>
> Am 11.10.2012 11:39, schrieb Romain Manni-Bucau:
>
>  Hi,
>>
>> This should work, maybe share your app if you can to let us reproduce it.
>>
>> - Romain
>> Le 11 oct. 2012 11:37, "Harald Wellmann" <hw...@gmail.com> a
>> écrit :
>>
>>  Yes, there is.
>>>
>>> 2012/10/10 Romain Manni-Bucau <rm...@gmail.com>:
>>>
>>>> Hi,
>>>>
>>>> is there a beans.xml in WEB-INF?
>>>>
>>>>
>>>
>>
>

Re: Embedded Bean Deployment Archive does not work

Posted by Harald Wellmann <hw...@gmail.com>.
The sample webapp is here:

http://search.maven.org/remotecontent?filepath=org/ops4j/pax/exam/samples/pax-exam-sample1-web/3.0.0.M4/pax-exam-sample1-web-3.0.0.M4.war

Sources:

https://github.com/ops4j/org.ops4j.pax.exam2/tree/exam3-milestones/samples

When you copy the Maven WAR to TomEE/webapps, the injection problem is 
at first hidden by an exception caused by an empty faces-config.xml (but 
this should be legal according to the JSF spec.)

After adding some valid XML to the file, deployment fails with this 
exception:

SEVERE: CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type 
[org.ops4j.pax.exam.sample1.service.LibraryService] is not found with 
the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name :  libraryService, 
Bean Owner : [LibraryBean, Name:library, WebBeans Type:MANAGED, API 
Types:[java.lang.Object,org.ops4j.pax.exam.sample1.web.LibraryBean], 
Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default,javax.inject.Named]]
	at 
org.apache.webbeans.util.InjectionExceptionUtils.throwUnsatisfiedResolutionException(InjectionExceptionUtils.java:77)

Best regards,
Harald


Am 11.10.2012 11:39, schrieb Romain Manni-Bucau:
> Hi,
>
> This should work, maybe share your app if you can to let us reproduce it.
>
> - Romain
> Le 11 oct. 2012 11:37, "Harald Wellmann" <hw...@gmail.com> a écrit :
>
>> Yes, there is.
>>
>> 2012/10/10 Romain Manni-Bucau <rm...@gmail.com>:
>>> Hi,
>>>
>>> is there a beans.xml in WEB-INF?
>>>
>>
>


Re: Embedded Bean Deployment Archive does not work

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

This should work, maybe share your app if you can to let us reproduce it.

- Romain
Le 11 oct. 2012 11:37, "Harald Wellmann" <hw...@gmail.com> a écrit :

> Yes, there is.
>
> 2012/10/10 Romain Manni-Bucau <rm...@gmail.com>:
> > Hi,
> >
> > is there a beans.xml in WEB-INF?
> >
>

Re: Embedded Bean Deployment Archive does not work

Posted by Harald Wellmann <hw...@gmail.com>.
Yes, there is.

2012/10/10 Romain Manni-Bucau <rm...@gmail.com>:
> Hi,
>
> is there a beans.xml in WEB-INF?
>

Re: Embedded Bean Deployment Archive does not work

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

is there a beans.xml in WEB-INF?

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*




2012/10/10 Harald Wellmann <hw...@gmail.com>

> I'm experimenting with TomEE 1.5.0 web profile, trying to run a deploy a
> simple sample WAR which works fine with GlassFish or JBoss.
>
> sample.war contains a service.jar in WEB-INF/lib. service.jar contains
> some stateless EJBs and has a META-INF/beans.xml.
>
> When deploying this WAR by copying it to the webapps folder, TomEE does
> not seem to find the EJBs from the service.jar (but it does find EJBs in
> WEB-INF/classes) and fails to @Inject these EJBs into request scoped CDI
> beans in sample.war.
>
> Am I missing some configuration for this setup?
>
> Best regards,
> Harald
>