NPE when creating a bean through Extension and not through Producer

2016-02-15 Thread Xavier Dury
Hi, I have written a CDI custom extension (with deltaspike BeanBuilder) to scan all types annotated with @XmlRegistry and create one @ApplicationScoped JAXBContext for my application. But beans referencing/injecting that JAXBContext give a NPE when created: java.lang.NullPointerException at o

RE: NPE when creating a bean through Extension and not through Producer

2016-02-15 Thread Xavier Dury
Blog > <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http://www.tomitribe.com> > > 2016-02-15 16:47 GMT+01:00 Xavier Dury : > >> Hi, >> &g

RE: NPE when creating a bean through Extension and not through Producer

2016-02-15 Thread Xavier Dury
+0100 >>> Subject: Re: NPE when creating a bean through Extension and not through >> Producer >>> To: users@tomee.apache.org >>> >>> Hi Xavier, >>> >>> do you have some code to share - hope google didnt eat any snippet again? >>> >>&g

RE: NPE when creating a bean through Extension and not through Producer

2016-02-15 Thread Xavier Dury
mannibucau <https://twitter.com/rmannibucau> | Blog > <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http://www.tomitribe.com> > > 2016-02-16 8:36 GMT+01:

RE: NPE when creating a bean through Extension and not through Producer

2016-02-16 Thread Xavier Dury
://twitter.com/rmannibucau> | Blog >> <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> >> | >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber >> <http://www.tomitribe.com> >> >> 2016-02-16 8:36 GM

RE: NPE when creating a bean through Extension and not through Producer

2016-02-16 Thread Xavier Dury
Thanks, I was trying to implement a custom ApplicationBoundaryService but OWB does not seem to pick it up (I added the class name to META-INF/openwebbeans/openwebbeans.properties with a configuration.ordinal over 9000 but it always takes the default one). Are those OWB SPIs required to be in a

RE: NPE when creating a bean through Extension and not through Producer

2016-02-16 Thread Xavier Dury
hub <https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http://www.tomitribe.com> > > 2016-02-16 9:56 GMT+01:00 Xavier Dury : > >> Thanks, >> >> I was trying to implement a custom Applicatio

NPE on Instance.destroy()

2016-02-23 Thread Xavier Dury
Hi, I've come accross a NPE while calling Instance.destroy() whith @Dependent beans I got from the same Instance, is it normal? (I am using TomEE 7M1 + OWB 1.6.3) More questions about Instance: - does the remove() method on the iterator obtained via Instance.iterator() do anything (like calling

RE: NPE on Instance.destroy()

2016-02-23 Thread Xavier Dury
Nevermind, if had to do something like that: Instance barInstance = fooInstance.select(Bar.class); Bar bar = barInstance.get(); barInstance.destroy(bar); > From: kal...@hotmail.com > To: users@tomee.apache.org > Subject: NPE on Instance.destroy() > Date: W

RE: NPE on Instance.destroy()

2016-02-24 Thread Xavier Dury
will recreate it). > > > Romain Manni-Bucau > @rmannibucau <https://twitter.com/rmannibucau> | Blog > <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http:/

ApplicationComposer and Mockito

2016-03-14 Thread Xavier Dury
Hi, When using ApplicationComposer and mockito together in the following test example: package eg; import javax.inject.Inject; import org.apache.openejb.junit.ApplicationComposerRule; import org.apache.openejb.mockito.MockitoInjector; import org.apache.openejb.testing.CdiExtensions; import org

RE: ApplicationComposer and Mockito

2016-03-14 Thread Xavier Dury
://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber > <http://www.tomitribe.com> > > 2016-03-14 15:25 GMT+01:00 Xavier Dury : > >> Hi, >> >> When using Applic

RE: ApplicationComposer and Mockito

