You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Alex Soto <as...@gmail.com> on 2014/04/13 19:54:27 UTC

EJB and REST

Hello I am developing a RESTful service. My first approach has been
creating a creating a class and annotating as @Sateless EJB and also using
@Path to be a REST point too and it worked.
In my next iteration I have modified a bit that class by extracting an
interface with REST annotations and then the EJB simply implements that
interface.

@Path("/points/")

public interface CatalogService {

    @Produces({MediaType.APPLICATION_JSON})

    @GET

    public List<Gift> catalog();

}


@Stateless

public class CatalogServiceImpl implements CatalogService {

    @EJB

    GiftCatalogService giftCatalogService;

    @Override

    public List<Gift> catalog() {

        return this.giftCatalogService.giftCatalog();

    }

}


Than I have created my Arquillian test and next exception is thrown:

*INFO: Started Ejb(deployment-id=GiftCatalogService,
ejb-name=GiftCatalogService, container=Default Stateless Container)*

*abr 13, 2014 7:41:12 PM org.apache.openejb.assembler.classic.Assembler
createApplication*

*INFO: Deployed
Application(path=/private/var/folders/k7/5t5fmkj547315vzzv51wh0fh0000gn/T/arquillian-tomee-app-working-dir/0/giftcatalog)*

*abr 13, 2014 7:41:13 PM org.apache.openejb.observer.ObserverManager
fireEvent*

*SEVERE: error invoking
Observer{class=org.apache.tomee.webservices.TomeeJaxRsService}*

*java.lang.UnsupportedOperationException*

* at
org.apache.cxf.common.logging.AbstractDelegatingLogger.setLevel(AbstractDelegatingLogger.java:268)*

* at
org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:391)*

* at
org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:453)*

* at
org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:273)*

* at
org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)*

I have noticed that the EJB is deployed correctly but when tries to
"decorate" with REST it throws this exception. Am I doing something wrong
or there is something not implemented on Apache CXF.

Also I have on classpath next dependencies with arquillian-tomee-embedded:


<dependency>

         groupId>org.apache.openejb</groupId>

                    <artifactId>openejb-cxf-rs</artifactId>

                    <version>4.6.0</version>

                    <scope>test</scope>

                </dependency>

                <dependency>

                    <groupId>org.apache.openejb</groupId>

                    <artifactId>tomee-jaxrs</artifactId>

                    <version>${tomee.version}</version>

                    <scope>test</scope>

                </dependency>

Re: EJB and REST

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Well it works by default using slf4* and log4j or jdk4 impl. This issue
just comes from commons logging usage so for a workshop no need of a new
release.
Le 13 avr. 2014 20:20, "Alex Soto" <as...@gmail.com> a écrit :

> Well on 25th April I have a workshop about Arquillian and I would like to
> use Apache TomEE. One of the example is using arquillian-rest-extension but
> I need to have  working the example commented on the first mail (basically
> having an interface with REST annotation and class being an EJB).
>
> Thank you  for your support.
> Alex.
>
>
> 2014-04-13 21:01 GMT+02:00 Jean-Louis MONTEIRO <je...@gmail.com>:
>
> > Hi Alex,
> >
> > The 1.6.0.1 (security maintenance) is under vote. Should be released
> > (crossing fingers) by the end of this week.
> > We talked about that on another thread, but basically, we wanted to
> release
> > 1.6.1 asap. BTW, it will probably be a 1.7.0 cause we plan to include
> Java
> > 8 support and the PLUME distro which is to much for a 1.6.1.
> >
> > Some parts are ready for Java 8, but we currently have some issues with
> > OpenJPA.
> >
> > I required (I mean users ask for it), we can also think about a 1.6.1 as
> > it's today, but without Java 8 and PLUME.
> > Not sure it makes a lot of sense that's why we want first the 1.7.0 with
> > Java 8 support.
> >
> > I'd like to start the release process before end of April, but not sure
> it
> > gonna be possible.
> > Do you have any due date or expectations?
> >
> > Jean-Louis
> >
> >
> >
> > 2014-04-13 20:52 GMT+02:00 Alex Soto <as...@gmail.com>:
> >
> > > Stupid question but by forcing you exactly mean? And also do you know
> > when
> > > 1.6.1 will be released?
> > >
> > > El diumenge, 13 abril de 2014, Romain Manni-Bucau <
> rmannibucau@gmail.com
> > >
> > > va escriure:
> > >
> > > > hmm weird, force cxf to log with something else
> > > > Romain Manni-Bucau
> > > > Twitter: @rmannibucau
> > > > Blog: http://rmannibucau.wordpress.com/
> > > > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > > > Github: https://github.com/rmannibucau
> > > >
> > > >
> > > >
> > > > 2014-04-13 20:16 GMT+02:00 Alex Soto <asotobu@gmail.com
> <javascript:;>>:
> > > > > Still happens :(
> > > > >
> > > > >  <dependencies>
> > > > >
> > > > >                 <dependency>
> > > > >
> > > > >                     <groupId>org.apache.openejb</groupId>
> > > > >
> > > > >
> > <artifactId>arquillian-tomee-embedded</artifactId>
> > > > >
> > > > >                     <version>${tomee.version}</version>
> > > > >
> > > > >                     <scope>test</scope>
> > > > >
> > > > >                 </dependency>
> > > > >
> > > > >
> > > > >                 <!-- To test jax-rs applications with embed TomEE
> you
> > > > need
> > > > >
> > > > >                     to both of these dependencies -->
> > > > >
> > > > >                 <dependency>
> > > > >
> > > > >                     <groupId>org.apache.openejb</groupId>
> > > > >
> > > > >                     <artifactId>openejb-cxf-rs</artifactId>
> > > > >
> > > > >                     <version>4.6.0</version>
> > > > >
> > > > >                     <scope>test</scope>
> > > > >
> > > > >                 </dependency>
> > > > >
> > > > >                 <dependency>
> > > > >
> > > > >                     <groupId>org.apache.openejb</groupId>
> > > > >
> > > > >                     <artifactId>tomee-jaxrs</artifactId>
> > > > >
> > > > >                     <version>${tomee.version}</version>
> > > > >
> > > > >                     <scope>test</scope>
> > > > >
> > > > >                     <exclusions>
> > > > >
> > > > >                         <exclusion>
> > > > >
> > > > >                             <groupId>commons-logging</groupId>
> > > > >
> > > > >
> <artifactId>commons-logging</artifactId>
> > > > >
> > > > >                         </exclusion>
> > > > >
> > > > >                     </exclusions>
> > > > >
> > > > >                 </dependency>
> > > > >
> > > > > Should I remove from any other dependency too? For example
> > > > > Arquillian.persistence-extension is using too, or Drone extension.
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 2014-04-13 20:06 GMT+02:00 Romain Manni-Bucau <
> rmannibucau@gmail.com
> > >:
> > > > >
> > > > >> well actually this was a regression due to a new feature. That's
> > like
> > > > >> it when you implement an API with throw new UnusupportedException,
> > > > >> thanks cxf logging facade ;)
> > > > >> Romain Manni-Bucau
> > > > >> Twitter: @rmannibucau
> > > > >> Blog: http://rmannibucau.wordpress.com/
> > > > >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > > > >> Github: https://github.com/rmannibucau
> > > > >>
> > > > >>
> > > > >>
> > > > >> 2014-04-13 20:03 GMT+02:00 Alex Soto <as...@gmail.com>:
> > > > >> > Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I
> > > > exclude
> > > > >> > commons-logging from tomee-jaxrs dependency and that's all.
> > > > >> >
> > > > >> > Thank you so much when I arrive at home I will try it.
> > > > >> >
> > > > >> > Well nice to see how TomEE is improving from release to release
> :)
> > > > >> >
> > > > >
> > >
> > >
> > >
> > > --
> > > Enviat amb Gmail Mobile
> > >
> >
> >
> >
> > --
> > Jean-Louis
> >
>
>
>
> --
> +----------------------------------------------------------+
>   Alex Soto Bueno - Computer Engineer
>   www.lordofthejars.com
> +----------------------------------------------------------+
>

