tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: EJB and REST
Date Sun, 13 Apr 2014 17:58:22 GMT
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 <asotobu@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>

Mime
View raw message