2016-03-14 Thread Xavier Dury
bucau> | Tomitriber > <http://www.tomitribe.com> > > 2016-03-14 15:56 GMT+01:00 Xavier Dury : > >> Hi Romain, >> >> I think that the @CdiExtensions is causing the problem: if I remove it, >> the test passes without the need of the @Produces annotation. >

OpenEJB and EL

2016-09-28 Thread Xavier Dury
Hi, I am using OpenEJB for my tests and need support for EL expressions in my own code. By default, if I do something like this (pay attention to the expression): ExpressionFactory factory = beanManager.wrapExpressionFactory(ExpressionFactory.newInstance()); StandardELContext elContext = new S

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
mee.apache.org Subject: Re: OpenEJB and EL   Hi Xavier On the phone so hard to give you a link bit try using tomcat el impl of tomcat 8.5 Le 28 sept. 2016 15:29, "Xavier Dury" a écrit : > Hi, > > I am using OpenEJB for my tests and need support for EL expressions in my &

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
Old Wordpress Blog <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-09-28 18:17 GMT+02:

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
@Inject private Conversation conversation; @Produces @ApplicationScoped @Named("javax") public Javax javax() {return new Javax();} } But that works! Xavier From: Xavier Dury Sent: Wednesday, September 28, 2016 8:42 PM To: users@tomee.apache.org Subject: Re: OpenEJB a

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
c class ConversationWrapper { >    private @Inject Conversation conv; > >   public Conversation get() { >    return conv; >    } > } > > And in the EL just use #{conversation.get.id} > > LieGrue, > strub > > > > > > On Wednesday, 28 September 20

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
;EL spec. >> >>Could you please try the following >> >>@RequestScoped >>@Named("conversation") >>public class ConversationWrapper { >>   private @Inject Conversation conv; >> >>  public Conversation get() { >>   return conv; >> 

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
ithub.com/rmannibucau> | [old blog] new RManniBucau().blog() rmannibucau.wordpress.com New blog on: https://blog-rmannibucau.rhcloud.com/ LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory-rmann

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
[ConversationWrapper, WebBeansType:MANAGED, Name:null, API Types:[eg.ConversationWrapper,java.lang.Object], Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]] From: Xavier Dury Sent: Wednesday, September 28, 2016 11:34 PM To: users@tomee.apache.org Subject: Re: OpenEJB and

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
tory-rmannibucau.rhcloud.com> 2016-09-28 23:45 GMT+02:00 Xavier Dury : > It seems that to inject the conversation in ConversationWrapper.conversation, > OWB does consider both the build-in conversation bean and the produced one > from... ConversationWrapper.getConv().

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
https://gist.github.com/kalgon/fbf529dc9c9764c115433cfb2f0f82bf From: Xavier Dury Sent: Wednesday, September 28, 2016 11:54 PM To: users@tomee.apache.org Subject: Re: OpenEJB and EL   No, I didn't add the @Default to the @Produces method. I verified: @RequestScoped public

Re: OpenEJB and EL

2016-09-28 Thread Xavier Dury
can you please add any random qualifier? E.g. @Destroyed. This will stop CDI from complaining but EL should work. LieGrue, strub > On Thursday, 29 September 2016, 0:04, Xavier Dury wrote: > > https://gist.github.com/kalgon/fbf529dc9c9764c115433cfb2f0f82bf OpenEjbElTest.java gist.git

Re: OpenEJB and EL

2016-09-29 Thread Xavier Dury
, September 29, 2016 8:54 AM To: users@tomee.apache.org Subject: Re: OpenEJB and EL   2016-09-29 8:32 GMT+02:00 Xavier Dury : > @Mark > > thanks, it works when adding any other qualifier! > > btw, do you think it would hurt to qualify the built-in conversation bean > with @N

Re: OpenEJB and EL

2016-09-29 Thread Xavier Dury
just sketched that wo trying). That should be available as #{nameResolver.get("javax.enterprise.context.conversation")} LieGrue, strub > On Thursday, 29 September 2016, 9:21, Romain Manni-Bucau > wrote: > > 2016-09-29 9:15 GMT+02:00 Xavier Dury : > >>  Indeed, @Nam