Re: EJB and REST

Posted by Alex Soto <as...@gmail.com>.
Well on 25th April I have a workshop about Arquillian and I would like to
use Apache TomEE. One of the example is using arquillian-rest-extension but
I need to have  working the example commented on the first mail (basically
having an interface with REST annotation and class being an EJB).

Thank you  for your support.
Alex.


2014-04-13 21:01 GMT+02:00 Jean-Louis MONTEIRO <je...@gmail.com>:

> Hi Alex,
>
> The 1.6.0.1 (security maintenance) is under vote. Should be released
> (crossing fingers) by the end of this week.
> We talked about that on another thread, but basically, we wanted to release
> 1.6.1 asap. BTW, it will probably be a 1.7.0 cause we plan to include Java
> 8 support and the PLUME distro which is to much for a 1.6.1.
>
> Some parts are ready for Java 8, but we currently have some issues with
> OpenJPA.
>
> I required (I mean users ask for it), we can also think about a 1.6.1 as
> it's today, but without Java 8 and PLUME.
> Not sure it makes a lot of sense that's why we want first the 1.7.0 with
> Java 8 support.
>
> I'd like to start the release process before end of April, but not sure it
> gonna be possible.
> Do you have any due date or expectations?
>
> Jean-Louis
>
>
>
> 2014-04-13 20:52 GMT+02:00 Alex Soto <as...@gmail.com>:
>
> > Stupid question but by forcing you exactly mean? And also do you know
> when
> > 1.6.1 will be released?
> >
> > El diumenge, 13 abril de 2014, Romain Manni-Bucau <rmannibucau@gmail.com
> >
> > va escriure:
> >
> > > hmm weird, force cxf to log with something else
> > > Romain Manni-Bucau
> > > Twitter: @rmannibucau
> > > Blog: http://rmannibucau.wordpress.com/
> > > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > > Github: https://github.com/rmannibucau
> > >
> > >
> > >
> > > 2014-04-13 20:16 GMT+02:00 Alex Soto <asotobu@gmail.com<javascript:;>>:
> > > > Still happens :(
> > > >
> > > >  <dependencies>
> > > >
> > > >                 <dependency>
> > > >
> > > >                     <groupId>org.apache.openejb</groupId>
> > > >
> > > >
> <artifactId>arquillian-tomee-embedded</artifactId>
> > > >
> > > >                     <version>${tomee.version}</version>
> > > >
> > > >                     <scope>test</scope>
> > > >
> > > >                 </dependency>
> > > >
> > > >
> > > >                 <!-- To test jax-rs applications with embed TomEE you
> > > need
> > > >
> > > >                     to both of these dependencies -->
> > > >
> > > >                 <dependency>
> > > >
> > > >                     <groupId>org.apache.openejb</groupId>
> > > >
> > > >                     <artifactId>openejb-cxf-rs</artifactId>
> > > >
> > > >                     <version>4.6.0</version>
> > > >
> > > >                     <scope>test</scope>
> > > >
> > > >                 </dependency>
> > > >
> > > >                 <dependency>
> > > >
> > > >                     <groupId>org.apache.openejb</groupId>
> > > >
> > > >                     <artifactId>tomee-jaxrs</artifactId>
> > > >
> > > >                     <version>${tomee.version}</version>
> > > >
> > > >                     <scope>test</scope>
> > > >
> > > >                     <exclusions>
> > > >
> > > >                         <exclusion>
> > > >
> > > >                             <groupId>commons-logging</groupId>
> > > >
> > > >                             <artifactId>commons-logging</artifactId>
> > > >
> > > >                         </exclusion>
> > > >
> > > >                     </exclusions>
> > > >
> > > >                 </dependency>
> > > >
> > > > Should I remove from any other dependency too? For example
> > > > Arquillian.persistence-extension is using too, or Drone extension.
> > > >
> > > >
> > > >
> > > >
> > > > 2014-04-13 20:06 GMT+02:00 Romain Manni-Bucau <rmannibucau@gmail.com
> >:
> > > >
> > > >> well actually this was a regression due to a new feature. That's
> like
> > > >> it when you implement an API with throw new UnusupportedException,
> > > >> thanks cxf logging facade ;)
> > > >> Romain Manni-Bucau
> > > >> Twitter: @rmannibucau
> > > >> Blog: http://rmannibucau.wordpress.com/
> > > >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > > >> Github: https://github.com/rmannibucau
> > > >>
> > > >>
> > > >>
> > > >> 2014-04-13 20:03 GMT+02:00 Alex Soto <as...@gmail.com>:
> > > >> > Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I
> > > exclude
> > > >> > commons-logging from tomee-jaxrs dependency and that's all.
> > > >> >
> > > >> > Thank you so much when I arrive at home I will try it.
> > > >> >
> > > >> > Well nice to see how TomEE is improving from release to release :)
> > > >> >
> > > >
> >
> >
> >
> > --
> > Enviat amb Gmail Mobile
> >
>
>
>
> --
> Jean-Louis
>



