You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by nialscorva <ja...@tensorwrench.com> on 2012/07/17 21:10:53 UTC

Re: Jackson on TomEE:

It seems that if you have an @Provider that uses @Context, CXF tries to
inject those values when the Provider is instantiated at startup.  Since
it's not in a request context, that fails and throws an exception.

Using @Providers inside seems to have similar behavior, and that's what's
killing Jackson from running.  Very annoying.

--
View this message in context: http://openejb.979440.n4.nabble.com/Jackson-on-TomEE-tp4656312p4656351.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jackson on TomEE:

Posted by Romain Manni-Bucau <rm...@gmail.com>.
the exclusion will prevent injections in the excluded jars but not the
opposite since you register the provider manually.

once again on turnk you shouldnt need it

- Romain


2012/7/28 nialscorva <ja...@tensorwrench.com>

> Just trying to nail down an absolute series of steps that work, and will
> write it up if you want to put it on the documentation page:
> Given com.foo.MyProvider and com.foo.MyOtherProvider in myApp.war:
>
> 1) CATALINA_BASE/conf/system.properties:
> openejb.cxf.jax-rs.providers=com.foo.MyProvider,com.foo.MyOtherProvider
>
> 2) The two providers .class files will be found inside of myApp.war.
>
> 3) myApp/WEB-INF/exclusions.list contains:
> com.foo.MyProvider
> com.foo.MyOtherProvider
>
> Will exclusion.list prevent injection from occurring on @Context and
> @Inject
> annotated fields in MyProvider and MyOtherProvider?
>
> Once I get a good vibe that I understand what is supposed to work, I'll
> give
> it a try.
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Jackson-on-TomEE-tp4656312p4656560.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Jackson on TomEE:

Posted by nialscorva <ja...@tensorwrench.com>.
Just trying to nail down an absolute series of steps that work, and will
write it up if you want to put it on the documentation page:
Given com.foo.MyProvider and com.foo.MyOtherProvider in myApp.war:

1) CATALINA_BASE/conf/system.properties:
openejb.cxf.jax-rs.providers=com.foo.MyProvider,com.foo.MyOtherProvider

2) The two providers .class files will be found inside of myApp.war.

3) myApp/WEB-INF/exclusions.list contains:
com.foo.MyProvider
com.foo.MyOtherProvider

Will exclusion.list prevent injection from occurring on @Context and @Inject
annotated fields in MyProvider and MyOtherProvider?

Once I get a good vibe that I understand what is supposed to work, I'll give
it a try.



--
View this message in context: http://openejb.979440.n4.nabble.com/Jackson-on-TomEE-tp4656312p4656560.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jackson on TomEE:

Posted by Romain Manni-Bucau <rm...@gmail.com>.
1) ok
2) /webapps/tomee/lib is wrong otherwise that's correct
3) tomee had an issue with a particular rest injection (fixed on trunk), to
avoid it you had to exclude jar using this injection

Note: using the snapshot 1 & 2 are enough.

- Romain


2012/7/28 nialscorva <ja...@tensorwrench.com>

> I'm seeing hints, but haven't found a good step by step.  To register a
> provider of any type(reader, writer, exception mapper, etc), the steps are:
>
> 1) class name of provider in openejb.cxf.jax-rs.providers.
>    in CATALINA_BASE/conf/system.properties or setenv.* CATALINA_OPTS?
> 2) put the provider class in a jar in...
>    /lib
>    /webapps/tomee/lib
>    /webapps/myapp/WEB-INF/lib
> 3) Add the jar to an "exclusion list".  Where and what does that do?  Does
> that mean the providers have to be outside of the war and completely
> seperate?
>
> Is that the whole process?
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Jackson-on-TomEE-tp4656312p4656557.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Jackson on TomEE:

Posted by nialscorva <ja...@tensorwrench.com>.
I'm seeing hints, but haven't found a good step by step.  To register a
provider of any type(reader, writer, exception mapper, etc), the steps are:

1) class name of provider in openejb.cxf.jax-rs.providers.
   in CATALINA_BASE/conf/system.properties or setenv.* CATALINA_OPTS?
2) put the provider class in a jar in...
   /lib
   /webapps/tomee/lib
   /webapps/myapp/WEB-INF/lib
3) Add the jar to an "exclusion list".  Where and what does that do?  Does
that mean the providers have to be outside of the war and completely
seperate?

Is that the whole process?



--
View this message in context: http://openejb.979440.n4.nabble.com/Jackson-on-TomEE-tp4656312p4656557.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Jackson on TomEE:

Posted by Romain Manni-Bucau <rm...@gmail.com>.
You need to add your jar in exclusion list if not already here works fine.

- Romain
Le 17 juil. 2012 21:11, "nialscorva" <ja...@tensorwrench.com> a écrit :

> It seems that if you have an @Provider that uses @Context, CXF tries to
> inject those values when the Provider is instantiated at startup.  Since
> it's not in a request context, that fails and throws an exception.
>
> Using @Providers inside seems to have similar behavior, and that's what's
> killing Jackson from running.  Very annoying.
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Jackson-on-TomEE-tp4656312p4656351.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>