Re: OpenEJB and EL

2016-09-29 Thread Xavier Dury
ribe.com> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-09-29 11:38 GMT+02:00 Xavier Dury : > Thanks, now I understand better why it is not implemented in OWB. > > Funny, I came to the same conclusion and was busy implementing an > @ApplicationScoped @N

Re: OpenEJB and EL

2016-09-29 Thread Xavier Dury
com/in/rmannibucau> | Tomitriber Romain Manni-Bucau | LinkedIn www.linkedin.com View Romain Manni-Bucau’s professional profile on LinkedIn. LinkedIn is the world's largest business network, helping professionals like Romain Manni-Bucau discover ... > <http://www.tomitribe.com> | JavaEE Factory > <https://javaeefactory-rmannibucau.rhcloud.com> > > 2016-09-29 14:38 GMT+02:00 Xavier Dury : > >> something like this? https://gist.github.com/kalgon/ >> c1cc45540a629314f615b90f944f >> >> >>

Re: OpenEJB and EL

2016-09-29 Thread Xavier Dury
Well, replace JspResolver by ServletResolver in my previous message... From: Xavier Dury Sent: Thursday, September 29, 2016 8:18 PM To: users@tomee.apache.org Subject: Re: OpenEJB and EL   Indeed, el resolvers should then be splitted like this: - JspResolver - CdiResolver - JavaxResolver

Re: OpenEJB and EL

2016-09-29 Thread Xavier Dury
.rhcloud.com/ LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-09-29 20:20 GMT+02:00 Xavier Dury : > Well, replace JspResolver by ServletResolver in my previous messag

EJBContainerRunner and @RequestScoped