-- 
+----------------------------------------------------------+
  Alex Soto Bueno - Computer Engineer
  www.lordofthejars.com
+----------------------------------------------------------+

Re: EJB and REST

Posted by Jean-Louis MONTEIRO <je...@gmail.com>.
Hi Alex,

The 1.6.0.1 (security maintenance) is under vote. Should be released
(crossing fingers) by the end of this week.
We talked about that on another thread, but basically, we wanted to release
1.6.1 asap. BTW, it will probably be a 1.7.0 cause we plan to include Java
8 support and the PLUME distro which is to much for a 1.6.1.

Some parts are ready for Java 8, but we currently have some issues with
OpenJPA.

I required (I mean users ask for it), we can also think about a 1.6.1 as
it's today, but without Java 8 and PLUME.
Not sure it makes a lot of sense that's why we want first the 1.7.0 with
Java 8 support.

I'd like to start the release process before end of April, but not sure it
gonna be possible.
Do you have any due date or expectations?

Jean-Louis



2014-04-13 20:52 GMT+02:00 Alex Soto <as...@gmail.com>:

> Stupid question but by forcing you exactly mean? And also do you know when
> 1.6.1 will be released?
>
> El diumenge, 13 abril de 2014, Romain Manni-Bucau <rm...@gmail.com>
> va escriure:
>
> > hmm weird, force cxf to log with something else
> > Romain Manni-Bucau
> > Twitter: @rmannibucau
> > Blog: http://rmannibucau.wordpress.com/
> > LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > Github: https://github.com/rmannibucau
> >
> >
> >
> > 2014-04-13 20:16 GMT+02:00 Alex Soto <asotobu@gmail.com <javascript:;>>:
> > > Still happens :(
> > >
> > >  <dependencies>
> > >
> > >                 <dependency>
> > >
> > >                     <groupId>org.apache.openejb</groupId>
> > >
> > >                     <artifactId>arquillian-tomee-embedded</artifactId>
> > >
> > >                     <version>${tomee.version}</version>
> > >
> > >                     <scope>test</scope>
> > >
> > >                 </dependency>
> > >
> > >
> > >                 <!-- To test jax-rs applications with embed TomEE you
> > need
> > >
> > >                     to both of these dependencies -->
> > >
> > >                 <dependency>
> > >
> > >                     <groupId>org.apache.openejb</groupId>
> > >
> > >                     <artifactId>openejb-cxf-rs</artifactId>
> > >
> > >                     <version>4.6.0</version>
> > >
> > >                     <scope>test</scope>
> > >
> > >                 </dependency>
> > >
> > >                 <dependency>
> > >
> > >                     <groupId>org.apache.openejb</groupId>
> > >
> > >                     <artifactId>tomee-jaxrs</artifactId>
> > >
> > >                     <version>${tomee.version}</version>
> > >
> > >                     <scope>test</scope>
> > >
> > >                     <exclusions>
> > >
> > >                         <exclusion>
> > >
> > >                             <groupId>commons-logging</groupId>
> > >
> > >                             <artifactId>commons-logging</artifactId>
> > >
> > >                         </exclusion>
> > >
> > >                     </exclusions>
> > >
> > >                 </dependency>
> > >
> > > Should I remove from any other dependency too? For example
> > > Arquillian.persistence-extension is using too, or Drone extension.
> > >
> > >
> > >
> > >
> > > 2014-04-13 20:06 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
> > >
> > >> well actually this was a regression due to a new feature. That's like
> > >> it when you implement an API with throw new UnusupportedException,
> > >> thanks cxf logging facade ;)
> > >> Romain Manni-Bucau
> > >> Twitter: @rmannibucau
> > >> Blog: http://rmannibucau.wordpress.com/
> > >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> > >> Github: https://github.com/rmannibucau
> > >>
> > >>
> > >>
> > >> 2014-04-13 20:03 GMT+02:00 Alex Soto <as...@gmail.com>:
> > >> > Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I
> > exclude
> > >> > commons-logging from tomee-jaxrs dependency and that's all.
> > >> >
> > >> > Thank you so much when I arrive at home I will try it.
> > >> >
> > >> > Well nice to see how TomEE is improving from release to release :)
> > >> >
> > >
>
>
>
> --
> Enviat amb Gmail Mobile
>



