Re: Obtaining tomee.xml resource properties?

2018-11-27 Thread Romain Manni-Bucau
Java.util as in
https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/resource/PropertiesInjectionTest.java

Do you have the resource creation log? If not the file is likely not found,
misplaced or not parsed properly.

Le mar. 27 nov. 2018 22:35, Jonathan Gallimore 
a écrit :

> Hi
>
> Are you able to wrap this up in a little example project that we could take
> a look at?
>
> Cheers
>
> Jon
>
> On Tue, Nov 27, 2018 at 9:32 PM Kean Erickson 
> wrote:
>
> > Oh duh, I should have seen that coming. Well, now that I'm attempting to
> > inject TomeeConfiguration in a managed class (annotated @Stateless), I'm
> > getting this when I attempt to provide that @Resource no matter what
> > managed class I put it in:
> >
> > 27-Nov-2018 12:57:09.469 SEVERE [localhost-startStop-1]
> > org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal Unable to
> > deploy collapsed ear in war
> > StandardEngine[Catalina].StandardHost[localhost].StandardContext[]
> >  org.apache.openejb.OpenEJBException: Can't find resource for class <<
> > *Classpath
> > for class containing @Resource TomeeConfiguration goes here* >>#config.
> (No
> > provider available for resource-ref 'null' of type
> > '*TomeeConfiguration*'
> > for '<< *Arbitrary class annotated with @Stateless goes here * >>'.)
> >
> > It looks like the resource that I declared in resources.xml is attempting
> > to be linked to every managed class when I start TomEE, and something is
> > failing upon attempting to link the first (arbitrary) one. The arbitrary
> > managed class that fails has nothing to do with the managed class that
> > actually contains the @Resource TomeeConfiguration... the injection of
> > TomeeConfiguration in any managed class is causing this error. I should
> > note that I don't think the issue is with the @Stateless managed class in
> > question, which is working properly otherwise.
> >
> > I've seen this " No provider available for resource-ref 'null' " error in
> > some googling, but it generally has to do with a library that is either
> > missing or needs to be put in an exclusions list in /conf, and not
> project
> > code itself. I'm not sure what the "null" here is all about, is it
> > expecting that I put something in /WEB-INF/web.xml ?
> >
> > Also, the Properties meant to be returned.. is that class
> > java.util.Properties, or is it supposed to be class
> > org.apache.openejb.jee.jpa.unit.Properties?
> >
> > I should also mention, I'm using an exploded WAR deployment.. so I
> actually
> > wound up putting resources.xml in WEB-INF.
> > Thanks again,
> > -Kean
> >
> > On Mon, Nov 26, 2018 at 10:17 PM Romain Manni-Bucau <
> rmannibu...@gmail.com
> > >
> > wrote:
> >
> > > @Resource(name="config")
> > > private TomeeConfiguration config;
> > >
> > > In a managed class to inject it. If you do a new tomee does nothing.
> > >
> > > Le mar. 27 nov. 2018 04:48, Kean Erickson  a
> > > écrit :
> > >
> > > > Thank you, that sounds like it'll work. I'm finding that
> > getProperties()
> > > on
> > > > my configuration file returns null though, I'm wondering if I'm using
> > the
> > > > right Properties class (java.util.Properties)?
> > > >
> > > > 1. Here's my WEB-INF/resources.xml class (I removed the package name)
> > > > 
> > > > 
> > > > UserName = postgres
> > > > 
> > > > 
> > > >
> > > >
> > > > 2. Here's my TomeeConfiguration class (taken from the old
> > documentation's
> > > > example):
> > > > 
> > > > package  .;
> > > > import java.util.Properties;
> > > >
> > > > public class TomeeConfiguration {
> > > > private Properties properties;
> > > >
> > > > public Properties getProperties() {
> > > > return properties;
> > > > }
> > > > public void setProperties(final Properties properties) {
> > > > this.properties = properties;
> > > > }
> > > > }
> > > > 
> > > >
> > > > 3. Then after the containe

Re: Obtaining tomee.xml resource properties?

2018-11-26 Thread Romain Manni-Bucau
@Resource(name="config")
private TomeeConfiguration config;

In a managed class to inject it. If you do a new tomee does nothing.

Le mar. 27 nov. 2018 04:48, Kean Erickson  a
écrit :

> Thank you, that sounds like it'll work. I'm finding that getProperties() on
> my configuration file returns null though, I'm wondering if I'm using the
> right Properties class (java.util.Properties)?
>
> 1. Here's my WEB-INF/resources.xml class (I removed the package name)
> 
> 
> UserName = postgres
> 
> 
>
>
> 2. Here's my TomeeConfiguration class (taken from the old documentation's
> example):
> 
> package  .;
> import java.util.Properties;
>
> public class TomeeConfiguration {
> private Properties properties;
>
> public Properties getProperties() {
> return properties;
> }
> public void setProperties(final Properties properties) {
> this.properties = properties;
> }
> }
> 
>
> 3. Then after the container has been prepared, I try the following, but
> c.getProperties() returns null.
> 
> TomeeConfiguration c = new TomeeConfiguration();
> String tomeeUsername = c.getProperties().getProperty("UserName");
> 
>
>
> I'm wondering what I'm missing?
> Thanks for your time,
> -Kean
>
>
> On Mon, Nov 26, 2018 at 4:05 AM Jonathan Gallimore <
> jonathan.gallim...@gmail.com> wrote:
>
> > Hi
> >
> > Yes - you can also define resources at the application level, by defining
> > resources in WEB-INF/resources.xml in your .war file. The syntax is
> pretty
> > much the same as tomee.xml, but with  as the top level tag as
> > opposed to . The will use the application classpath, eliminating
> the
> > requirement to add your resource class to lib/.
> >
> > Let us know how you get on - if you're stuck, I can dig out an example.
> >
> > Kind Regards
> >
> > Jon
> >
> > On Sun, Nov 25, 2018 at 10:47 PM Romain Manni-Bucau <
> rmannibu...@gmail.com
> > >
> > wrote:
> >
> > > Guess you want to read
> > > http://tomee.apache.org/admin/configuration/index.html - doc is more
> > > complete and up to date.
> > >
> > > Le dim. 25 nov. 2018 23:44, Kean Erickson  a
> > > écrit :
> > >
> > > > The docs mention a way of obtaining properties in code from a
> resource
> > in
> > > > Tomee.xml, under "Custom resources"
> > > >
> > > > http://tomee.apache.org/application-resources.html
> > > >
> > > > ..such that I could denote a class-name on the resource pointing to a
> > > > configuration class (which would be pretty boilerplate, judging by
> the
> > > > example). But in order to do this, I have to package the config class
> > in
> > > > TomEE's /lib directory. This introduces some complications in my
> case,
> > > for
> > > > other reasons.. I was wondering if there's any other way to obtain
> > these
> > > > resource properties without having to add anything to TomEE's
> > classpath.
> > > >
> > > > Thanks,
> > > > -Kean
> > > >
> > >
> >
>


Re: Obtaining tomee.xml resource properties?

2018-11-25 Thread Romain Manni-Bucau
Guess you want to read
http://tomee.apache.org/admin/configuration/index.html - doc is more
complete and up to date.

Le dim. 25 nov. 2018 23:44, Kean Erickson  a
écrit :

> The docs mention a way of obtaining properties in code from a resource in
> Tomee.xml, under "Custom resources"
>
> http://tomee.apache.org/application-resources.html
>
> ..such that I could denote a class-name on the resource pointing to a
> configuration class (which would be pretty boilerplate, judging by the
> example). But in order to do this, I have to package the config class in
> TomEE's /lib directory. This introduces some complications in my case, for
> other reasons.. I was wondering if there's any other way to obtain these
> resource properties without having to add anything to TomEE's classpath.
>
> Thanks,
> -Kean
>


Re: TomEE Maven Plugin: Can conf/system.properties be externalized?

2018-11-22 Thread Romain Manni-Bucau
Placeholders are a real feature so ko worry on them.
Not sure what you mean by cdi config source but microprofile is not tomee
mainstream (they still breaks api between each versions) and cdi hapoens
way too late for the container (tomee and cdi extension) but an app using
only injection you can do it using CDI utility class.

Le ven. 23 nov. 2018 03:23, Shultz, Dmitry  a
écrit :

> To complete the for example (somehow typed it in my brain instead of the
> form:)
>
> It looks like it will solve some problems by reading directly from the
> configmap (cdi custom config source would be awesome) instead of  relying
> on some yaml.
>
> Cheers,
> Dmitry
> 
> From: Shultz, Dmitry 
> Sent: 22 November 2018 17:03:36
> To: users@tomee.apache.org
> Subject: RE: TomEE Maven Plugin: Can conf/system.properties be
> externalized?
>
> Thanks Romain, this is pretty cool functionality I can see the potential
> (for example ).
>
> Just for the sake of completeness ('also' follows after 'yes':), is it
> still Ok to use env variables in ${}?
>
> Cheers,
> Dmitry
>
>
> -Original Message-
> From: Romain Manni-Bucau [mailto:rmannibu...@gmail.com]
> Sent: Thursday, November 22, 2018 11:01 AM
> To: users@tomee.apache.org
> Subject: Re: TomEE Maven Plugin: Can conf/system.properties be
> externalized?
>
> You also have propertiesproviders and configurers for resources:
>
> https://github.com/apache/tomee/blob/8547f730b7c9fc085534a8f5d1f68340154d2cfe/container/openejb-core/src/main/java/org/apache/openejb/resource/heroku/HerokuDatabasePropertiesProvider.java
> and
>
> https://github.com/apache/tomee/blob/8547f730b7c9fc085534a8f5d1f68340154d2cfe/container/openejb-core/src/test/java/org/apache/openejb/resource/heroku/HerokuDatabasePropertiesProviderResourceTest.java
> for an example of usage
>
> Le jeu. 22 nov. 2018 19:25, Shultz, Dmitry  a
> écrit :
>
> > Hi guys,
> >
> > I'm looking at the same thing but from perspective to run TomEE image
> > in the K8's cluster.
> > The ${} replacement looks promising, especially when I found this
> > thread
> > http://tomee-openejb.979440.n4.nabble.com/how-con-figure-the-datasourc
> > e-into-tomee-xml-using-docker-td4682533.html
> > where Romain shared that it is possible to use env variables (not JVM
> > properties) for substitution. From what I can see it is the most
> > straightforward way to consume datasource configuration from K8's
> > config map (by exposing config map values as env variables to the pod).
> >
> > Unfortunately, I can't find any other documentation for this
> > functionality and it makes me worry if it's not officially supported
> > and may be removed in the future versions. Please clarify.
> >
> > Also, if there is any other way to consume config map key/values in
> > tomee.xml please let me know.
> >
> > Cheers,
> > Dmitry
> >
> >
> > -Original Message-
> > From: Roberto Cortez [mailto:radcor...@yahoo.com.INVALID]
> > Sent: Thursday, November 22, 2018 4:01 AM
> > To: users@tomee.apache.org
> > Subject: Re: TomEE Maven Plugin: Can conf/system.properties be
> > externalized?
> >
> > I guess you want to hide user, password, connection, schema etc.
> >
> > You could use variable replacement with ${} and pack the file in the
> > jar and then just set the properties to replace like Romain mentioned.
> > I think it should work,
> >
> > Cheers,
> > Roberto
> >
> > > On 22 Nov 2018, at 05:42, Romain Manni-Bucau 
> > wrote:
> > >
> > > Hello,
> > >
> > > You can always load system properties in setenv.sh before the server
> > starts.
> > >
> > > If it is properties settable after tomee.xml is read you can set
> > > them in it and it supports 
> > >
> > > Finally you can always plug a tomcat listener before tomee one and
> > > set the system properties the way you want peogrammatically.
> > >
> > > Le mer. 21 nov. 2018 23:51, exabrial12  a écrit :
> > >
> > >> We want to store the configuration for our datasources separate
> > >> from the distribution of the one-jar. If you haven't seen Jonathan
> > >> [Gallimore's] excellent blog post on configuration TomEE, see here:
> > >> https://www.tomitribe.com/blog/tomee-configuration-techniques/
> > >>
> > >> Looking at the TomEE plugin's options though, it allows you to
> > >> include a system.properties at build time, but I can't seem to find
> > >> a way to set it at runtime.
> > >>
> > >> Any ideas or alternatives?
> > >>
> > >>
> > >>
> > >> --
> > >> Sent from:
> > >> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> > >>
> >
> >
>


Re: TomEE Maven Plugin: Can conf/system.properties be externalized?

2018-11-22 Thread Romain Manni-Bucau
You also have propertiesproviders and configurers for resources:
https://github.com/apache/tomee/blob/8547f730b7c9fc085534a8f5d1f68340154d2cfe/container/openejb-core/src/main/java/org/apache/openejb/resource/heroku/HerokuDatabasePropertiesProvider.java
and
https://github.com/apache/tomee/blob/8547f730b7c9fc085534a8f5d1f68340154d2cfe/container/openejb-core/src/test/java/org/apache/openejb/resource/heroku/HerokuDatabasePropertiesProviderResourceTest.java
for an example of usage

Le jeu. 22 nov. 2018 19:25, Shultz, Dmitry  a
écrit :

> Hi guys,
>
> I'm looking at the same thing but from perspective to run TomEE image in
> the K8's cluster.
> The ${} replacement looks promising, especially when I found this thread
> http://tomee-openejb.979440.n4.nabble.com/how-con-figure-the-datasource-into-tomee-xml-using-docker-td4682533.html
> where Romain shared that it is possible to use env variables (not JVM
> properties) for substitution. From what I can see it is the most
> straightforward way to consume datasource configuration from K8's config
> map (by exposing config map values as env variables to the pod).
>
> Unfortunately, I can't find any other documentation for this functionality
> and it makes me worry if it's not officially supported and may be removed
> in the future versions. Please clarify.
>
> Also, if there is any other way to consume config map key/values in
> tomee.xml please let me know.
>
> Cheers,
> Dmitry
>
>
> -Original Message-
> From: Roberto Cortez [mailto:radcor...@yahoo.com.INVALID]
> Sent: Thursday, November 22, 2018 4:01 AM
> To: users@tomee.apache.org
> Subject: Re: TomEE Maven Plugin: Can conf/system.properties be
> externalized?
>
> I guess you want to hide user, password, connection, schema etc.
>
> You could use variable replacement with ${} and pack the file in the jar
> and then just set the properties to replace like Romain mentioned. I think
> it should work,
>
> Cheers,
> Roberto
>
> > On 22 Nov 2018, at 05:42, Romain Manni-Bucau 
> wrote:
> >
> > Hello,
> >
> > You can always load system properties in setenv.sh before the server
> starts.
> >
> > If it is properties settable after tomee.xml is read you can set them
> > in it and it supports 
> >
> > Finally you can always plug a tomcat listener before tomee one and set
> > the system properties the way you want peogrammatically.
> >
> > Le mer. 21 nov. 2018 23:51, exabrial12  a écrit :
> >
> >> We want to store the configuration for our datasources separate from
> >> the distribution of the one-jar. If you haven't seen Jonathan
> >> [Gallimore's] excellent blog post on configuration TomEE, see here:
> >> https://www.tomitribe.com/blog/tomee-configuration-techniques/
> >>
> >> Looking at the TomEE plugin's options though, it allows you to
> >> include a system.properties at build time, but I can't seem to find a
> >> way to set it at runtime.
> >>
> >> Any ideas or alternatives?
> >>
> >>
> >>
> >> --
> >> Sent from:
> >> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >>
>
>


Re: Arquillian TomEE embedded on Java 10

2018-11-22 Thread Romain Manni-Bucau
It is likely missing some --add-opens for unamed module on the command line

Le jeu. 22 nov. 2018 17:43, COURTAULT Francois <
francois.courta...@gemalto.com> a écrit :

> Hello,
>
> I don't know if it is related but I can't use TomEE using Java 11 or 10.
>
> See my Jira issues:
>  - https://issues.apache.org/jira/projects/TOMEE/issues/TOMEE-2263
>  - https://issues.apache.org/jira/projects/TOMEE/issues/TOMEE-2264
>
> Best Regards.
> PS: you vote for it.
>
> -Original Message-
> From: vranac [mailto:kon...@yahoo.com]
> Sent: jeudi 22 novembre 2018 10:06
> To: users@tomee.apache.org
> Subject: Arquillian TomEE embedded on Java 10
>
> I'm using Java jdk 10 TomEE 7.1(also embedded), johnzon 1.0.0(also tried
> with
> 1.0.1) .
> When running test case which is using Arquillian, f.e. from Intellij I get
> this error message:
>
> Exception in thread "main" java.lang.IllegalAccessError: tried to access
> field org.apache.johnzon.jaxrs.jsonb.jaxrs.JsonbJaxrsProvider.config from
> class org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonbProvider
> at
>
> org.apache.openejb.server.cxf.rs.johnzon.TomEEJsonbProvider.(TomEEJsonbProvider.java:31)
> at
>
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
>
> java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
> at
>
> java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
> at
> java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)
> at java.base/java.lang.Class.newInstance(Class.java:560)
> at
>
> org.apache.openejb.server.cxf.rs.CxfRSService.initCxfProviders(CxfRSService.java:233)
> at
> org.apache.openejb.server.cxf.rs.CxfRSService.init(CxfRSService.java:213)
> at org.apache.tomee.catalina.TomcatLoader.initialize(TomcatLoader.java:301)
> at org.apache.tomee.embedded.Container.start(Container.java:741)
> at
>
> org.apache.openejb.arquillian.embedded.EmbeddedTomEEContainer.start(EmbeddedTomEEContainer.java:136)
> at
>
> org.jboss.arquillian.container.impl.ContainerImpl.start(ContainerImpl.java:179)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:137)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$8.perform(ContainerLifecycleController.java:133)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forContainer(ContainerLifecycleController.java:208)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startContainer(ContainerLifecycleController.java:133)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:564)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
> at
>
> org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:103)
> at
>
> org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:90)
> at
>
> org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:54)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
>
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.base/java.lang.reflect.Method.invoke(Method.java:564)
> at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:86)
> at
>
> org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:95)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:133)
> at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:105)
> at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:62)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:70)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController$2.perform(ContainerLifecycleController.java:64)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.forEachSuiteContainer(ContainerLifecycleController.java:181)
> at
>
> org.jboss.arquillian.container.impl.client.container.ContainerLifecycleController.startSuiteContainers(ContainerLifecycleController.java:64)
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> at
>
> 

Re: TomEE Maven Plugin: Can conf/system.properties be externalized?

2018-11-22 Thread Romain Manni-Bucau
side note: why tomee:exec and not tomee:build which was intended for that
case?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 22 nov. 2018 à 17:32, exabrial12  a écrit :

> Brilliant! I knew about setting system properties, but I didn't know ${var}
> would pull from the unix environment!
>
> What we're doing now is tomee-exec->deb package->sftp to ubuntu->freight
> script adds to apt repo->apt installation on linux system. The deb script
> creates a user/group after the artifact id, then installs a systemd unit to
> control the process. We then just point systemd at an environment file with
> all of the secret stuff:
>
>
> [Unit]
> Description=${project.artifactId} ${project.version}
> After=network.target
>
> [Service]
> EnvironmentFile=/etc/default/${project.artifactId}
> Type=simple
> WorkingDirectory=/opt/${project.artifactId}
> ExecStart=/usr/bin/java -jar
> /opt/${project.artifactId}/${project.artifactId}-exec.jar
> User=${project.artifactId}
> Group=${project.artifactId}
> RestartSec=10
> Restart=always
>
> [Install]
> WantedBy=multi-user.target
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Continuous integration and a PR

2018-11-22 Thread Romain Manni-Bucau
Hi Otavio,

Just needs to be asked to infra but the reactivity will be ~3h instead of a
few minutes like for small projects so not sure it would help much.
Investing in a build.sh can help more (./build.sh --core, ./build.sh
--tomee, ./build.sh --tomee --validate etc) - it is an old idea nobody
tackled by lack of need at that time

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 22 nov. 2018 à 14:56, Otávio Gonçalves de Santana <
osant...@tomitribe.com> a écrit :

> Hello everyone, I have a question about PR and continuous integrations.
> Why we don't have a plugin to run the tests when we open a PR?
>
> I'm also helping in another Apache Project such as Apache TinkerPop
> <https://github.com/apache/tinkerpop/pull/1000> and Apache Commons
> <https://github.com/apache/commons-lang/pull/384> Lang and both have this.
>
>
> I also did a small search about, and I find more projects such as Zeppelin,
> Commons-IO, Commons Collection those use the Travis plugin
> <https://travis-ci.org>.
>


Re: Continuous integration and a PR

2018-11-22 Thread Romain Manni-Bucau
If it helps: Travis is quite bad for big OS projects cause it has a limited
queue for OS project which prevent parallelism very quickly so you would
just wait days at the end, likely better to ask infra to setup the build on
ASF jenkins IMHO. We can have a light flavor of the build, like just a "mvn
clean install -Pall-adapters" - assuming a 3h build still helps.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 22 nov. 2018 à 15:15, Jonathan Gallimore <
jonathan.gallim...@gmail.com> a écrit :

> We do have a CI server:
> https://ci.apache.org/builders/tomee-trunk-ubuntu-jvm8
>
> Our build is massive though - it takes between 2 and 5 hours, depending on
> hardware. 6+ PRs being updated per day would mean it would be potentially
> running all the time with a growing queue. Commons-lang on the other hand,
> takes 15 minutes:
>
> https://travis-ci.org/apache/commons-lang/builds/457567190?utm_source=github_status_medium=notification
> .
>
> I'm certainly not against it, but I'm not sure it'll be a trivial setup
> either. For those interested, the relevant parts of our buildbot build are
> here:
>
> f = util.BuildFactory()
> f.addStep(steps.Git(repourl="/tomee.git", mode='full',
> method='clobber', submodules=True, branch="" + scm_path))
> f.addStep(steps.ShellCommand(command=["rm", "-rf", tmpdir],
> name="remove-tmpdir"))
> f.addStep(steps.ShellCommand(command=["mkdir", "-p", tmpdir],
> name="create-tmpdir"))
> f.addStep(steps.Compile(
> command=[
> "mvn",
> "-e",
> "--show-version",
> "--update-snapshots",
> "--fail-at-end",
> "-Djava.io.tmpdir=" + tmpdir,
> "clean",
> "install",
> "-Dhttps.protocols=TLSv1.1,TLSv1.2",
> "-DfailIfNoTests=false",
> "-DskipTests",
> ],
> env={'MAVEN_OPTS': mopts},
> warningPattern="(^WARN) | (^WARNING) | (^warning) |
> (.*warning[:].*)",
> warnOnWarnings=False,
> timeout=2400,
> name="compile"
> ))
>
> f.addStep(steps.ShellCommand(
> command=[
> "mvn",
> "-U",
> "-Dhttps.protocols=TLSv1.1,TLSv1.2",
> "checkstyle:check",
> "-Pstyle"
> ],
> name="check-formatting"
> ))
>
> f.addStep(steps.ShellCommand(
> command=[
> "mvn",
> "-Dhttps.protocols=TLSv1.1,TLSv1.2",
> "pmd:check",
> "-Pstyle"
> ],
> name="check-pmd"
> ))
>
> f.addStep(steps.ShellCommand(command=["rm", "-rf", tmpdir],
> name="remove-tmpdir"))
> f.addStep(steps.ShellCommand(command=["mkdir", "-p", tmpdir],
> name="create-tmpdir"))
> f.addStep(steps.Compile(
> command=[
> "mvn",
> "-U",
> "--show-version",
> "--fail-at-end",
> "-Djava.io.tmpdir=" + tmpdir,
> "clean",
> "install",
> "-Pall-adapters",
> "-Dmaven.test.error.ignore=true",
> "-Dmaven.test.failure.ignore=true",
> "-Dhttps.protocols=TLSv1.1,TLSv1.2",
> "-Dsurefire.useFile=false",
> "-DdisableXmlReport=true",
> "-Dopenejb.arquillian.debug=true",
> "-DTOMEE_LOCK_FILE=/tmp/" + name + "-tomee.port.lock",
> ],
> env={'MAVEN_OPTS': mopts},
> warningPattern="(^WARN) | (^WARNING) | (^warning) |
> (.*warning[:].*)",
> warnOnWarnings=False,
> timeout=18000,
> name="test"
> ))
>
> f.addStep(steps.ShellCommand(
> command=["bash", "-c", "find . -name 'org.*.txt' | xargs cat"],
> alwaysRun=True,
> name=&

Re: can't stop tomee with maven plugin

2018-11-22 Thread Romain Manni-Bucau
Stop a TomEE started with start command.
means you can use tomee:stop to stop an instance launched with tomee:start.
tomee:run blocks in the contextual shell and is stopped typing "exit" in
the shell (it is a kind of command line interface)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 22 nov. 2018 à 14:50, mauro2java2011  a
écrit :

> Sorry but what you mean with:
>
> Stop is intended for "start" only as in tomcat. ???
>
> From the page
>
> http://tomee.apache.org/tomee-maven-plugin.html
> <http://tomee.apache.org/tomee-maven-plugin.html>
>
> Exist the command tomee:stop
>
> Sorry for my confusion
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: TomEE Maven Plugin: Can conf/system.properties be externalized?

2018-11-21 Thread Romain Manni-Bucau
Hello,

You can always load system properties in setenv.sh before the server starts.

If it is properties settable after tomee.xml is read you can set them in it
and it supports 

Finally you can always plug a tomcat listener before tomee one and set the
system properties the way you want peogrammatically.

Le mer. 21 nov. 2018 23:51, exabrial12  a écrit :

> We want to store the configuration for our datasources separate from the
> distribution of the one-jar. If you haven't seen Jonathan [Gallimore's]
> excellent blog post on configuration TomEE, see here:
> https://www.tomitribe.com/blog/tomee-configuration-techniques/
>
> Looking at the TomEE plugin's options though, it allows you to include a
> system.properties at build time, but I can't seem to find a way to set it
> at
> runtime.
>
> Any ideas or alternatives?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: CXF customize wadl generation without spring

2018-11-15 Thread Romain Manni-Bucau
Hi Vicente,

don't think there is an example but cxf is configurable in tomee as in
spring (but without it):
http://tomee.apache.org/developer/configuration/cxf.html

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 15 nov. 2018 à 09:43, cocorossello  a
écrit :

> Hi,
>
> I would like to hide some endpoints in wadl generation, all examples I see
> are spring based, just setting org.apache.cxf.endpoint.private property to
> true, but I have no clue of how to do it in plain tomee. Is there any way
> to
> inject the configuration and setting that property or similar?
>
> What I would really like is to have two different wadl (public and
> private),
> but I can live just hiding some endpoints. I guess that for this matter I
> would have to write a servlet with a custom WadlGenerator, listing some
> endpoints. Is it right? Is there any example out there (without spring)?
>
> Thanks,
> Vicente.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: javaee-api 8.0 JPA

2018-11-14 Thread Romain Manni-Bucau
For the record it belongs to geronimo for the spec jar and tomee for the
integration in its bundle (javaee-api).
Thanks for opening the issue, think we can ping the right communities from
there ;).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 14 nov. 2018 à 09:43, cocorossello  a
écrit :

