You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2018/08/01 04:59:24 UTC

Re: Classloader woes: EAR containing an RAR

I am happy to help you using the rar if you can setup a reproducer project
but for kafka gain is pretty low and being cdi based opens more doors like
composing with decorators, getting a better error handling than EJB,
getting rid of some useless layer for kafka etc...but we can still do the
exercise technically :)

Le mer. 1 août 2018 02:00, ChrisOwens <ch...@chris-owens.com> a écrit :

> Romain Manni-Bucau wrote
> > If your goal is really to interact with kafka - and you dont care of rar
> > by
> > themselves - i would recommand to use a cdi extension,
> > you can find several on the net like
> > https://github.com/bgjug/kafka-cdi-extension and
> > https://github.com/aerogear/kafka-cdi
>
>
> Thank you.  I was hoping to use the message-driven-bean abstraction, but I
> will look into these cdi extensions instead.
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>

Re: Classloader woes: EAR containing an RAR

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Depends the people but personally I see JCA as deprecated by CDI addition
to JavaEE 6 (tomee or any other server). Goal being to realign the
programming model on the more natural one of marking a method as a listener
rather than having this heavy process to define inbound/outbound connectors
+ the related packaging. JCA got some work on that area to have some
command oriented pattern but it stays very heavy compared to the more
widespread CDI based solution.

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. 1 août 2018 à 15:50, ChrisOwens <ch...@chris-owens.com> a écrit :

> Putting aside for a moment the question of whether or not the adapter is
> packaged in a rar file, what is your opinion of JCA for a JavaEE 7
> application hosted on TomeEE +?  Use it or avoid it?
>
>
>
>
>
> --
> Sent from:
> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>

Re: Classloader woes: EAR containing an RAR

Posted by ChrisOwens <ch...@chris-owens.com>.
Putting aside for a moment the question of whether or not the adapter is
packaged in a rar file, what is your opinion of JCA for a JavaEE 7
application hosted on TomeEE +?  Use it or avoid it?





--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html

Re: Classloader woes: EAR containing an RAR

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Le mer. 1 août 2018 à 16:12, ChrisOwens <ch...@chris-owens.com> a écrit :

> I am trying to set up a reproducer project using the tomee maven plugin.
> I am looking at the plugin's new documentation page to which you referred
> me. (Might I suggest that you take down the old, obsolete documentation
> page, which is the first hit for google "tomee maven plugin", or at least
> put in it a link to the new page?
>

When we switched to the new website we (I actually) got asked to not remove
or modify the old pages so not sure we should now.
Maybe it is more a google indexation thing to update? Anyone knows?


>
> My first attempt to get the plugin to put the rar in tomee's apps folder
> was
> to add the rar as a project dependency and to  put this in the
> configuration
> block of the plugin:
>

[Not sure what happens but i still dont see what should be here, seems
erased]

The coordinates should be put, like groupId:artifactId:version:rar and this
artifact must be resolvable from the project (pluginRepositories).


>
>
>
> This failed with the following error, apparently the plugin was looking in
> the repo for a jar file rather than a rar file:
>
>
> My next thought was to use a synchronizer as defined by tomee-maven-plugin
> to copy the rar file into the apps directory.... but the only info on the
> documentation page about how to use a synchronizer was this:
>

The synchronizer is more a runtime update thing for dev, doesn't sound very
sane to use it for that.


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

Re: Classloader woes: EAR containing an RAR

Posted by ChrisOwens <ch...@chris-owens.com>.
I am trying to set up a reproducer project using the tomee maven plugin. 
I am looking at the plugin's new documentation page to which you referred
me. (Might I suggest that you take down the old, obsolete documentation
page, which is the first hit for google "tomee maven plugin", or at least
put in it a link to the new page?

My first attempt to get the plugin to put the rar in tomee's apps folder was
to add the rar as a project dependency and to  put this in the configuration
block of the plugin:



This failed with the following error, apparently the plugin was looking in
the repo for a jar file rather than a rar file:


My next thought was to use a synchronizer as defined by tomee-maven-plugin
to copy the rar file into the apps directory.... but the only info on the
documentation page about how to use a synchronizer was this:







--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html

Re: Classloader woes: EAR containing an RAR

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Using jta 1.2 and @Transactional it would if the consumer impl wpuld. Means
it will not for kafka but it is true of a connector as well until you fake
the tx/persistence.

See connectors as a default interceptor stack, cdi provides a customizable
one by design. This is why jca will no more be mainstream IMHO.

Le mer. 1 août 2018 17:56, David Jencks <da...@gmail.com> a écrit :

> Does the CDI approach support consuming a message inside a transaction?
> Looking at one of the Kafka cdi examples, I didn’t immediately see how it
> would. Being able to roll back the consumption of a message always seemed
> one of the main points of jca to me.
>
> Thanks
> David Jencks
>
> Sent from my iPhone
>
> > On Jul 31, 2018, at 9:59 PM, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
> >
> > I am happy to help you using the rar if you can setup a reproducer
> project
> > but for kafka gain is pretty low and being cdi based opens more doors
> like
> > composing with decorators, getting a better error handling than EJB,
> > getting rid of some useless layer for kafka etc...but we can still do the
> > exercise technically :)
> >
> > Le mer. 1 août 2018 02:00, ChrisOwens <ch...@chris-owens.com> a écrit :
> >
> >> Romain Manni-Bucau wrote
> >>> If your goal is really to interact with kafka - and you dont care of
> rar
> >>> by
> >>> themselves - i would recommand to use a cdi extension,
> >>> you can find several on the net like
> >>> https://github.com/bgjug/kafka-cdi-extension and
> >>> https://github.com/aerogear/kafka-cdi
> >>
> >>
> >> Thank you.  I was hoping to use the message-driven-bean abstraction,
> but I
> >> will look into these cdi extensions instead.
> >>
> >>
> >>
> >>
> >> --
> >> Sent from:
> >> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
> >>
>

Re: Classloader woes: EAR containing an RAR

Posted by David Jencks <da...@gmail.com>.
Does the CDI approach support consuming a message inside a transaction? Looking at one of the Kafka cdi examples, I didn’t immediately see how it would. Being able to roll back the consumption of a message always seemed one of the main points of jca to me.

Thanks
David Jencks 

Sent from my iPhone

> On Jul 31, 2018, at 9:59 PM, Romain Manni-Bucau <rm...@gmail.com> wrote:
> 
> I am happy to help you using the rar if you can setup a reproducer project
> but for kafka gain is pretty low and being cdi based opens more doors like
> composing with decorators, getting a better error handling than EJB,
> getting rid of some useless layer for kafka etc...but we can still do the
> exercise technically :)
> 
> Le mer. 1 août 2018 02:00, ChrisOwens <ch...@chris-owens.com> a écrit :
> 
>> Romain Manni-Bucau wrote
>>> If your goal is really to interact with kafka - and you dont care of rar
>>> by
>>> themselves - i would recommand to use a cdi extension,
>>> you can find several on the net like
>>> https://github.com/bgjug/kafka-cdi-extension and
>>> https://github.com/aerogear/kafka-cdi
>> 
>> 
>> Thank you.  I was hoping to use the message-driven-bean abstraction, but I
>> will look into these cdi extensions instead.
>> 
>> 
>> 
>> 
>> --
>> Sent from:
>> http://tomee-openejb.979440.n4.nabble.com/TomEE-Dev-f982480.html
>>