GithubHelp home page GithubHelp logo

restlet / restlet-framework-java Goto Github PK

View Code? Open in Web Editor NEW
640.0 76.0 283.0 653.7 MB

The first REST API framework for Java

Home Page: https://restlet.talend.com

XSLT 1.05% Shell 0.22% CSS 0.15% NSIS 0.43% Java 68.53% HTML 29.29% Batchfile 0.03% FreeMarker 0.14% Rich Text Format 0.05% RAML 0.09% Velocity Template Language 0.01%
rest-api framework java restlet

restlet-framework-java's People

Contributors

alepac avatar alt250 avatar bitsofinfo avatar boillodmanuel avatar bryanhunt avatar curioustechizen avatar devsprint avatar fantomjac avatar grammophone avatar guiblondeau avatar harbulot avatar javamonkey79 avatar jeffplourde avatar jgustie avatar jkeljo avatar jlouvel avatar ls-cyril-grosset avatar ludovic-chaboud-capgemini avatar marcelo-ochoa avatar msvens avatar quilicicf avatar remidewitte avatar restletforger avatar robheittman avatar rsutphin avatar stephankoo avatar tembrel avatar templth avatar thboileau avatar tliron avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

restlet-framework-java's Issues

Consider setting up automated builds

We should consider setting up Jenkins for all of the builds. It could easily manage all of the editions, archives, and releases. It also integrates nicely with JaCoCo, FindBugs, and Sonar.

workload: 4h

two kind of tasks:

  • simple build targetted at each commit for checking code
  • daily snapshot published

.gitignore

probably should add .gitignore

.cache
.project
.classpath
.settings/

bin/
target/

release.properties
pom.xml.releaseBackup

ServerResource.getVariants(Method) caches without reference to Method

The return value from ServerResource.getVariants(Method) is cached in the instance variable this.variants, but the cached value is not correlated with the method that was passed in.

Future calls to ServerResource.getVariants(Method) with different Method arguments will return the cached results for whatever Method was in the first call, which may be incorrect.

The cache could be implemented as a Map<Method, List> instead of just List to solve this issue.

Is it compatible with the Android 2.1?

Hi,

I had found the same error as:
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&viewType=browseAll&dsMessageId=2891050#messagefocus

My code is really simple:
ClientResource itemsResource = new ClientResource("http://host:8090/App");
Representation r = itemsResource.get();
System.out.println(r);

I'm sure that the application is on. I tested it on the browser.

The Exception Stack is:

org.restlet(3496): Unexpected error while controlling connector
org.restlet(3496): java.nio.channels.IllegalSelectorException
java.nio.channels.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:158)
org.restlet.util.SelectionRegistration.register(SelectionRegistration.java:308)
org.restlet.engine.connector.ConnectionController.registerKeys(ConnectionController.java:246)
org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:151)
org.restlet.engine.connector.Controller.run(Controller.java:158)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
java.util.concurrent.FutureTask.run(FutureTask.java:137)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
org.restlet(3496): at java.lang.Thread.run(Thread.java:1096)

Use pulse to share eclipse profile for restlet developers

Jerome, hello;

since you already store .project etc eclipse meta data in the source repo,
and all development is very much eclipse centric due to reliance on pde,
I suggest you could use pulse to share eclipse profile for restlet developers
http://www.poweredbypulse.com/

the idea is that you create "authoritative developers profile" yourself
and then share this profile with restlet developers;

this would free the developers from hunting for the
correct set and versions of eclipse plugins that are needed for work;

if you choose to create restlet pulse profile,
please invite my user id = Andrei dot Pozolotin @ gmail dot com

thank you;

Andrei.

Error parsing content type header

A trailing semicolon in ContentType header, makes Restlet to throw an exception.

Here is an exemple : 
HEAD on lifehacker.com returns

HTTP/1.1 200 OK
Date: Thu, 09 Feb 2012 15:31:13 GMT
Server: Apache
X-Cookie-Set: 0
Set-Cookie: ____GSW=static; expires=Sat, 10-Mar-2012 15:31:13 GMT; path=/; domain=.lifehacker.com
Set-Cookie: form_token=142cb0de573f4ac5e1835d40039c6cbb; expires=Tue, 02-Oct-2096 07:06:40 GMT; path=/; domain=.lifehacker.com
P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"
GawkerApplicationHost: Ganja
GawkerHost: GM33 - Request took D=21722 at t=1328801473148303 on site lifehacker.com (live)
GawkerApplication: ganja
Content-Type: text/html; charset=utf-8;
Accept-Ranges: bytes
Cache-Control: private, max-age=30
Age: 0
Expires: Thu, 09 Feb 2012 15:31:43 GMT
x-cdn: Served by WebAcceleration
x-cdn-ver: 2011.11.17.01
Transfer-Encoding: chunked
Connection: Keep-Alive

Restlet throws this exception : 

