You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Reto Bachmann-Gmür <re...@trialox.org> on 2008/10/16 17:01:23 UTC

RESTfull applications in OSGi container

JAX-RS [1] (aka JSR 311) is the new Java API for RESTful Web Services.

At trialox.org we have implemented Triaxrs, a JAX-RS implementation,
that can run in OSGi containers. Our code is open source and licensed
under the apache 2.0 license. It allows discovery of root resources and
providers using the OSGi service registry. A tutorial is available which
shows the steps to create a RESTfull application and deploy it in the
felix OSGi container.

Triaxrs 0.3 implements most of the features of version 0.10 of the
JAX-RS API, a snapshot based on version 1.0 will be available soon. We
would like to invite you to test it and are happy to receive any feedback.

Website: http://trialox.org/projects/org.trialox.jaxrs/

Mercurial-source repository: http://scm.trialox.org/org.trialox.jaxrs/

Tutorial:
http://trialox.org/projects/org.trialox.jaxrs/tutorials/tutorial_1.xhtml

Download: http://repo.trialox.org/distro/org/trialox/org.trialox.jaxrs/0.3/

Cheers,
reto

1. http://jsr311.dev.java.net/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: RESTfull applications in OSGi container

Posted by Reto Bachmann-Gmür <re...@trialox.org>.
Hi Martin,

We compiled Triaxrs  with jdk 1.6 for java 1.6, I never tried nor
checked the requirement of dependencies but I can't think of a reason
why it shouldn't compile with java 5.

Cheers,
reto

Martin Thelian said the following on 2008-10-16 21:19:
> Hi,
>
> is java 1.6 required to use the API? In the OSGi Log I found messages
> like the following:
>
>> Error [56] FrameworkEvent ERROR
>> http://repo.trialox.org/distro/org/trialox/org.trialox.jaxrs/0.3/org.trialox.jaxrs-0.3.jar
>>
>> org.osgi.framework.BundleException: Exception in
>> org.eclipse.equinox.internal.ds.ServiceReg.getService()
>>         at
>> org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:127)
>>
>>  [...]
>> Caused by: org.osgi.service.component.ComponentException: Exception
>> occurred while creating new instance of component Component[
>>         name = org.trialox.jaxrs.JaxRsHandler
>>         autoenable = true
>>         factory = null
>>         immediate = false
>>         implementation = org.trialox.jaxrs.JaxRsHandler
>>         properties = {service.pid=org.trialox.jaxrs.JaxRsHandler}
>>         serviceFactory = false
>>         serviceInterface = [org.wymiwyg.wrhapi.Handler]
>>         references = {
>>                 Reference[name = component, interface =
>> java.lang.Object, policy = dynamic, cardinality = 0..n, target =
>> (javax.ws.rs=true), bind = bindComponent, unbind = unbindComponent]
>>                 Reference[name = applicationConfig, interface =
>> javax.ws.rs.core.Application, policy = static, cardinality = 0..1,
>> target = null, bind = bindApplicationConfig, unbind =
>> unbindApplicationConfig]
>>         }
>>         located in bundle =
>> http://repo.trialox.org/distro/org/trialox/org.trialox.jaxrs/0.3/org.trialox.jaxrs-0.3.jar
>> [56]
>> ]
>> [...]
>>         ... 54 more
>> Caused by: java.lang.UnsupportedClassVersionError: Bad version number
>> in .class file
> It seems not to be possible to run trialox with Java version 1.5. With
> version 1.6 the tutorial seems to work.
>
> Regards,
> Martin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: RESTfull applications in OSGi container

Posted by Martin Thelian <Ma...@gmx.at>.
Hi,

is java 1.6 required to use the API? In the OSGi Log I found messages 
like the following:

> Error [56] FrameworkEvent ERROR 
> http://repo.trialox.org/distro/org/trialox/org.trialox.jaxrs/0.3/org.trialox.jaxrs-0.3.jar
> org.osgi.framework.BundleException: Exception in 
> org.eclipse.equinox.internal.ds.ServiceReg.getService()
>         at 
> org.eclipse.osgi.framework.internal.core.ServiceUse.getService(ServiceUse.java:127)
>  [...]
> Caused by: org.osgi.service.component.ComponentException: Exception 
> occurred while creating new instance of component Component[
>         name = org.trialox.jaxrs.JaxRsHandler
>         autoenable = true
>         factory = null
>         immediate = false
>         implementation = org.trialox.jaxrs.JaxRsHandler
>         properties = {service.pid=org.trialox.jaxrs.JaxRsHandler}
>         serviceFactory = false
>         serviceInterface = [org.wymiwyg.wrhapi.Handler]
>         references = {
>                 Reference[name = component, interface = 
> java.lang.Object, policy = dynamic, cardinality = 0..n, target = 
> (javax.ws.rs=true), bind = bindComponent, unbind = unbindComponent]
>                 Reference[name = applicationConfig, interface = 
> javax.ws.rs.core.Application, policy = static, cardinality = 0..1, 
> target = null, bind = bindApplicationConfig, unbind = 
> unbindApplicationConfig]
>         }
>         located in bundle = 
> http://repo.trialox.org/distro/org/trialox/org.trialox.jaxrs/0.3/org.trialox.jaxrs-0.3.jar 
> [56]
> ]
> [...]
>         ... 54 more
> Caused by: java.lang.UnsupportedClassVersionError: Bad version number 
> in .class file
It seems not to be possible to run trialox with Java version 1.5. With 
version 1.6 the tutorial seems to work.

Regards,
Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: RESTfull applications in OSGi container

Posted by Martin Thelian <Ma...@gmx.at>.
Hi,

I've tried your tutorial using Equniox and I'm getting an Exception when 
trying to call the exampel URL:

> 16 Okt 2008 19:30:22 ERROR org.mortbay.log  - EXCEPTION
> java.lang.NullPointerException
>         at 
> org.wymiwyg.wrhapi.jetty.JettyWebServerFactory$2.handle(JettyWebServerFactory.java:79)
>         at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>         at org.mortbay.jetty.Server.handle(Server.java:324)
>         at 
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
>         at 
> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
>         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
>         at 
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
>         at 
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
>         at 
> org.mortbay.jetty.nio.BlockingChannelConnector$Connection.run(BlockingChannelConnector.java:163)
>         at 
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
How can I solve this problem? Thanks.

Regards,
Martin


Reto Bachmann-Gmür schrieb:
> JAX-RS [1] (aka JSR 311) is the new Java API for RESTful Web Services.
>
> At trialox.org we have implemented Triaxrs, a JAX-RS implementation,
> that can run in OSGi containers. Our code is open source and licensed
> under the apache 2.0 license. It allows discovery of root resources and
> providers using the OSGi service registry. A tutorial is available which
> shows the steps to create a RESTfull application and deploy it in the
> felix OSGi container.
>
> Triaxrs 0.3 implements most of the features of version 0.10 of the
> JAX-RS API, a snapshot based on version 1.0 will be available soon. We
> would like to invite you to test it and are happy to receive any feedback.
>
> Website: http://trialox.org/projects/org.trialox.jaxrs/
>
> Mercurial-source repository: http://scm.trialox.org/org.trialox.jaxrs/
>
> Tutorial:
> http://trialox.org/projects/org.trialox.jaxrs/tutorials/tutorial_1.xhtml
>
> Download: http://repo.trialox.org/distro/org/trialox/org.trialox.jaxrs/0.3/
>
> Cheers,
> reto
>
> 1. http://jsr311.dev.java.net/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org