-- 
Jean-Louis

Re: EJB and REST

Posted by Alex Soto <as...@gmail.com>.
Stupid question but by forcing you exactly mean? And also do you know when
1.6.1 will be released?

El diumenge, 13 abril de 2014, Romain Manni-Bucau <rm...@gmail.com>
va escriure:

> hmm weird, force cxf to log with something else
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-04-13 20:16 GMT+02:00 Alex Soto <asotobu@gmail.com <javascript:;>>:
> > Still happens :(
> >
> >  <dependencies>
> >
> >                 <dependency>
> >
> >                     <groupId>org.apache.openejb</groupId>
> >
> >                     <artifactId>arquillian-tomee-embedded</artifactId>
> >
> >                     <version>${tomee.version}</version>
> >
> >                     <scope>test</scope>
> >
> >                 </dependency>
> >
> >
> >                 <!-- To test jax-rs applications with embed TomEE you
> need
> >
> >                     to both of these dependencies -->
> >
> >                 <dependency>
> >
> >                     <groupId>org.apache.openejb</groupId>
> >
> >                     <artifactId>openejb-cxf-rs</artifactId>
> >
> >                     <version>4.6.0</version>
> >
> >                     <scope>test</scope>
> >
> >                 </dependency>
> >
> >                 <dependency>
> >
> >                     <groupId>org.apache.openejb</groupId>
> >
> >                     <artifactId>tomee-jaxrs</artifactId>
> >
> >                     <version>${tomee.version}</version>
> >
> >                     <scope>test</scope>
> >
> >                     <exclusions>
> >
> >                         <exclusion>
> >
> >                             <groupId>commons-logging</groupId>
> >
> >                             <artifactId>commons-logging</artifactId>
> >
> >                         </exclusion>
> >
> >                     </exclusions>
> >
> >                 </dependency>
> >
> > Should I remove from any other dependency too? For example
> > Arquillian.persistence-extension is using too, or Drone extension.
> >
> >
> >
> >
> > 2014-04-13 20:06 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
> >
> >> well actually this was a regression due to a new feature. That's like
> >> it when you implement an API with throw new UnusupportedException,
> >> thanks cxf logging facade ;)
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-04-13 20:03 GMT+02:00 Alex Soto <as...@gmail.com>:
> >> > Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I
> exclude
> >> > commons-logging from tomee-jaxrs dependency and that's all.
> >> >
> >> > Thank you so much when I arrive at home I will try it.
> >> >
> >> > Well nice to see how TomEE is improving from release to release :)
> >> >
> >



-- 
Enviat amb Gmail Mobile

Re: EJB and REST