> Hi,
>
> I just created https://issues.apache.org/jira/browse/OPENJPA-2758 . Feel
> free to close it if it's not the right place. I'd be glad to help, but I'm
> not using openjpa and my knowledge about it is very limited.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Johnzon 1.0.1 change in behaviour for final objects

2018-10-29 Thread Romain Manni-Bucau
Failling fast is not really an option since it is the correct behavior and
does not violate java contract.

We can tune some config like the extsing readAttributeBeforeWrite to reuse
it to read your map and enrich it instead of overwriting it but it can also
lead to inconsistent values when reusing mapped objects.
Getting the map then clearing it before setting it is an option but not
sure it does worth it since the fix is very easy (a setter, dropping final,
@JohnzonAny in an object etc).

Le mar. 30 oct. 2018 04:40, dave  a écrit :

> Thanks for the explanation Romain.
>
> In this case I have been able to remove the final modifiers from the
> affected fields. This was the simplest thing to do as the mapping was being
> done automatically in REST API calls rather than explicitly via Johnzon.
>
> The problem did take some tracking down. I can understand the Map field m
> not being settable if final, but this also has the effect of causing
> Johnzon
> to silently not set the values within the map even if the map has been
> initialised. I presume the same would apply for any nested final objects
> containing settable non-final fields. From my perspective it would be
> preferable to either support this, or fail fast with an error in such
> cases.
>
> Regards,
> Dave
>
>
> Romain Manni-Bucau wrote
> > Hi Dave,
> >
> > yes this is tracked in https://issues.apache.org/jira/browse/JOHNZON-142
> > and 77
> >
> > long story short setting final fields was not intended and lead to
> > inconsistencies so this behavior has been dropped.
> >
> > if you need the previous behavior and are sure it is intended you can get
> > it back using:
> >
> > WithFinalMap o = new MapperBuilder()
> > .setAccessMode(new FieldAccessMode(true, true) {
> > @Override
> > protected MapString, Field fields(Class clazz,
> > boolean includeFinalFields) {
> > return super.fields(clazz, true);
> > }
> > })
> > .build().readObject("{\"m\":{\"A\":\"a\"}}", WithFinalMap.class);
> >
> >
> > That said i wouldnt recommand you to do it and maybe use the constructor
> > rather than this old hack
> >
> > Romain Manni-Bucau
> > @rmannibucau https://twitter.com/rmannibucau; |  Blog
> > https://rmannibucau.metawerx.net/; | Old Blog
> > http://rmannibucau.wordpress.com; | Github
> > https://github.com/rmannibucau; |
> > LinkedIn https://www.linkedin.com/in/rmannibucau; | Book
> > 
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> ;
> >
> >
> > Le lun. 29 oct. 2018 à 00:10, dave 
>
> > d.eaves@.co
>
> >  a écrit :
> >
> >> Hi,
> >>
> >> I am attempting to upgrade from TomEE 7.0.4 (Johnzon 1.0.0) to TomEE
> >> 7.1.0
> >> (Johnzon 1.0.1) and have encountered a change in behaviour with JSON
> >> deserialization. The below test passes with Johnzon 1.0.0 but fails with
> >> 1.0.1.
> >>
> >> Tracing this through with the different Johnzon versions it appears the
> >> cause is FieldAccessMode.field() method excluding final fields in 1.0.1.
> >> Johnzon no longer regards the map field "m" as writeable so silently
> >> skips
> >> attempting to put its contents. Removing the final modifier from the map
> >> avoids the issue.
> >>
> >> Is this behaviour considered erroneous?
> >>
> >> Thanks,
> >> Dave
> >>
> >> public class JohnzonMapperTest
> >> {
> >>   @Test
> >>   public void testFinalMap()
> >>   throws Exception
> >>   {
> >> WithFinalMap o = new
> >> MapperBuilder().build().readObject("{\"m\":{\"A\":\"a\"}}",
> >> WithMap.class);
> >> assertEquals("a", o.m.get("A"));
> >>   }
> >>
> >>
> >>   public static class WithFinalMap
> >>   {
> >> public final MapString, Object m = new HashMap<>();
> >>   }
> >> }
> >>
> >>
> >>
> >>
> >> --
> >> Sent from:
> >> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >>
>
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
yes

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 16:53, exabrial12  a écrit :

> So the @Provider annotation does nothing for the jaxrs client essentially.
> Is
> this correct?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
yes

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 16:41, exabrial12  a écrit :

> So, currently I'm not instantiating it. I tried both managing it with CDI
> (@ApplicationScoped AND @Provider), no management (Just annotating
> @Provider) and it didn't get picked up automatically. The only thing that
> worked was @ApplicationScoped it and calling client.register on the CDI
> managed instance. Is that expected behavior?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Heap Memory / boot Tomee

2018-10-29 Thread Romain Manni-Bucau
yep, scan.xml controls all the scanning globally for the app

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 16:19, Matthew Broadhead
 a écrit :

>   just tried using scan.xml but i get:
>
> 29-Oct-2018 16:15:16.495 SEVERE [localhost-startStop-1]
> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication CDI Beans
> module deployment failed
>   org.apache.webbeans.exception.WebBeansDeploymentException:
> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> [org.apache.deltaspike.core.spi.future.FutureableStrategy] is not found
> with the qualifiers
> Qualifiers: [@javax.enterprise.inject.Default()]
> for injection into Field Injection Point, field name :
> futureableStrategy, Bean Owner : [FutureableInterceptor,
> WebBeansType:INTERCEPTOR, Name:null, API
>
> Types:[org.apache.deltaspike.core.impl.future.FutureableInterceptor,java.lang.Object,
> java.io.Serializable],
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
>  at
> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:338)
>  at
>
> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
>  at
>
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:189)
>  at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:41)
>  at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:963)
>  at
>
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:757)
>  at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1303)
>  at
>
> org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1125)
>  at
>
> org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:133)
>  at
>
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:94)
>  at
>
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5154)
>  at
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
>  at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)
>  at
>
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)
>  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>  at
>
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>      at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  at java.lang.Thread.run(Thread.java:748)
>
> am i supposed to scan deltaspike library?
>
> On 29/10/2018 15:02, Romain Manni-Bucau wrote:
> > Hello,
> >
> > it depends the scanning coverage for your app, normally you can tune it
> > using scan.xml (in WEB-INF) to only scan the EE classes (CDI/EJB) and not
> > all others which will reduce it at the minimum.
> >   See http://tomee.apache.org/refcard/refcard.html for more details
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> >
> > Le lun. 29 oct. 2018 à 14:53, cedr29  a écrit
> :
> >
> >> Hi,
> >>
> >> I would like to know if increase of heap memory is normal just after
> >> booting
> >> tomee.
> >> I ran GC and analysed hprof in "Memory Analyser"
> >>
> >> It tells me that I have :
> >> - 17,3Mo of "org.apache.bval.cdi.BValExtension".
> >> Next ones are
> >> -"java.net.URLClassLoader" with 5.1Mo
> >> - TomEEWebappClassLoader with 5Mo
> >> webbeans.container.BeanManagerImpl with 3.7Mo
> >>
> >> Those values are coherent?
> >>
> >> By default I have 192Mo max for Heap size.
> >> I expose more and more REST APIs et SOAP WS and i d like to know if its
> >> normal heap size takes 150Mo just after boot.
> >>
> >> Thank You
> >>
> >>
> >>
> >> --
> >> Sent from:
> >> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >>
>
>


Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
Yep, except you instantiate yourself the client outside any container so
you are the one to pick it up ;)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 16:32, exabrial12  a écrit :

> Actually, I just wrote my own MessageBodyReader/writer, annotated it with
> @Provider, and it is _definitely not_ being invoked while using the JAXRS
> client. Is that the expected behavior?
>
> It *does* work if you call client.register(), but I thought anything
> annotated @Provider was supposed to be picked up automatically.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-29 Thread Romain Manni-Bucau
Here what i has in mind:


public class MyClient {
private MyClient() {
// no-op
}

public static void main(final String[] args) throws JAXBException {
Client client = ClientBuilder.newClient();
try {
client.register(new
MyJaxbProvider<>(JAXBContext.newInstance(MyRoot.class)))
  .target("http://foo.bar;)
  .request()
  .get();
} finally {
client.close();
}
}

@XmlRootElement
public static class MyRoot {
// ...
}

// note: base impl, error handling + stream security to enhance etc
public static class MyJaxbProvider implements
MessageBodyReader, MessageBodyWriter {
private final JAXBContext context;

public MyJaxbProvider(final JAXBContext context) {
this.context = context;
}

private boolean isJaxb(final Class type) {
return type.isAnnotationPresent(XmlRootElement.class) ||
type.isAnnotationPresent(XmlType.class);
}

@Override
public boolean isReadable(final Class type, final Type genericType,
  final Annotation[] annotations,
final MediaType mediaType) {
return isJaxb(type);
}

@Override
public T readFrom(final Class type, final Type genericType,
Annotation[] annotations,
  final MediaType mediaType, final
MultivaluedMap httpHeaders,
  final InputStream entityStream)
throws WebApplicationException {
// customize the xml size etc if no other protection in
front - see AbsrtactJAXBProvider configureReader
try {
return
context.createUnmarshaller().unmarshal(StaxUtils.createXMLStreamReader(entityStream),
type).getValue();
} catch (final JAXBException e) {
throw new WebApplicationException(Response.Status.BAD_REQUEST);
}
}

@Override
public boolean isWriteable(final Class type, final Type genericType,
   final Annotation[] annotations,
final MediaType mediaType) {
return isJaxb(type);
}

@Override
public void writeTo(final T t, final Class type, final Type
genericType,
final Annotation[] annotations, final
MediaType mediaType,
final MultivaluedMap
httpHeaders, final OutputStream entityStream)
throws WebApplicationException {
try {
context.createMarshaller().marshal(t,
StaxUtils.createXMLStreamWriter(entityStream));
} catch (final JAXBException e) {
throw new WebApplicationException(Response.Status.BAD_REQUEST);
}
}
}
}


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 15:41, exabrial12  a écrit :

> Romain Manni-Bucau wrote
> > You register you provider(s) and cxf should let it be taken cause user
> > providers are higher priority for the same media type.
>
> Got it, so create our own handlers for XML.
>
>
> Romain Manni-Bucau wrote
> > The messagebody reader/writer are trivial to impl if you have the
> context
> > so yes, just dont try to reuse cxf but just jaxrs here. Cxf logic is
> > mainly
> > grabbing the jaxbcontext so if you have it no nees of that cxf logic.
>
> Apologies, I'm not understanding what you're saying.
>
> Given this:
>
> https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java#L479
>
> I would suspect the "correct" way to fix it would be to to simply put all
> of
> the Providers into the CXF MessageContext somehow?
>
> Or, if you can tell me the best place to do it, I'll see if I can put a
> patch together, just try to be as specific as possible. Thank you!
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Heap Memory / boot Tomee

2018-10-29 Thread Romain Manni-Bucau
Maybe activate -Dopenejb.cdi.debug=true to ensure it is taken into account
in your instance

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 15:24, cedr29  a écrit :

> Thank you Romain for quick reply.
>
> I already use a scan.xml in my webapp (in "WEB-INF" folder of my war)
>
> 
> 
> 
> com.MyEntreprise
> 
> 
>
> This is why I dont understand why so much memory is consummed just after
> tomee boot.
> If you have an other Idea? (We use Tomee 7.0.4 with JDK8).
>
> Thanks/Merci!
>
>
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Heap Memory / boot Tomee

2018-10-29 Thread Romain Manni-Bucau
Hello,

it depends the scanning coverage for your app, normally you can tune it
using scan.xml (in WEB-INF) to only scan the EE classes (CDI/EJB) and not
all others which will reduce it at the minimum.
 See http://tomee.apache.org/refcard/refcard.html for more details

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 14:53, cedr29  a écrit :

> Hi,
>
> I would like to know if increase of heap memory is normal just after
> booting
> tomee.
> I ran GC and analysed hprof in "Memory Analyser"
>
> It tells me that I have :
> - 17,3Mo of "org.apache.bval.cdi.BValExtension".
> Next ones are
> -"java.net.URLClassLoader" with 5.1Mo
> - TomEEWebappClassLoader with 5Mo
> webbeans.container.BeanManagerImpl with 3.7Mo
>
> Those values are coherent?
>
> By default I have 192Mo max for Heap size.
> I expose more and more REST APIs et SOAP WS and i d like to know if its
> normal heap size takes 150Mo just after boot.
>
> Thank You
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Johnzon 1.0.1 change in behaviour for final objects

2018-10-29 Thread Romain Manni-Bucau
Hi Dave,

yes this is tracked in https://issues.apache.org/jira/browse/JOHNZON-142
and 77

long story short setting final fields was not intended and lead to
inconsistencies so this behavior has been dropped.

if you need the previous behavior and are sure it is intended you can get
it back using:

WithFinalMap o = new MapperBuilder()
.setAccessMode(new FieldAccessMode(true, true) {
@Override
protected Map fields(Class clazz,
boolean includeFinalFields) {
return super.fields(clazz, true);
}
})
.build().readObject("{\"m\":{\"A\":\"a\"}}", WithFinalMap.class);


That said i wouldnt recommand you to do it and maybe use the constructor
rather than this old hack

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 29 oct. 2018 à 00:10, dave  a écrit :

> Hi,
>
> I am attempting to upgrade from TomEE 7.0.4 (Johnzon 1.0.0) to TomEE 7.1.0
> (Johnzon 1.0.1) and have encountered a change in behaviour with JSON
> deserialization. The below test passes with Johnzon 1.0.0 but fails with
> 1.0.1.
>
> Tracing this through with the different Johnzon versions it appears the
> cause is FieldAccessMode.field() method excluding final fields in 1.0.1.
> Johnzon no longer regards the map field "m" as writeable so silently skips
> attempting to put its contents. Removing the final modifier from the map
> avoids the issue.
>
> Is this behaviour considered erroneous?
>
> Thanks,
> Dave
>
> public class JohnzonMapperTest
> {
>   @Test
>   public void testFinalMap()
>   throws Exception
>   {
> WithFinalMap o = new
> MapperBuilder().build().readObject("{\"m\":{\"A\":\"a\"}}", WithMap.class);
> assertEquals("a", o.m.get("A"));
>   }
>
>
>   public static class WithFinalMap
>   {
> public final Map m = new HashMap<>();
>   }
> }
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-27 Thread Romain Manni-Bucau
The messagebody reader/writer are trivial to impl if you have the context
so yes, just dont try to reuse cxf but just jaxrs here. Cxf logic is mainly
grabbing the jaxbcontext so if you have it no nees of that cxf logic.

You register you provider(s) and cxf should let it be taken cause user
providers are higher priority for the same media type.

Le ven. 26 oct. 2018 22:22, exabrial12  a écrit :

> Thanks for the information, I'll take a look at ClientProviderFactory and
> see
> what would be involved.
>
>
> I didn't understand what you mean though by "wire it in the provider"
> though. Is there a way to specify a JAXB Context on the client?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Should the JAX-RS Client pay attention to ContextResolver[s]?

2018-10-26 Thread Romain Manni-Bucau
Hello

AFAIK cxf does not support it client side and spec is silent on it even if
the api is always associated with server references ("resources"). Maybe
open a feature request, no reason the clientproviderfactory cant support it.

Now for your issue you can wire it in the provider when creating your
client so no real need of the resolver ;)

Le ven. 26 oct. 2018 18:38, exabrial12  a écrit :

> I'm having trouble finding whether or not this is in the specification or
> not, but lets say I want the JAX-RS client to use a custom JAXB Context
> that
> I universally manage with CDI:
> @ApplicationScopedpublic class JaxbContextResolver implements
> ContextResolver {  @Inject  private JAXBContext jaxbContext;  @Override
> public JAXBContext getContext(Class type) {return jaxbContext;  }}
> I then call an endpoint that requires XML:
> ...@Injectprivate JaxbContextResolver jaxbContextResolver;...  Client
> client
> = ClientBuilder.newClient();  client.register(jaxbContextResolver);
> client.target("https://example.com
> ").request("application/xml").post(Entity.entity(payload,
> "application/xml"), Response.class);..
> The problem I'm having is that the jax-rs client is never calling my
> jaxbContextResolver.getContext() method. Are ContextResolver[s] supported
> on
> the jax-rs client or is that not in the spec? I did notice that CXF
> attempts
> to use a ContextResolver but it's not finding mine:
>
> https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AbstractJAXBProvider.java#L479
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html


Re: tomee+activemq: JMS reading sometimes hang with full queue

2018-10-24 Thread Romain Manni-Bucau
Le mer. 24 oct. 2018 à 09:23, Emmanuel Touzery <
emmanuel.touz...@lit-transit.com> a écrit :

> Hello,
>
>  thank you for the answer!
>
>  In this case TOMEE and AMQ are in the same process, on the same
> machine, communicating through 127.0.0.1 so network between AMQ and
> TOMEE shouldn't be an issue.
>

you are client of yourself? was more thinking about client <-> server

typically if you have

sender -- some proxy --- message driven bean

then you can have these "fake state" on network layer


>  In our case, writing to JMS keeps working, but consumers don't get
> notified. I'm not sure if there are two separate communication channels
> for that?
>

normally it is the same but depending the queue state it can block

did you check your DLQ too?


>
>  I'm not sure what you mean by backpressure, but we did disable flow
> control (which should only affect writes though, not notifying
> consumers) -- were you referring to something like that?
>

Yep


>  Also don't know about a disk issue -- the persistent queue keeps
> filling up on disk, and I see no exceptions in the logs.
>

maybe next time give a quick peak to the disk state and if the partition is
full,
can also be good to activate AMQ debug logs in such cases (if you can)


