RE: Re: Re: Re: Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread COURTAULT Francois
Hello Romain, More familiar with JIRA: https://issues.apache.org/jira/browse/TOMEE-2150 Best Regards. -Original Message- From: Romain Manni-Bucau [mailto:rmannibu...@gmail.com] Sent: lundi 27 novembre 2017 16:42 To: users@tomee.apache.org Subject: [++SPAM++]: Re: Re: Re: Re: : Re: Re: :

Re: Adding a new datasource during runtime?

2017-11-27 Thread Romain Manni-Bucau
being managed is not that hard, you can check https://github.com/apache/tomee/blob/master/container/openejb-core/src/main/java/org/apache/openejb/resource/jdbc/managed/JTADataSourceWrapperFactory.java out Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 16:54 GMT

Re: Adding a new datasource during runtime?

2017-11-27 Thread Paul Carter-Brown
Hi Karl, Do you know at build/deploy time what drivers you will be using (e.g. MySQL, Postgres etc). If so it would probably be easiest to point a set of datasources to HAProxy on say port 1, 10001 etc and then do the runtime setup on HAProxy by configuring the frontend to backend mappings as

Re: Adding a new datasource during runtime?

2017-11-27 Thread Karl Kildén
Hi, Thanks for the idea. And to have it jta managed etc? Anything I need to think about to make it behave as normal. No source in front of me now but maybe enough to use correct datasource impl? Skickat från min iPhone > 27 nov. 2017 kl. 16:42 skrev Romain Manni-Bucau : > > Hi > > if you ha

Re: @Produces returning null

2017-11-27 Thread Matthew Broadhead
also i did not realise that @Dependent is a Scope.  so i was declaring @RequestScoped and @Dependent at the same time On 27/11/2017 11:41, Matthew Broadhead wrote: looks like it.  another method was injecting the security context, so i moved it to it own class and now it is working.  changing f

Re: Adding a new datasource during runtime?

2017-11-27 Thread Romain Manni-Bucau
Hi if you have a router impl you can just use your own datasource manager behind it and manage it the way you want no? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 16:27 GMT+01:00 Karl Kildén : > Hello! > > For production we use tomee.xml and for development

Re: Re: Re: Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread Romain Manni-Bucau
2017-11-27 16:29 GMT+01:00 COURTAULT Francois : > Hello Romain, > > Agreed but no so familiar with that. > > If the compare has to be set on my branch: >- First, I need to create a new one from master, right ? >- Second, I have to submit a code change in TomEE, right ? 1. fork tomee reposi

RE: Re: Re: Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread COURTAULT Francois
Hello Romain, Agreed but no so familiar with that. If the compare has to be set on my branch: - First, I need to create a new one from master, right ? - Second, I have to submit a code change in TomEE, right ? May be it should be easier, for me, to submit an issue on TomEE Jira. Best Rega

Adding a new datasource during runtime?

2017-11-27 Thread Karl Kildén
Hello! For production we use tomee.xml and for development resources.xml and are very happy. Our next app to convert to tomee is multi-tenant with a hard requirement on logical separation so we will need a Router and dynamic datasources. This is also working very well in my tests. We will have

Re: Re: Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread Romain Manni-Bucau
base branch = master compare = your branch no? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 15:36 GMT+01:00 COURTAULT Francois : > Hello Romain, > > Done. > #114 Tomee 7.0.4 issue with CDI interceptor and WebServiceContext resource > injection > > I have st

RE: Re: Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread COURTAULT Francois
Hello Romain, Done. #114 Tomee 7.0.4 issue with CDI interceptor and WebServiceContext resource injection I have still a question, in order to create a pull request, I have to have a base branch and a compare branch, right ? So I have set the base branch to Master and the compare branch to tome

Re: Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread Romain Manni-Bucau
PR on master on github yes or patch attached to a jira (but review will be a bit longer) Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 12:36 GMT+01:00 COURTAULT Francois : > Hello Romain, > > How can I do that ? Pull-request on master branch ? Go directly to J

RE: Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread COURTAULT Francois
Hello Romain, How can I do that ? Pull-request on master branch ? Go directly to JIRA ? Best Regards. -Original Message- From: Romain Manni-Bucau [mailto:rmannibu...@gmail.com] Sent: lundi 27 novembre 2017 12:05 To: users@tomee.apache.org Subject: [++SPAM++]: Re: : Re: Re: : Re: : Re: :

Re: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread Romain Manni-Bucau
I have to confess I think it is not specified at all (JAX-WS not being updated for this case) but feel free to propose a fix on github. No blocker to enrich it. Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 11:56 GMT+01:00 COURTAULT Francois : > Hello Romain,

RE: : Re: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread COURTAULT Francois
Hello Romain, OK but this didn't happen with the other App Servers. The only I haven't tried is Liberty but I can if you want. So for me it's a bug, right ? Best Regards. -Original Message- From: Romain Manni-Bucau [mailto:rmannibu...@gmail.com] Sent: lundi 27 novembre 2017 11:47 To: us

Re: [++SPAM++]: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread Romain Manni-Bucau
Back to the first post I think: you get a proxy and the proxy gets the injections properly but this is not your business instance. Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 11:32 GMT+01:00 COURTAULT Francois : > Hello Romain, > > I have defined an annotati

Re: @Produces returning null