Posted by Romain Manni-Bucau <rm...@gmail.com>.
hmm weird, force cxf to log with something else
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-04-13 20:16 GMT+02:00 Alex Soto <as...@gmail.com>:
> Still happens :(
>
>  <dependencies>
>
>                 <dependency>
>
>                     <groupId>org.apache.openejb</groupId>
>
>                     <artifactId>arquillian-tomee-embedded</artifactId>
>
>                     <version>${tomee.version}</version>
>
>                     <scope>test</scope>
>
>                 </dependency>
>
>
>                 <!-- To test jax-rs applications with embed TomEE you need
>
>                     to both of these dependencies -->
>
>                 <dependency>
>
>                     <groupId>org.apache.openejb</groupId>
>
>                     <artifactId>openejb-cxf-rs</artifactId>
>
>                     <version>4.6.0</version>
>
>                     <scope>test</scope>
>
>                 </dependency>
>
>                 <dependency>
>
>                     <groupId>org.apache.openejb</groupId>
>
>                     <artifactId>tomee-jaxrs</artifactId>
>
>                     <version>${tomee.version}</version>
>
>                     <scope>test</scope>
>
>                     <exclusions>
>
>                         <exclusion>
>
>                             <groupId>commons-logging</groupId>
>
>                             <artifactId>commons-logging</artifactId>
>
>                         </exclusion>
>
>                     </exclusions>
>
>                 </dependency>
>
> Should I remove from any other dependency too? For example
> Arquillian.persistence-extension is using too, or Drone extension.
>
>
>
>
> 2014-04-13 20:06 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
>
>> well actually this was a regression due to a new feature. That's like
>> it when you implement an API with throw new UnusupportedException,
>> thanks cxf logging facade ;)
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014-04-13 20:03 GMT+02:00 Alex Soto <as...@gmail.com>:
>> > Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I exclude
>> > commons-logging from tomee-jaxrs dependency and that's all.
>> >
>> > Thank you so much when I arrive at home I will try it.
>> >
>> > Well nice to see how TomEE is improving from release to release :)
>> >
>> >
>> > 2014-04-13 19:58 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
>> >
>> >> Hi
>> >>
>> >> this should be fixed on trunk. If you switch from commons logging to
>> >> jul it should work even with this version.
>> >> Romain Manni-Bucau
>> >> Twitter: @rmannibucau
>> >> Blog: http://rmannibucau.wordpress.com/
>> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> >> Github: https://github.com/rmannibucau
>> >>
>> >>
>> >>
>> >> 2014-04-13 19:54 GMT+02:00 Alex Soto <as...@gmail.com>:
>> >> > Hello I am developing a RESTful service. My first approach has been
>> >> > creating a creating a class and annotating as @Sateless EJB and also
>> >> using
>> >> > @Path to be a REST point too and it worked.
>> >> > In my next iteration I have modified a bit that class by extracting an
>> >> > interface with REST annotations and then the EJB simply implements
>> that
>> >> > interface.
>> >> >
>> >> > @Path("/points/")
>> >> >
>> >> > public interface CatalogService {
>> >> >
>> >> >     @Produces({MediaType.APPLICATION_JSON})
>> >> >
>> >> >     @GET
>> >> >
>> >> >     public List<Gift> catalog();
>> >> >
>> >> > }
>> >> >
>> >> >
>> >> > @Stateless
>> >> >
>> >> > public class CatalogServiceImpl implements CatalogService {
>> >> >
>> >> >     @EJB
>> >> >
>> >> >     GiftCatalogService giftCatalogService;
>> >> >
>> >> >     @Override
>> >> >
>> >> >     public List<Gift> catalog() {
>> >> >
>> >> >         return this.giftCatalogService.giftCatalog();
>> >> >
>> >> >     }
>> >> >
>> >> > }
>> >> >
>> >> >
>> >> > Than I have created my Arquillian test and next exception is thrown:
>> >> >
>> >> > *INFO: Started Ejb(deployment-id=GiftCatalogService,
>> >> > ejb-name=GiftCatalogService, container=Default Stateless Container)*
>> >> >
>> >> > *abr 13, 2014 7:41:12 PM
>> org.apache.openejb.assembler.classic.Assembler
>> >> > createApplication*
>> >> >
>> >> > *INFO: Deployed
>> >> >
>> >>
>> Application(path=/private/var/folders/k7/5t5fmkj547315vzzv51wh0fh0000gn/T/arquillian-tomee-app-working-dir/0/giftcatalog)*
>> >> >
>> >> > *abr 13, 2014 7:41:13 PM org.apache.openejb.observer.ObserverManager
>> >> > fireEvent*
>> >> >
>> >> > *SEVERE: error invoking
>> >> > Observer{class=org.apache.tomee.webservices.TomeeJaxRsService}*
>> >> >
>> >> > *java.lang.UnsupportedOperationException*
>> >> >
>> >> > * at
>> >> >
>> >>
>> org.apache.cxf.common.logging.AbstractDelegatingLogger.setLevel(AbstractDelegatingLogger.java:268)*
>> >> >
>> >> > * at
>> >> >
>> >>
>> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:391)*
>> >> >
>> >> > * at
>> >> >
>> >>
>> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:453)*
>> >> >
>> >> > * at
>> >> >
>> >>
>> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:273)*
>> >> >
>> >> > * at
>> >> >
>> >>
>> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)*
>> >> >
>> >> > I have noticed that the EJB is deployed correctly but when tries to
>> >> > "decorate" with REST it throws this exception. Am I doing something
>> wrong
>> >> > or there is something not implemented on Apache CXF.
>> >> >
>> >> > Also I have on classpath next dependencies with
>> >> arquillian-tomee-embedded:
>> >> >
>> >> >
>> >> > <dependency>
>> >> >
>> >> >          groupId>org.apache.openejb</groupId>
>> >> >
>> >> >                     <artifactId>openejb-cxf-rs</artifactId>
>> >> >
>> >> >                     <version>4.6.0</version>
>> >> >
>> >> >                     <scope>test</scope>
>> >> >
>> >> >                 </dependency>
>> >> >
>> >> >                 <dependency>
>> >> >
>> >> >                     <groupId>org.apache.openejb</groupId>
>> >> >
>> >> >                     <artifactId>tomee-jaxrs</artifactId>
>> >> >
>> >> >                     <version>${tomee.version}</version>
>> >> >
>> >> >                     <scope>test</scope>
>> >> >
>> >> >                 </dependency>
>> >>
>> >
>> >
>> >
>> > --
>> > +----------------------------------------------------------+
>> >   Alex Soto Bueno - Computer Engineer
>> >   www.lordofthejars.com
>> > +----------------------------------------------------------+
>>
>
>
>
> --
> +----------------------------------------------------------+
>   Alex Soto Bueno - Computer Engineer
>   www.lordofthejars.com
> +----------------------------------------------------------+

Re: EJB and REST