>
>  When you talk about batch size, do you mean acknowledge
> optimization? ("ActiveMQ can acknowledge receipt of messages back to the
> broker in batches (to improve performance). The batch size is 65% of the
> prefetch limit for the Consumer"). This sounds like it could be
> related.. If acknowldge breaks down, AMQ would wait on consumers to
> complete, while the consumers did complete and are waiting for new
> messages. I already had the idea to check on the JMX "InFlightMessages"
> info during such an incident to confirm whether AMQ thinks that
> consumers are busy. But even if it turns out it does, that doesn't
> really help me, short-term.
>

Yep, here you can test with a batch size of 1 (will be "slow" but each
message is considered alone)


>
>  In this case client=server (we get messages over HTTP, write them
> in a queue on the activeMQ which runs in the same process as TOMEE, and
> consume them from the same TOMEE instance) so the thread dump I did
> covers both client & server.
>

It answers to the first question, so if you don't have any dynamic network
(like it can be with docker or so) it is likely not the issue.


>
>  Another backend than kahadb could be interesting, but there's a lot
> of traffic and validation of configuration changes for the server is
> expensive. I'm not sure that's really workable, especially since the
> chances of this fixing the issue are not that high.
>

Well, first you need to have an environment reproducing that issue then you
can iterate to identify it:

(no particular order)

0. DLQ state (ensure it is monitored)
1. network (if relevant)
2. backend
3. (potentially) transport
4. AMQ version

...


>
>  Regards,
>
> Emmanuel
>
> On 24/10/2018 08:39, Romain Manni-Bucau wrote:
> > Hello Emmanuel
> >
> > It can be a lot of things like a network breakdown behind a proxy (so AMQ
> > does not see it in some cases and a restart recreates the connection),
> some
> > backpressure (exponentional), some disk issue etc...
> >
> > It can be interesting to check your config for healthchecks, batch sizes,
> > and dump the threads in the server and client when hanging. Also testing
> > with another backend than kahadb can be interesting depending your work
> > load.
> >
> > Le mer. 24 oct. 2018 07:59, Emmanuel Touzery <
> > emmanuel.touz...@lit-transit.com> a écrit :
> >
> >> Hello,
> >>
> >>   noone has any suggestion?
> >>
> >>   Regards,
> >>
> >> emmanuel
> >>
> >> On 22/10/2018 16:04, Emmanuel Touzery wrote:
> >>> Hello,
> >>>
> >>>  we have a tomee+ 7.0.3 installation with activemq, using kahadb as
> >>> a persistent message storage. We have an activemq.xml, we plugged it
> >>> though :
> >>>
> >>> BrokerXmlConfig = xbean:file:/opt/app/tomee/conf/activemq.xml
> >>>
> >>>  in the tomee.xml. The activemq broken runs within TOMEE:
> >>>
> >>> ServerUrl   =  tcp://127.0.0.1:61616
> >>>
> >>>  We have a prefetch of 2000:
> >>>
> >>>  >>> uri="nio://0.0.0.0:61616?jms.prefetchPolicy.all=2000"/>
> >>>
> >>>  We use mKaha. We disabled flow control.
> >>>
> >>>

Re: tomee+activemq: JMS reading sometimes hang with full queue

2018-10-24 Thread Romain Manni-Bucau
Hello Emmanuel

It can be a lot of things like a network breakdown behind a proxy (so AMQ
does not see it in some cases and a restart recreates the connection), some
backpressure (exponentional), some disk issue etc...

It can be interesting to check your config for healthchecks, batch sizes,
and dump the threads in the server and client when hanging. Also testing
with another backend than kahadb can be interesting depending your work
load.

Le mer. 24 oct. 2018 07:59, Emmanuel Touzery <
emmanuel.touz...@lit-transit.com> a écrit :

> Hello,
>
>  noone has any suggestion?
>
>  Regards,
>
> emmanuel
>
> On 22/10/2018 16:04, Emmanuel Touzery wrote:
> > Hello,
> >
> > we have a tomee+ 7.0.3 installation with activemq, using kahadb as
> > a persistent message storage. We have an activemq.xml, we plugged it
> > though :
> >
> > BrokerXmlConfig = xbean:file:/opt/app/tomee/conf/activemq.xml
> >
> > in the tomee.xml. The activemq broken runs within TOMEE:
> >
> > ServerUrl   =  tcp://127.0.0.1:61616
> >
> > We have a prefetch of 2000:
> >
> >  > uri="nio://0.0.0.0:61616?jms.prefetchPolicy.all=2000"/>
> >
> > We use mKaha. We disabled flow control.
> >
> > So that everything would work, we had to add a couple of JARs in
> > the TOMEE lib folder:
> >
> > activemq-spring-5.14.3.jar
> > spring-beans-3.2.9.RELEASE.jar
> > spring-context-3.2.9.RELEASE.jar
> > spring-core-3.2.9.RELEASE.jar
> > spring-expression-3.2.9.RELEASE.jar
> > spring-web-3.2.9.RELEASE.jar
> > xbean-spring-3.9.jar
> >
> > We are "reading" from JMS through message-driven beans,
> > implementing MessageListener and with @MessageDriven annotations.
> >
> > The application is pretty simple... Receive the data from
> > HTTP/JSON, and store it to SQL (through hibernate).
> >
> > Everything works fine as long as the traffic is normal. However
> > when there is a surge of incoming traffic, sometimes the JMS consumers
> > stop getting called, and the queue only grows. The issue does not get
> > fixed until TOMEE is restarted. And then we've seen the issue
> > re-appear again maybe 40 minutes later. After a while, the server
> > clears the queue and everything is fine again.
> >
> > We took a jstack thread dump of the application when it's in that
> > "hung" state:
> > https://www.dropbox.com/s/p8wy7uz6inzsmlj/jstack.txt?dl=0
> >
> > What's interesting is that writes fall quite fast, and in steps,
> > in general not all at once, but as well not slowly:
> > https://www.dropbox.com/s/nhm5s2zc7r9mk9z/graph_writes.png?dl=0
> >
> > After a restart things are fine again immediately.
> >
> > We're not sure what is the cause. From what we can tell from the
> > thread dump, the consumers are idle, they just don't get notified that
> > work is available. The server is certainly aware there are items in
> > the queue, we monitor the queue through JMX and the queue size keeps
> > growing during these episodes. We don't see anything out of the
> > ordinary in the logs. We looked at thread IDs for consumers just
> > before the issue, it doesn't look like the consumers get some deadlock
> > one after the other for instance. It seems like a bunch of them are
> > called in the last minute before the dropoff for instance. Also,
> > during a blackout the JDBC pool usage is at 0 according to our JMX
> > monitoring, so it doesn't seem to be about a deadlocked JDBC connection.
> >
> > We did notice the following activemq warnings in the log file, but
> > the timestamps don't match with any particular events and from what we
> > found out, they don't seem to be particularly worrying or likely to be
> > related to the issue:
> >
> > WARNING [ActiveMQ Journal Checkpoint Worker]
> >
> org.apache.activemq.store.kahadb.MessageDatabase.getNextLocationForAckForward
>
> > Failed to load next journal location: null
> >
> > WARNING [ActiveMQ NIO Worker 6]
> > org.apache.activemq.broker.TransportConnection.serviceTransportException
> > Transport Connection to: tcp://127.0.0.1:37024 failed:
> > java.io.EOFException
> >
> > Do you have any suggestion to try to fix this issue (which we
> > sadly can't reproduce at will.. and it only happens pretty rarely)?
> > Should we rather ask on the activemq mailing list?
> >
> > Regards,
> >
> > emmanuel
> >
> >
>
>


Re: JAX-RS: deserialization of org.json.JSONObject

2018-10-16 Thread Romain Manni-Bucau
Hi Kean

You can write a message body reader/writer to handle org.json.


Le mar. 16 oct. 2018 20:50, Kean Erickson  a
écrit :

> Although the javax.json.JsonObject API at is now meant to be used instead,
> it's interesting that org.json.JSONObject is properly deserialized in
> JAX-RS. The only catch is that every json object nested inside is itself
> nested as a value with a key called "map", such that if I had a structure
> like this:
>
> "a" : { "b" : "c" }
>
> ...the resulting output would be:
>
> "a" : { "map" : {"b": "c"} }
>
> The org.simple.JSONObject library would be completely usable for this
> purpose if not for this one strange addition. I'm wondering where this
> behavior originates, or the simplest way to change it?
>
> I'm aware that the json processing API is meant to be used instead, but I
> find it to be fairly inflexible compared to JSONObject for a few reasons,
> so I'd prefer to use the latter if possible.
>
> Thanks,
> -Kean
>


Re: bval emailvalidator

2018-10-14 Thread Romain Manni-Bucau
Yes or just import commons lib

Le dim. 14 oct. 2018 12:48, Matthew Broadhead
 a écrit :

> i just noticed that apache commons validator is not included in TomEE.
> i wanted to use EmailValidator.  i noticed that BVal has an
> EmailValidator.  can that be used instead?
>


Re: TomEE management/administration applications

2018-10-05 Thread Romain Manni-Bucau
Hi Sudhakar,

We don't have an OS/free console really worth it ATM I think - mainly
because our configuration stays simple enough to not require it. We have a
few JMX stuff but it depends what you are looking for.

Not sure there is a book going really further Tomcat administration and
tomee configuration but you can check our website at
http://tomee.apache.org/docs.html and ask any question you don't find an
answer to here.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 5 oct. 2018 à 13:52, sudhakarvm  a écrit :

> We are looking for TomEE administration application similar to Weblogic
> console, from where I can override connection pool settings, thread pool
> settings, JVM settings etc. Or using GUI I can enable a queue or disable,
> view the EJB's. Is there any such application. Should I look into Webadmin.
>
> I tried tomee-webaccess-7.0.2, it seemed to be just deployed applications
> and log file viewer. Can it do anything more.
>
> tomee-webapp-7.0.2.war, seems to be just TomEE installer; but it did not
> worked on my machine. I could just Installer link and nothing happens after
> clicking it.
>
> Also can you please suggest any good books for TomEE development and
> administration.
>
> Thanks in advance.
> Sudhakar
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Does SingleSignOn valve works for web apps deployed inside an .ear file?

2018-10-03 Thread Romain Manni-Bucau
Hi Luis,

yes, it relies on "local" storage accross webapps so it works.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 3 oct. 2018 à 18:37, Luis Rodríguez Fernández  a
écrit :

> Hello there,
>
> OS Version: CentOS Linux release 7.5.1804
> (Core) 3.10.0-862.11.6.el7.x86_64
> Server version: Apache Tomcat/8.5.32 (TomEE 7.0.5)
>
> I am deploying a (huge, sigh...) .ear file with multiple .war applications
> on it. I was wondering if the good and
> old "org.apache.catalina.authenticator.SingleSignOn" valve would work with
> them.
>
> For the deployment I am copying the .ear file in an "apps" folder inside my
> $CATALINA_BASE. My conf/tomee.xml looks like:
>
> 
>
>   
> 
>
> Any thoughts on this?
>
> Thanks in advance,
>
> Luis
>
> --
>
> "Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better."
>
> - Samuel Beckett
>


Re: jdbc connection pool size 2

2018-10-01 Thread Romain Manni-Bucau
2 is not our default, it should be inherited from the pool defaults

In cloudfoundry or any environment it is quite easy to change the default
cause you can always use resources.xml to force the value if you want (it
supports placeholders on the env variable if needed to get back the
url/user/password)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 1 oct. 2018 à 08:12, clemensx  a écrit :

> Thank for all the good suggestions. But my main question remains: Why is
> the
> max connection count set to 2? This cannot be the default, right?
>
> Also, changing (default) parameters is very complicated in a CloudFoundry
> environment - I didn't get this working for other problems, e.g. with
> default thread pool size. Nevertheless, I first need to understand why
> TomEE
> uses 2 connections, then think about where to change that.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Does TomEE support EJB 2?

2018-09-28 Thread Romain Manni-Bucau
Hi Aaron

We didnt drop that support so it should work

Le ven. 28 sept. 2018 20:10, Aaron  a écrit :

> Does TomEE support EJB 2? After upgrading our previous application server,
> the new version puked up a bunch of errors about no longer supporting EJB 2
> entities (and that wasn't the only problem we faced).
>
> Does TomEE support legacy EJB 2 software, or will it want the code
> rewritten
> to be EJB 3 compliant?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: jdbc connection pool size 2

2018-09-28 Thread Romain Manni-Bucau
I'd just add to Jon's answer that setting a maxWait to 0 will help you to
identify these issues, otherwise it can hides some undersizing problem
during the tuning phase.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 28 sept. 2018 à 16:24, Jonathan Gallimore <
jonathan.gallim...@gmail.com> a écrit :

> I tend to run with small connection pools and only increase them if its
> really necessary. If you do have something leaking a connection somewhere,
> its worth solving that rather than increasing the pool size. That said, I'd
> say a maxactive of 2 is very small, and maybe 10 would be a good starting
> point. If you're seeing most of your connections in use all the time at
> that point, get some thread dumps and maybe some timings on your queries to
> make sure nothing is getting stuck.
>
> Jon
>
> On Fri, Sep 28, 2018 at 3:17 PM clemensx  wrote:
>
> > We have very long background processes working intensively with the DB.
> So
> > I
> > would guess that at least one connection is almost always in use. Two
> just
> > is too few connections. Even if a much larger pool would maybe not really
> > solve the problem, it would at least make it much less severe.
> >
> > If we last around a day currently with two connections, my guess would be
> > to
> > last many days with many more connections...
> >
> >
> >
> > --
> > Sent from:
> > http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >
>


Re: Apache Ignite initialization before EntityManagerFactory

2018-09-27 Thread Romain Manni-Bucau
Well, long story short you can create any instance from your app
classloader and make it a resource using resources.xml.

The datasources follow that rule and just need some tricks in some cases:

1. If you want it to be jta managed then you need to use the jta wrapper
(see
https://rmannibucau.wordpress.com/2014/04/11/openejbtomee-custom-datasource-jta-integration/
)
2. To ensure it works with jpa, add type=DataSource as for any default
datasource - even using class-name.

Le jeu. 27 sept. 2018 23:43, Shultz, Dmitry  a
écrit :

> I figured it out when found this:
> https://rmannibucau.wordpress.com/2013/11/05/openejbtomee-resources-how-does-it-work/
> and this
> http://svn.apache.org/repos/asf/tomee/tomee/trunk/container/openejb-core/src/main/resources/META-INF/org.apache.openejb/service-jar.xml
>
> Everything seems to be working now.
> However, I noticed the resource factory method is called twice (7.0.4) not
> sure how bad it is.
>
>
> Cheers,
> Dmitry
>
> -Original Message-
> From: Shultz, Dmitry
> Sent: Thursday, September 27, 2018 1:28 PM
> To: users@tomee.apache.org
> Subject: RE: Apache Ignite initialization before EntityManagerFactory
>
> Thanks Romain.
>
> Ignite is using static variables internally to track it's cache instances,
> so EntityManagerFactory and Ignite must be initiated by the same
> classloader, not sure if it will create problem with custom resource for
> Ignite, I will try to play with it and lazy persistence unit later.
>
> For now I would like to figure out how to instantiate the DataSource
> properly using class-name/factory-name approach (I'm going to need this for
> another use case as well).
>
> I can see the
> https://github.com/apache/tomee/blob/master/container/openejb-core/src/test/java/org/apache/openejb/config/typed/util/ServerContextTest.java
> is using DataSourceBuilder and ServerContext to create the DataSource
> resource. Is there anything like that can be used from my custom factory
> method?
>
> Cheers,
> Dmitry
>
> -Original Message-
> From: Romain Manni-Bucau [mailto:rmannibu...@gmail.com]
> Sent: Thursday, September 27, 2018 12:28 PM
> To: users@tomee.apache.org
> Subject: Re: Apache Ignite initialization before EntityManagerFactory
>
> This works, you can also create an ignite resource just to create ignite
> instance.
>
> That said, did you try to make your persistence unit lazy? Can make it
> working and let you start ignite from your app.
>
> Le jeu. 27 sept. 2018 21:01, Shultz, Dmitry  a
> écrit :
>
> > Figured out some way to make sure Ignite is initialized before
> > EntityManagerFactory, not sure if it's the right way though. Please
> > let me know if I'm doing something conceptually wrong here.
> >
> > I'm trying to use the  class-name and factory-name (as described here:
> > http://tomee.apache.org/application-resources.html) to make sure the
> > DataSource is initialized after Ignite.start() is called. The sequence
> > problem seems to be resolved, but I'm not sure how to properly
> > manually instantiate the JTA managed datasource.
> >
> > Here is my resources.xml:
> >
> > 
> >
> >  > class-name="com.bla.bla.DataSourceFactory" factory-name="create">
> > JdbcDriver   = org.postgresql.Driver
> > JdbcUrl  = jdbc:postgresql://localhost:5432/mydb
> > UserName = user
> > Password = test
> > maxActive = 10
> > maxIdle = 10
> > TestOnBorrow = true
> > TestWhileIdle = true
> > TestOnReturn = true
> > ValidationQuery = SELECT 1
> > JtaManaged=true
> > 
> > 
> >
> >
> > Here is my factory method (ofcom.bla.bla.DataSourceFactory):
> >
> > public Object create() {
> >
> > initIgnite();
> >
> > BasicManagedDataSource resource = new
> > BasicManagedDataSource("myDB");
> > resource.setJdbcDriver("org.postgresql.Driver");
> > resource.setJdbcUrl("jdbc:postgresql://localhost:5432/mydb");
> > resource.setUserName("user");
> > resource.setPassword("test");
> > resource.setTestOnBorrow(true);
> > resource.setTestWhileIdle(true);
> > resource.setTestOnReturn(true);
> > resource.setValidationQuery("SELECT 1");
> >
> > return resource;
> > }
> >
> > BasicManagedDataSource doesn't have the setJtaManaged(), so it's
> > probably not a good choice... Also, and I'm seeing this in the log:
> >
> > 27-S

Re: Apache Ignite initialization before EntityManagerFactory

2018-09-27 Thread Romain Manni-Bucau
This works, you can also create an ignite resource just to create ignite
instance.

That said, did you try to make your persistence unit lazy? Can make it
working and let you start ignite from your app.

Le jeu. 27 sept. 2018 21:01, Shultz, Dmitry  a
écrit :

> Figured out some way to make sure Ignite is initialized before
> EntityManagerFactory, not sure if it's the right way though. Please let me
> know if I'm doing something conceptually wrong here.
>
> I'm trying to use the  class-name and factory-name (as described here:
> http://tomee.apache.org/application-resources.html) to make sure the
> DataSource is initialized after Ignite.start() is called. The sequence
> problem seems to be resolved, but I'm not sure how to properly manually
> instantiate the JTA managed datasource.
>
> Here is my resources.xml:
>
> 
>
>  class-name="com.bla.bla.DataSourceFactory" factory-name="create">
> JdbcDriver   = org.postgresql.Driver
> JdbcUrl  = jdbc:postgresql://localhost:5432/mydb
> UserName = user
> Password = test
> maxActive = 10
> maxIdle = 10
> TestOnBorrow = true
> TestWhileIdle = true
> TestOnReturn = true
> ValidationQuery = SELECT 1
> JtaManaged=true
> 
> 
>
>
> Here is my factory method (ofcom.bla.bla.DataSourceFactory):
>
> public Object create() {
>
> initIgnite();
>
> BasicManagedDataSource resource = new
> BasicManagedDataSource("myDB");
> resource.setJdbcDriver("org.postgresql.Driver");
> resource.setJdbcUrl("jdbc:postgresql://localhost:5432/mydb");
> resource.setUserName("user");
> resource.setPassword("test");
> resource.setTestOnBorrow(true);
> resource.setTestWhileIdle(true);
> resource.setTestOnReturn(true);
> resource.setValidationQuery("SELECT 1");
>
> return resource;
> }
>
> BasicManagedDataSource doesn't have the setJtaManaged(), so it's probably
> not a good choice... Also, and I'm seeing this in the log:
>
> 27-Sep-2018 18:26:50.516 WARNING [http-nio-8080-exec-4]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'JdbcDriver' for resource 'my-app/myDS'
> 27-Sep-2018 18:26:50.516 WARNING [http-nio-8080-exec-4]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'JdbcUrl' for resource 'my-app / myDS '
> 27-Sep-2018 18:26:50.516 WARNING [http-nio-8080-exec-4]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'UserName' for resource 'my-app / myDS '
> 27-Sep-2018 18:26:50.516 WARNING [http-nio-8080-exec-4]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'Password' for resource 'my-app / myDS '
> ...
>
>
> From: Shultz, Dmitry
> Sent: Thursday, September 27, 2018 10:03 AM
> To: users@tomee.apache.org
> Subject: Apache Ignite initialization before EntityManagerFactory
>
> Hi All,
>
> I'm trying to use Apache Ignite as a L2 cache in my app.
>
> Both JPA/Hibernate and Ignite are configured to work together, but I'm not
> sure how to make the Ignite to started before JPA/Hibernate is initialized.
> Right now the war deployment fails when deployer is trying to create
> EntityManagerFactory and can't find the specified (in persistence.xml)
> Ignite instance. Do I have to deploy another app (with Ignite.start() in
> it) before the 'main' app or there is some other way to do it?
>
> Cheers,
> Dmitry
>
>


Re: Is the licensing for the extended versions of TomEE (eg: TomEE+) the same?

2018-09-27 Thread Romain Manni-Bucau
Hi Aaron

Yes it does, the difference is the content. Plume uses eclipselink and
mojarra, plus adds jsf, jms, soap, ...

So it is really distributions and not related to any licensing.

Le jeu. 27 sept. 2018 18:22, Aaron  a écrit :

> I am trying to figure out if the extended versions of TomEE use the same
> licensing as the base version of TomEE. I would assume it does, as the
> legal
> page says that _all_ Apache software uses the same licensing. But if that
> is
> the case, why is there a TomEE, TomEE+, and other versions of TomEE?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: CDI Interceptors to intercept all EJB @Schedule methods

2018-09-20 Thread Romain Manni-Bucau
Hi,

did you put @AroundTimeout on the interceptor method? AroundInvoke is not
triggered for @Schedule.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 20 sept. 2018 à 11:45, cocorossello  a
écrit :

> Hi,
>
> Is there any way to apply a CDI interceptor to existing @Schedule without
> explicitly usign @Interceptors in all methods? I haven't found anything in
> the spec.
>
> Or is there any easy way to create my own @Schedule CDI interceptor?
>
> Thanks in advance.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: [Newsletter] Re: TomEE Performance

2018-09-04 Thread Romain Manni-Bucau
Hi Fabian,

a few pointers and directions to check:

1. Ensure to test with securerandom.source=/dev/./urandom since you use a
lot of crypto
2. You use hsqldb which is known to not scale very well with the
concurrency, maybe switch to another database with a correctly configured
connection pool
3. You use DataBaseRealm which does a lookup of the connection for each
authentication which is synchronized and has no cache on the password
hashes so it can be slow at runtime

Personally i would start by using a fast realm (even if it always says
"ok") to validate this hypothesis before investigating other cases.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mar. 4 sept. 2018 à 12:15,  a écrit :

> You were right, my student did something wrong with the first thread dump,
> I
> uploaded a correct one:
> https://gist.github.com/TrustedGate/83781f05950f245a3bfd2388c5bfd7ab
>
> Also at the bottom there is a vmstat result, its definitely multithreaded
> :)
>
> -Original Message-
> From: Jean-Louis Monteiro 
> Sent: Tuesday, September 04, 2018 11:59 AM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: TomEE Performance
>
> I would need to check on this one and probably investigate a bit more what
> you
> are doing.
>
> That being said, I can confirm only one thread is currently working. So
> either
> jmeter is only sending monothreaded requests or there is something else.
> But you aren't doing multiple requests in parallel
>
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
>
> On Tue, Sep 4, 2018 at 11:53 AM, 
> wrote:
>
> > We have
> >
> > @Resource
> > WebServiceContext webserviceContext;
> >
> > in our SOAP api class, that should not work with @Singleton, or am I
> > mistaken?
> >
> >
> > -Original Message-
> > From: Jean-Louis Monteiro 
> > Sent: Tuesday, September 04, 2018 11:41 AM
> > To: users@tomee.apache.org
> > Subject: *EXT* [Newsletter] Re: [Newsletter] Re: [Newsletter] Re:
> > TomEE Performance
> >
> > Ah ok. Well I was asking if you were injecting when you took the
> > thread dump because from a server point of view I saw only one thread
> > working.
> > If you were using jmeter with multiple virtual users, I was expecting
> > to see more than one thread working.
> >
> > I'll double check.
> >
> > @Singleton is by default using Lock WRITE which prevents multiple
> > threads to access the singleton.
> > If you don't need synchronization or if your code is thread safe (no
> > instance variables, etc). You can safely use @Singleton with Lock READ
> > which will be faster than @Stateless because there is no pool
> > involved. And again, there is no tuning to do
> >
> >
> >
> > --
> > Jean-Louis Monteiro
> > http://twitter.com/jlouismonteiro
> > http://www.tomitribe.com
> >
> > On Tue, Sep 4, 2018 at 11:37 AM, 
> > wrote:
> >
> > > Injecting? The jmeter was running during the threaddump. What do you
> > > mean with injecting?
> > >
> > > Is Singleton (Lock.READ) not even more of a bottleneck when it comes
> > > to multiple concurrent requests? IIRC we tried Singleton before, but
> > > not sure what the reason was why we went with @Stateless...
> > >
> > > -Original Message-
> > > From: Jean-Louis Monteiro 
> > > Sent: Tuesday, September 04, 2018 11:30 AM
> > > To: users@tomee.apache.org
> > > Subject: *EXT* [Newsletter] Re: [Newsletter] Re: TomEE Performance
> > >
> > > Yes exactly.
> > >
> > > Were you injecting anything when you took the jstack?
> > > It seems that only one thread is working.
> > >
> > > We would need you to do it when you are injecting.
> > > If you could also give us the CPU usage when you take the jstack
> > > that'd be great.
> > > You can run `vmstat 5` on another terminal so you can see what's
> > > going
> > on.
> > >
> > > You are using Stateless Session beans. Any reason you aren't using a
> > > plain singleton?
> > > With Singleton (Lock.READ) there is no pooling involved, so you
> > > don't have anything to configure or tune.
> > >
> > >
> > &g

Re: [Tomee Maven Plugin] Unkillable Tomee...

2018-08-31 Thread Romain Manni-Bucau
Changing java version can help sometimes since they regularly have issues
with their process management (this is why JMX local connection is
regularly broken for instance)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 31 août 2018 à 10:06, Daniel Chiaramello <
daniel.chiarame...@gemalto.com> a écrit :

> Hello Romain.
>
> Thanks for your answer.
>
> jstack  returns the following line (from cmd.exe launched with
> Administrator privileges):
> 7848: Access is denied
> The -F option can be used when the target process is not responding
>
> jstack -F  returns the following lines:
> Attaching to process ID 7848, please wait...
> Error attaching to process: Windbg Error: WaitForEvent failed!
> sun.jvm.hotspot.debugger.DebuggerException: Windbg Error: WaitForEvent
> failed!
> at
> sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach0(Native Method)
> at
>
> sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal.attach(WindbgDebuggerLocal.java:152)
> at
> sun.jvm.hotspot.HotSpotAgent.attachDebugger(HotSpotAgent.java:671)
> at
> sun.jvm.hotspot.HotSpotAgent.setupDebuggerWin32(HotSpotAgent.java:569)
> at
> sun.jvm.hotspot.HotSpotAgent.setupDebugger(HotSpotAgent.java:335)
> at sun.jvm.hotspot.HotSpotAgent.go(HotSpotAgent.java:304)
> at sun.jvm.hotspot.HotSpotAgent.attach(HotSpotAgent.java:140)
> at sun.jvm.hotspot.tools.Tool.start(Tool.java:185)
> at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
> at sun.jvm.hotspot.tools.JStack.main(JStack.java:92)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at sun.tools.jstack.JStack.runJStackTool(JStack.java:140)
> at sun.tools.jstack.JStack.main(JStack.java:106)
>
> I checked before trying to kill it, and jstack was correctly returning the
> thread stacks.
>
> Even if I have no concrete argument, my current thought is that it may be
> related to Windows... There has been an important upgrade on my PC around
> the period when I started to have the problem - and we can find many posts
> on Google about unkillable Windows processes (it seems to be an old
> problem). Why would it impact Tomee Maven Plugin now, I don't know - and it
> seems to concern "only" our office (I didn't find any message related to
> that problem posted by other people, so maybe we are not using it "the
> normal way", or there's something related to our network/environment).
>
> Anyways, thanks again for your answer. We have "solved" the problem by
> installing Tomee on a VirtualBox VM, and configuring IntelliJ to deploy our
> WAR on that VM, so it's less critical now in our day-to-day job - but I'll
> keep monitoring that thread in case someone wants to have a look at that
> problem to investigate what happens.
>
> Thanks again,
> Daniel
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: [Tomee Maven Plugin] Unkillable Tomee...

2018-08-30 Thread Romain Manni-Bucau
Hi Daniel,

did you capture a thread dump when it doesn't destroy? (jstack can give it
to you and you can share it on gist or pastebin sites).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 30 août 2018 à 11:04, Daniel Chiaramello <
daniel.chiarame...@gemalto.com> a écrit :

> Hello.
>
> Since 2 weeks now, I'm facing a highly frustrating problem with Tomee Maven
> Plugin, used from IntelliJ on Windows.
>
> In short, after I have used "tomee:run" target, I'm no more able to kill
> Tomee (even from Task Manager, which says "access denied" when I try to
> kill
> it, despite the fact that I'm administrator).
> This is highly frustrating because the only way to kill it is by restarting
> the PC... And it used to work "as expected" 2 weeks ago...
>
> In detail: I first need to apologize, I'm really new on Java development (2
> months old, after 25 years developing in C/C++). So, Java, Maven, IntelliJ
> and Tomee are things I don't master - please forgive me if I'm using words
> not corresponding to usual terms used by the community!
>
> The purpose is to develop a REST-based application.
> I was really impressed by the ease (compared to C++) to develop a prototype
> of such application in Java - in a matter of few days, despite my absolute
> lack of knowledge in all these technologies, I had a first API implemented
> and running.
> That prototype is working on IntelliJ Community 2018.2, on Java 1.8, with
> Tomee Maven Plugin v7.0.5. My company is using its own Maven repository,
> accessible behind an HTTP firewall (I'm not sure it has a relation with my
> problem, but I'm mentioning it just in case...)
>
> Everything was perfect, I was really happy. But 2 weeks ago, I started to
> face a problem mentioned above: I am no more able to kill Tomee except by
> restarting my PC... So, as soon as I launch my application with tomee:run,
> to launch a new version of it, I have to restart my PC...
> I spent days to try to find a solution - without success for now.
> Worse that that, the person from my company who helped me in my first
> steps,
> providing my guidances on the tools to use (IntelliJ, tomee maven plugin,
> etc...) and helped me setting up my environment is now facing the exact
> same
> problem than me! But since he's no more working on these topics, he
> couldn't
> help me in trying to find a solution - which is why I'm there...
>
> I generated a quasi-empty IntelliJ project reproducing the problem, with
> only one class extending "javax.ws.rs.core.Application" (doing absolutely
> nothing), the pom.xml and the web.xml files.
>
> pom.xml content:
>
>
>
> I attached a WORD document to that message presenting that project, and
> showing the problem with screenshots and full outputs:
> Tomee.docx
> <http://tomee-openejb.979440.n4.nabble.com/file/t376190/Tomee.docx>
>
> I don't know what to do next... I also investigated to live with that
> problem, by trying to use deploy/undeploy instead of "run" once Tomee is
> running, without any success for now (I lack too many knowledge to
> understand all Google pages explaining how to do it...)
>
> What would you need to investigate why Tomee is no more exiting? Is there a
> way to activate more logs in Tomee, which may help find the cause (remember
> that things which may seem evident for you are not for me)?
> jstack showed the following:
>
>
> Thanks for your attention,
> Daniel
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: protect endpoint with basic auth

2018-08-22 Thread Romain Manni-Bucau
Yes works, or even @WebFilter(urlPatterns="/*",asyncSupported=true)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 22 août 2018 à 16:15, Matthew Broadhead
 a écrit :

> Hi Romain,
>
> Thanks.  that was the conclusion was coming to.  I am glad it is a valid
> solution.  I found this example also
> https://gist.github.com/neolitec/8953607.
>
> I guess i will define a filter mapping in web.xml
>
> Matthew
>
> On 22/08/18 16:01, Romain Manni-Bucau wrote:
> > Hi Matthew,
> >
> > tomcat does that because the spec does (even if several people ask to
> break
> > that limitation it is not yet done at servlet spec level)
> > that said to secure a rest endpoint you just need a filter in your app
> and
> > implement the security login in there. you can delegate to the container
> > (request.login()/request.logout())  or not depending what you want to do.
> > MP JWT Auth uses that typically:
> >
> https://github.com/apache/geronimo-jwt-auth/blob/master/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/servlet/GeronimoJwtAuthFilter.java
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> >
> > Le mer. 22 août 2018 à 15:55, Matthew Broadhead
> >  a écrit :
> >
> >> my webapp already has a login-config set to keycloak in web.xml so AFAIK
> >> i cannot define any other security configs there.  why doesn't tomcat
> >> allow multiple security methods?
> >> 
> >>   KEYCLOAK
> >>   secure
> >> 
> >>
> >> is there another way to protect a jax-rs endpoint using basic auth
> >> without having to create another webapp?  i read something about
> valves...
> >>
> >>
>
>


Re: protect endpoint with basic auth

2018-08-22 Thread Romain Manni-Bucau
Hi Matthew,

tomcat does that because the spec does (even if several people ask to break
that limitation it is not yet done at servlet spec level)
that said to secure a rest endpoint you just need a filter in your app and
implement the security login in there. you can delegate to the container
(request.login()/request.logout())  or not depending what you want to do.
MP JWT Auth uses that typically:
https://github.com/apache/geronimo-jwt-auth/blob/master/src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/servlet/GeronimoJwtAuthFilter.java

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 22 août 2018 à 15:55, Matthew Broadhead
 a écrit :

> my webapp already has a login-config set to keycloak in web.xml so AFAIK
> i cannot define any other security configs there.  why doesn't tomcat
> allow multiple security methods?
> 
>  KEYCLOAK
>  secure
> 
>
> is there another way to protect a jax-rs endpoint using basic auth
> without having to create another webapp?  i read something about valves...
>
>


Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

2018-08-17 Thread Romain Manni-Bucau
You can implement a custom converter/adapter to do that

Le ven. 17 août 2018 22:18, Matthew Broadhead
 a écrit :

> is there an annotation which will tell johnzon to return only the id of
> the jpa object and not the whole thing?
>
> On 17/08/18 22:05, Matthew Broadhead wrote:
> > no. i will add those and try again.
> >
> > i also changed the entry in system.properties to
> > org.apache.johnzon.deduplicateObjects = true to match
> > org.apache.johnzon.max-string-length = 8192
> >
> >
> > On 17/08/18 21:56, Romain Manni-Bucau wrote:
> >> Do you have a valid equals/hashcode?
> >>
> >> Le ven. 17 août 2018 21:28, chongma  a
> >> écrit :
> >>
> >>> i was trying to output some JPA objects to json today.  after adding
> >>> johnzon.deduplicateObjects = true to system.properties and
> >>> restarting TomEE
> >>> i still get
> >>> javax.json.stream.JsonGenerationException: Invalid json
> >>>  at
> >>>
> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:454)
> >>>
> >>>  at
> >>> org.apache.johnzon.mapper.Mapper.writeObject(Mapper.java:147)
> >>>  at
> >>> uk.me.kissy.sales.dao.LeadScriptDao.marshall(LeadScriptDao.java:435)
> >>> is there any way to get a deeped debug?
> >>>
> >>>
> >>>
> >>> --
> >>> Sent from:
> >>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >>>
> >
>
>


Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

2018-08-17 Thread Romain Manni-Bucau
Do you have a valid equals/hashcode?

Le ven. 17 août 2018 21:28, chongma  a
écrit :

> i was trying to output some JPA objects to json today.  after adding
> johnzon.deduplicateObjects = true to system.properties and restarting TomEE
> i still get
> javax.json.stream.JsonGenerationException: Invalid json
> at
> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:454)
> at org.apache.johnzon.mapper.Mapper.writeObject(Mapper.java:147)
> at
> uk.me.kissy.sales.dao.LeadScriptDao.marshall(LeadScriptDao.java:435)
> is there any way to get a deeped debug?
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: JPA 2.0 compliant OpenJPA version in 2.1 based TomEE?

