RE: Serialization example: NoSuchMethodError on Router.attach

2010-12-08 Thread webpost
Guido,

thanks for the advice. However ...

Even when I set the property as a VM argument using :-

-Dorg.restlet.engine.io.bufferSize="102400"

BEFORE the Restlet Application is launched, BEFORE it's constructor is called, 
and BEFORE the Restlet engine is started, for my ServerResource, the buffer 
size appears to be unaltered.

I used a separate test class to call the initialse method of my Restlet 
Application (see code below). This test class is launched with the -D argument 
shown above.

>From the code below, the initialise method outputs this (note: the property is 
>set but IoUtils STILL reports 8192 for the buffer size) :-

org.restlet.engine.io.bufferSize = 102400
IoUtils.getBufferSize() = 8192

... and the java.nio.BufferOverflowException still occurs :-( How frustrating 
is this !

Any ideas ?

Kind Regards

Fraser.

Example code :-

public class MbHttpMockAFComBufApplication  extends Application  {

  public MbHttpMockAFComBufApplication() {

  logger.debug("Hi from MbHttpMockAFComBufApplication constructor");

  setAuthor("Fraser Goffin");
}

  public static void initialise(int Port) throws Exception {

  logger.debug("Hi from initialise()"); 
  System.out.println("org.restlet.engine.io.bufferSize = " + 
System.getProperty("org.restlet.engine.io.bufferSize"));
  System.out.println("IoUtils.getBufferSize() = " + IoUtils.getBufferSize());
...
 // create Server etc ...
}

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688291


Re: interesting problem with @Get content negotiation

2010-12-08 Thread Thierry Boileau
Hello Bryan,

this is a known bug of the internal connectors. The current implementation
(InboundWay#createEntity in the trunk) does not have enough information to
decide the right Representation to generate. Mainly, when a client send a
"connection: close" header without a "content-length" or without a
Transfer-encoding: chunked" header, it is hard to figure out if the
representation is available or not. In some cases it is easy, for example
GET requests. We can introduce a new property on the Method class, or try to
read a character which may block the server.
I've entered an issue for this bug as I don't see an existing one that
corresponds : http://restlet.tigris.org/issues/show_bug.cgi?id=1218

Best regards,
Thierry  Boileau


I have the following server resource:
>
> public class HelloResource extends ServerResource
> {
> @Get("txt")
> public String sayHello()
> {
> return "Hello";
> }
>
> @Get("html")
> public String getDocument()
> {
> StringBuilder html = new StringBuilder();
> html.append("\n");
> html.append("  \n");
> html.append("Hello\n");
> html.append("   \n");
> html.append("\n");
> return html.toString();
> }
> }
>
> If I issue a get using curl and set the Accept header, everything works
> just fine.  I can get either the string Hello, or the html depending on the
> Accept header.  If I use the HTTP GUI client for OS X (
> http://ditchnet.org/httpclient/), I only get the Hello string even when
> the Accept header is set to text/html.  I debugged the code and found the
> problem in AnnotationInfo line 506 (Restlet 2.0.3).  When I use curl,
> requestEntity.isAvailable() returns false and when I use the HTTP GUI
> client, requestEntity.isAvailable() returns true.  When
> requestEntity.isAvailable() returns true, getRequestVariants() returns an
> empty list which causes isCompatibleRequestEntity() to return false.
>
> Would you consider this a Restlet bug, or a bug in the HTTP GUI I'm using?
>
> Bryan
>

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688917

RE: gae edition deploy error

2010-12-08 Thread Thierry Boileau
Hello Bryan,

thanks for your mail, I have to update the sample code.
The fix for this bug is available in the current snapshot of the trunk (release 
2.1).
I will try to apply this fix in the 2.0 repository, but I'm not very confident. 
see http://restlet.tigris.org/issues/show_bug.cgi?id=1217

Best regards,
Thierry Boileau

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688902


Re: 2.0 series snapshots

2010-12-08 Thread Rhett Sutphin
Hi Theirry,

On Dec 8, 2010, at 1:30 PM, Thierry Boileau wrote:

> Hello Rhett,
> 
> there are actually the same, the last dated is a copy of the snapshot.
> We firstly published only the "-SNAPSHOT" artifacts. Then, some asked for the 
> dated ones for reasons that I don't clearly remember for now. Thus, we 
> decided to published both of them.
> Does it sound irregular?

No, not irregular.  I probably misunderstood your original message -- I thought 
you were saying that only the -SNAPSHOT ones were being updated, not the dated 
ones.  It seems to me that neither of them are -- the last dated snapshot is 
from November 7 and the -SNAPSHOT is identical to it.

I think the idea of the dated snapshots is to have reproducible builds, even if 
you aren't depending on an official release.

Rhett

> 
> Best regards,
> Thierry Boileau
> ps : the date corresponds to the last modification of the svn repository.
> 
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688858

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688861


RE: Re: 2.0 series snapshots

2010-12-08 Thread Thierry Boileau
Hello Rhett,

there are actually the same, the last dated is a copy of the snapshot.
We firstly published only the "-SNAPSHOT" artifacts. Then, some asked for the 
dated ones for reasons that I don't clearly remember for now. Thus, we decided 
to published both of them.
Does it sound irregular?

Best regards,
Thierry Boileau
ps : the date corresponds to the last modification of the svn repository.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688858


RE: gae edition deploy error

2010-12-08 Thread webpost
thanks for the reply. sorry i posted at the google app engine forum and forgot 
to do it here. 

yes, i compiled it again but i get this. 


compiling module org.restlet.example.gae.serialization.Serialization 
   Validating newly compiled units 
  [ERROR] Errors in 'jar:file:/Users/ytbryan/Documents/workspace/ 
google/gwt-2.1.0/gwt-user.jar!/com/google/gwt/logging/impl/ 
DevModeLoggingFixes.java' 
 [ERROR] Line 58: The method getName() is undefined for the 
type Logger 
 [ERROR] Line 59: The method getName() is undefined for the 
type Logger 
 [ERROR] Line 76: The method setUseParentHandlers(boolean) is 
undefined for the type Logger 
  [ERROR] Errors in 'jar:file:/Users/ytbryan/Documents/workspace/ 
google/gwt-2.1.0/gwt-user.jar!/com/google/gwt/logging/impl/ 
LoggerImplRegular.java' 
 [ERROR] Line 73: The method getLevel() is undefined for the 
type Logger 
 [ERROR] Line 109: The method intValue() is undefined for the 
type Level 
 [ERROR] Line 109: The method intValue() is undefined for the 
type Level 
 [ERROR] Line 131: The method log(Level, String) in the type 
Logger is not applicable for the arguments (LogRecord) 
  [ERROR] Errors in 'jar:file:/Users/ytbryan/Documents/workspace/ 
google/gwt-2.1.0/gwt-user.jar!/com/google/gwt/user/client/rpc/core/ 
java/util/logging/Level_CustomFieldSerializer.java' 
 [ERROR] Line 38: The method parse(String) is undefined for 
the type Level 
  [ERROR] Errors in 'jar:file:/Users/ytbryan/Documents/workspace/ 
google/gwt-2.1.0/gwt-user.jar!/com/google/gwt/user/client/rpc/core/ 
java/util/logging/LogRecord_CustomFieldSerializer.java' 
 [ERROR] Line 50: The method parse(String) is undefined for 
the type Level 
  [ERROR] Errors in 'jar:file:/Users/ytbryan/Documents/workspace/ 
google/gwt-2.1.0/gwt-user.jar!/com/google/gwt/emul/java/util/logging/ 
Handler.java' 
 [ERROR] Line 43: The method intValue() is undefined for the 
type Level 
 [ERROR] Line 43: The method intValue() is undefined for the 
type Level 
  [ERROR] Errors in 'jar:file:/Users/ytbryan/Documents/workspace/ 
google/gwt-2.1.0/gwt-user.jar!/com/google/gwt/emul/java/util/logging/ 
LogManager.java' 
 [ERROR] Line 34: The method setLevel(Level) is undefined for 
the type LogManager.RootLogger 
 [ERROR] Line 57: The method getName() is undefined for the 
type Logger 
 [ERROR] Line 77: The method getName() is undefined for the 
type Logger 
 [ERROR] Line 80: The method getName() is undefined for the 
type Logger 
 [ERROR] Line 81: The method setParent(Logger) is undefined 
for the type Logger 
  [ERROR] Errors in 'file:/Users/ytbryan/Documents/workspace/ 
evogaws/src/org/restlet/example/common/ContactResource.java' 
 [ERROR] Line 3: The import org.restlet.resource cannot be 
resolved 
 [ERROR] Line 4: The import org.restlet.resource cannot be 
resolved 
 [ERROR] Line 5: The import org.restlet.resource cannot be 
resolved 
 [ERROR] Line 12: Get cannot be resolved to a type 
 [ERROR] Line 15: Put cannot be resolved to a type 
 [ERROR] Line 18: Delete cannot be resolved to a type 
   [ERROR] Errors in 'file:/Users/ytbryan/Documents/workspace/evogaws/ 
src/org/restlet/example/gae/serialization/client/Serialization.java' 
  [ERROR]  Internal compiler error 
java.lang.NoSuchMethodError: 
com.google.gwt.user.rebind.rpc.SerializableTypeOracleBuilder.setLogOutputSt 
ream(Ljava/ 
io/OutputStream;)V 
at 
org.restlet.rebind.ClientProxyGenerator.generateSerializers(ClientProxyGene 
rator.java: 
563) 
at 
org.restlet.rebind.ClientProxyGenerator.generateProxy(ClientProxyGenerator. 
java: 
429) 
at 
org.restlet.rebind.ClientProxyGenerator.generate(ClientProxyGenerator.java: 
208) 
at 
com.google.gwt.dev.javac.StandardGeneratorContext.runGenerator(StandardGene 
ratorContext.java: 
427) 
at 
com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java: 
39) 
at com.google.gwt.dev.shell.StandardRebindOracle 
$Rebinder.tryRebind(StandardRebindOracle.java:115) 
at com.google.gwt.dev.shell.StandardRebindOracle 
$Rebinder.rebind(StandardRebindOracle.java:58) 
at 
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.j 
ava: 
161) 
at 
com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.j 
ava: 
150) 
at com.google.gwt.dev.Precompile 
$DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(Precompile.ja va: 
345) 
at 
com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRe 
binds(WebModeCompilerFrontEnd.java: 
106) 
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox 
$CompilerImpl.process(AbstractCompiler.java:254) 
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java: 
444) 
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox 
$Comp

