restlet / restlet-framework-java Goto Github PK
View Code? Open in Web Editor NEWThe first REST API framework for Java
Home Page: https://restlet.talend.com
The first REST API framework for Java
Home Page: https://restlet.talend.com
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.
two kind of tasks:
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=223
probably should add .gitignore
.cache
.project
.classpath
.settings/
bin/
target/
release.properties
pom.xml.releaseBackup
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=127
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.
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=203
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)
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=148
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=228
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=6
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=122
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=126
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=17
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=8
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=174
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=175
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.
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=170
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=224
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
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=142
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=221
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=165
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=106
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=134
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=230
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=104
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
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=167
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.
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=176
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=7
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=196
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=197
Jerome, hi;
as Pierre reported here:
http://restlet-discuss.1400322.n2.nabble.com/Problem-with-wrap-td6290637.html
ClientResource.wrap() in osgi does not work when crossing the bundle boundary:
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;
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);
}
thank you;
Andrei
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=42
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=207
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=194
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=71
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=231
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=168
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=58
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=22
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=198
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=193
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
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=133
We should consider using Sonar to keep a watch on code complexity, technical debt, etc. Sonar integrates nicely with Jenkins, JaCoco, FindBugs, etc.
Freemarker released a new version yesterday which has some urgent fixes, depending on the setup. From the description it is not inconceivable that the freemarker plugin could be used in one of those ways, although not directly. The extensions ContextTemplateLoader may also be vulnerable.
Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=83
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.