2018-08-07 Thread Romain Manni-Bucau
Hi Fabian,

no real reason I guess, feel free to open a PR

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mar. 7 août 2018 à 13:22, gilbertoca  a écrit :

> Hello, Fabian!
>
> Based on this answer[1] by Romain I think they are targeting the 2.2 spec
> and waiting for the release of the Jakarta EE TCKs[2].
>
> Regards,
>
> Gilberto
>
> [1]
>
> http://tomee-openejb.979440.n4.nabble.com/Apache-TomEE-7-0-5-and-JPA-2-1-td4684185.html
> [2] https://projects.eclipse.org/proposals/eclipse-jakarta-ee-tck
>
>
> fabian-a.richter wrote
> > Hi,
> >
> > the OpenJPA team released its JPA 2.1 release at the same time as the
> > update for 2.0 (2.4.3)
> >
> > As TomEE 7 is Java EE 7 based (which includes JPA 2.1 if I am not
> > mistaken) why didn’t the 7.0.5 release finally incude the (correct) JPA
> > 2.1 compliant relase of OpenJPA?
> >
> > You guys do maintain the OpenEJB packages as well, don’t you?
> >
> > What was the reason for still packaging a JPA 2.0 implementation into a
> > JPA 2.1 application server?
> >
> > Thanks and best,
> >
> > Fabian
> > smime.p7s (7K)
> > 
> http://tomee-openejb.979440.n4.nabble.com/attachment/4684429/0/smime.p7s
> ;
>
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

2018-07-19 Thread Romain Manni-Bucau
1.1 supports reference handling but not the 1.0 of tomee 7.

Le jeu. 19 juil. 2018 19:17, Matthew Broadhead
 a écrit :

> JAXB used to use @XmlInverseReference annotation.  is there no such
> johnzon annotation?  @JohnzonIgnore is more like @Transient?
>
> On 19/07/18 17:10, Romain Manni-Bucau wrote:
> > Hi Sudhakar,
> >
> > Ensure you have a @JohnzonIgnore on one side to avoid a loop.
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> >
> > Le jeu. 19 juil. 2018 à 16:46, sudhakarvm  a
> écrit :
> >
> >> I am facing problem while json is generated from my JPA model object
> using
> >> default JSON provider Johnzon.
> >> This JPA entity class B has @ManyToOne relationship with other entity A.
> >> Since A also includes B as @OneToMany member with List datatype.
> Because of
> >> this Johnzon is going in infinite loop to prepare the json and I am
> getting
> >> following exception:
> >>
> >> /Caused by: javax.json.stream.JsonGenerationException: Invalid json
> >>  at
> >>
> >>
> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:437)/
> >>
> >> JPA (using eclipselink) is returning correct results. Any suggestions
> for
> >> this issue please.
> >>
> >> Thanks in advance
> >> Sudhakar
> >>
> >>
> >>
> >> --
> >> Sent from:
> >> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> >>
>
>


Re: TomEE Plume 7.0.4/JDBC resource config/unused property

2018-07-19 Thread Romain Manni-Bucau
Actually JDBCDriver expects a Driver implementation, OracleXADataSource is
a datasource implementation. We tolerate it but in this case you must also
configure the underlying datasource instance.

More on http://tomee.apache.org/admin/configuration/resources.html and
http://tomee.apache.org/datasource-config.html (the very end for this one)


Le jeu. 19 juil. 2018 à 17:26, maciejka 
a écrit :

> I am quite new to TomEE and maybe thats why I dont understand Your point.
>
> You wrote 'you didnt set oracle driver as jdbcdriver'
>
> Isn't below configuration setting oracle driver as jdbcdriver? :
>
> 
> *jdbcDriver=oracle.jdbc.xa.client.OracleXADataSource *
> ...
>
> You wrote 'you must configure the datasource too' - haven't I just done
> that
> by defining Resource?
>
> I used instruction from:
> http://tomee.apache.org/datasource-config.html
>
> Could You give a template of sample config?
> Should I configure something more than:
> ...?
>
>
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: TomEE stderr and stdout

2018-07-19 Thread Romain Manni-Bucau
Le jeu. 19 juil. 2018 à 17:05, maciejka 
a écrit :

> I start TomEE, deploy my app, and invoke rest endpoint:
> Example:
>
> @GET
> @Path("/all")
> @Produces(MediaType.APPLICATION_JSON + "; charset=UTF-8")
> @StringifyJSON
> public Service getAll(@DefaultValue("false")
> @QueryParam(CompressJsonFilter.PRETTY) boolean pretty) {
>logger.debug("GET ServicesAll with param pretty {}", pretty);
>System.out.println("Some text")
>
>return l;
> }
> Method completes sucessfully.
> Should 'Some text' be printed in catalina.out? It is not. Why?
> What do You mean by "run" command? I do not run System.out from shell.
>

If you start tomcat with catalina.[bat|sh] run then it is normal, if not it
is not. Maybe share the command launched, the system properties and
environment variables (you can grab most of it from a JMX console).


>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Johnzon is going to infinite loop on JPA entities with OneToMany relationship

2018-07-19 Thread Romain Manni-Bucau
Hi Sudhakar,

Ensure you have a @JohnzonIgnore on one side to avoid a loop.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 19 juil. 2018 à 16:46, sudhakarvm  a écrit :

> I am facing problem while json is generated from my JPA model object using
> default JSON provider Johnzon.
> This JPA entity class B has @ManyToOne relationship with other entity A.
> Since A also includes B as @OneToMany member with List datatype. Because of
> this Johnzon is going in infinite loop to prepare the json and I am getting
> following exception:
>
> /Caused by: javax.json.stream.JsonGenerationException: Invalid json
> at
>
> org.apache.johnzon.core.JsonGeneratorImpl.close(JsonGeneratorImpl.java:437)/
>
> JPA (using eclipselink) is returning correct results. Any suggestions for
> this issue please.
>
> Thanks in advance
> Sudhakar
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: TomEE stderr and stdout

2018-07-19 Thread Romain Manni-Bucau
Hi,

no it is still used but if you rely on "run" command this is totally
ignored since you own the shell in this case.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 19 juil. 2018 à 15:36, maciejka 
a écrit :

> Hello
>
> In my webapp I have statement:
>
> System.out.println("Some message");
>
> When I invoke Rest endpoint this is not printed neither in default
> catalina.out log nor in file pointed by CATALINA_OUT.
>
> Are 'System.out.println' statements diabled or redirected to /dev/null ?
> How
> to enable them?
>
> TomEE 7.0.4. | java 1.8.0_152 | Linux debian 3.16.0-4-amd64
>
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: TomEE Plume 7.0.4/JDBC resource config/unused property

2018-07-19 Thread Romain Manni-Bucau
Hi

Basically the tests " Password=xxx, Password xxx, password=xxx, passWord
xxx" are all the same since we are not case sensitive.

However you didnt set oracle driver as jdbcdriver so our pool configuration
is bypassed by default and we use the oracle datasource as main
configuration for the real connection so you must configure the datasource
too, i.e  User and Pass for oracle IIRC.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 19 juil. 2018 à 15:41, maciejka 
a écrit :

> Hello and welcome
>
> I am using 'apache-tomee-plume-7.0.4' with java version '1.8.0_152' on
> 'Linux debian 3.16.0-4-amd64'
>
> I have basic problem with datasource configuration. My datasource is
> configured like (tried various configurations - Password=xxx, Password xxx,
> password=xxx, passWord xxx):
>
> 
> jdbcDriver=oracle.jdbc.xa.client.OracleXADataSource
> jdbcUrl=jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:xxx
> UserName=xxx
> Password=xxx
> 
>
> I put ojdbc.jar to tomee lib folder. During deployment of my app I have
> warning like:
>
> 18-Jul-2018 16:35:13.799 INFO [main]
> org.apache.openejb.assembler.classic.Assembler.createRecipe Creating
> Resource(id=jdbc/xxx)
> 18-Jul-2018 16:35:13.900 WARNING [main]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'JdbcUrl' for resource 'jdbc/xxx'
> 18-Jul-2018 16:35:13.900 WARNING [main]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'UserName' for resource 'jdbc/xxx'
> 18-Jul-2018 16:35:13.900 WARNING [main]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'Password' for resource 'jdbc/xxx'
> 18-Jul-2018 16:35:13.900 WARNING [main]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'PasswordCipher' for resource 'jdbc/xxx'
> 18-Jul-2018 16:35:13.900 WARNING [main]
> org.apache.openejb.assembler.classic.Assembler.unusedProperty unused
> property 'asdf' for resource 'jdbc/xxx'
>
> When I use my Resource like:
>
> @Resource(name = "jdbc/xxx")
> private DataSource ds;
>
> java.sql.Connection connection = ds.getConnection();
> Statement createStatement = connection.createStatement();
> executeQuery = createStatement.executeQuery("...");
>
>
> I get: java.sql.SQLException: ORA-01017: invalid username/password; logon
> denied
>
> but if I write:
>
> java.sql.Connection connection = ds.getConnection("xxx", "xxx");
> Statement createStatement = connection.createStatement();
> executeQuery = createStatement.executeQuery("...");
>
> it works.
> Somehow 'jdbcUrl' was set on resource - despite the WARINING - and
> 'username' and 'password' were not.
>
> Questions:
>  Why properties (username, password) set in tomee.xml for the datasource
> are
> not taken into account and 'jdbcUrl' is?
>  How to trace this issue? I don't know where to search.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: No Factories configured for this Application. This happens if the faces-initialization does not work at all

2018-07-16 Thread Romain Manni-Bucau
Hi

Maybe check your web.xml declaration of faces servlet, you classpath and
webapp lib folder (some jsf api or impl leaking?) and finally ensure when
you redeployed that you cleaned work/, conf/ and other temporary
folders in your catalina.base folder.

Le mar. 17 juil. 2018 00:22, Jean-Louis Monteiro 
a écrit :