interesting problem with @Get content negotiation

2010-12-08 Thread Bryan Hunt
I have the following server resource:

public class HelloResource extends ServerResource
{
@Get("txt")
public String sayHello()
{
return "Hello";
}

@Get("html")
public String getDocument()
{
StringBuilder html = new StringBuilder();
html.append("\n");
html.append("  \n");
html.append("Hello\n");
html.append("   \n");
html.append("\n");
return html.toString();
}
}

If I issue a get using curl and set the Accept header, everything works just 
fine.  I can get either the string Hello, or the html depending on the Accept 
header.  If I use the HTTP GUI client for OS X 
(http://ditchnet.org/httpclient/), I only get the Hello string even when the 
Accept header is set to text/html.  I debugged the code and found the problem 
in AnnotationInfo line 506 (Restlet 2.0.3).  When I use curl, 
requestEntity.isAvailable() returns false and when I use the HTTP GUI client, 
requestEntity.isAvailable() returns true.  When requestEntity.isAvailable() 
returns true, getRequestVariants() returns an empty list which causes 
isCompatibleRequestEntity() to return false.

Would you consider this a Restlet bug, or a bug in the HTTP GUI I'm using?

Bryan

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688827

Re: 2.0 series snapshots

2010-12-08 Thread Rhett Sutphin
Hi Thierry,

On Dec 8, 2010, at 3:57 AM, Thierry Boileau wrote:

> Hello Rhett,
> 
> the snapshot has been reactivated last week. It contains recent snapshots. 
> Having said that, it misses the artifacts tagged with the date. I check that.

Are you sure they are being published?  It seems like the last dated one is the 
same as the "SNAPSHOT".

$ curl 
http://maven.restlet.org/org/restlet/jee/org.restlet/2.0-SNAPSHOT/org.restlet-2.0-SNAPSHOT.jar.md5
67329eaa98a718dc29aa7c2b79f0a50c
$ curl 
http://maven.restlet.org/org/restlet/jee/org.restlet/2.0-SNAPSHOT/org.restlet-2.0-20101107.204753-7087.jar.md5
67329eaa98a718dc29aa7c2b79f0a50c

Thanks for looking into this.

Rhett

> 
> Best regards,
> Thierry Boileau
> 
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688719

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688817


RE: 2.0 series snapshots

2010-12-08 Thread Thierry Boileau
Hello Rhett,

the snapshot has been reactivated last week. It contains recent snapshots. 
Having said that, it misses the artifacts tagged with the date. I check that.

Best regards,
Thierry Boileau

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688719


RE: gae edition deploy error

2010-12-08 Thread Thierry Boileau
Hello Bryan,

it sounds like the GWT compilation process fails.
What happens if you simply compiles the project? Do you have any other log 
traces?

Best regards,
Thierry Boileau

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688698


RE: Re: PUT requests return 405 code with @Put annotated method using 2.0.1 release

2010-12-08 Thread markcallen
Check your import statements in the ServerResource.  They should be like:

import org.restlet.resource.Put;

I spent some time chasing this one around for a while.

Mark.
-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/PUT-requests-return-405-code-with-Put-annotated-method-using-2-0-1-release-tp5603984p5814511.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2688691