Posted by Alex Soto <as...@gmail.com>.
Still happens :(

 <dependencies>

                <dependency>

                    <groupId>org.apache.openejb</groupId>

                    <artifactId>arquillian-tomee-embedded</artifactId>

                    <version>${tomee.version}</version>

                    <scope>test</scope>

                </dependency>


                <!-- To test jax-rs applications with embed TomEE you need

                    to both of these dependencies -->

                <dependency>

                    <groupId>org.apache.openejb</groupId>

                    <artifactId>openejb-cxf-rs</artifactId>

                    <version>4.6.0</version>

                    <scope>test</scope>

                </dependency>

                <dependency>

                    <groupId>org.apache.openejb</groupId>

                    <artifactId>tomee-jaxrs</artifactId>

                    <version>${tomee.version}</version>

                    <scope>test</scope>

                    <exclusions>

                        <exclusion>

                            <groupId>commons-logging</groupId>

                            <artifactId>commons-logging</artifactId>

                        </exclusion>

                    </exclusions>

                </dependency>

Should I remove from any other dependency too? For example
Arquillian.persistence-extension is using too, or Drone extension.




2014-04-13 20:06 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:

> well actually this was a regression due to a new feature. That's like
> it when you implement an API with throw new UnusupportedException,
> thanks cxf logging facade ;)
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-04-13 20:03 GMT+02:00 Alex Soto <as...@gmail.com>:
> > Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I exclude
> > commons-logging from tomee-jaxrs dependency and that's all.
> >
> > Thank you so much when I arrive at home I will try it.
> >
> > Well nice to see how TomEE is improving from release to release :)
> >
> >
> > 2014-04-13 19:58 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
> >
> >> Hi
> >>
> >> this should be fixed on trunk. If you switch from commons logging to
> >> jul it should work even with this version.
> >> Romain Manni-Bucau
> >> Twitter: @rmannibucau
> >> Blog: http://rmannibucau.wordpress.com/
> >> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> >> Github: https://github.com/rmannibucau
> >>
> >>
> >>
> >> 2014-04-13 19:54 GMT+02:00 Alex Soto <as...@gmail.com>:
> >> > Hello I am developing a RESTful service. My first approach has been
> >> > creating a creating a class and annotating as @Sateless EJB and also
> >> using
> >> > @Path to be a REST point too and it worked.
> >> > In my next iteration I have modified a bit that class by extracting an
> >> > interface with REST annotations and then the EJB simply implements
> that
> >> > interface.
> >> >
> >> > @Path("/points/")
> >> >
> >> > public interface CatalogService {
> >> >
> >> >     @Produces({MediaType.APPLICATION_JSON})
> >> >
> >> >     @GET
> >> >
> >> >     public List<Gift> catalog();
> >> >
> >> > }
> >> >
> >> >
> >> > @Stateless
> >> >
> >> > public class CatalogServiceImpl implements CatalogService {
> >> >
> >> >     @EJB
> >> >
> >> >     GiftCatalogService giftCatalogService;
> >> >
> >> >     @Override
> >> >
> >> >     public List<Gift> catalog() {
> >> >
> >> >         return this.giftCatalogService.giftCatalog();
> >> >
> >> >     }
> >> >
> >> > }
> >> >
> >> >
> >> > Than I have created my Arquillian test and next exception is thrown:
> >> >
> >> > *INFO: Started Ejb(deployment-id=GiftCatalogService,
> >> > ejb-name=GiftCatalogService, container=Default Stateless Container)*
> >> >
> >> > *abr 13, 2014 7:41:12 PM
> org.apache.openejb.assembler.classic.Assembler
> >> > createApplication*
> >> >
> >> > *INFO: Deployed
> >> >
> >>
> Application(path=/private/var/folders/k7/5t5fmkj547315vzzv51wh0fh0000gn/T/arquillian-tomee-app-working-dir/0/giftcatalog)*
> >> >
> >> > *abr 13, 2014 7:41:13 PM org.apache.openejb.observer.ObserverManager
> >> > fireEvent*
> >> >
> >> > *SEVERE: error invoking
> >> > Observer{class=org.apache.tomee.webservices.TomeeJaxRsService}*
> >> >
> >> > *java.lang.UnsupportedOperationException*
> >> >
> >> > * at
> >> >
> >>
> org.apache.cxf.common.logging.AbstractDelegatingLogger.setLevel(AbstractDelegatingLogger.java:268)*
> >> >
> >> > * at
> >> >
> >>
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:391)*
> >> >
> >> > * at
> >> >
> >>
> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:453)*
> >> >
> >> > * at
> >> >
> >>
> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:273)*
> >> >
> >> > * at
> >> >
> >>
> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)*
> >> >
> >> > I have noticed that the EJB is deployed correctly but when tries to
> >> > "decorate" with REST it throws this exception. Am I doing something
> wrong
> >> > or there is something not implemented on Apache CXF.
> >> >
> >> > Also I have on classpath next dependencies with
> >> arquillian-tomee-embedded:
> >> >
> >> >
> >> > <dependency>
> >> >
> >> >          groupId>org.apache.openejb</groupId>
> >> >
> >> >                     <artifactId>openejb-cxf-rs</artifactId>
> >> >
> >> >                     <version>4.6.0</version>
> >> >
> >> >                     <scope>test</scope>
> >> >
> >> >                 </dependency>
> >> >
> >> >                 <dependency>
> >> >
> >> >                     <groupId>org.apache.openejb</groupId>
> >> >
> >> >                     <artifactId>tomee-jaxrs</artifactId>
> >> >
> >> >                     <version>${tomee.version}</version>
> >> >
> >> >                     <scope>test</scope>
> >> >
> >> >                 </dependency>
> >>
> >
> >
> >
> > --
> > +----------------------------------------------------------+
> >   Alex Soto Bueno - Computer Engineer
> >   www.lordofthejars.com
> > +----------------------------------------------------------+
>



-- 
+----------------------------------------------------------+
  Alex Soto Bueno - Computer Engineer
  www.lordofthejars.com
+----------------------------------------------------------+