> Hi,
>
> Thanks for the detailed email with context and useful information.
>
> Is it random, or can you reproduce easily?
> Are you using JDK 8?
>
> Regards
> Jean-Louis
>
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
>
> On Mon, Jul 16, 2018 at 1:54 PM, Emmanuel Touzery <
> emmanuel.touz...@lit-transit.com> wrote:
>
> > Hello,
> >
> > we have a TOMEE 7.0.3 application, which uses also JMS, which works
> > without issues. We've recently made a new version of the application (one
> > of the notable changes is a migration from using the JMS1.1 to the JMS2
> > API).
> >
> > With the new version, we have an issue, but only on our PROD
> > environment, where we get no errors in the catalina.out log file (but the
> > application doesn't work), but an error in the localhost log file, the
> > error being as in the title of the email, I put the info from the
> localhost
> > log file at the end of this email.
> >
> > I can't put the source on github or something like that,
> > unfortunately. What is strange is that this error does not occur on our
> > staging or UAT environments, but it does occur every time (well, we tried
> > multiple times to restart the application and it failed consistently) on
> > the PROD environment. We copied the entire PROD tomee folder on another
> > machine and failed to reproduce the issue. We also tried to simulate
> > incoming traffic when restarting the application, and run it against a
> > backup of the PROD database... Somehow we can't reproduce the error. We
> are
> > guessing that maybe the PROD traffic is higher than what we can simulate
> > and some incoming message comes at just the wrong time? But we don't know
> > for sure.
> >
> > Now, studying the issue, we realized that we used to have this in our
> > src/main/webapp/WEB-INF/faces-config.xml:
> >
> > http://java.sun.com/xml/ns/javaee; xmlns:xsi="http://www.w3.org/2
> > 001/XMLSchema-instance" xsi:schemaLocation="http://jav
> > a.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/jav
> > aee/web-facesconfig_2_1.xsd" version="2.1"> > anaged-bean-name>login > class>com.lecip.tms.tms_core.application.Login > bean-class>view > >
> >
> > We believe the JSF version is not correct for JEE7 anymore, in
> > addition the managed-bean annotation is not necessary, so we changed the
> > file to now contain:
> >
> > 
> > http://xmlns.jcp.org/xml/ns/javaee;
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance;
> > xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
> > http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd;
> >   version="2.2">
> > 
> >
> > Could this be the cause for that error that we saw in our PROD
> > environment? Or you would think the root cause would be something else?
> The
> > problem is that it's pretty difficult for us to experiment with changes
> > since any deployment on PROD must be first validated on staging and
> UAT...
> > Any hints? Is there maybe some logging configuration flag we could
> activate
> > to get more information about the error? Or any other place to look to
> get
> > more information about the issue?
> >
> > The irony is that we use JSF only for the login screen and nowhere
> > else...
> >
> > Regards,
> >
> > Emmanuel
> >
> > 12-Jul-2018 17:44:04.335 SEVERE [localhost-startStop-1]
> >
> org.apache.tomcat.util.descriptor.web.SecurityConstraint.findUncoveredHttpMethods
> > For security constraints with URL pattern [/*] only the HTTP methods
> [TRACE
> > HEAD DELETE POST GET OPTIONS PUT] are covered. All other methods are
> > uncovered.
> > 12-Jul-2018 17:44:22.078 SEVERE [localhost-startStop-1]
> > org.apache.catalina.core.ApplicationContext.log StandardWrapper.Throwable
> >  java.lang.IllegalStateException: No Factories configured for this
> > Application. This happens if the faces-initialization does not work at
> all
> > - make sure that you properly include all configuration settings
> necessary
> > for a basic faces application and that all the necessary libs are
> included.
> > Also check the logging output of your web application and your container
> > for any exceptions!
> > If you did that and find nothing, the mistake might be due to the fact
> > that you use some special web-containers which do not support registering
> > context-listeners via TLD files and a context listener is not setup in
> your
> > web.xml.
> > A typical config looks like this;
> > 
> > org.apache.myfaces.webapp.StartupServletCont
> > extListener
> > 
> >
> > at javax.faces.FactoryFinder._getFactory(FactoryFinder.java:305)
> > at 

Re: cannot use ManagedExecutorService resource

2018-07-16 Thread Romain Manni-Bucau
yes, note that "name" doesn't need "java", the namespace is a "lookup"
thing.

personally I would recommand you to stay away from default resources since
you have no idea how it will behave at runtime and I would just ensure to
name correctly each resource I use.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 16 juil. 2018 à 15:57, clemensx  a écrit :

> Many thanks for the fast and detailed answer!
>
> Do I understand correctly that I can simply use the default name in the
> resource.xml to extend the thread pool and should be able to use it
> everywhere I used to access the default service with default settings?
> @Resource(name="java:comp/DefaultManagedExecutorService"
>
> That would be perfectly fitting to our needs.
>
> Thanks!
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: cannot use ManagedExecutorService resource

2018-07-16 Thread Romain Manni-Bucau
Hi

yes, this is normal. TomEE defines defaults and you can override them. To
supports all cases the defaults are auto-adjusted to the "prod" (hardcoded)
resources - very handy in tests.
If you don't activate openejb.offline=true then this is the behavior you
have, if you set it then no implicit/default resource are available.

This means that if you define a resource matching the default auto-created
one it will be considered as the default. This works until you define the
name of the resource. In this case you must ensure there is no ambiguity
and the resource is defined with the right name.

For you it means you must redefine the default resource as soon as you
define another one of the same type.

Side note: for prod it is more than highly recommanded to do that since the
default executor service can be synchronous or highly parallel, there is
nothing required in the spec so better to take the control of it.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 16 juil. 2018 à 12:31, clemensx  a écrit :

> Hi,
>
> we have problems using ManagedExecutorService resources in tomee 7.0.4
> Using default ManagedExecutorService works fine, but if we try to define a
> new pool with more threads we cannot access the service
>
> In resource.xml we do this:
> 
> Core = 40
> Max = 50
> KeepAlive = 5 s
> Queue = 150
> ThreadFactory =
> org.apache.openejb.threads.impl.ManagedThreadFactoryImpl
> Lazy = true
> 
>
> But then we cannot even get the default service injected in our stateful
> session bean:
> @Resource(name="java:comp/DefaultManagedExecutorService")
> private ManagedExecutorService execService;
> will yield a null execService.
>
> @Resource(name="FooManagedExecutorService")
> private ManagedExecutorService execService;
> same with trying to access our own resource.
>
> Getting the reference programmatically via
> execService = (ManagedExecutorService)
> sessionContext.lookup(“openejb:Resource/FooManagedExecutorService”);
> also gives null.
>
>
> In the server startup logs we see several mentions of our service:
>
> for all beans:
> [CONTAINER] OpenEJB.startup.config INFO Auto-linking resource-ref
> 'openejb/Resource/ROOT/FooManagedExecutorService' in bean ProductDao to
> Resource(id=FooManagedExecutorService)
>
> 3 times this info (no idea why the container is creating the resource 3
> times):
> [CONTAINER] OpenEJB.startup.service INFO Creating
> Resource(id=ROOT/FooManagedExecutorService,
> aliases=FooManagedExecutorService)
>
> [CONTAINER] OpenEJB.startup.config INFO Configuring
> Service(id=ROOT/FooManagedExecutorService, type=Resource,
> provider-id=Default Executor Service)
>
>
> Thanks for any ideas/workarounds
> clemens
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: RMI From TomEE to Jboss

2018-07-11 Thread Romain Manni-Bucau
The "Referencing a bean in another server" part of
http://tomee.apache.org/ejb-refs.html should already enable several cases.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 11 juil. 2018 à 11:24, Jonathan Gallimore <
jonathan.gallim...@gmail.com> a écrit :

> You can certainly make remote calls to JBoss in the same way you would do
> with a regular client. You'd need to include the JBoss client jars, and use
> the appropriate URL and context factory in your InitialContext. This should
> be a reasonable approach.
>
> JBoss itself has the concept of an ExternalContext which effectively maps
> an external JNDI into a local one. TomEE doesn't have its own equivalent
> that I know of, but it might be possible to come up with something similar.
> If I get a chance later this week I'll see if I can hack something up.
>
> Jon
>
> On Tue, Jul 10, 2018 at 10:29 PM, Joshua Sharf  wrote:
>
> > Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> > EJB?  I
> > know we can set up TomEE to host EJBs, but that's not what we want to do.
> > We want to make the call from TomEE to the remote EJB,
> >
> > We're running TomEE Plume 7.0.4, and EAP7.
> >
> > Thanks for any help you can give us,
> > Joshua Sharf
> >
> >
> >
> > --
> > Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-
> > f979441.html
> >
>


Re: RMI From TomEE to Jboss

2018-07-10 Thread Romain Manni-Bucau
Hi

If you have the client API it will work as in any app (spring apps always
do that and it will be exactly the same in tomee).

You can even do fun stuff like proxying the jboss calls with an endpoint
redirecring the streams or redirecting an ejbd (tomee) rmi call to jboss
either using a plain client or extenal jndi provider to inject the remote
context config. Not sure it is good compared to having a plain client but
very doable.

Romain


Le mer. 11 juil. 2018 02:16, Gurkan Erdogdu  a écrit :

> Hi Joshua
> AFAIK, it is not possible to propagate RMI call from TomEE to JBoss because
> TomEE uses its own remote protocol (for example, you can not propagate
> distributed transactions). But, you may use JBoss client JARS in TomEE to
> call your EJBs in JBoss.
> Regards.
> Gurkan
>
> On Wed, Jul 11, 2018 at 2:23 AM, Jonathan S. Fisher 
> wrote:
>
> > It's likely possible, but whether or not it's a "good idea" is the better
> > question :) It might be best to see about getting a consultant from
> > Tomitribe out there to help you.
> >
> > The process would be something like, use the JBoss InitialContextFactory
> > and point it at the remote server. Then, you should be able to use that
> to
> > perform a lookup. I don't think there will be a way to use @EJB
> injection,
> > unless you did some magic with CDI and the @Produces annotation.
> >
> > A better way would be to wrap your legacy EJBs with RESTful services so
> > that way you're platform independent.
> >
> > On Tue, Jul 10, 2018 at 4:29 PM Joshua Sharf  wrote:
> >
> > > Is there a way to make an RMI call *from* a TomEE server *to* a JBoss
> > > EJB?  I
> > > know we can set up TomEE to host EJBs, but that's not what we want to
> do.
> > > We want to make the call from TomEE to the remote EJB,
> > >
> > > We're running TomEE Plume 7.0.4, and EAP7.
> > >
> > > Thanks for any help you can give us,
> > > Joshua Sharf
> > >
> > >
> > >
> > > --
> > > Sent from:
> > > http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
> > >
> >
> >
> > --
> > Jonathan | exabr...@gmail.com
> > Pessimists, see a jar as half empty. Optimists, in contrast, see it as
> half
> > full.
> > Engineers, of course, understand the glass is twice as big as it needs to
> > be.
> >
>


Re: Apache TomEE 7.0.5 and JPA 2.1

2018-07-05 Thread Romain Manni-Bucau
Hi

We got openjpa 3 which is close to that but not complete and targets jpa
2.2 IIRC.


Le jeu. 5 juil. 2018 20:25, gilbertoca  a écrit :

> Hello guys,
>
> It seems version 7.0.5 is quite ready. But I cant see any mention about
> openjpa(the 2.1 spec one).
> Any change of tomee 7.X.X brings openjpa(the 2.1 spec one)?
> In the openjpa site there is no mention about that is spec.
>
> Regards,
>
> Gilberto
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings

2018-07-02 Thread Romain Manni-Bucau
Would be interesting to have the full stack and probably some logs around
this issue. But sounds more related to the dev setup than anything which
can happen in prod.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 2 juil. 2018 à 13:34, Matthew Broadhead
 a écrit :

> yes it normally happens after some code changes.
> library is in tomee lib.  i am on 7.0.3
>
> On 02/07/18 13:23, Romain Manni-Bucau wrote:
> > Hi
> >
> > Does it happen after some redeployment?
> > Is mysql in tomee lib or the app lib folder?
> >
> >
> > Le lun. 2 juil. 2018 13:07, Matthew Broadhead
> >  a écrit :
> >
> >> recently i have been getting this exception during development.
> >> restarting the container allows me to proceed.  i am worried it might
> >> start happening in production.
> >>
> >> java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
> >>   at
> >>
> >>
> com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1450)
> >>   at
> >> com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4165)
> >>   at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
> >>   at
> >>
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >>   at java.lang.reflect.Method.invoke(Method.java:498)
> >>   at
> >>
> >>
> org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
> >>   at
> >>
> >>
> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
> >>   at
> >>
> >>
> org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
> >>   at com.sun.proxy.$Proxy649.prepareStatement(Unknown Source)
> >>   at
> >>
> >>
> org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:135)
> >>
>
>


Re: java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings

2018-07-02 Thread Romain Manni-Bucau
Hi

Does it happen after some redeployment?
Is mysql in tomee lib or the app lib folder?


Le lun. 2 juil. 2018 13:07, Matthew Broadhead
 a écrit :

> recently i have been getting this exception during development.
> restarting the container allows me to proceed.  i am worried it might
> start happening in production.
>
> java.lang.NoClassDefFoundError: com/mysql/jdbc/ParameterBindings
>  at
>
> com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1450)
>  at
> com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4165)
>  at sun.reflect.GeneratedMethodAccessor418.invoke(Unknown Source)
>  at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at
>
> org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
>  at
>
> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
>  at
>
> org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
>  at com.sun.proxy.$Proxy649.prepareStatement(Unknown Source)
>  at
>
> org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:135)
>


Re: EAR deployment

2018-06-29 Thread Romain Manni-Bucau
ears probably not (but you are not that numerous anymore ;)) but with a
security manager is more the criteria here IMHO.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 29 juin 2018 à 16:44,  a écrit :

> Not terribly familiar with Git, but I assume you asking me to submit a
> pull request that points to a fix?  The short answer is "no".  I would
> love to see this fixed, but right now I don't have the time to grok git
> (we use svn), set up a build environment for Tomee, pickup maven (we use
> ant+ivy), and figure out the actual bug.If I have to, I will --- but
> only God knows how long it will be before I can make the time to do these
> things.
>
> But this raises a question: am I really the last person still deploying
> EARs?!   Really???
>
> Thanks for your prompt help -- you guys are amazing!
> Ross
>
>
>
>
>
> From:   "Romain Manni-Bucau" 
> To: users@tomee.apache.org,
> Date:   06/28/2018 04:03 PM
> Subject:Re: EAR deployment
>
>
>
> I see
>
> Then it is just a bug and we miss a wrapping to be SM compliant in that
> part of the code.
>
> Do you want to submit a PR to fix it?
>
> Le jeu. 28 juin 2018 19:37,  a écrit :
>
> > Couldn't find it in the summary.   Of course, its there as a VM
> argument,
> > but I expect that.   After digging around a bit more I found it in the
> > MXBeans:  java.lang -> Runtime -> Attributes.
> >
> > Every thing there is set as it is in the file: ie
> > java.security.policy=C:\IBM\liferay\tomee\conf\catalina.policy
> > java.security.manager=
> >
> > -- both of which I would expect.
> >
> > Note that I have not tried chang  in
> tomee.xml.
> > Maybe that needs chaning -- though what I have seem really close to
> > working.
> >
> > Just occurred to me that I never included my full VM args:
> >
> > -Dcatalina.base="C:\IBM\liferay\tomee"
> > -Dcatalina.home="C:\IBM\liferay\tomee"
> > -Dwtp.deploy="C:\IBM\liferay\tomee\webapps"
> > -Djava.endorsed.dirs="C:\IBM\liferay\tomee\endorsed"
> > -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true
> >
>
> -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
> >
> >
> > -Duser.timezone=EST
> > -Djava.security.manager
> > -Djava.security.policy="C:\IBM\liferay\tomee\conf\catalina.policy"
> >
> -Djava.security.auth.login.config="C:\IBM\liferay\tomee\conf\jaas.config"
> > -Dwnyric.deployment.properties.directory.path="C:\IBM\liferay"
> > -Xmx2048m
> >
> >
> > Thanks,
> > Ross
> >
> >
> >
> >
> >
> > From:   "Romain Manni-Bucau" 
> > To: users@tomee.apache.org,
> > Date:   06/28/2018 11:20 AM
> > Subject:Re: EAR deployment
> >
> >
> >
> > I think you can check it in the JVM info in system properties (VM
> Summary)
> >
> > Romain Manni-Bucau
> > @rmannibucau <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly90d2l0dGVyLmNvbS9ybWFubmlidWNhdQ%3D%3D&_s=ZXJpZTE%3D&_c=7b6344b3
>
> > > |  Blog
> > <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9ybWFubmlidWNhdS5tZXRhd2VyeC5uZXQv&_s=ZXJpZTE%3D&_c=03b3f7d2
>
> > > | Old Blog
> > <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cDovL3JtYW5uaWJ1Y2F1LndvcmRwcmVzcy5jb20%3D&_s=ZXJpZTE%3D&_c=7ac52c4b
>
> > > | Github <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=d53ffcf9
>
> > > |
> > LinkedIn <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2luL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=aff046f7
>
> > > | Book
> > <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly93d3cucGFja3RwdWIuY29tL2FwcGxpY2F0aW9uLWRldmVsb3BtZW50L2phdmEtZWUtOC1oaWdoLXBlcmZvcm1hbmNl&_s=ZXJpZTE%3D&_c=5ede79c4
>
> > >
> >
> >
> > Le jeu. 28 juin 2018 à 17:19,  a écrit :
> >
> > > So:
> > >
> > > 1.   With

Re: FailOnUnknowActivationSpec for MessageDriven Bean

2018-06-29 Thread Romain Manni-Bucau
Hi Gropp,

feel free to do a PR on https://github.com/apache/tomee-site-generator.
This is also probably related to this one
https://github.com/apache/tomee-site-generator/pull/4

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 29 juin 2018 à 12:42, Gropp Volker  a
écrit :

> Hi,
>
> the documentation
> http://tomee.apache.org/admin/configuration/containers.html is not
> updated, so I used the 'old' wrong spelling. The spelling was fixed in
> https://issues.apache.org/jira/browse/TOMEE-2093 without updating the
> documentation. This was a pain to resolve. For anyone who is looking for a
> solution, I updated my openejb test repository with a working
> configuration: https://github.com/vgropp/openEjbContainer
>
> Regards Volker Gropp
>
> From: Gropp Volker [mailto:volker.gr...@e-velopment.de]
> Sent: Freitag, 22. Juni 2018 17:06
> To: users@tomee.apache.org
> Subject: FailOnUnknowActivationSpec for MessageDriven Bean
>
> Hi,
>
> is it possible to either not deploy MessageDriven Beans at all in openejb
> or turn off FailOnUnknowActivationSpec for all Container/MDB using
> properties? I use openEjb for my container based unit-tests and it fails
> to deploy a JMS MDB with
> messageListenerInterface = MessageListener.class,
> activationConfig = {
> @ActivationConfigProperty(propertyName="maxSession",
> propertyValue="1")
>  }
>
> I found you can declare it in Properties using
> http://tomee.apache.org/admin/configuration/containers.html
> But after adding that I get:
> Assembler failed to build the container system.
> org.apache.openejb.OpenEJBException: No existing resource adapter defined
> with id 'Default JMS Resource Adapter'.
>
> My original error without trying to set FailOnUnknowActivationSpec to
> false is:
>
> org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
> org.apache.openejb.OpenEJBException: Creating application failed: C:\test:
> Error deploying 'ListenerMDB'.  Exception: class
> org.apache.openejb.OpenEJBException: Unable to create activation spec: No
> setter found for the activation spec properties: [maxSession]: Unable to
> create activation spec: No setter found for the activation spec properties:
> [maxSession]
>  at
> org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:347)
>  at
> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
>  at
> de.evelopment.openejb.util.EjbTestHelper.startContainer(EjbTestHelper.java:91)
>  at de.evelopment.openejb.EjbTestCase.startUp(EjbTestCase.java:39)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>  at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>  at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>  at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
>  at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
>  at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
>  at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>  at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>  at
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>  at
> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>  at
> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>  at
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>  at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27

Re: EAR deployment

2018-06-28 Thread Romain Manni-Bucau
I see

Then it is just a bug and we miss a wrapping to be SM compliant in that
part of the code.

Do you want to submit a PR to fix it?

Le jeu. 28 juin 2018 19:37,  a écrit :

> Couldn't find it in the summary.   Of course, its there as a VM argument,
> but I expect that.   After digging around a bit more I found it in the
> MXBeans:  java.lang -> Runtime -> Attributes.
>
> Every thing there is set as it is in the file: ie
> java.security.policy=C:\IBM\liferay\tomee\conf\catalina.policy
> java.security.manager=
>
> -- both of which I would expect.
>
> Note that I have not tried chang  in tomee.xml.
> Maybe that needs chaning -- though what I have seem really close to
> working.
>
> Just occurred to me that I never included my full VM args:
>
> -Dcatalina.base="C:\IBM\liferay\tomee"
> -Dcatalina.home="C:\IBM\liferay\tomee"
> -Dwtp.deploy="C:\IBM\liferay\tomee\webapps"
> -Djava.endorsed.dirs="C:\IBM\liferay\tomee\endorsed"
> -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true
> -Dorg.apache.catalina.loader.WebappClassLoader.ENABLE_CLEAR_REFERENCES=false
>
>
> -Duser.timezone=EST
> -Djava.security.manager
> -Djava.security.policy="C:\IBM\liferay\tomee\conf\catalina.policy"
> -Djava.security.auth.login.config="C:\IBM\liferay\tomee\conf\jaas.config"
> -Dwnyric.deployment.properties.directory.path="C:\IBM\liferay"
> -Xmx2048m
>
>
> Thanks,
> Ross
>
>
>
>
>
> From:   "Romain Manni-Bucau" 
> To: users@tomee.apache.org,
> Date:   06/28/2018 11:20 AM
> Subject:Re: EAR deployment
>
>
>
> I think you can check it in the JVM info in system properties (VM Summary)
>
> Romain Manni-Bucau
> @rmannibucau <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly90d2l0dGVyLmNvbS9ybWFubmlidWNhdQ%3D%3D&_s=ZXJpZTE%3D&_c=7b6344b3
> > |  Blog
> <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9ybWFubmlidWNhdS5tZXRhd2VyeC5uZXQv&_s=ZXJpZTE%3D&_c=03b3f7d2
> > | Old Blog
> <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cDovL3JtYW5uaWJ1Y2F1LndvcmRwcmVzcy5jb20%3D&_s=ZXJpZTE%3D&_c=7ac52c4b
> > | Github <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=d53ffcf9
> > |
> LinkedIn <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2luL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=aff046f7
> > | Book
> <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly93d3cucGFja3RwdWIuY29tL2FwcGxpY2F0aW9uLWRldmVsb3BtZW50L2phdmEtZWUtOC1oaWdoLXBlcmZvcm1hbmNl&_s=ZXJpZTE%3D&_c=5ede79c4
> >
>
>
> Le jeu. 28 juin 2018 à 17:19,  a écrit :
>
> > So:
> >
> > 1.   With the security manager disabled, the ear deploys fine, ejb's
> > instantitiate, initialize, etc -- no errors at all!
> >
> > 2.  I connected to the running jvm with jmx, and poked around for a
> while,
> > but could not find where it specified the policy file Tomcat was using.
> > Can I get a hint as to where this info is?
> >
> > Thanks,
> > Ross
> >
> >
> >
> > From:   "Romain Manni-Bucau" 
> > To: users@tomee.apache.org,
> > Date:   06/27/2018 04:54 PM
> > Subject:Re: EAR deployment
> >
> >
> >
> > Hi
> >
> > can you confirm it works without the security manager enabled?
> >
> > Also can you check connecting on the JVM through JMX that the right
> policy
> > file is used and tomcat didn't override the one you thought using?
> >
> > Romain Manni-Bucau
> > @rmannibucau <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly90d2l0dGVyLmNvbS9ybWFubmlidWNhdQ%3D%3D&_s=ZXJpZTE%3D&_c=7b6344b3
>
> > > |  Blog
> > <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9ybWFubmlidWNhdS5tZXRhd2VyeC5uZXQv&_s=ZXJpZTE%3D&_c=03b3f7d2
>
> > > | Old Blog
> > <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cDovL3JtYW5uaWJ1Y2F1LndvcmRwcmVzcy5jb20%3D&_s=ZXJpZTE%3D&_c=7ac52c4b
>
> > > | Github <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=d53ffcf9
>
> > > |
> > LinkedIn <
> >
> >
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2luL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=aff046f7
&

Re: EAR deployment

2018-06-28 Thread Romain Manni-Bucau
I think you can check it in the JVM info in system properties (VM Summary)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le jeu. 28 juin 2018 à 17:19,  a écrit :

> So:
>
> 1.   With the security manager disabled, the ear deploys fine, ejb's
> instantitiate, initialize, etc -- no errors at all!
>
> 2.  I connected to the running jvm with jmx, and poked around for a while,
> but could not find where it specified the policy file Tomcat was using.
> Can I get a hint as to where this info is?
>
> Thanks,
> Ross
>
>
>
> From:   "Romain Manni-Bucau" 
> To: users@tomee.apache.org,
> Date:   06/27/2018 04:54 PM
> Subject:Re: EAR deployment
>
>
>
> Hi
>
> can you confirm it works without the security manager enabled?
>
> Also can you check connecting on the JVM through JMX that the right policy
> file is used and tomcat didn't override the one you thought using?
>
> Romain Manni-Bucau
> @rmannibucau <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly90d2l0dGVyLmNvbS9ybWFubmlidWNhdQ%3D%3D&_s=ZXJpZTE%3D&_c=7b6344b3
> > |  Blog
> <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9ybWFubmlidWNhdS5tZXRhd2VyeC5uZXQv&_s=ZXJpZTE%3D&_c=03b3f7d2
> > | Old Blog
> <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cDovL3JtYW5uaWJ1Y2F1LndvcmRwcmVzcy5jb20%3D&_s=ZXJpZTE%3D&_c=7ac52c4b
> > | Github <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly9naXRodWIuY29tL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=d53ffcf9
> > |
> LinkedIn <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2luL3JtYW5uaWJ1Y2F1&_s=ZXJpZTE%3D&_c=aff046f7
> > | Book
> <
>
> https://milton-web.wnyric.org/canit/urlproxy.php?_q=aHR0cHM6Ly93d3cucGFja3RwdWIuY29tL2FwcGxpY2F0aW9uLWRldmVsb3BtZW50L2phdmEtZWUtOC1oaWdoLXBlcmZvcm1hbmNl&_s=ZXJpZTE%3D&_c=5ede79c4
> >
>
>
> Le mer. 27 juin 2018 à 19:12,  a écrit :
>
> > I'm running 7.0.4.  I have been deploying to webapps ( > dir="apps" />   remains commented).
> >
> > Ross
> >
> >
> >
> > From:   "Jonathan Gallimore" 
> > To: users@tomee.apache.org,
> > Date:   06/27/2018 12:22 PM
> > Subject:Re: EAR deployment
> >
> >
> >
> > Hi
> >
> > What version of TomEE are you running?
> >
> > Are you deploying your EAR from webapps, or from apps with  > dir="apps" /> added in tomee.xml?
> >
> > Regards
> >
> > Jon
> >
> > On Wed, Jun 27, 2018 at 5:15 PM,  wrote:
> >
> > > I seem unable to deploy EARs.I have set the catalina.policy to:
> > > grant {
> > > permission java.security.AllPermission;
> > > };
> > >
> > > I have set the work directory to "work"  (and at deploy see the
> exploded
> > > EAR there).
> > >
> > > Also I have set deployOnStartup to false, autoDeploy to true, and
> > > unpackWARs to true.
> > >
> > > On deploy, at first matters look promising.   It unpacks, initializes
> my
> > > EJBs, then I get single AccessContorlException (RuntimePermistion),
> > > followed by an infinitely repeating (every 5 seconds or so) access
> > control
> > > exception (FilePermission).
> > >
> > >
> > > INFO: Created Ejb(deployment-id=CloseEventsBean,
> > > ejb-name=CloseEventsBean,
> > > container=Default Singleton Container)
> > > Jun 26, 2018 11:41:40 AM
> org.apache.openejb.assembler.classic.Assembler
> > > startEjbs
> > > INFO: Created Ejb(deployment-id=ManagerReminderBean,
> > > ejb-name=ManagerReminderBean, container=Default Singleton Container)
> > > Jun 26, 2018 11:41:40 AM sun.reflect.NativeMethodAccessorImpl invoke
> > > SEVERE: Exception invoking periodic operation:
> > > java.security.AccessControlException: access denied
> > > ("java.lang.RuntimePermission" "setContextClassLoader")
> > > at
> > > java.security.AccessControlContext.checkPermission(
> > > AccessControlContext.java:472)
> > > at
> > >
> >
> java.security.AccessController.checkPermission(Acc

Re: EAR deployment

2018-06-27 Thread Romain Manni-Bucau
Hi

can you confirm it works without the security manager enabled?

Also can you check connecting on the JVM through JMX that the right policy
file is used and tomcat didn't override the one you thought using?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 27 juin 2018 à 19:12,  a écrit :

> I'm running 7.0.4.  I have been deploying to webapps ( dir="apps" />   remains commented).
>
> Ross
>
>
>
> From:   "Jonathan Gallimore" 
> To: users@tomee.apache.org,
> Date:   06/27/2018 12:22 PM
> Subject:Re: EAR deployment
>
>
>
> Hi
>
> What version of TomEE are you running?
>
> Are you deploying your EAR from webapps, or from apps with  dir="apps" /> added in tomee.xml?
>
> Regards
>
> Jon
>
> On Wed, Jun 27, 2018 at 5:15 PM,  wrote:
>
> > I seem unable to deploy EARs.I have set the catalina.policy to:
> > grant {
> > permission java.security.AllPermission;
> > };
> >
> > I have set the work directory to "work"  (and at deploy see the exploded
> > EAR there).
> >
> > Also I have set deployOnStartup to false, autoDeploy to true, and
> > unpackWARs to true.
> >
> > On deploy, at first matters look promising.   It unpacks, initializes my
> > EJBs, then I get single AccessContorlException (RuntimePermistion),
> > followed by an infinitely repeating (every 5 seconds or so) access
> control
> > exception (FilePermission).
> >
> >
> > INFO: Created Ejb(deployment-id=CloseEventsBean,
> > ejb-name=CloseEventsBean,
> > container=Default Singleton Container)
> > Jun 26, 2018 11:41:40 AM org.apache.openejb.assembler.classic.Assembler
> > startEjbs
> > INFO: Created Ejb(deployment-id=ManagerReminderBean,
> > ejb-name=ManagerReminderBean, container=Default Singleton Container)
> > Jun 26, 2018 11:41:40 AM sun.reflect.NativeMethodAccessorImpl invoke
> > SEVERE: Exception invoking periodic operation:
> > java.security.AccessControlException: access denied
> > ("java.lang.RuntimePermission" "setContextClassLoader")
> > at
> > java.security.AccessControlContext.checkPermission(
> > AccessControlContext.java:472)
> > at
> >
> java.security.AccessController.checkPermission(AccessController.java:884)
> > at
> > java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
> > at java.lang.Thread.setContextClassLoader(Thread.java:1474)
> > at
> > org.apache.openejb.log.LoggerCreator$Get.exec(LoggerCreator.java:94)
> > at
> > org.apache.openejb.log.LoggerCreator$Get.exec(LoggerCreator.java:105)
> > at
> >
> org.apache.openejb.util.JuliLogStream.isWarnEnabled(JuliLogStream.java:61)
> > at
> > org.apache.openejb.util.Logger.isWarningEnabled(Logger.java:425)
> > at org.apache.openejb.util.Logger.warning(Logger.java:646)
> > at
> > org.apache.tomee.catalina.TomcatWebAppBuilder.checkHost(
> > TomcatWebAppBuilder.java:2233)
> > at
> > org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(
> > GlobalListenerSupport.java:141)
> > at
> > org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(
> > LifecycleBase.java:94)
> > at
> > org.apache.catalina.core.ContainerBase.backgroundProcess(
> > ContainerBase.java:1164)
> > at
> > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
> > processChildren(ContainerBase.java:1388)
> > at
> > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
> > processChildren(ContainerBase.java:1392)
> > at
> > org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.
> > run(ContainerBase.java:1360)
> > at java.lang.Thread.run(Thread.java:748)
> >
> >
> >
> > Below is the repeating exception.
> >
> > Jun 26, 2018 11:41:50 AM sun.reflect.NativeMethodAccessorImpl invoke
> > SEVERE: Exception invoking periodic operation:
> > java.security.AccessControlException: access denied
> > ("java.io.FilePermission" "C:\IBM\liferay\tomee\webapps\ROOT.war"
> "read")
> > at

Re: How to enable keepAliveTimeout in TomEE

2018-06-26 Thread Romain Manni-Bucau
This part of tomee is tomcat, literally, so just do as for tomcat.

Le mar. 26 juin 2018 07:57, srikanth myneni  a
écrit :

> Hi Romain,
>
> For Tomcat we use below property set the value. Do we have a similar
> configuration in TomEE?
>
> keepAliveTimeout
>
> The number of milliseconds this *Connector* will wait for another HTTP
> request before closing the connection. The default value is to use the
> value that has been set for the *connectionTimeout* attribute. Use a value
> of -1 to indicate no (i.e. infinite) timeout.
>
> Regards,
> Srikanth
>
> On Mon, Jun 25, 2018 at 5:01 PM Romain Manni-Bucau 
> wrote:
>
> > Hi Srikanth?
> >
> > which keepAliveTimeout? (we have in ejbd -> ejbd.properties, in tomcat
> > connectors -> standard tomcat config, etc...)
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> >
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> > >
> >
> >
> > Le lun. 25 juin 2018 à 13:30, srikanth myneni 
> a
> > écrit :
> >
> > > Hi All,
> > >
> > > Can anyone share the TomEE configuration for setting the
> keepAliveTimeout
> > > property?
> > >
> > > Regards,
> > > Srikanth
> > >
> >
>


Re: How to enable keepAliveTimeout in TomEE

2018-06-25 Thread Romain Manni-Bucau
Hi Srikanth?

which keepAliveTimeout? (we have in ejbd -> ejbd.properties, in tomcat
connectors -> standard tomcat config, etc...)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 25 juin 2018 à 13:30, srikanth myneni  a
écrit :

> Hi All,
>
> Can anyone share the TomEE configuration for setting the keepAliveTimeout
> property?
>
> Regards,
> Srikanth
>


Re: tomee testing

2018-06-24 Thread Romain Manni-Bucau
ang.StringBuilder.append(StringBuilder.java:131)
> >> at java.util.AbstractMap.toString(AbstractMap.java:559)
> >> at java.text.MessageFormat.subformat(MessageFormat.java:1280)
> >> at java.text.MessageFormat.format(MessageFormat.java:865)
> >> at java.text.Format.format(Format.java:157)
> >> at java.text.MessageFormat.format(MessageFormat.java:841)
> >> at
> >>
> org.apache.openjpa.lib.util.Localizer$Message.getMessage(Localizer.java:282)
> >> at
> >>
> org.apache.openjpa.lib.util.Localizer$Message.toString(Localizer.java:309)
> >> at
> >> org.apache.openjpa.lib.log.AbstractLog.toString(AbstractLog.java:138)
> >> at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:72)
> >> at org.apache.openjpa.lib.log.AbstractLog.trace(AbstractLog.java:67)
> >> at
> >>
> org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationProviderImpl.setInto(PersistenceProductDerivation.java:764)
> >> at
> >>
> org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(JDBCBrokerFactory.java:60)
> >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> at
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> >> at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> >> at java.lang.reflect.Method.invoke(Method.java:498)
> >> at
> >> org.apache.openjpa.kernel.Bootstrap.invokeFactory(Bootstrap.java:131)
> >> at
> >> org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:65)
> >> ... 29 more
> >>
> >> On 24/06/18 13:02, Romain Manni-Bucau wrote:
> >>> mapping error in your model it seems or bad persistence unit
> >>> definition if
> >>> you dont use scanning.
> >>>
> >>> Romain Manni-Bucau
> >>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> >>> <https://rmannibucau.metawerx.net/> | Old Blog
> >>> <http://rmannibucau.wordpress.com> | Github
> >>> <https://github.com/rmannibucau> |
> >>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> >>> <
> https://www.packtpub.com/application-development/java-ee-8-high-performance>
>
> >>>
> >>>
> >>>
> >>> Le dim. 24 juin 2018 à 12:52, Matthew Broadhead
> >>>  a écrit :
> >>>
> >>>> thanks.  removing the @Jars helped. it is now injecting CDI bean fine.
> >>>> but now i get OpenJPA NPE on
> >>>> List quoteTypeList = query.getResultList();
> >>>>
> >>>> 
> >>>> org.apache.openjpa.persistence.PersistenceException: null
> >>>>   at
> >>>> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1029)
> >>>>   at
> >>>> org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:928)
> >>>>   at
> >>>>
> >>>>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1032)
>
> >>>>
> >>>>   at
> >>>>
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
> >>>>
> >>>>   at
> >>>>
> >>>>
> org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2382)
>
> >>>>
> >>>>   at
> >>>>
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
> >>>>
> >>>>   at
> >>>>
> >>>>
> org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
>
> >>>>
> >>>>   at
> >>>>
> >>>>
> org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2080)
>
> >>>>
> >>>>   at
> >>>>
> org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:35)
> >>>>
> >>>>   at
> >>>> org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1257)
> >>>>   at
> >>>> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1013)
> >>>>   at
> >>>> org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:869)
> >>>>  

Re: tomee testing

2018-06-24 Thread Romain Manni-Bucau
mapping error in your model it seems or bad persistence unit definition if
you dont use scanning.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 24 juin 2018 à 12:52, Matthew Broadhead
 a écrit :

> thanks.  removing the @Jars helped.  it is now injecting CDI bean fine.
> but now i get OpenJPA NPE on
> List quoteTypeList = query.getResultList();
>
> 
> org.apache.openjpa.persistence.PersistenceException: null
>  at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:1029)
>  at org.apache.openjpa.kernel.BrokerImpl.find(BrokerImpl.java:928)
>  at
>
> org.apache.openjpa.jdbc.kernel.JDBCStoreManager.load(JDBCStoreManager.java:1032)
>  at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:280)
>  at
>
> org.apache.openjpa.jdbc.sql.SelectImpl$SelectResult.load(SelectImpl.java:2382)
>  at
> org.apache.openjpa.jdbc.sql.AbstractResult.load(AbstractResult.java:274)
>  at
>
> org.apache.openjpa.jdbc.kernel.InstanceResultObjectProvider.getResultObject(InstanceResultObjectProvider.java:59)
>  at
>
> org.apache.openjpa.kernel.QueryImpl$PackingResultObjectProvider.getResultObject(QueryImpl.java:2080)
>  at
> org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:35)
>  at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1257)
>  at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1013)
>  at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:869)
>  at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:800)
>  at
> org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:541)
>  at
> org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:274)
>  at
> org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:290)
>  at
> uk.me.kissy.sales.dao.QuoteTypeDao.selectQuoteTypes(QuoteTypeDao.java:51)
>  at
>
> uk.me.kissy.sales.dao.QuoteTypeDao$$OwbNormalScopeProxy0.selectQuoteTypes(uk/me/kissy/sales/dao/QuoteTypeDao.java)
>  at
> uk.me.kissy.sales.test.QuoteGeneratorTest.test1(QuoteGeneratorTest.java:96)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>  at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:498)
>  at
>
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>  at
>
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>  at
>
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>  at
>
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>  at
>
> org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:44)
>  at
>
> org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:40)
>  at
>
> org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:1070)
>  at
>
> org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
>  at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>  at
>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>  at
>
> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>  at
>
> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
>  at
>
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
>  at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
>  at
>
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
>  at
&g

Re: tomee testing

2018-06-24 Thread Romain Manni-Bucau
you don't need @Jars for that

why you get an exception is cause appcomposers knows mysql has no EE
classes so it is excluded from the "find" logic. @Jars means "grab the jars
matching this prefix and scan them to include them in the deployed app".

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 24 juin 2018 à 12:15, Matthew Broadhead
 a écrit :

> i tried adding test scope to pom.xml
> 
>  mysql
> mysql-connector-java
> ${mysql.connector.version}
>  test
>  
>
> also added mysql-connector-java-5.1.33.jar to the root of
> src/test/resources but i still get
> java.lang.IllegalArgumentException: mysql not found in classpath
>  at
>
> org.apache.openejb.testing.ApplicationComposers.findFiles(ApplicationComposers.java:1020)
>  at
>
> org.apache.openejb.testing.ApplicationComposers.addWebApp(ApplicationComposers.java:899)
>  at
>
> org.apache.openejb.testing.ApplicationComposers.deployApp(ApplicationComposers.java:651)
>
>
> On 24/06/18 12:01, Romain Manni-Bucau wrote:
> > Appcopposer loads classes in the classpath so add it as a test
> dependency.
> >
> > Le dim. 24 juin 2018 11:37, Matthew Broadhead
> >  a écrit :
> >
> >> not much luck with arquillian.  i am trying ApplicationComposer again.
> >> now i understand the properties format
> >> @ContainerProperties({ @ContainerProperties.Property(name = "sales",
> >> value = "new://Resource?type=DataSource"),
> >>   @ContainerProperties.Property(name = "sales.JdbcDriver", value
> >> = "com.mysql.jdbc.Driver"),
> >>   @ContainerProperties.Property(name = "sales.JdbcUrl", value =
> >> "jdbc:mysql://localhost:3306/sales"),
> >>   @ContainerProperties.Property(name = "sales.Username", value =
> >> "admin"),
> >>   @ContainerProperties.Property(name = "sales.Password", value =
> >> "blahblah") })
> >>
> >> but now i get
> >> org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> >> resolve class com.mysql.jdbc.Driver
> >>   at
> >>
> >>
> org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
> >>   at
> >>
> >>
> org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
> >>
> >> how to bundle the mysql driver?  i tried
> >> @Jars("mysql")
> >>
> >> On 23/06/18 21:58, Romain Manni-Bucau wrote:
> >>> You need all your tested app needs (this is why classpath deploypent
> >>> solutions are easier to maintain).
> >>>
> >>> Maybe import our ziplock lib and use Mvn.Builder class if you are maven
> >>> based. It can help.
> >>>
> >>> Le sam. 23 juin 2018 20:09, Matthew Broadhead
> >>>  a écrit :
> >>>
> >>>> ah ok.  i found
> >>>> .addAsManifestResource(new
> ClassLoaderAsset("META-INF/persistence.xml"),
> >>>> "persistence.xml")
> >>>>
> >>>> in
> >>>>
> >>>>
> >>
> http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
> >>>> but now i am back to
> >>>> SEVERE - CDI Beans module deployment failed
> >>>> org.apache.webbeans.exception.WebBeansDeploymentException:
> >>>> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> >>>> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> >>>> Qualifiers: [@javax.enterprise.inject.Default()]
> >>>> for injection into Field Injection Point, field name : quoteTypeDao,
> >>>> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> >>>> Name:null, API
> >>>>
> >>
> Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
> >>
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
> >>>>at
> >>>>
> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.j

Re: tomee testing

2018-06-24 Thread Romain Manni-Bucau
Appcopposer loads classes in the classpath so add it as a test dependency.

Le dim. 24 juin 2018 11:37, Matthew Broadhead
 a écrit :

> not much luck with arquillian.  i am trying ApplicationComposer again.
> now i understand the properties format
> @ContainerProperties({ @ContainerProperties.Property(name = "sales",
> value = "new://Resource?type=DataSource"),
>  @ContainerProperties.Property(name = "sales.JdbcDriver", value
> = "com.mysql.jdbc.Driver"),
>  @ContainerProperties.Property(name = "sales.JdbcUrl", value =
> "jdbc:mysql://localhost:3306/sales"),
>  @ContainerProperties.Property(name = "sales.Username", value =
> "admin"),
>  @ContainerProperties.Property(name = "sales.Password", value =
> "blahblah") })
>
> but now i get
> org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> resolve class com.mysql.jdbc.Driver
>  at
>
> org.apache.xbean.propertyeditor.ClassEditor.toObjectImpl(ClassEditor.java:43)
>  at
>
> org.apache.xbean.propertyeditor.AbstractConverter.toObject(AbstractConverter.java:86)
>
> how to bundle the mysql driver?  i tried
> @Jars("mysql")
>
> On 23/06/18 21:58, Romain Manni-Bucau wrote:
> > You need all your tested app needs (this is why classpath deploypent
> > solutions are easier to maintain).
> >
> > Maybe import our ziplock lib and use Mvn.Builder class if you are maven
> > based. It can help.
> >
> > Le sam. 23 juin 2018 20:09, Matthew Broadhead
> >  a écrit :
> >
> >> ah ok.  i found
> >> .addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"),
> >> "persistence.xml")
> >>
> >> in
> >>
> >>
> http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
> >>
> >> but now i am back to
> >> SEVERE - CDI Beans module deployment failed
> >> org.apache.webbeans.exception.WebBeansDeploymentException:
> >> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> >> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> >> Qualifiers: [@javax.enterprise.inject.Default()]
> >> for injection into Field Injection Point, field name : quoteTypeDao,
> >> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> >> Name:null, API
> >>
> Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
> >>
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
> >>   at
> >> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
> >>
> >> so i must have missed a required class somewhere
> >>
> >> On 23/06/18 18:53, Matthew Broadhead wrote:
> >>> do i need to copy the persistence.xml to src/test/resources/META-INF?
> >>> or can i specify its location somewhere in config?
> >>>
> >>> SEVERE - FAIL ... sales:Missing required persistence.xml for
> >>> @PersistenceUnit ref "entityManagerFactory" to unit "sales"
> >>> SEVERE - Invalid EjbModule(name=sales,
> >>>
> path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
> >>> SEVERE - FAIL ... sales:Missing required persistence.xml for
> >>> @PersistenceUnit ref "entityManagerFactory" to unit "sales"
> >>> SEVERE - Invalid WebModule(name=sales,
> >>>
> path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
> >>> INFO - Set the 'openejb.validation.output.level' system property to
> >>> VERBOSE for increased validation details.
> >>> SEVERE - Unable to deploy collapsed ear in war
> >>>
> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
> >>> org.apache.openejb.config.ValidationFailedException: Module failed
> >>> validation. AppModule(name=sales)
> >>>  at
> >>>
> >>
> org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
> >>>  at
> >>> org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
> >>>
> >>> On 23/06/18 13:30, Romain Manni-Bucau wrote:
> >>>> You can but you need to add all the object graph in the archive. Here
> >>>> you
> >>>> miss an injection it seems (in your dao?).
> >>>&

Re: tomee testing

2018-06-23 Thread Romain Manni-Bucau
You need all your tested app needs (this is why classpath deploypent
solutions are easier to maintain).

Maybe import our ziplock lib and use Mvn.Builder class if you are maven
based. It can help.

Le sam. 23 juin 2018 20:09, Matthew Broadhead
 a écrit :

> ah ok.  i found
> .addAsManifestResource(new ClassLoaderAsset("META-INF/persistence.xml"),
> "persistence.xml")
>
> in
>
> http://svn.apache.org/repos/asf/tomee/tomee/trunk/examples/arquillian-jpa/src/test/java/org/superbiz/arquillian/test/persistence/PersistenceTest.java
>
> but now i am back to
> SEVERE - CDI Beans module deployment failed
> org.apache.webbeans.exception.WebBeansDeploymentException:
> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> Qualifiers: [@javax.enterprise.inject.Default()]
> for injection into Field Injection Point, field name : quoteTypeDao,
> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> Name:null, API
> Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
>  at
> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
>
> so i must have missed a required class somewhere
>
> On 23/06/18 18:53, Matthew Broadhead wrote:
> > do i need to copy the persistence.xml to src/test/resources/META-INF?
> > or can i specify its location somewhere in config?
> >
> > SEVERE - FAIL ... sales:Missing required persistence.xml for
> > @PersistenceUnit ref "entityManagerFactory" to unit "sales"
> > SEVERE - Invalid EjbModule(name=sales,
> > path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
> > SEVERE - FAIL ... sales:Missing required persistence.xml for
> > @PersistenceUnit ref "entityManagerFactory" to unit "sales"
> > SEVERE - Invalid WebModule(name=sales,
> > path=/home/matthew/git/case-management/sales/target/working-dir/0/sales)
> > INFO - Set the 'openejb.validation.output.level' system property to
> > VERBOSE for increased validation details.
> > SEVERE - Unable to deploy collapsed ear in war
> > StandardEngine[Catalina].StandardHost[localhost].StandardContext[/sales]
> > org.apache.openejb.config.ValidationFailedException: Module failed
> > validation. AppModule(name=sales)
> > at
> >
> org.apache.openejb.config.ReportValidationResults.deploy(ReportValidationResults.java:88)
> > at
> > org.apache.openejb.config.AppInfoBuilder.build(AppInfoBuilder.java:322)
> >
> > On 23/06/18 13:30, Romain Manni-Bucau wrote:
> >> You can but you need to add all the object graph in the archive. Here
> >> you
> >> miss an injection it seems (in your dao?).
> >>
> >> Side note: operatesondeployment and naming your archive is not needed
> >> here.
> >> It is useful when you deploy N > 1 archives.
> >>
> >> Le sam. 23 juin 2018 12:54, Matthew Broadhead
> >>  a écrit :
> >>
> >>> i got the sample configuration from
> >>> http://tomee.apache.org/developer/testing/arquillian/index.html under
> >>> remote section.
> >>>
> >>> now my problem is that i can't inject the CDI bean
> >>> SEVERE - CDI Beans module deployment failed
> >>> org.apache.webbeans.exception.WebBeansDeploymentException:
> >>> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> >>> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> >>> Qualifiers: [@javax.enterprise.inject.Default()]
> >>> for injection into Field Injection Point, field name : quoteTypeDao,
> >>> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> >>> Name:null, API
> >>>
> Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
> >>>
> >>>
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
> >>>
> >>>   at
> >>> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
> >>>   at
> >>>
> >>>
> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
>
> >>>
> >>>
> >>> i created the @Deployment using
> >>> @Inject
> >>>   private QuoteTypeDao quoteTypeDao;
> >>>
> >>>   @Deployment(name = "archive")
> >>>   public static WebArchive war() {
> 

Re: tomee testing

2018-06-23 Thread Romain Manni-Bucau
You can but you need to add all the object graph in the archive. Here you
miss an injection it seems (in your dao?).

Side note: operatesondeployment and naming your archive is not needed here.
It is useful when you deploy N > 1 archives.

Le sam. 23 juin 2018 12:54, Matthew Broadhead
 a écrit :

> i got the sample configuration from
> http://tomee.apache.org/developer/testing/arquillian/index.html under
> remote section.
>
> now my problem is that i can't inject the CDI bean
> SEVERE - CDI Beans module deployment failed
> org.apache.webbeans.exception.WebBeansDeploymentException:
> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> Qualifiers: [@javax.enterprise.inject.Default()]
> for injection into Field Injection Point, field name : quoteTypeDao,
> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> Name:null, API
> Types:[uk.me.kissy.sales.test.QuoteGeneratorArquillian,java.lang.Object],
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
>  at
> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:327)
>  at
>
> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:196)
>
> i created the @Deployment using
> @Inject
>  private QuoteTypeDao quoteTypeDao;
>
>  @Deployment(name = "archive")
>  public static WebArchive war() {
>  return ShrinkWrap.create(WebArchive.class,
> "test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")
>  .addClasses(QuoteTypeDao.class);
>  }
>
>  @Test
>  @OperateOnDeployment("archive")
>  public void test1() {
>  Quote quote = new Quote();
>  Promotion promotion = null;
>  List quoteTypeList =
> quoteTypeDao.selectQuoteTypes(promotion, true);
>  System.out.println("Quote type list size: " +
> quoteTypeList.size());
>  for (QuoteType quoteType : quoteTypeList) {
>  System.out.println(quoteType.getName());
>  // quoteGeneratorDao.generateQuote(quote, promotion,
>  // quoteType.getQuoteTypeCategories(), quoteQuestions,
>  // quoteInit, true);
>      assertEquals(0, 1);
>  }
>  assertEquals(0, 1);
>  }
>
> can i not inject a CDI bean into the test using arquillian-tomee-remote?
>
> On 23/06/18 10:17, Romain Manni-Bucau wrote:
> > It is not needed at all bit it appears in your stack. If it is a copy
> paste
> > just drop it ;)
> >
> > Le sam. 23 juin 2018 10:05, Matthew Broadhead
> >  a écrit :
> >
> >> hi, i checked http://incubator.apache.org/projects/sirona.html but i
> >> couldn't find any documentation.  is sirona a requirement for
> >> arquillian-tomee-remote?  i.e. is it necessary to monitor tests? if so,
> >> then how do i exclude the mysql lib from the configuration?
> >> 
> >> 
> >> mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
> >> 
> >>
> >> On 23/06/18 08:15, Romain Manni-Bucau wrote:
> >>> Exclude mysql from sirona instrumentation. Its bytecode is not safe.
> >>>
> >>> Le sam. 23 juin 2018 01:03, Matthew Broadhead
> >>>  a écrit :
> >>>
> >>>> thanks i added it using
> >>>>  >>>> name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33
> >>>>
> >>>> but i get these errors (which don't seem to stop execution)
> >>>>
> >>>> fail to transform
> class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
> >>>> JSR/RET are not supported with computeFrames
> >>>> optionjava.lang.RuntimeException: JSR/RET are not supported with
> >>>> computeFrames option
> >>>>at org.apache.sirona.asm.Frame.a(Unknown Source)
> >>>>at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
> >> Source)
> >>>> SEVERE - Can't create DataSource
> >>>> java.lang.LinkageError: loader (instance of java/net/URLClassLoader):
> >>>> attempted  duplicate class definition for name:
> >>>> "com/mysql/jdbc/ConnectionImpl"
> >>>>
> >>>> but this one is a stopper
> >>>>
> >>>> SEVERE - CDI Beans module deployment failed
> >>>> org.apache.webbeans.exception.WebBeansDeploymentException:
> >>>> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> >

Re: tomee testing

2018-06-23 Thread Romain Manni-Bucau
It is not needed at all bit it appears in your stack. If it is a copy paste
just drop it ;)

Le sam. 23 juin 2018 10:05, Matthew Broadhead
 a écrit :

> hi, i checked http://incubator.apache.org/projects/sirona.html but i
> couldn't find any documentation.  is sirona a requirement for
> arquillian-tomee-remote?  i.e. is it necessary to monitor tests? if so,
> then how do i exclude the mysql lib from the configuration?
> 
> 
> mvn:org.apache.sirona:sirona-javaagent:0.2-incubating:jar:shaded
> 
>
> On 23/06/18 08:15, Romain Manni-Bucau wrote:
> > Exclude mysql from sirona instrumentation. Its bytecode is not safe.
> >
> > Le sam. 23 juin 2018 01:03, Matthew Broadhead
> >  a écrit :
> >
> >> thanks i added it using
> >>  >> name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33
> >>
> >> but i get these errors (which don't seem to stop execution)
> >>
> >> fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
> >> JSR/RET are not supported with computeFrames
> >> optionjava.lang.RuntimeException: JSR/RET are not supported with
> >> computeFrames option
> >>   at org.apache.sirona.asm.Frame.a(Unknown Source)
> >>   at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown
> Source)
> >>
> >> SEVERE - Can't create DataSource
> >> java.lang.LinkageError: loader (instance of java/net/URLClassLoader):
> >> attempted  duplicate class definition for name:
> >> "com/mysql/jdbc/ConnectionImpl"
> >>
> >> but this one is a stopper
> >>
> >> SEVERE - CDI Beans module deployment failed
> >> org.apache.webbeans.exception.WebBeansDeploymentException:
> >> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> >> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> >> Qualifiers: [@javax.enterprise.inject.Default()]
> >> for injection into Field Injection Point, field name : quoteTypeDao,
> >> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> >> Name:null, API
> >> Types:[java.lang.Object,uk.me
> .kissy.sales.test.QuoteGeneratorArquillian],
> >>
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
> >>
> >> i tried enabling remote support as i am trying remote not embedded
> >> tomee.remote.support = true
> >> # tomee.serialization.class.blacklist = *
> >> tomee.serialization.class.whitelist = *
> >>
> >> On 22/06/18 18:44, Romain Manni-Bucau wrote:
> >>> You can add it in libs property of arquillian container config. Just
> >> prefix
> >>> the coords with mvn:.
> >>>
> >>> Ex: mvn:mysql:mysql-connector-jav:version
> >>>
> >>> It is a multiline property so you can add N libs to tomee lib this way
> >>>
> >>> Le ven. 22 juin 2018 18:13, Matthew Broadhead
> >>>  a écrit :
> >>>
> >>>> INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please
> >>>> wait...
> >>>>
> >>>> i have an arquillian test running up ok but it is complaining
> >>>> SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the
> >>>> following stack trace and this message to users@tomee.apache.org :
> >>>> org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> >>>> resolve class com.mysql.jdbc.Driver
> >>>>
> >>>> is there any way to directly bring in the mysql driver from maven
> >>>> central?  or do i need to download manually and put it into
> >>>> src/test/tomee/lib?
> >>>>
> >>>>
> >>>> On 22/06/18 10:03, Romain Manni-Bucau wrote:
> >>>>> You can theorically but I'd recommand you to write it in the final
> >> module
> >>>>> instead of trying to use the parent which will be executed before any
> >>>> other
> >>>>> modules.
> >>>>>
> >>>>> If A depends on B which depends on C then write your tests in A for
> the
> >>>>> complete app tests and write unit tests in B and C (potentially using
> >>>>> arquillian, appcomposer or even other solutions).
> >>>>>
> >>>>> For reference:
> >>>>> http://tomee.apache.org/developer/testing/arquillian/index.html and
> >>>>> http://tomee.apache.org/developer/testing/index.html
> &

Re: tomee testing

2018-06-23 Thread Romain Manni-Bucau
Exclude mysql from sirona instrumentation. Its bytecode is not safe.

Le sam. 23 juin 2018 01:03, Matthew Broadhead
 a écrit :

> thanks i added it using
>  name="additionalLibs">mvn:mysql:mysql-connector-java:5.1.33
>
> but i get these errors (which don't seem to stop execution)
>
> fail to transform class:com/mysql/jdbc/AbandonedConnectionCleanupThread,
> JSR/RET are not supported with computeFrames
> optionjava.lang.RuntimeException: JSR/RET are not supported with
> computeFrames option
>  at org.apache.sirona.asm.Frame.a(Unknown Source)
>  at org.apache.sirona.asm.MethodWriter.visitJumpInsn(Unknown Source)
>
> SEVERE - Can't create DataSource
> java.lang.LinkageError: loader (instance of java/net/URLClassLoader):
> attempted  duplicate class definition for name:
> "com/mysql/jdbc/ConnectionImpl"
>
> but this one is a stopper
>
> SEVERE - CDI Beans module deployment failed
> org.apache.webbeans.exception.WebBeansDeploymentException:
> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> [uk.me.kissy.sales.dao.QuoteTypeDao] is not found with the qualifiers
> Qualifiers: [@javax.enterprise.inject.Default()]
> for injection into Field Injection Point, field name : quoteTypeDao,
> Bean Owner : [QuoteGeneratorArquillian, WebBeansType:ENTERPRISE,
> Name:null, API
> Types:[java.lang.Object,uk.me.kissy.sales.test.QuoteGeneratorArquillian],
> Qualifiers:[javax.enterprise.inject.Default,javax.enterprise.inject.Any]]
>
> i tried enabling remote support as i am trying remote not embedded
> tomee.remote.support = true
> # tomee.serialization.class.blacklist = *
> tomee.serialization.class.whitelist = *
>
> On 22/06/18 18:44, Romain Manni-Bucau wrote:
> > You can add it in libs property of arquillian container config. Just
> prefix
> > the coords with mvn:.
> >
> > Ex: mvn:mysql:mysql-connector-jav:version
> >
> > It is a multiline property so you can add N libs to tomee lib this way
> >
> > Le ven. 22 juin 2018 18:13, Matthew Broadhead
> >  a écrit :
> >
> >> INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please
> >> wait...
> >>
> >> i have an arquillian test running up ok but it is complaining
> >> SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the
> >> following stack trace and this message to users@tomee.apache.org :
> >>org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> >> resolve class com.mysql.jdbc.Driver
> >>
> >> is there any way to directly bring in the mysql driver from maven
> >> central?  or do i need to download manually and put it into
> >> src/test/tomee/lib?
> >>
> >>
> >> On 22/06/18 10:03, Romain Manni-Bucau wrote:
> >>> You can theorically but I'd recommand you to write it in the final
> module
> >>> instead of trying to use the parent which will be executed before any
> >> other
> >>> modules.
> >>>
> >>> If A depends on B which depends on C then write your tests in A for the
> >>> complete app tests and write unit tests in B and C (potentially using
> >>> arquillian, appcomposer or even other solutions).
> >>>
> >>> For reference:
> >>> http://tomee.apache.org/developer/testing/arquillian/index.html and
> >>> http://tomee.apache.org/developer/testing/index.html
> >>>
> >>> Romain Manni-Bucau
> >>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> >>> <https://rmannibucau.metawerx.net/> | Old Blog
> >>> <http://rmannibucau.wordpress.com> | Github <
> >> https://github.com/rmannibucau> |
> >>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> >>> <
> >>
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >>>
> >>>
> >>> Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
> >>>  a écrit :
> >>>
> >>>> it sounds like Arquillian might be the best fit in my case.  can the
> >>>> tests inject CDI beans from the webapps or does everything need to be
> >>>> done through http?  looking at
> >>>> https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test"
> >> it
> >>>> looks as if beans can be injected...
> >>>>
> >>>> is it possible to create the tests (or at least TomEE instance) in a
> >>>> parent pom?  i need to run several webapps at once which are all
> modules
> >>

Re: tomee testing

2018-06-22 Thread Romain Manni-Bucau
You can add it in libs property of arquillian container config. Just prefix
the coords with mvn:.

Ex: mvn:mysql:mysql-connector-jav:version

It is a multiline property so you can add N libs to tomee lib this way

Le ven. 22 juin 2018 18:13, Matthew Broadhead
 a écrit :

> INFO: Downloading org.apache.tomee:apache-tomee:7.0.3:zip:plus please
> wait...
>
> i have an arquillian test running up ok but it is complaining
> SEVERE - FATAL ERROR: Unknown error in Assembler.  Please send the
> following stack trace and this message to users@tomee.apache.org :
>   org.apache.xbean.propertyeditor.PropertyEditorException: Unable to
> resolve class com.mysql.jdbc.Driver
>
> is there any way to directly bring in the mysql driver from maven
> central?  or do i need to download manually and put it into
> src/test/tomee/lib?
>
>
> On 22/06/18 10:03, Romain Manni-Bucau wrote:
> > You can theorically but I'd recommand you to write it in the final module
> > instead of trying to use the parent which will be executed before any
> other
> > modules.
> >
> > If A depends on B which depends on C then write your tests in A for the
> > complete app tests and write unit tests in B and C (potentially using
> > arquillian, appcomposer or even other solutions).
> >
> > For reference:
> > http://tomee.apache.org/developer/testing/arquillian/index.html and
> > http://tomee.apache.org/developer/testing/index.html
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> https://github.com/rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
> >
> >
> > Le ven. 22 juin 2018 à 09:42, Matthew Broadhead
> >  a écrit :
> >
> >> it sounds like Arquillian might be the best fit in my case.  can the
> >> tests inject CDI beans from the webapps or does everything need to be
> >> done through http?  looking at
> >> https://tomee.apache.org/refcard/refcard.html "Simple Arquilian Test"
> it
> >> looks as if beans can be injected...
> >>
> >> is it possible to create the tests (or at least TomEE instance) in a
> >> parent pom?  i need to run several webapps at once which are all modules
> >> of the parent.  i think code is discouraged in parent project.
> >>
> >>
> >> On 22/06/18 09:18, Romain Manni-Bucau wrote:
> >>> You can set the property openejb.location (or the other ones we have)
> to
> >>> point to an openejb.xml if you want. The advantage of the properties is
> >>> that it is filtered during the test and doesnt require a maven build
> but
> >> it
> >>> is up to you and depends the project setup.
> >>>
> >>> Arquillian is great to test complete application*s* in a real server,
> >>> ApplicationComposer is good to test small parts of applications or
> >>> frameworks, TomEE,
> >>> TomEEEmbeddedSingleRunner is great to test a real app (single
> deployment
> >>> from the classpath + single test setup) and will save a lot of time.
> >>>
> >>> Romain Manni-Bucau
> >>> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> >>> <https://rmannibucau.metawerx.net/> | Old Blog
> >>> <http://rmannibucau.wordpress.com> | Github <
> >> https://github.com/rmannibucau> |
> >>> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> >>> <
> >>
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >>>
> >>>
> >>> Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
> >>>  a écrit :
> >>>
> >>>> i am trying to use ApplicationComposer to create some tests.  CDI is
> >>>> scanning the classes correctly but i am a little uncertain about how
> to
> >>>> load a test database.
> >>>>
> >>>> i was going to start by just loading the database as normal as it is a
> >>>> copy of production database.  but how do i specify the username and
> >>>> password or any other properties that are needed to connect to the db?
> >>>>
> >>>> @ContainerProperties(@ContainerProperties.Property(name = "mydb",
> value
> >>>> = "jdbc:mysql://localhost:3306/mydb"))
> >>>>
> >>>> is there a way to specify the resource in an xml file?
> >>>>
> >>>> another question...is it better to start with Arquillian or
> >>>> ApplicationComposer?
> >>>>
> >>
>
>


Re: TomEE stderr and stdout

2018-06-22 Thread Romain Manni-Bucau
Hi,

did you try:

export CATALINA_OUT=/tmp/tomee-stdout

?

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 22 juin 2018 à 15:18,  a écrit :

> Hi,
>
>
>
> I am searching for a way to re-enable stdout and stderr logging in TomEE
> 7.0.4.
>
>
>
> The files tomee-stderr and tomee-stdout were created automatically in 1.7
> but now they are gone.
>
>
>
> I need these files because log output that was in tomee-stdout after
> enabling kerberos loggin with –Dsun.security.krb5.debug=true is now nowhere
> to be found L
>
>
>
> How do I “switch on” this old feature?
>
>
>
> Thanks and best
>
> Fabian
>


Re: How to pass keystore password to TomEE for PasswordCipher

2018-06-22 Thread Romain Manni-Bucau
Hi,

you can use an environment var or a system property for that.

Alternatively you can use another resource or service in tomee.xml which is
configured as usual and injected into the datasource (PasswordCipher =
$myCipher or PasswordCipher = @myCipher).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 22 juin 2018 à 10:48, sudhakarvm  a écrit :

> I have implemented PasswordCipher to encrypt and decrypt the DB password
> using AES algorithm. I want to store my AES key in a keystore or in a
> secured place. If I store in a keystore then I need to pass the keystore
> password. What is the best way to pass the keystore password.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: [Newsletter] Re: [Newsletter] Re: [Newsletter] Re: [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?

2018-06-22 Thread Romain Manni-Bucau
Feel free to do it and if you want submit a pull request or patch if you
have it.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 22 juin 2018 à 08:28,  a écrit :

> Should I file a bug report?
>
> -----Original Message-
> From: Romain Manni-Bucau 
> Sent: Wednesday, June 20, 2018 3:52 PM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: [Newsletter] Re: [Newsletter] Re:
> [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?
>
> you are right, this is a bug. We clearly can't import guava in lib/
> (breaks too much apps) so we need to find a solution for that (potentially
> not importing saml).
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> https://rmannibucau.metawerx.net/> | Old Blog <
> http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le mer. 20 juin 2018 à 15:16,  a
> écrit :
>
> > I dont understand, java-support-7.1.1.jar (which contains all the
> > shibboleth classes) _IS_ part of the TomEE 7.0.4 Plus package
> >
> > -Original Message-
> > From: Romain Manni-Bucau 
> > Sent: Wednesday, June 20, 2018 3:12 PM
> > To: users@tomee.apache.org
> > Subject: *EXT* [Newsletter] Re: [Newsletter] Re: [Newsletter] Re:
> > Missing Guava in TomEE 7.0.4 Plus?
> >
> > It is not in tomee lib so should be coming from your app or
> > environment :s
> >
> > by leak i meant we don't intend to deliver this lib out of the box
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> > https://rmannibucau.metawerx.net/> | Old Blog <
> > http://rmannibucau.wordpress.com> | Github
> > <https://github.com/rmannibucau>
> > | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> > https://www.packtpub.com/application-development/java-ee-8-high-perfor
> > mance
> > >
> >
> >
> > Le mer. 20 juin 2018 à 15:06,  a
> > écrit :
> >
> > > What do you mean with "leak"? We do not have it in our webapp, we
> > > only have guava but it is not picked up by the parent classloader :(
> > >
> > > -Original Message-
> > > From: Romain Manni-Bucau 
> > > Sent: Wednesday, June 20, 2018 3:00 PM
> > > To: users@tomee.apache.org
> > > Subject: *EXT* [Newsletter] Re: [Newsletter] Re: Missing Guava in
> > > TomEE
> > > 7.0.4 Plus?
> > >
> > > Hmm if we provide it OOTB that's a "leak" on our side, if you have
> > > it in the webapp just drop it.
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> > > https://rmannibucau.metawerx.net/> | Old Blog <
> > > http://rmannibucau.wordpress.com> | Github
> > > <https://github.com/rmannibucau>
> > > | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> > > https://www.packtpub.com/application-development/java-ee-8-high-perf
> > > or
> > > mance
> > > >
> > >
> > >
> > > Le mer. 20 juin 2018 à 14:58,  a
> > > écrit :
> > >
> > > > Is there a way to not "import shibboleth"? I am pretty sure we
> > > > don’t need it...
> > > >
> > > > -Original Message-
> > > > From: Romain Manni-Bucau 
> > > > Sent: Wednesday, June 20, 2018 2:49 PM
> > > > To: users@tomee.apache.org
> > > > Subject: *EXT* [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?
> > > >
> > > > Hi,
> > > >
> > > > yes and no. We intentionnally drop guava and it works with
> > > > opensaml until you import shibboleth which requires it. At that
> > > > moment you have to either drop opensaml libs from tomee libs or
> > > > add the missing
> > ones.
> > > >
> > > > Romain Manni-Bucau
> > > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> > > > https://rmannibuc

Re: tomee testing

2018-06-22 Thread Romain Manni-Bucau
You can set the property openejb.location (or the other ones we have) to
point to an openejb.xml if you want. The advantage of the properties is
that it is filtered during the test and doesnt require a maven build but it
is up to you and depends the project setup.

Arquillian is great to test complete application*s* in a real server,
ApplicationComposer is good to test small parts of applications or
frameworks, TomEE,
TomEEEmbeddedSingleRunner is great to test a real app (single deployment
from the classpath + single test setup) and will save a lot of time.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le ven. 22 juin 2018 à 09:03, Matthew Broadhead
 a écrit :

> i am trying to use ApplicationComposer to create some tests.  CDI is
> scanning the classes correctly but i am a little uncertain about how to
> load a test database.
>
> i was going to start by just loading the database as normal as it is a
> copy of production database.  but how do i specify the username and
> password or any other properties that are needed to connect to the db?
>
> @ContainerProperties(@ContainerProperties.Property(name = "mydb", value
> = "jdbc:mysql://localhost:3306/mydb"))
>
> is there a way to specify the resource in an xml file?
>
> another question...is it better to start with Arquillian or
> ApplicationComposer?
>


Re: [Newsletter] Re: [Newsletter] Re: [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?

2018-06-20 Thread Romain Manni-Bucau
you are right, this is a bug. We clearly can't import guava in lib/ (breaks
too much apps) so we need to find a solution for that (potentially not
importing saml).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 20 juin 2018 à 15:16,  a écrit :

> I dont understand, java-support-7.1.1.jar (which contains all the
> shibboleth classes) _IS_ part of the TomEE 7.0.4 Plus package
>
> -Original Message-
> From: Romain Manni-Bucau 
> Sent: Wednesday, June 20, 2018 3:12 PM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: [Newsletter] Re: [Newsletter] Re: Missing
> Guava in TomEE 7.0.4 Plus?
>
> It is not in tomee lib so should be coming from your app or environment :s
>
> by leak i meant we don't intend to deliver this lib out of the box
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> https://rmannibucau.metawerx.net/> | Old Blog <
> http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le mer. 20 juin 2018 à 15:06,  a
> écrit :
>
> > What do you mean with "leak"? We do not have it in our webapp, we only
> > have guava but it is not picked up by the parent classloader :(
> >
> > -Original Message-
> > From: Romain Manni-Bucau 
> > Sent: Wednesday, June 20, 2018 3:00 PM
> > To: users@tomee.apache.org
> > Subject: *EXT* [Newsletter] Re: [Newsletter] Re: Missing Guava in
> > TomEE
> > 7.0.4 Plus?
> >
> > Hmm if we provide it OOTB that's a "leak" on our side, if you have it
> > in the webapp just drop it.
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> > https://rmannibucau.metawerx.net/> | Old Blog <
> > http://rmannibucau.wordpress.com> | Github
> > <https://github.com/rmannibucau>
> > | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> > https://www.packtpub.com/application-development/java-ee-8-high-perfor
> > mance
> > >
> >
> >
> > Le mer. 20 juin 2018 à 14:58,  a
> > écrit :
> >
> > > Is there a way to not "import shibboleth"? I am pretty sure we don’t
> > > need it...
> > >
> > > -Original Message-
> > > From: Romain Manni-Bucau 
> > > Sent: Wednesday, June 20, 2018 2:49 PM
> > > To: users@tomee.apache.org
> > > Subject: *EXT* [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?
> > >
> > > Hi,
> > >
> > > yes and no. We intentionnally drop guava and it works with opensaml
> > > until you import shibboleth which requires it. At that moment you
> > > have to either drop opensaml libs from tomee libs or add the missing
> ones.
> > >
> > > Romain Manni-Bucau
> > > @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> > > https://rmannibucau.metawerx.net/> | Old Blog <
> > > http://rmannibucau.wordpress.com> | Github
> > > <https://github.com/rmannibucau>
> > > | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> > > https://www.packtpub.com/application-development/java-ee-8-high-perf
> > > or
> > > mance
> > > >
> > >
> > >
> > > Le mer. 20 juin 2018 à 14:46,  a
> > > écrit :
> > >
> > > > Hey,
> > > >
> > > >
> > > >
> > > > when I try to initialize OpenSAML in TomEE 7.0.4 with
> > > > InitializationService.initialize(); I get
> > > >
> > > >
> > > >
> > > > java.lang.ClassNotFoundException: com.google.common.base.Function
> > > >
> > > >
> > > > java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> > > >
> > > > java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> > > >
> > > > java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > > >
> > > >
> > > > net.shibboleth.utilities.java.support.xml.AttributeS

Re: [Newsletter] Re: [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?

2018-06-20 Thread Romain Manni-Bucau
It is not in tomee lib so should be coming from your app or environment :s

by leak i meant we don't intend to deliver this lib out of the box

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 20 juin 2018 à 15:06,  a écrit :

> What do you mean with "leak"? We do not have it in our webapp, we only
> have guava but it is not picked up by the parent classloader :(
>
> -Original Message-
> From: Romain Manni-Bucau 
> Sent: Wednesday, June 20, 2018 3:00 PM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: [Newsletter] Re: Missing Guava in TomEE
> 7.0.4 Plus?
>
> Hmm if we provide it OOTB that's a "leak" on our side, if you have it in
> the webapp just drop it.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> https://rmannibucau.metawerx.net/> | Old Blog <
> http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le mer. 20 juin 2018 à 14:58,  a
> écrit :
>
> > Is there a way to not "import shibboleth"? I am pretty sure we don’t
> > need it...
> >
> > -Original Message-
> > From: Romain Manni-Bucau 
> > Sent: Wednesday, June 20, 2018 2:49 PM
> > To: users@tomee.apache.org
> > Subject: *EXT* [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?
> >
> > Hi,
> >
> > yes and no. We intentionnally drop guava and it works with opensaml
> > until you import shibboleth which requires it. At that moment you have
> > to either drop opensaml libs from tomee libs or add the missing ones.
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> > https://rmannibucau.metawerx.net/> | Old Blog <
> > http://rmannibucau.wordpress.com> | Github
> > <https://github.com/rmannibucau>
> > | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> > https://www.packtpub.com/application-development/java-ee-8-high-perfor
> > mance
> > >
> >
> >
> > Le mer. 20 juin 2018 à 14:46,  a
> > écrit :
> >
> > > Hey,
> > >
> > >
> > >
> > > when I try to initialize OpenSAML in TomEE 7.0.4 with
> > > InitializationService.initialize(); I get
> > >
> > >
> > >
> > > java.lang.ClassNotFoundException: com.google.common.base.Function
> > >
> > >
> > > java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> > >
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> > >
> > > java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> > >
> > >
> > > net.shibboleth.utilities.java.support.xml.AttributeSupport.getAttrib
> > > ut
> > > eValueAsQName(AttributeSupport.java:334)
> > >
> > >
> > > org.opensaml.core.xml.config.XMLConfigurator.initializeObjectProvide
> > > rs
> > > (XMLConfigurator.java:231)
> > >
> > >
> > > org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.ja
> > > va
> > > :203)
> > >
> > >
> > > org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.ja
> > > va
> > > :188)
> > >
> > >
> > > org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.ja
> > > va
> > > :162)
> > >
> > >
> > > org.opensaml.core.xml.config.AbstractXMLObjectProviderInitializer.in
> > > it
> > > (AbstractXMLObjectProviderInitializer.java:52)
> > >
> > >
> > > org.opensaml.core.xml.config.XMLObjectProviderInitializer.init(XMLOb
> > > je
> > > ctProviderInitializer.java:45)
> > >
> > >
> > > org.opensaml.core.config.InitializationService.initialize(Initializa
> > > ti
> > > onService.java:56)
> > >
> > >
> > >
> > > As soon as I add guava-18.0.jar to TomEE/lib it works.
> > >
> > >
> > >
> > > Did you guys miss to package this transitive dependency of opensaml
> > > (via java-support)?
> > >
> > >
> > >
> > > Thanks and best
> > >
> > > Fabian
> > >
> >
>


Re: [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?

2018-06-20 Thread Romain Manni-Bucau
Hmm if we provide it OOTB that's a "leak" on our side, if you have it in
the webapp just drop it.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 20 juin 2018 à 14:58,  a écrit :

> Is there a way to not "import shibboleth"? I am pretty sure we don’t need
> it...
>
> -Original Message-
> From: Romain Manni-Bucau 
> Sent: Wednesday, June 20, 2018 2:49 PM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: Missing Guava in TomEE 7.0.4 Plus?
>
> Hi,
>
> yes and no. We intentionnally drop guava and it works with opensaml until
> you import shibboleth which requires it. At that moment you have to either
> drop opensaml libs from tomee libs or add the missing ones.
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> https://rmannibucau.metawerx.net/> | Old Blog <
> http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le mer. 20 juin 2018 à 14:46,  a
> écrit :
>
> > Hey,
> >
> >
> >
> > when I try to initialize OpenSAML in TomEE 7.0.4 with
> > InitializationService.initialize(); I get
> >
> >
> >
> > java.lang.ClassNotFoundException: com.google.common.base.Function
> >
> > java.net.URLClassLoader.findClass(URLClassLoader.java:381)
> >
> > java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> >
> > java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> >
> >
> > net.shibboleth.utilities.java.support.xml.AttributeSupport.getAttribut
> > eValueAsQName(AttributeSupport.java:334)
> >
> >
> > org.opensaml.core.xml.config.XMLConfigurator.initializeObjectProviders
> > (XMLConfigurator.java:231)
> >
> >
> > org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.java
> > :203)
> >
> >
> > org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.java
> > :188)
> >
> >
> > org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.java
> > :162)
> >
> >
> > org.opensaml.core.xml.config.AbstractXMLObjectProviderInitializer.init
> > (AbstractXMLObjectProviderInitializer.java:52)
> >
> >
> > org.opensaml.core.xml.config.XMLObjectProviderInitializer.init(XMLObje
> > ctProviderInitializer.java:45)
> >
> >
> > org.opensaml.core.config.InitializationService.initialize(Initializati
> > onService.java:56)
> >
> >
> >
> > As soon as I add guava-18.0.jar to TomEE/lib it works.
> >
> >
> >
> > Did you guys miss to package this transitive dependency of opensaml
> > (via java-support)?
> >
> >
> >
> > Thanks and best
> >
> > Fabian
> >
>


Re: Missing Guava in TomEE 7.0.4 Plus?

2018-06-20 Thread Romain Manni-Bucau
Hi,

yes and no. We intentionnally drop guava and it works with opensaml until
you import shibboleth which requires it. At that moment you have to either
drop opensaml libs from tomee libs or add the missing ones.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 20 juin 2018 à 14:46,  a écrit :

> Hey,
>
>
>
> when I try to initialize OpenSAML in TomEE 7.0.4 with
> InitializationService.initialize(); I get
>
>
>
> java.lang.ClassNotFoundException: com.google.common.base.Function
>
> java.net.URLClassLoader.findClass(URLClassLoader.java:381)
>
> java.lang.ClassLoader.loadClass(ClassLoader.java:424)
>
> java.lang.ClassLoader.loadClass(ClassLoader.java:357)
>
>
> net.shibboleth.utilities.java.support.xml.AttributeSupport.getAttributeValueAsQName(AttributeSupport.java:334)
>
>
> org.opensaml.core.xml.config.XMLConfigurator.initializeObjectProviders(XMLConfigurator.java:231)
>
>
> org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.java:203)
>
>
> org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.java:188)
>
>
> org.opensaml.core.xml.config.XMLConfigurator.load(XMLConfigurator.java:162)
>
>
> org.opensaml.core.xml.config.AbstractXMLObjectProviderInitializer.init(AbstractXMLObjectProviderInitializer.java:52)
>
>
> org.opensaml.core.xml.config.XMLObjectProviderInitializer.init(XMLObjectProviderInitializer.java:45)
>
>
> org.opensaml.core.config.InitializationService.initialize(InitializationService.java:56)
>
>
>
> As soon as I add guava-18.0.jar to TomEE/lib it works.
>
>
>
> Did you guys miss to package this transitive dependency of opensaml (via
> java-support)?
>
>
>
> Thanks and best
>
> Fabian
>


Re: [Newsletter] Re: TomEE 7.0.4 and contextPath

2018-06-19 Thread Romain Manni-Bucau
:), that said it is surely better than change of opinion each two years ;)

Now in practise you always have something doing the provisioning, worse
case it is a script (like a sh on jenkins) but the point is you always
control the name of your delivery so it is not a big deal.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mar. 19 juin 2018 à 08:48,  a écrit :

> ugh, tough crowd, these tomcat people! Thanks for this discussion 2 years
> ago, Romain. Sadly they were adamant about their opinions.
>
> Best
> Fabian
>
> -Original Message-
> From: Romain Manni-Bucau 
> Sent: Monday, June 18, 2018 5:39 PM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: TomEE 7.0.4 and contextPath
>
> outch makes years now but think i sent it on tomcat list:
>
> https://markmail.org/search/?q=rmannibucau%20tomcat%20context.xml%20path%20list%3Aorg.apache.tomcat.dev%2F#query:rmannibucau%20tomcat%20context.xml%20path%20list%3Aorg.apache.tomcat.dev%2F+page:1+mid:nu4lsudwup67w34d+state:results
>
> Romain Manni-Bucau
> @rmannibucau <https://twitter.com/rmannibucau> |  Blog <
> https://rmannibucau.metawerx.net/> | Old Blog <
> http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau>
> | LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book <
> https://www.packtpub.com/application-development/java-ee-8-high-performance
> >
>
>
> Le lun. 18 juin 2018 à 17:35, Mark Struberg  a
> écrit :
>
> >  that's news to me.
> > Which ticket was that?Could not find it on bugzilla.
> >
> > On Monday, 18 June 2018, 17:15:01 CEST, Romain Manni-Bucau <
> > rmannibu...@gmail.com> wrote:
> >
> >  If you put the war in webapps (or auto deploy) you must rename the
> > war file now (tomcat change).
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <
> > https://github.com/rmannibucau> | LinkedIn
> > <https://www.linkedin.com/in/rmannibucau> | Book <
> > https://www.packtpub.com/application-development/java-ee-8-high-perfor
> > mance
> > >
> >
> >
> > Le lun. 18 juin 2018 à 17:01,  a
> > écrit :
> >
> > > Hey,
> > >
> > >
> > >
> > > sorry to bother you guys again, but I am trying to change the
> > > context path of my webapp in TomEE 7.0.4 but the old method of
> > > setting 

Re: TomEE 7.0.4 and contextPath

2018-06-18 Thread Romain Manni-Bucau
If you put the war in webapps (or auto deploy) you must rename the war file
now (tomcat change).

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 18 juin 2018 à 17:01,  a écrit :

> Hey,
>
>
>
> sorry to bother you guys again, but I am trying to change the context
> path of my webapp in TomEE 7.0.4 but the old method of setting  path="/somehting”> in META-INF/context.xml is not working anymore.
>
>
>
> What is the current best practice to “overwrite” the webapp/context name?
>
>
>
> Thanks in advance and best
>
> Fabian
>
>
>


Re: Embedded TomEE 7.0.4 and Arquillian and TLS

2018-06-18 Thread Romain Manni-Bucau
Looks good to me (if anyone wants to apply it otherwise I'll do it end of
the week)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 18 juin 2018 à 16:02, Gurkan Erdogdu  a écrit :

> Also added test patch.
>
> On Mon, Jun 18, 2018 at 4:45 PM, Romain Manni-Bucau  >
> wrote:
>
> > Misses a test (but looks good) and surely something to fix in
> > https://github.com/apache/tomee/blob/master/tomee/tomee-
> > embedded/src/test/java/org/apache/tomee/embedded/SslTomEETest.java
> > since it should have tested it
> >
> > Romain Manni-Bucau
> > @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > <https://rmannibucau.metawerx.net/> | Old Blog
> > <http://rmannibucau.wordpress.com> | Github <https://github.com/
> > rmannibucau> |
> > LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > <https://www.packtpub.com/application-development/java-
> > ee-8-high-performance>
> >
> >
> > Le lun. 18 juin 2018 à 15:39, Gurkan Erdogdu  a
> > écrit :
> >
> > > Also added patch :)
> > >
> > > On Mon, Jun 18, 2018 at 4:37 PM, Gurkan Erdogdu 
> > > wrote:
> > >
> > > > Hello
> > > > I created the issue https://issues.apache.org/jira/browse/TOMEE-2196
> > > > Best
> > > > Gurkan
> > > >
> > > > On Mon, Jun 18, 2018 at 4:29 PM, Romain Manni-Bucau <
> > > rmannibu...@gmail.com
> > > > > wrote:
> > > >
> > > >> Hi Fabian,
> > > >>
> > > >> there is a bug for keystorefile, the property name is empty (
> > > >> https://github.com/apache/tomee/blob/fb_tomee8/tomee/tomee-
> > > >> embedded/src/main/java/org/apache/tomee/embedded/
> > Container.java#L632),
> > > >> feel free to submit a PR fixing that
> > > >>
> > > >> Romain Manni-Bucau
> > > >> @rmannibucau <https://twitter.com/rmannibucau> |  Blog
> > > >> <https://rmannibucau.metawerx.net/> | Old Blog
> > > >> <http://rmannibucau.wordpress.com> | Github <
> > > >> https://github.com/rmannibucau> |
> > > >> LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
> > > >> <https://www.packtpub.com/application-development/java-ee-8-
> > > >> high-performance>
> > > >>
> > > >>
> > > >> Le lun. 18 juin 2018 à 14:55, 
> a
> > > >> écrit :
> > > >>
> > > >> > Hi,
> > > >> >
> > > >> >
> > > >> >
> > > >> > I am migrating to TomEE 7.0.4 and our old TLS config in
> > arquillian.xml
> > > >> is
> > > >> > not working any longer, the property
> > > >> >
> > > >> >
> > > >> >
> > > >> > property name="keystoreFile"
> > > >> >
> > > >> >
> > > >> >
> > > >> > seems to be ignored completely now, and ~/.keystore used instead.
> > What
> > > >> is
> > > >> > the replacement? Where do I find documentation on arquillian.xml
> > which
> > > >> is
> > > >> > up to date for the TomEE embedded driver?
> > > >> >
> > > >> >
> > > >> >
> > > >> > Thanks in advance and best
> > > >> >
> > > >> > Fabian
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >>
> > > >
> > > >
> > >
> >
>


Re: Embedded TomEE 7.0.4 and Arquillian and TLS

2018-06-18 Thread Romain Manni-Bucau
Hi Fabian,

there is a bug for keystorefile, the property name is empty (
https://github.com/apache/tomee/blob/fb_tomee8/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java#L632),
feel free to submit a PR fixing that

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 18 juin 2018 à 14:55,  a écrit :

> Hi,
>
>
>
> I am migrating to TomEE 7.0.4 and our old TLS config in arquillian.xml is
> not working any longer, the property
>
>
>
> property name="keystoreFile"
>
>
>
> seems to be ignored completely now, and ~/.keystore used instead. What is
> the replacement? Where do I find documentation on arquillian.xml which is
> up to date for the TomEE embedded driver?
>
>
>
> Thanks in advance and best
>
> Fabian
>
>
>
>
>


Re: Interceptors discovery

2018-06-13 Thread Romain Manni-Bucau
Hi

https://github.com/apache/geronimo-metrics should run in tomee 8, we plan
to release it pretty soon so it can be a good choice.

For your particular issue, I think your issue is that the name of your
artifact is excluded, try to rename it "foo-metrics.jar" and you will know.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 13 juin 2018 à 14:40, Matthew Broadhead <
matthew.broadh...@nbmlaw.co.uk> a écrit :

> sorry i am not too sure about interceptors.  also there are a lot of
> conferences at the moment so the main people that can help you are
> probably busy for a few days.  i am sure you will get an answer when
> they return
>
> On 12/06/18 08:45, vranac wrote:
> > Did I asked difficult questions or what? I think few of them could be
> answer
> > just with yes/no.
> >
> >
> >
> > --
> > Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>
>


Re: GraalVM

2018-06-10 Thread Romain Manni-Bucau
No and GraalVM doesn't support enough of java yet for EE. Will come ;)

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le dim. 10 juin 2018 à 11:19, Matthew Broadhead <
matthew.broadh...@nbmlaw.co.uk> a écrit :

> out of interest has anyone tried to create a native image of TomEE using
> GraalVM?
>


Re: Own SecurityService ignored migrating from TomEE Plus 1.7.1 to 1.7.5

2018-05-31 Thread Romain Manni-Bucau
You can launch tomee in remote debug mode (export JPDA_SUSPEND=y &&
export JPDA_ADDRESS=5005 in setenv.sh) , then connect to tomee through
an IDE: you have the option in the run configurations.

Romain Manni-Bucau
@rmannibucau |  Blog | Old Blog | Github | LinkedIn | Book
Le jeu. 31 mai 2018 à 11:08, renz  a écrit :
>
> How can I debug it?
>
>
>
> --
> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html


Re: Own SecurityService ignored migrating from TomEE Plus 1.7.1 to 1.7.5

2018-05-30 Thread Romain Manni-Bucau
Looks good,

maybe give a try to some debugging, hopefully it is some signature
change you dont have in your impl.

Romain Manni-Bucau
@rmannibucau |  Blog | Old Blog | Github | LinkedIn | Book

Le mer. 30 mai 2018 à 16:08, renz  a écrit :
>
> I've edited my previous post.
> I'm using nabble and I had the same issue with my first message (maybe it's
> du to the preview).
>
>
>
> --
> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html


Re: Own SecurityService ignored migrating from TomEE Plus 1.7.1 to 1.7.5

2018-05-30 Thread Romain Manni-Bucau
Hi,

it seems some mail client (not sure it is yours or mine) ate the log
you pasted (= I cant read it).
The easiest is likely to check the log which should say which security
service it creates but you can also just put a breakpoint in your
instance to check.

Romain Manni-Bucau
@rmannibucau |  Blog | Old Blog | Github | LinkedIn | Book

Le mer. 30 mai 2018 à 11:04, renz  a écrit :
>
> Hi Romain,
>
> Sorry for my late reply.
> I'm not sure to understand your message.
>
> How can i check that my Imp is instatied?
> Below an extract of Tomee's startup logs :
>
>
> and
>
>
>
> Which part of my setup do you need?
>
> Thank you.
>
>
>
>
> --
> Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html


Re: Basic EJB sample not working if I don't start package name with "org"

2018-05-24 Thread Romain Manni-Bucau
This pattern is supported until you hit exclusions as always.
Openejb.classloader.forced-load can allow you to work it around but
normally it is not needed.


Le jeu. 24 mai 2018 19:22, sudhakarvm  a écrit :

> It will be com.{company name} I am sorry I can't disclose company name.
> Can't
> I use any name.
>
> Thanks
> Sudhakar
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Basic EJB sample not working if I don't start package name with "org"

2018-05-24 Thread Romain Manni-Bucau
We only filtrr known packages like com.sun,  whats yours?

Le jeu. 24 mai 2018 18:53, sudhakarvm  a écrit :

> You mean deleting from work folder and deleting from webapps. Yes I have
> done
> it. I think it is something to do with class scanning.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: Could not load any resource bundle by com.sun.org.apache.xerces.internal.impl.msg.SAXMessages

2018-05-23 Thread Romain Manni-Bucau
Hi Matthew,

looks like a classloader issue like that but would need more details

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le mer. 23 mai 2018 à 10:52, Matthew Broadhead <
matthew.broadh...@nbmlaw.co.uk> a écrit :

> After TomEE 7.0.3 has been running for a long time, maybe weeks, it starts
> producing these messages when users try to transform XML using XSLT
> (usually to generate PDF using FOP).  The container has to be restarted in
> order for it to start working again.  Is this related to the Xalan problem?
>
> java.util.MissingResourceException: Could not load any resource bundle by
> com.sun.org.apache.xerces.internal.impl.msg.SAXMessages
> at
> com.sun.org.apache.xerces.internal.utils.SecuritySupport$7.run(SecuritySupport.java:174)
> at
> com.sun.org.apache.xerces.internal.utils.SecuritySupport$7.run(SecuritySupport.java:166)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.sun.org.apache.xerces.internal.utils.SecuritySupport.getResourceBundle(SecuritySupport.java:166)
> at
> com.sun.org.apache.xerces.internal.util.SAXMessageFormatter.formatMessage(SAXMessageFormatter.java:58)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.setProperty(AbstractSAXParser.java:1949)
> at
> com.sun.org.apache.xerces.internal.parsers.SAXParser.setProperty(SAXParser.java:175)
> at
> org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:476)
>
>


Re: Own SecurityService ignored migrating from TomEE Plus 1.7.1 to 1.7.5

2018-05-21 Thread Romain Manni-Bucau
Hi

did you check your impl was instantiated?
if no I suspect it is already available in the SystemInstance at
https://github.com/apache/tomee/blob/5e75f652cf96e1d95e3a5504f27306f6d6fb85f2/container/openejb-core/src/main/java/org/apache/openejb/assembler/classic/Assembler.java#L3455
but we still use the same loading mecanism. If you can share you setup we
can maybe have a deeper look.

Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://rmannibucau.metawerx.net/> | Old Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Book
<https://www.packtpub.com/application-development/java-ee-8-high-performance>


Le lun. 21 mai 2018 à 19:04, renz <renald.hene...@areasante.com> a écrit :

> Hi Chongma, I've edited my first post.
> Thanks.
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html
>


Re: TomEE Stable and OpenJDK

2018-05-14 Thread Romain Manni-Bucau
Le lun. 14 mai 2018 13:16, COURTAULT Francois <
francois.courta...@gemalto.com> a écrit :

> Hello Mark,
>
> Thanks a lot for sharing the TomEE roadmap.
>
> My main concerns about TomEE are:
> -  java 9 and above support (java 10 and 11)
> - JavaEE 8 specification support
> - µProfile follow up: no TomEE µProfile released yet whereas others
> exist today like Payara micro, Wildfly Swarm for example.
>
> So first, java 9 and above support: when you say 7.0.5 in preparation
> right now, could you provide us please a release date ?
> Second, I have another question: TomEE 7.1.x will address µProfile 1.3,
> right ? So why, TomEE 8.x won't address µProfile 1.3 at starting point ?
>

8 will, 7.1 is still being discussed AFAIK

The side note is you can import most of mp spec as any lib in any tomee
distro since they never really depends on the container and rely - as any
spec should - on cdi IoC for the wiring.



> Best regards.
>
> -Original Message-
> From: Mark Struberg [mailto:strub...@yahoo.de.INVALID]
> Sent: dimanche 6 mai 2018 13:11
> To: users@tomee.apache.org
> Subject: Re: TomEE Stable and OpenJDK
>
> I'm running it in production with OpenJDK.
>
> Actually whenever you have some RHEL server then you will run on OpenJDK.
> So those days everything which is in the Linux server area will almost
> certainly run perfectly fine on OpenJDK.
>
> LieGrue,
> strub
>
>
> > Am 06.05.2018 um 12:10 schrieb Fredrik Jonson :
> >
> > Mark Struberg wrote:
> >
> >> I think what the download page fails to communicate is which EE level
> >> it addresses.
> >>
> >> TomEE-1.7.x adresses the JavaEE 6 specifications, with minimum
> >> requirement
> >> Java7 (up to Java8)
> >> TomEE-7.0.x adresses JavaEE 7, with minimum Java7, soon up to Java11
> >> (7.0.5 in preparation right now)
> >> TomEE-7.1.x (wip) will address JavaEE7 + MicroProfile 1.3 with
> >> minimum Java8 TomEE-8.0.x (wip) will address JavaEE8 + MicroProfile
> >> 1.0 with minimum Java8
> >
> > Thanks for that clarification. It may seem obvious to people in the
> > know, but it is interesting to see a statement on the upper bound of
> > supported JDK/JRE version, as well as the lower bound. In addition to
> > the supported Java EE version range, for the major Tomee versions.
> >
> > Now, just to be explicit here: Apart from EE certification, does the
> > Tomee community consider OpenJDK on equal footing to OracleJDK when it
> > comes to Tomee deployment? Is there any important reason not to
> > recommend OpenJDK over, or at least on par with, OracleJDK?
> >
> > I'm asking because I still encounter a bit of hesitation towards
> > migrating from OracleJDK to OpenJDK. It would be helpful if open
> > source projects such as Tomee made a clear stance on OpenJDK.
> >
> > BTW, I also run Tomee 7.x on OpenJDK 8, and have not found any issues
> > compared to OracleJDK. So, now we know there are more than one
> > application deployed on Tomee and OpenJDK. :)
> >
> > --
> > Fredrik Jonson
> >
>
> 
>  This message and any attachments are intended solely for the addressees
> and may contain confidential information. Any unauthorized use or
> disclosure, either whole or partial, is prohibited.
> E-mails are susceptible to alteration. Our company shall not be liable for
> the message if altered, changed or falsified. If you are not the intended
> recipient of this message, please delete it and notify the sender.
> Although all reasonable efforts have been made to keep this transmission
> free from viruses, the sender will not be liable for damages caused by a
> transmitted virus.
>


Re: [Newsletter] Re: [Newsletter] Re: Migration step of jtaManaged flag in context resources

2018-05-14 Thread Romain Manni-Bucau
Le lun. 14 mai 2018 09:56, <fabian-a.rich...@rohde-schwarz.com> a écrit :

> So bottom line: There is no portable DataSource definition technique as
> they are part of the container and hence container specific?
>

Yes, portable solution is an app datasource which breaks the injection
pattern :(


> -Original Message-----
> From: Romain Manni-Bucau <rmannibu...@gmail.com>
> Sent: Monday, May 14, 2018 10:52 AM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: [Newsletter] Re: Migration step of
> jtaManaged flag in context resources
>
> Not portable but same as context.xml ;)
>
> @DataSourceDefinition is not too :( - properties are not
>
> Le lun. 14 mai 2018 07:57, <fabian-a.rich...@rohde-schwarz.com> a écrit :
>
> > Hi Mark and Romain,
> >
> > thanks for your replies!
> >
> > Is the resources.xml approach a portable solution? E.g. if we want to
> > support Wildfly in the future, which approach is the most portable?
> > Tomee.conf doesn’t sound too portable :)
> >
> > Thanks and best
> > Fabian
> >
> > -Original Message-
> > From: Mark Struberg <strub...@yahoo.de.INVALID>
> > Sent: Friday, May 11, 2018 10:27 AM
> > To: users@tomee.apache.org
> > Subject: *EXT* [Newsletter] Re: Migration step of jtaManaged flag in
> > context resources
> >
> > Hi Fabian!
> >
> >
> > To give a bit more context:
> >
> > Having actual db connections configured inside a WAR or EAR is usually
> > something you'd rather like to avoid.
> > Having passwords checked in into your source repo, needing to
> > recompile if you want to tweak the connection or credentials, etc All
> > that is simply not a really good idea.
> >
> > This problem is imo best solved by separating off all configuration
> > and kind of 'infrastructure' setup from your own appliaction source
> > and provide it via the container.
> >
> > TLDR; I recommend configuring DataSources and stuff in the container
> > and not in your WAR: Just use /conf/tomee.xml [1].
> > And you can ofc also encrypt your passwords [2] so they are not stored
> > in plain text.
> >
> > LieGrue,
> > strub
> >
> >
> > [1] https://tomee.apache.org/configuring-datasources.html
> > [2] https://tomee.apache.org/datasource-password-encryption.html
> >
> > > Am 09.05.2018 um 17:21 schrieb Romain Manni-Bucau
> > ><rmannibu...@gmail.com
> > >:
> > >
> > > Hi
> > >
> > > Just use resources.xml
> > >
> > > Le mer. 9 mai 2018 14:05, <fabian-a.rich...@rohde-schwarz.com> a
> écrit :
> > >
> > >> Hi all,
> > >>
> > >>
> > >>
> > >> I haven been trying to migrate from TomEE 1.7.5 to 7.0.4 but I am
> > >> currently stuck with the following problem:
> > >>
> > >>
> > >>
> > >> We have DataSources defined in webapp’s META-INF/context.xml as
> > >> Tomcat  and there _*was*_ a flag called jtaManaged which
> > >> apparently doesn’t exist in Tomcat 8.5 anymore. Problem is our
> > >> persistence units are still JTA managed, so what I see in the log is:
> > >>
> > >>
> > >>
> > >> org.apache.openejb.config.AutoConfig deploy Found matching
> > >> datasource: XXX but this one is not a JTA datasource
> > >>
> > >>
> > >>
> > >> An hence TomEE does the following:
> > >>
> > >> org.apache.openejb.config.AutoConfig setJtaDataSource Adjusting
> > >> PersistenceUnit Auditing  to Resource ID 'Default
> > >> JDBC Database' from 'XXX
> > >>
> > >> org.apache.openejb.config.AutoConfig setNonJtaDataSource Adjusting
> > >> PersistenceUnit Auditing  to Resource ID
> > >> 'Default Unmanaged JDBC Database' from 'null'
> > >>
> > >>
> > >>
> > >> How can I define a DataSource inside context.xml which is still JTA
> > >> managed? Or what is the correct way to migrate such a scenario?
> > >> Wrapping it in JTADataSourceWrapperFacory?
> > >>
> > >>
> > >>
> > >> Thanks in advance and best
> > >>
> > >> Fabian
> > >>
> > >>
> > >>
> >
>


Re: [Newsletter] Re: Migration step of jtaManaged flag in context resources

2018-05-14 Thread Romain Manni-Bucau
Not portable but same as context.xml ;)

@DataSourceDefinition is not too :( - properties are not

Le lun. 14 mai 2018 07:57, <fabian-a.rich...@rohde-schwarz.com> a écrit :

> Hi Mark and Romain,
>
> thanks for your replies!
>
> Is the resources.xml approach a portable solution? E.g. if we want to
> support Wildfly in the future, which approach is the most portable?
> Tomee.conf doesn’t sound too portable :)
>
> Thanks and best
> Fabian
>
> -Original Message-
> From: Mark Struberg <strub...@yahoo.de.INVALID>
> Sent: Friday, May 11, 2018 10:27 AM
> To: users@tomee.apache.org
> Subject: *EXT* [Newsletter] Re: Migration step of jtaManaged flag in
> context resources
>
> Hi Fabian!
>
>
> To give a bit more context:
>
> Having actual db connections configured inside a WAR or EAR is usually
> something you'd rather like to avoid.
> Having passwords checked in into your source repo, needing to recompile if
> you want to tweak the connection or credentials, etc All that is simply not
> a really good idea.
>
> This problem is imo best solved by separating off all configuration and
> kind of 'infrastructure' setup from your own appliaction source and provide
> it via the container.
>
> TLDR; I recommend configuring DataSources and stuff in the container and
> not in your WAR: Just use /conf/tomee.xml [1].
> And you can ofc also encrypt your passwords [2] so they are not stored in
> plain text.
>
> LieGrue,
> strub
>
>
> [1] https://tomee.apache.org/configuring-datasources.html
> [2] https://tomee.apache.org/datasource-password-encryption.html
>
> > Am 09.05.2018 um 17:21 schrieb Romain Manni-Bucau <rmannibu...@gmail.com
> >:
> >
> > Hi
> >
> > Just use resources.xml
> >
> > Le mer. 9 mai 2018 14:05, <fabian-a.rich...@rohde-schwarz.com> a écrit :
> >
> >> Hi all,
> >>
> >>
> >>
> >> I haven been trying to migrate from TomEE 1.7.5 to 7.0.4 but I am
> >> currently stuck with the following problem:
> >>
> >>
> >>
> >> We have DataSources defined in webapp’s META-INF/context.xml as
> >> Tomcat  and there _*was*_ a flag called jtaManaged which
> >> apparently doesn’t exist in Tomcat 8.5 anymore. Problem is our
> >> persistence units are still JTA managed, so what I see in the log is:
> >>
> >>
> >>
> >> org.apache.openejb.config.AutoConfig deploy Found matching
> >> datasource: XXX but this one is not a JTA datasource
> >>
> >>
> >>
> >> An hence TomEE does the following:
> >>
> >> org.apache.openejb.config.AutoConfig setJtaDataSource Adjusting
> >> PersistenceUnit Auditing  to Resource ID 'Default
> >> JDBC Database' from 'XXX
> >>
> >> org.apache.openejb.config.AutoConfig setNonJtaDataSource Adjusting
> >> PersistenceUnit Auditing  to Resource ID
> >> 'Default Unmanaged JDBC Database' from 'null'
> >>
> >>
> >>
> >> How can I define a DataSource inside context.xml which is still JTA
> >> managed? Or what is the correct way to migrate such a scenario?
> >> Wrapping it in JTADataSourceWrapperFacory?
> >>
> >>
> >>
> >> Thanks in advance and best
> >>
> >> Fabian
> >>
> >>
> >>
>


Re: Migration step of jtaManaged flag in context resources

2018-05-11 Thread Romain Manni-Bucau
Le ven. 11 mai 2018 10:07, Mark Struberg <strub...@yahoo.de.invalid> a
écrit :

> Do you remember (would have to look it up in the code) if the
> conf/tomee.xml overrides resource parameters defined in resources.xml from
> the WAR?
>
> Kind of:
> 1.) pickup all values from resources.xml
> 2.) add/override values from resources defined in conf/tomee.xml
>
> Does it work that way?
>

Resources.xml id are prefixed by the app name and lifecycle is managed by
the app but otherwise it is the exact same and there is no override just a
last one wins rules since override rules are handled at another layer
already (properties).



> LieGrue,
> strub
>
>
> > Am 11.05.2018 um 10:37 schrieb Romain Manni-Bucau <rmannibu...@gmail.com
> >:
> >
> > Le ven. 11 mai 2018 09:27, Mark Struberg <strub...@yahoo.de.invalid> a
> > écrit :
> >
> >> Hi Fabian!
> >>
> >>
> >> To give a bit more context:
> >>
> >> Having actual db connections configured inside a WAR or EAR is usually
> >> something you'd rather like to avoid.
> >> Having passwords checked in into your source repo, needing to recompile
> if
> >> you want to tweak the connection or credentials, etc
> >> All that is simply not a really good idea.
> >>
> >> This problem is imo best solved by separating off all configuration and
> >> kind of 'infrastructure' setup from your own appliaction source and
> provide
> >> it via the container.
> >>
> >> TLDR; I recommend configuring DataSources and stuff in the container and
> >> not in your WAR: Just use /conf/tomee.xml [1].
> >> And you can ofc also encrypt your passwords [2] so they are not stored
> in
> >> plain text.
> >>
> >
> >
> > Mark, dont forget you can use placeholders with default for all values in
> > the war but it hardcodes mandatory things like jtaManaged + exposes the
> > config as needed by the app and not the tomee way which can be undesired
> or
> > not consistent with the app way ;)
> >
> >
> >> LieGrue,
> >> strub
> >>
> >>
> >> [1] https://tomee.apache.org/configuring-datasources.html
> >> [2] https://tomee.apache.org/datasource-password-encryption.html
> >>
> >>> Am 09.05.2018 um 17:21 schrieb Romain Manni-Bucau <
> rmannibu...@gmail.com
> >>> :
> >>>
> >>> Hi
> >>>
> >>> Just use resources.xml
> >>>
> >>> Le mer. 9 mai 2018 14:05, <fabian-a.rich...@rohde-schwarz.com> a
> écrit :
> >>>
> >>>> Hi all,
> >>>>
> >>>>
> >>>>
> >>>> I haven been trying to migrate from TomEE 1.7.5 to 7.0.4 but I am
> >>>> currently stuck with the following problem:
> >>>>
> >>>>
> >>>>
> >>>> We have DataSources defined in webapp’s META-INF/context.xml as Tomcat
> >>>>  and there _*was*_ a flag called jtaManaged which apparently
> >>>> doesn’t exist in Tomcat 8.5 anymore. Problem is our persistence units
> >> are
> >>>> still JTA managed, so what I see in the log is:
> >>>>
> >>>>
> >>>>
> >>>> org.apache.openejb.config.AutoConfig deploy Found matching datasource:
> >> XXX
> >>>> but this one is not a JTA datasource
> >>>>
> >>>>
> >>>>
> >>>> An hence TomEE does the following:
> >>>>
> >>>> org.apache.openejb.config.AutoConfig setJtaDataSource Adjusting
> >>>> PersistenceUnit Auditing  to Resource ID 'Default
> JDBC
> >>>> Database' from 'XXX
> >>>>
> >>>> org.apache.openejb.config.AutoConfig setNonJtaDataSource Adjusting
> >>>> PersistenceUnit Auditing  to Resource ID 'Default
> >>>> Unmanaged JDBC Database' from 'null'
> >>>>
> >>>>
> >>>>
> >>>> How can I define a DataSource inside context.xml which is still JTA
> >>>> managed? Or what is the correct way to migrate such a scenario?
> >> Wrapping it
> >>>> in JTADataSourceWrapperFacory?
> >>>>
> >>>>
> >>>>
> >>>> Thanks in advance and best
> >>>>
> >>>> Fabian
>
>


  1   2   3   4   5   6   7   8   9   10   >