INFO: Error while handling an HTTP client call
java.lang.IllegalArgumentException: The Content Type could not be read.
at org.restlet.engine.http.header.ContentType.(ContentType.java:106)
at org.restlet.engine.http.header.HeaderUtils.extractEntityHeaders(HeaderUtils.java:664)
at org.restlet.engine.http.ClientCall.getResponseEntity(ClientCall.java:204)
at org.restlet.engine.http.adapter.ClientAdapter.updateResponse(ClientAdapter.java:207)
at org.restlet.engine.http.adapter.ClientAdapter.commit(ClientAdapter.java:117)
at org.restlet.engine.http.HttpClientHelper.handle(HttpClientHelper.java:110)
at org.restlet.Client.handle(Client.java:177)
at org.restlet.Client.handle(Client.java:168)
at com.steambeat.domain.subject.webpage.CanonicalUriFinder.doFollow(CanonicalUriFinder.java:29)
at com.steambeat.domain.subject.webpage.CanonicalUriFinder.followRedirection(CanonicalUriFinder.java:16)
at com.steambeat.domain.subject.webpage.CanonicalUriFinder.find(CanonicalUriFinder.java:10)
at com.steambeat.domain.subject.webpage.Association.update(Association.java:39)
at com.steambeat.domain.subject.webpage.Association.(Association.java:15)
at com.steambeat.application.AssociationService.lookUp(AssociationService.java:20)
at com.steambeat.application.WebPageService.lookUpWebPage(WebPageService.java:16)
at com.steambeat.web.resources.WebPageResource.doInit(WebPageResource.java:24)
at org.restlet.resource.UniformResource.init(UniformResource.java:576)
at org.restlet.resource.Finder.handle(Finder.java:507)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Router.doHandle(Router.java:497)
at org.restlet.routing.Router.handle(Router.java:737)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Router.doHandle(Router.java:497)
at org.restlet.routing.Router.handle(Router.java:737)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:72)
at org.restlet.Application.handle(Application.java:388)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Router.doHandle(Router.java:497)
at org.restlet.routing.Router.handle(Router.java:737)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.routing.Router.doHandle(Router.java:497)
at org.restlet.routing.Router.handle(Router.java:737)
at org.restlet.routing.Filter.doHandle(Filter.java:156)
at org.restlet.routing.Filter.handle(Filter.java:203)
at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111)
at org.restlet.Component.handle(Component.java:388)
at org.restlet.Server.handle(Server.java:488)
at org.restlet.engine.ServerHelper.handle(ServerHelper.java:71)
at org.restlet.engine.http.HttpServerHelper.handle(HttpServerHelper.java:150)
at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1028)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.io.IOException: Empty parameter name detected.
at org.restlet.engine.http.header.ContentTypeReader.readValue(ContentTypeReader.java:158)
at org.restlet.engine.http.header.ContentType.(ContentType.java:99)
... 68 more

Looking at ContentTypeReader, I found the origine : https://gist.github.com/1780774

Varargs compile error for Buffer.process

I am trying to compile restlet using OpenJDK-7 and it fails to differentiate between Buffer.process(BufferProcessor, int, Object... args) and Buffer.process(BufferProcessor, Object... args) when trying to compile NbChannelInputStream

It may be due to the fact that the int can be autoboxed to Integer and would then match both methods. I am not an expert on varargs, but there may be a difference in interpretation between OpenJDK and other JDKs.

The maven error is:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project org.restlet: Compilation failure
[ERROR] /home/peter/gitrepos/restlet-framework-java/modules/org.restlet/src/org/restlet/engine/io/NbChannelInputStream.java:[305,26] error: reference to process is ambiguous, both method process(BufferProcessor,int,Object...) in Buffer and method process(BufferProcessor,Object...) in Buffer match

The ant error is:

[javac] /home/peter/gitrepos/restlet-framework-java/build/temp/jse/modules/org.restlet/src/org/restlet/engine/io/NbChannelInputStream.java:305: error: reference to process is ambiguous, both method process(BufferProcessor,int,Object...) in Buffer and method process(BufferProcessor,Object...) in Buffer match
[javac]         return getBuffer().process(this, length, targetArray, offset);

$ java -version
java version "1.7.0_147-icedtea"
OpenJDK Runtime Environment (IcedTea7 2.0) (7~b147-2.0-0ubuntu0.11.10.1)
OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)

$ mvn -version
Apache Maven 3.0.3 (r1075438; 2011-03-01 03:31:09+1000)
Maven home: /usr/local/apache-maven
Java version: 1.7.0_147-icedtea, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-openjdk-amd64/jre
Default locale: en_AU, platform encoding: UTF-8
OS name: "linux", version: "3.0.0-16-generic", arch: "amd64", family: "unix"

$ ant -version
Apache Ant(TM) version 1.8.2 compiled on August 19 2011

migrate build system to maven

Jerome, hi;

