You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Chris Owens <ct...@chris-owens.com> on 2013/08/02 13:23:31 UTC

How to enable DeltaSpike's BeanProvider in TomEE?

What do I need to do to enable DeltaSpike's BeanProvider in TomEE?

I do this:

1) Add an empty WEB-INF/beans.xml 

2) Include POM dependencies on deltaspike-core-api (Compile scope) and
deltaspike-core-impl (Runtime scope)

3) Put this in a java class:


and I get this error:




I am obviously missing some configuration step, but I cannot figure out from
the documentation what it is.





--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Chris Owens <ct...@chris-owens.com>.
On the theory that good modularity trumps fancy hacks, I eliminated any
dependency on EJBs from within my entity objects.  Problem solved and code
is cleaner, too.



--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664588.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Tamás Kimmel <ku...@gmail.com>.
Just query the BeanManager via JNDI. Not so fast as using a reference from
the extension, but it's simple.

BeanManager bm = (BeanManager)
InitialContext.doLookup("java:comp/BeanManager");



2013/8/2 Romain Manni-Bucau <rm...@gmail.com>

> A cdi extension, observe aftervalidationdeployment event, you can get the
> beanmanager as 2nd parameter.
> Le 2 août 2013 20:07, "Chris Owens" <ct...@chris-owens.com> a
> écrit :
>
> > Romain Manni-Bucau wrote
> > > Just write an extension holding the beanmanager of the extension
> > > statically, it will be enough.
> >
> > Thanks.  I need more details: An extension of what?   Which beanmanager?
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664503.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
A cdi extension, observe aftervalidationdeployment event, you can get the
beanmanager as 2nd parameter.
Le 2 août 2013 20:07, "Chris Owens" <ct...@chris-owens.com> a écrit :

> Romain Manni-Bucau wrote
> > Just write an extension holding the beanmanager of the extension
> > statically, it will be enough.
>
> Thanks.  I need more details: An extension of what?   Which beanmanager?
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664503.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Chris Owens <ct...@chris-owens.com>.
Romain Manni-Bucau wrote
> Just write an extension holding the beanmanager of the extension
> statically, it will be enough. 

Thanks.  I need more details: An extension of what?   Which beanmanager?





--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664503.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Just write an extension holding the beanmanager of the extension
statically, it will be enough. Then use the bm to get your bean
Le 2 août 2013 18:18, "Chris Owens" <ct...@chris-owens.com> a écrit :

> I'm kind of restricted by policy (that I can't reasonably change) to using
> released software.
>
> At this point I'm looking for a workaround.  Here's my use case:
>
> I have several instances of @Entity that probably contain a little more
> functionality than they should. (Yes, I know that Marty Fowler and others
> call Active Records an anti-pattern).
>
> In some cases, they need access to functionality that is provided by a
> @Stateless EJB.
>
> @EJB and @Inject do not work inside @Enitity.
>
> I had hoped to use DeltaSpike to get hold of the EJB from within the
> entity.
>
> One possible workaround:
> Just how bad is it to put, say, @Entity and @Stateless annotations on the
> same class?  I haven't been through the OpenEJB and OpenJPA code enough to
> understand what that would do?
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664501.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Chris Owens <ct...@chris-owens.com>.
I'm kind of restricted by policy (that I can't reasonably change) to using
released software.

At this point I'm looking for a workaround.  Here's my use case:  

I have several instances of @Entity that probably contain a little more
functionality than they should. (Yes, I know that Marty Fowler and others
call Active Records an anti-pattern).   

In some cases, they need access to functionality that is provided by a
@Stateless EJB.

@EJB and @Inject do not work inside @Enitity.

I had hoped to use DeltaSpike to get hold of the EJB from within the entity.

One possible workaround:
Just how bad is it to put, say, @Entity and @Stateless annotations on the
same class?  I haven't been through the OpenEJB and OpenJPA code enough to
understand what that would do?




--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664501.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
i'm not the only one to do internal releases to use it in prod

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



2013/8/2 Chris Owens <ct...@chris-owens.com>

> Would you personally use trunk in a production system that controls
> machinery
> and that handles real money?
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664488.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Chris Owens <ct...@chris-owens.com>.
Would you personally use trunk in a production system that controls machinery
and that handles real money?




--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664488.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
we had issues at a moment with DS BeanProvider, surely the 1.5.2 was the
impacted version. I use it with trunk without issues.

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



2013/8/2 Chris Owens <ct...@chris-owens.com>

> Romain, TomEE+ 1.5.2, with one change:  replace OpenJPA with version 2.2.2
> in
> tomee's lib
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664486.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Chris Owens <ct...@chris-owens.com>.
Romain, TomEE+ 1.5.2, with one change:  replace OpenJPA with version 2.2.2 in
tomee's lib



--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664486.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi, which tomee version?

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



2013/8/2 John D. Ament <jo...@gmail.com>