2016-09-30 Thread Xavier Dury
Hi, Is it normal that all test methods from a test class running with EJBContainerRunner share one single request context? If the request context is shared between methods, this can cause some unwanted dependency between them. Example: public @ApplicationScoped class ScopeService {      publi

Re: EJBContainerRunner and @RequestScoped

2016-09-30 Thread Xavier Dury
and geeky topics... <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber <http://www.tomitribe.com> | JavaEE Factory <https://javaeefactory-rmannibucau.rhcloud.com> 2016-09-30 11:45

Problem with openejb.testing.start-cdi-contexts = false and application composer

2016-12-16 Thread Xavier Dury
Hi, I have a problem with the following test (with TomEE 7.0.1): @ContainerProperties(@ContainerProperties.Property(name = "openejb.testing.start-cdi-contexts", value = "false")) @Classes(cdi = true, innerClassesAsBean = true) @RunWith(ApplicationComposer.class) public class ScopesRuleTest {    

Re: Problem with openejb.testing.start-cdi-contexts = false and application composer

2016-12-16 Thread Xavier Dury
. <http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> | [old blog] new RManniBucau().blog() rmannibucau.wordpress.com New blog on: https://blog-rmannibucau.rhcloud.com/ LinkedIn <https://www.linkedin.com/in/rmannibucau> | JavaEE Factory <https://javaeefactory

ApplicationComposer and qualified mocks

2017-04-05 Thread Xavier Dury
Hi, When using ApplicationComposer, I can declare mocks in my test classes like that: @Mock MyDependency myDependency; @MockInjector public Class mockInjector() { return MockitoInjector.class; } But that does not seem to work with (un@Named) qualified mocks: @Mock @MyQualifier MyDepend

Re: ApplicationComposer and qualified mocks

2017-04-05 Thread Xavier Dury
Hi Romain > From: Romain Manni-Bucau > > Hi Xavier, > > 2017-04-05 12:22 GMT+02:00 Xavier Dury : > >> Hi, >> >> When using ApplicationComposer, I can declare mocks in my test classes >> like that: >> >> @Mock >> MyDependency my

Re: ApplicationComposer and qualified mocks

2017-04-05 Thread Xavier Dury
OK, I'll try to provide a patch when I can find some time. > From: Romain Manni-Bucau > > I think I get the use case. Do you want to try to patch openejb-mockito? > > 2017-04-05 13:28 GMT+02:00 Xavier Dury : > > > Hi Romain > > > > > Fro

Re: ApplicationComposer and qualified mocks

2017-04-06 Thread Xavier Dury
Hi Romain, I made a gist and wanted your opinion before I submit a PR: https://gist.github.com/kalgon/ee1e00c0fecdd86afb01fe1a6891454a I don't use MockRegistry or MockitoInjector anymore (everything happens in the extension) and wanted to know if that was ok for you. > From: Xav

Testing WebServices (OPENEJB-2088)

2014-05-12 Thread Xavier Dury
Hi, I have been testing the fix for OPENEJB-2088 (injection of (SOAP)Handlers) and have noticed a strange behavior: when my test class has 3 or more test methods, it seems that handlers are not injected anymore (I get NPEs). I don't think it's related to what the test really does as this error oc

RE: Problem with OpenWebbeans when Iterating over javax.enterprise.inject.Instance

2014-05-13 Thread Xavier Dury
I think it's this bug: https://issues.apache.org/jira/browse/OWB-888 > From: rmannibu...@gmail.com > Date: Tue, 13 May 2014 16:40:41 +0200 > Subject: Re: Problem with OpenWebbeans when Iterating over > javax.enterprise.inject.Instance > To: users@tomee.apache.org > > Hi > > this is an openwebbe

ApplicationComposer and secured WebService

2014-05-13 Thread Xavier Dury
Hi, I am using ApplicationComposer to test an EJB exposed as a WebService. My service is secured with @RolesAllowed and I would like to use BASIC authentication or disable security for the test. As I don't know how to disable security, I tried to activate BASIC authentication (with groups/user.p

RE: ApplicationComposer and secured WebService

2014-05-13 Thread Xavier Dury
new Properties(); > p.setProperty("cxf-rs.auth", "BASIC"); > return p; > > > That should work > -- > Jean-Louis Monteiro > http://twitter.com/jlouismonteiro > http://www.tomitribe.com > > > On Fri, May 9, 2014 at 6:19 AM, Xavier Dury

RE: ApplicationComposer and secured WebService

2014-05-14 Thread Xavier Dury
); >> p.setProperty("cxf-rs.auth", "BASIC"); >> return p; >> >> >> That should work >> -- >> Jean-Louis Monteiro >> http://twitter.com/jlouismonteiro >> http://www.tomitribe.com >> >> >> On Fri, May 9, 2014 a

RE: ApplicationComposer and secured WebService

2014-05-14 Thread Xavier Dury
gt;> From: jlmonte...@tomitribe.com >>> To: users@tomee.apache.org >>> >>> Try adding a method annotated with @Configuration and add the following as >>> the content >>> final Properties p = new Properties(); >>> p.setProperty("cxf-rs.auth"

RE: Tomee 1.7.0 Release-Date

2014-06-16 Thread Xavier Dury
Hi, do you have any new estimate about the 1.7.0 release date? Thanks, Xavier > Date: Wed, 4 Jun 2014 15:59:19 +0200 > From: agumbre...@tomitribe.com > To: users@tomee.apache.org > Subject: Re: Tomee 1.7.0 Release-Date > > Hi Alex, > > Unfortunately ther

Some questions about WebService and OpenEJB

2014-06-27 Thread Xavier Dury
Hi, I've been developing a WebService and wanted to test it with ApplicationComposer. First, it seems that only EJB (@Stateless) endpoints can be injected into my test instance through @WebServiceRef. Is it correct? If I remove @Stateless from my service, then I get the following error: WARNI

RE: Some questions about WebService and OpenEJB

2014-06-27 Thread Xavier Dury
r: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > 2014-06-27 16:30 GMT+02:00 Xavier Dury : > >> Hi, >> >> I've been developing a WebService and

RE: Some questions about WebService and OpenEJB

2014-06-29 Thread Xavier Dury
s/asf/tomee/tomee/trunk/examples/applicationcomposer-jaxws-cdi/ > > > > Romain Manni-Bucau > Twitter: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > 2014-06-27 17:58

RE: Some questions about WebService and OpenEJB

2014-06-29 Thread Xavier Dury
lease > > > Romain Manni-Bucau > Twitter: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > 2014-06-30 7:44 GMT+02:00 Xavier Dury : >> G, that

RE: Some questions about WebService and OpenEJB

2014-06-30 Thread Xavier Dury
/github.com/rmannibucau > > > 2014-06-30 8:16 GMT+02:00 Xavier Dury : >> here it is https://dl.dropboxusercontent.com/u/908875/openejb/mtom.zip >> >> >>> From: rmannibu...@gmail.com >>> Date: Mon, 30 J

RE: Some questions about WebService and OpenEJB

2014-07-02 Thread Xavier Dury
-06-30 9:25 GMT+02:00 Romain Manni-Bucau : >>> sure, just need "open" internet to commit the 3 missing lines ;) >>> >>> >>> Romain Manni-Bucau >>> Twitter: @rmannibucau >>> Blog: http://rmannibucau.wordpress.com/ >>> LinkedIn: http://fr.l

RE: Some questions about WebService and OpenEJB

2014-07-02 Thread Xavier Dury
omain Manni-Bucau : > >>> > >>> we should read both actually. BindingType is the old way to do it and > >>> @MTOM the more recent. > >>> > >>> > >>> Romain Manni-Bucau > >>> Twitter: @rmannibucau > >>> Blog:

EJBContainerRule

2014-10-10 Thread Xavier Dury
Hi, I have been playing with the EJBContainerRule but, in the logs, I always see some warnings like these: WARNING - WARN ... EjbModule1458021134: The application [EjbModule1458021134] uses @Inject but CDI is not enabled. Maybe youd need to add a beans.xml file. WARNING - 1 warning for EjbModul

openejb-jar.xml and testing

2014-10-20 Thread Xavier Dury
Hi, When I'm using OpenEJB for testing (EJBContainerRule/OpenEjbRunner) and want to test my @Stateless web-service security (@RolesAllowed), I have to include an openejb-jar.xml next to ejb-jar.xml containing an BASIC so that users and groups are read from users/groups.properties. Is there an

RE: openejb-jar.xml and testing

2014-10-20 Thread Xavier Dury
ers. > Just ensure it is set before the rule starts. > Romain Manni-Bucau > Twitter: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > > 2014-10-20 10:58 GMT+02:00

EJBContainerRule and @RunTestAs

2014-10-30 Thread Xavier Dury
Hi, While using EJBContainerRule, I have seen no easy way (~ @Run(Test)As) to invoke my EJBs with a particular user/role in my tests. There is already an InjectRule and a TransactionRule so would it be possible to add some kind of Run(Test)AsRule as well? Thanks, Xavier

RE: EJBContainerRule and @RunTestAs

2014-10-31 Thread Xavier Dury
e87d71ecbec66 > > If needed we can backport to 1.7.x > Romain Manni-Bucau > Twitter: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > > 2014-10-30 12:50 GMT+01:0

RE: EJBContainerRule and @RunTestAs

2014-10-31 Thread Xavier Dury
y tests with custom security services or > based on security environment > Romain Manni-Bucau > Twitter: @rmannibucau > Blog: http://rmannibucau.wordpress.com/ > LinkedIn: http://fr.linkedin.com/in/rmannibucau > Github: https://github.com/rmannibucau > > > > 2014-10-3