I know you answered this before ("too many editions, maven did not work on the first try in the past"), but this is is a recurring issue for me, so here you have it again :-)

My user story is like this:

I build for osgi embedded environments, like felix (not equinox/eclipse, like Brian does);

I use strictly maven driven builds on jenkins with eclipse
interactive development support via m2e connectors;

I use "major" osgi maven plugins, such as
http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
http://karaf.apache.org/manual/2.2.5/developers-guide/features-maven-plugin.html
http://eclipse.org/m2e/
http://eclipse.org/tycho/

yes, there is a world of difference between manifest-first and pom.xml-first approaches;
but it does not meant they are not compatible; there are ways to make it work together (tycho);

the kind of hackery you do with pom.xml generation for your restlet builds makes me think you never use restlet in osgi/maven (non eclipse) builds so you do not even see the weird things I have to deal with when including restlet artifacts as dependencies in my projects :-)

bottom line is: both your manifest.mf and pom.xml bundle import/dependency definitions are useless for me; the best work around I found so far for inclusion of restlet and its extensions in my builds is to create custom osgi bundle projects which embed restlet, extensions, dependencies - with heavy duty import/export exclusion, version override, etc; pretty much the way spring http://ebr.springsource.com/repository/app/ does only worse :-)

I wish you would have time to re-try maven-centric build again, and add your much needed multi-edition builds as customization / maven plugins for restlet on top of that;

thank you;

Andrei.

ClientResource.wrap() in osgi

Jerome, hi;

  1. as Pierre reported here:
    http://restlet-discuss.1400322.n2.nabble.com/Problem-with-wrap-td6290637.html

  2. ClientResource.wrap() in osgi does not work when crossing the bundle boundary:

https://github.com/restlet/restlet-framework-java/blob/master/modules/org.restlet/src/org/restlet/resource/ClientResource.java

public T wrap(Class<? extends T> resourceInterface) {
T result = null;

    // Create the client resource proxy
    java.lang.reflect.InvocationHandler h = new org.restlet.engine.resource.ClientInvocationHandler<T>(
            this, resourceInterface);

    // Instantiate our dynamic proxy
    result = (T) java.lang.reflect.Proxy.newProxyInstance(
            org.restlet.engine.Engine.getInstance().getClassLoader(),
            new Class<?>[] { ClientProxy.class, resourceInterface }, h);

    return result;
}

due to Engine.getInstance().getClassLoader() used as default;

  1. the following are workarounds :

a) make change in wrap():
Engine.getInstance().getClassLoader() -> resourceInterface.getClass().getClassLoader()

b) "wrap" the wrap invocation:

Engine engine = Engine.getInstance();
ClassLoader loaderOld = engine.getUserClassLoader();
ClassLoader loaderNew = resourceInterface.getClass().getClassLoader();
try {
engine.setUserClassLoader(loaderNew);
clientResource.wrap(resourceInterface);
}
finally {
engine.setUserClassLoader(loaderOld);
}

  1. I am curious if change should be made in wrap()
    or there is a need for one more wiki page which explains
    restlet class loader best use practices, especially for osgi?

thank you;

Andrei

Broken OSGi Manifest file - depends on a private package

I use the 2.1-SNAPSHOT OSGi edition.

The new manifest file which was modified 661205e#diff-3

makes the Jackson Extension unusable in OSGi environment because the jackson mapper bundle
exports only these packages:
org.codehaus.jackson.map
org.codehaus.jackson.map.annotate
org.codehaus.jackson.map.deser
org.codehaus.jackson.map.deser.impl
org.codehaus.jackson.map.deser.std
org.codehaus.jackson.map.exc
org.codehaus.jackson.map.introspect
org.codehaus.jackson.map.jsontype
org.codehaus.jackson.map.jsontype.impl
org.codehaus.jackson.map.module
org.codehaus.jackson.map.ser
org.codehaus.jackson.map.ser.impl
org.codehaus.jackson.map.ser.std
org.codehaus.jackson.map.type
org.codehaus.jackson.map.util
org.codehaus.jackson.node
org.codehaus.jackson.schema

and the manifest requires the org.codehaus.jackson.map.ext package.

As you can see here this is a private package http://svn.codehaus.org/jackson/trunk/ant/build-osgi.xml

Please also remove this header
Require-Bundle: org.codehaus.jackson

or correct it and require one of these http://mvnrepository.com/artifact/org.codehaus.jackson
for example:
Bundle-SymbolicName: jackson-mapper-asl
Bundle-SymbolicName: jackson-core-asl
or
Bundle-SymbolicName: jackson-mapper-lgpl
Bundle-SymbolicName: jackson-core-lgpl

I rather suggest just to remove it.

See the same issue at http://restlet.tigris.org/issues/show_bug.cgi?id=1380

Consider using Sonar

We should consider using Sonar to keep a watch on code complexity, technical debt, etc. Sonar integrates nicely with Jenkins, JaCoco, FindBugs, etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.