2017-11-27 Thread Matthew Broadhead
looks like it.  another method was injecting the security context, so i moved it to it own class and now it is working.  changing from @ApplicationScoped to @RequestScoped must have uncovered the problem.  i set everything to requestscoped now because all only produce on request On 27/11/2017

RE: [++SPAM++]: Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread COURTAULT Francois
Hello Romain, I have defined an annotation like below: @Inherited @InterceptorBinding @Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface Logged { @Nonbinding String logLevel() default "INFO"; } Then, I have written a class like this: @Logged

Re: @Produces returning null

2017-11-27 Thread Romain Manni-Bucau
Loops in you generic usages? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 11:29 GMT+01:00 Matthew Broadhead : > starts up ok but then on page load i get > > |java.lang.StackOverflowError at > org.apache.webbeans.util.GenericsUtil.isAssignableFrom(GenericsUtil

Re: @Produces returning null

2017-11-27 Thread Matthew Broadhead
starts up ok but then on page load i get |java.lang.StackOverflowError at org.apache.webbeans.util.GenericsUtil.isAssignableFrom(GenericsUtil.java:172) at org.apache.webbeans.util.GenericsUtil.isAssignableFrom(GenericsUtil.java:146) at org.apache.webbeans.util.GenericsUtil.isAssignableFrom(G

Re: @Produces returning null

2017-11-27 Thread Romain Manni-Bucau
Hi it looks accurate, a normal scoped instance - request scoped - proxies a not null instance so you can't return null. Using a @RequestScoped producer class (the enclosing one) and @Dependent producer can work too if you inject this context in request scoped instances only. Romain Manni-Bucau @r

Re: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread Romain Manni-Bucau
If there is no proxy for the instance this should work, did you ensure it is not a cdi bean somehow or a @Dependent cdi bean? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 11:00 GMT+01:00 COURTAULT Francois : > Hello Romain, > > Sorry to come back to you about

Re: @Produces inside jar

2017-11-27 Thread Romain Manni-Bucau
No but you can tune it with beans.xml (excludes, scanning mode, etc...) Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 10:57 GMT+01:00 Matthew Broadhead : > should i somehow be manually defining which beans are cdi managed? > > > On 27/11/2017 10:48, Romain Man

@Produces returning null

2017-11-27 Thread Matthew Broadhead
if @Produces can produce null e.g. @Produces @Default @RequestScoped public KeycloakSecurityContext keycloakSecurityContext() {     if (httpServletRequest.getUserPrincipal() instanceof KeycloakPrincipal) {         KeycloakPrincipal keycloakPrincipal = (KeycloakPrincipal) httpServletRequest.get

RE: : Re: : Re: : Re: Injecting WebserviceContext returns null

2017-11-27 Thread COURTAULT Francois
Hello Romain, Sorry to come back to you about this topic. But I think there is a real issue with CDI interceptor in TomEE 7.0.4. Let me explain, I have removed in the LoggingInterceptor annotated with @Logged @Interceptor, the code below @Inject @Intercepted private Bean intercepted; And

Re: @Produces inside jar

2017-11-27 Thread Matthew Broadhead
should i somehow be manually defining which beans are cdi managed? On 27/11/2017 10:48, Romain Manni-Bucau wrote: all i guess, System.out.println(beanManager.getBeans(Object.class)) should list them Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 10:31 GMT+0

Re: @Produces inside jar

2017-11-27 Thread Romain Manni-Bucau
all i guess, System.out.println(beanManager.getBeans(Object.class)) should list them Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 10:31 GMT+01:00 Matthew Broadhead : > yes that works. does that mean all classes are being added as cdi for some > reason? or

Re: @Produces inside jar

2017-11-27 Thread Matthew Broadhead
yes that works.  does that mean all classes are being added as cdi for some reason?  or only ones that are being produced? On 27/11/2017 10:25, Romain Manni-Bucau wrote: hmm there is not link with serializable but if it is a cdi bean then producing it will make it ambiguous add @vetoed on the

Re: @Produces inside jar

2017-11-27 Thread Romain Manni-Bucau
hmm there is not link with serializable but if it is a cdi bean then producing it will make it ambiguous add @vetoed on the class maybe? Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 10:24 GMT+01:00 Matthew Broadhead : > should not be serializable? > > > On 2

Re: @Produces inside jar

2017-11-27 Thread Matthew Broadhead
should not be serializable? On 27/11/2017 10:17, Romain Manni-Bucau wrote: No but likely MyCustomObject is scanned and has a default constructor Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 10:00 GMT+01:00 Matthew Broadhead : If I include a jar in several

Re: @Produces inside jar

2017-11-27 Thread Romain Manni-Bucau
No but likely MyCustomObject is scanned and has a default constructor Romain Manni-Bucau @rmannibucau | Blog | Old Blog | Github | LinkedIn 2017-11-27 10:00 GMT+01:00 Matthew Broadhead : > If I include a jar in several webapps and the jar contains some > @ApplicationScoped beans it seems to wor

@Produces inside jar

2017-11-27 Thread Matthew Broadhead
If I include a jar in several webapps and the jar contains some @ApplicationScoped beans it seems to work fine.  i.e. those @ApplicationScoped beans can be injected into the beans in the webapps without conflict. However if I use @Produces, e.g @Produces @MyQualifier @RequestScoped public MyCu