> What ends up in your WAR file's lib?
>
>
> On Fri, Aug 2, 2013 at 7:23 AM, Chris Owens <ctag+openejb@chris-owens.com
> >wrote:
>
> > What do I need to do to enable DeltaSpike's BeanProvider in TomEE?
> >
> > I do this:
> >
> > 1) Add an empty WEB-INF/beans.xml
> >
> > 2) Include POM dependencies on deltaspike-core-api (Compile scope) and
> > deltaspike-core-impl (Runtime scope)
> >
> > 3) Put this in a java class:
> >
> >
> > and I get this error:
> >
> >
> >
> >
> > I am obviously missing some configuration step, but I cannot figure out
> > from
> > the documentation what it is.
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by Chris Owens <ct...@chris-owens.com>.
Here is the contents of my war file's lib:


activemq-camel-5.7.0.jar                 maven-artifact-manager-2.0.5.jar
activemq-pool-5.7.0.jar                  maven-dependency-analyzer-1.3.jar
activemq-web-5.7.0.jar                   maven-model-2.0.5.jar
aopalliance-1.0.jar                      maven-profile-2.0.5.jar
asm-3.2.jar                              maven-project-2.0.5.jar
aspectjrt-1.7.0.jar                      maven-repository-metadata-2.0.5.jar
aspectjweaver-1.7.0.jar                  maven-settings-2.0.5.jar
camel-core-2.10.1.jar                    mccdaq-0.1.0.BUILD-SNAPSHOT.jar
camel-jms-2.10.1.jar                    
org.springframework.roo.annotations-1.2.3.RELEASE.jar
camel-spring-2.10.1.jar                 
plexus-component-annotations-1.5.5.jar
cglib-nodep-2.2.2.jar                   
plexus-container-default-1.0-alpha-9.jar
classworlds-1.1-alpha-2.jar              plexus-utils-1.5.1.jar
commons-beanutils-1.8.3.jar              rome-1.0.jar
commons-digester-2.1.jar                 spring-aop-3.2.0.RELEASE.jar
commons-fileupload-1.2.2.jar             spring-aspects-3.2.0.RELEASE.jar
commons-io-2.1.jar                       spring-beans-3.2.0.RELEASE.jar
commons-logging-1.1.1.jar                spring-context-3.2.0.RELEASE.jar
deltaspike-core-api-0.4.jar             
spring-context-support-3.2.0.RELEASE.jar
deltaspike-core-impl-0.4.jar             spring-core-3.2.0.RELEASE.jar
<prorietary deleted>                 spring-expression-3.2.0.RELEASE.jar
flexjson-2.1.jar                         spring-jdbc-3.2.0.RELEASE.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar       spring-jms-3.0.7.RELEASE.jar
h2-1.3.172.jar                          
spring-js-resources-2.2.1.RELEASE.jar
               spring-orm-3.2.0.RELEASE.jar
jackson-annotations-2.2.2.jar            spring-tx-3.2.0.RELEASE.jar
jackson-core-2.2.2.jar                   spring-web-3.2.0.RELEASE.jar
jackson-databind-2.2.2.jar               spring-webmvc-3.2.0.RELEASE.jar
jcl-over-slf4j-1.7.2.jar                 tiles-api-2.2.2.jar
jdom-1.0.jar                             tiles-core-2.2.2.jar
jetty-continuation-7.6.7.v20120910.jar   tiles-jsp-2.2.2.jar
jetty-http-7.6.7.v20120910.jar           tiles-servlet-2.2.2.jar
jetty-io-7.6.7.v20120910.jar             tiles-template-2.2.2.jar
jetty-util-7.6.7.v20120910.jar           wagon-provider-api-1.0-beta-2.jar
jetty-websocket-7.6.7.v20120910.jar      xbean-spring-3.11.1.jar
joda-time-1.6.jar                        xmlpull-1.1.3.1.jar
<proprietary deleted>                 xpp3-1.1.4c.jar
logback-classic-1.0.7.jar                xpp3_min-1.1.4c.jar
logback-core-1.0.7.jar                   xstream-1.4.3.jar
maven-artifact-2.0.5.jar




--
View this message in context: http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480p4664485.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: How to enable DeltaSpike's BeanProvider in TomEE?

Posted by "John D. Ament" <jo...@gmail.com>.
What ends up in your WAR file's lib?


On Fri, Aug 2, 2013 at 7:23 AM, Chris Owens <ct...@chris-owens.com>wrote:

> What do I need to do to enable DeltaSpike's BeanProvider in TomEE?
>
> I do this:
>
> 1) Add an empty WEB-INF/beans.xml
>
> 2) Include POM dependencies on deltaspike-core-api (Compile scope) and
> deltaspike-core-impl (Runtime scope)
>
> 3) Put this in a java class:
>
>
> and I get this error:
>
>
>
>
> I am obviously missing some configuration step, but I cannot figure out
> from
> the documentation what it is.
>
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/How-to-enable-DeltaSpike-s-BeanProvider-in-TomEE-tp4664480.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>