Re: EJB and REST

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well actually this was a regression due to a new feature. That's like
it when you implement an API with throw new UnusupportedException,
thanks cxf logging facade ;)
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-04-13 20:03 GMT+02:00 Alex Soto <as...@gmail.com>:
> Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I exclude
> commons-logging from tomee-jaxrs dependency and that's all.
>
> Thank you so much when I arrive at home I will try it.
>
> Well nice to see how TomEE is improving from release to release :)
>
>
> 2014-04-13 19:58 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:
>
>> Hi
>>
>> this should be fixed on trunk. If you switch from commons logging to
>> jul it should work even with this version.
>> Romain Manni-Bucau
>> Twitter: @rmannibucau
>> Blog: http://rmannibucau.wordpress.com/
>> LinkedIn: http://fr.linkedin.com/in/rmannibucau
>> Github: https://github.com/rmannibucau
>>
>>
>>
>> 2014-04-13 19:54 GMT+02:00 Alex Soto <as...@gmail.com>:
>> > Hello I am developing a RESTful service. My first approach has been
>> > creating a creating a class and annotating as @Sateless EJB and also
>> using
>> > @Path to be a REST point too and it worked.
>> > In my next iteration I have modified a bit that class by extracting an
>> > interface with REST annotations and then the EJB simply implements that
>> > interface.
>> >
>> > @Path("/points/")
>> >
>> > public interface CatalogService {
>> >
>> >     @Produces({MediaType.APPLICATION_JSON})
>> >
>> >     @GET
>> >
>> >     public List<Gift> catalog();
>> >
>> > }
>> >
>> >
>> > @Stateless
>> >
>> > public class CatalogServiceImpl implements CatalogService {
>> >
>> >     @EJB
>> >
>> >     GiftCatalogService giftCatalogService;
>> >
>> >     @Override
>> >
>> >     public List<Gift> catalog() {
>> >
>> >         return this.giftCatalogService.giftCatalog();
>> >
>> >     }
>> >
>> > }
>> >
>> >
>> > Than I have created my Arquillian test and next exception is thrown:
>> >
>> > *INFO: Started Ejb(deployment-id=GiftCatalogService,
>> > ejb-name=GiftCatalogService, container=Default Stateless Container)*
>> >
>> > *abr 13, 2014 7:41:12 PM org.apache.openejb.assembler.classic.Assembler
>> > createApplication*
>> >
>> > *INFO: Deployed
>> >
>> Application(path=/private/var/folders/k7/5t5fmkj547315vzzv51wh0fh0000gn/T/arquillian-tomee-app-working-dir/0/giftcatalog)*
>> >
>> > *abr 13, 2014 7:41:13 PM org.apache.openejb.observer.ObserverManager
>> > fireEvent*
>> >
>> > *SEVERE: error invoking
>> > Observer{class=org.apache.tomee.webservices.TomeeJaxRsService}*
>> >
>> > *java.lang.UnsupportedOperationException*
>> >
>> > * at
>> >
>> org.apache.cxf.common.logging.AbstractDelegatingLogger.setLevel(AbstractDelegatingLogger.java:268)*
>> >
>> > * at
>> >
>> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:391)*
>> >
>> > * at
>> >
>> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:453)*
>> >
>> > * at
>> >
>> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:273)*
>> >
>> > * at
>> >
>> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)*
>> >
>> > I have noticed that the EJB is deployed correctly but when tries to
>> > "decorate" with REST it throws this exception. Am I doing something wrong
>> > or there is something not implemented on Apache CXF.
>> >
>> > Also I have on classpath next dependencies with
>> arquillian-tomee-embedded:
>> >
>> >
>> > <dependency>
>> >
>> >          groupId>org.apache.openejb</groupId>
>> >
>> >                     <artifactId>openejb-cxf-rs</artifactId>
>> >
>> >                     <version>4.6.0</version>
>> >
>> >                     <scope>test</scope>
>> >
>> >                 </dependency>
>> >
>> >                 <dependency>
>> >
>> >                     <groupId>org.apache.openejb</groupId>
>> >
>> >                     <artifactId>tomee-jaxrs</artifactId>
>> >
>> >                     <version>${tomee.version}</version>
>> >
>> >                     <scope>test</scope>
>> >
>> >                 </dependency>
>>
>
>
>
> --
> +----------------------------------------------------------+
>   Alex Soto Bueno - Computer Engineer
>   www.lordofthejars.com
> +----------------------------------------------------------+

Re: EJB and REST

Posted by Alex Soto <as...@gmail.com>.
Oh cool I suppose you are talking about Apache TomEE 1.6.1, so I exclude
commons-logging from tomee-jaxrs dependency and that's all.

Thank you so much when I arrive at home I will try it.

Well nice to see how TomEE is improving from release to release :)


2014-04-13 19:58 GMT+02:00 Romain Manni-Bucau <rm...@gmail.com>:

> Hi
>
> this should be fixed on trunk. If you switch from commons logging to
> jul it should work even with this version.
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
>
>
>
> 2014-04-13 19:54 GMT+02:00 Alex Soto <as...@gmail.com>:
> > Hello I am developing a RESTful service. My first approach has been
> > creating a creating a class and annotating as @Sateless EJB and also
> using
> > @Path to be a REST point too and it worked.
> > In my next iteration I have modified a bit that class by extracting an
> > interface with REST annotations and then the EJB simply implements that
> > interface.
> >
> > @Path("/points/")
> >
> > public interface CatalogService {
> >
> >     @Produces({MediaType.APPLICATION_JSON})
> >
> >     @GET
> >
> >     public List<Gift> catalog();
> >
> > }
> >
> >
> > @Stateless
> >
> > public class CatalogServiceImpl implements CatalogService {
> >
> >     @EJB
> >
> >     GiftCatalogService giftCatalogService;
> >
> >     @Override
> >
> >     public List<Gift> catalog() {
> >
> >         return this.giftCatalogService.giftCatalog();
> >
> >     }
> >
> > }
> >
> >
> > Than I have created my Arquillian test and next exception is thrown:
> >
> > *INFO: Started Ejb(deployment-id=GiftCatalogService,
> > ejb-name=GiftCatalogService, container=Default Stateless Container)*
> >
> > *abr 13, 2014 7:41:12 PM org.apache.openejb.assembler.classic.Assembler
> > createApplication*
> >
> > *INFO: Deployed
> >
> Application(path=/private/var/folders/k7/5t5fmkj547315vzzv51wh0fh0000gn/T/arquillian-tomee-app-working-dir/0/giftcatalog)*
> >
> > *abr 13, 2014 7:41:13 PM org.apache.openejb.observer.ObserverManager
> > fireEvent*
> >
> > *SEVERE: error invoking
> > Observer{class=org.apache.tomee.webservices.TomeeJaxRsService}*
> >
> > *java.lang.UnsupportedOperationException*
> >
> > * at
> >
> org.apache.cxf.common.logging.AbstractDelegatingLogger.setLevel(AbstractDelegatingLogger.java:268)*
> >
> > * at
> >
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:391)*
> >
> > * at
> >
> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:453)*
> >
> > * at
> >
> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:273)*
> >
> > * at
> >
> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)*
> >
> > I have noticed that the EJB is deployed correctly but when tries to
> > "decorate" with REST it throws this exception. Am I doing something wrong
> > or there is something not implemented on Apache CXF.
> >
> > Also I have on classpath next dependencies with
> arquillian-tomee-embedded:
> >
> >
> > <dependency>
> >
> >          groupId>org.apache.openejb</groupId>
> >
> >                     <artifactId>openejb-cxf-rs</artifactId>
> >
> >                     <version>4.6.0</version>
> >
> >                     <scope>test</scope>
> >
> >                 </dependency>
> >
> >                 <dependency>
> >
> >                     <groupId>org.apache.openejb</groupId>
> >
> >                     <artifactId>tomee-jaxrs</artifactId>
> >
> >                     <version>${tomee.version}</version>
> >
> >                     <scope>test</scope>
> >
> >                 </dependency>
>



-- 
+----------------------------------------------------------+
  Alex Soto Bueno - Computer Engineer
  www.lordofthejars.com
+----------------------------------------------------------+

Re: EJB and REST

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

this should be fixed on trunk. If you switch from commons logging to
jul it should work even with this version.
Romain Manni-Bucau
Twitter: @rmannibucau
Blog: http://rmannibucau.wordpress.com/
LinkedIn: http://fr.linkedin.com/in/rmannibucau
Github: https://github.com/rmannibucau



2014-04-13 19:54 GMT+02:00 Alex Soto <as...@gmail.com>:
> Hello I am developing a RESTful service. My first approach has been
> creating a creating a class and annotating as @Sateless EJB and also using
> @Path to be a REST point too and it worked.
> In my next iteration I have modified a bit that class by extracting an
> interface with REST annotations and then the EJB simply implements that
> interface.
>
> @Path("/points/")
>
> public interface CatalogService {
>
>     @Produces({MediaType.APPLICATION_JSON})
>
>     @GET
>
>     public List<Gift> catalog();
>
> }
>
>
> @Stateless
>
> public class CatalogServiceImpl implements CatalogService {
>
>     @EJB
>
>     GiftCatalogService giftCatalogService;
>
>     @Override
>
>     public List<Gift> catalog() {
>
>         return this.giftCatalogService.giftCatalog();
>
>     }
>
> }
>
>
> Than I have created my Arquillian test and next exception is thrown:
>
> *INFO: Started Ejb(deployment-id=GiftCatalogService,
> ejb-name=GiftCatalogService, container=Default Stateless Container)*
>
> *abr 13, 2014 7:41:12 PM org.apache.openejb.assembler.classic.Assembler
> createApplication*
>
> *INFO: Deployed
> Application(path=/private/var/folders/k7/5t5fmkj547315vzzv51wh0fh0000gn/T/arquillian-tomee-app-working-dir/0/giftcatalog)*
>
> *abr 13, 2014 7:41:13 PM org.apache.openejb.observer.ObserverManager
> fireEvent*
>
> *SEVERE: error invoking
> Observer{class=org.apache.tomee.webservices.TomeeJaxRsService}*
>
> *java.lang.UnsupportedOperationException*
>
> * at
> org.apache.cxf.common.logging.AbstractDelegatingLogger.setLevel(AbstractDelegatingLogger.java:268)*
>
> * at
> org.apache.openejb.server.cxf.rs.CxfRsHttpListener.deployApplication(CxfRsHttpListener.java:391)*
>
> * at
> org.apache.openejb.server.rest.RESTService.deployApplication(RESTService.java:453)*
>
> * at
> org.apache.openejb.server.rest.RESTService.afterApplicationCreated(RESTService.java:273)*
>
> * at
> org.apache.tomee.webservices.TomeeJaxRsService.afterApplicationCreated(TomeeJaxRsService.java:51)*
>
> I have noticed that the EJB is deployed correctly but when tries to
> "decorate" with REST it throws this exception. Am I doing something wrong
> or there is something not implemented on Apache CXF.
>
> Also I have on classpath next dependencies with arquillian-tomee-embedded:
>
>
> <dependency>
>
>          groupId>org.apache.openejb</groupId>
>
>                     <artifactId>openejb-cxf-rs</artifactId>
>
>                     <version>4.6.0</version>
>
>                     <scope>test</scope>
>
>                 </dependency>
>
>                 <dependency>
>
>                     <groupId>org.apache.openejb</groupId>
>
>                     <artifactId>tomee-jaxrs</artifactId>
>
>                     <version>${tomee.version}</version>
>
>                     <scope>test</scope>
>
>                 </dependency>