Re: NoSuchMethodException in HTTPClientConnector?

2011-01-24 Thread Alexander Kampmann
I've tried with the simple connector and got the same problem.

On 23.01.2011 21:22, Alexander Kampmann wrote:
 Hello Thierry,

 you are right about that. There was a dependency which should have 
 gone long before in my maven- pom. Thanks, removing it even solved 
 another bug ;)

 I think that solved the problem client side, but another one arises.
 On the serverside, the jetty- extension does not start. The problem is 
 a ClassNotFoundException. I think it is a moved class again. I found 
 it in the jar file, it is just in another package. But there is no 
 newer version of the jetty extension than 2.0-M6 on the public 
 repository. Is there another problem or do I have to wait until the 
 jetty extension gets released?

 Here is the exception:

 java.lang.NoClassDefFoundError: org/restlet/engine/http/HttpServerHelper
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
 at 
 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
 at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
 at 
 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
 at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:314)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
 at org.restlet.engine.Engine.registerHelper(Engine.java:850)
 at org.restlet.engine.Engine.registerHelpers(Engine.java:887)
 at org.restlet.engine.Engine.registerHelpers(Engine.java:927)
 at org.restlet.engine.Engine.discoverConnectors(Engine.java:625)
 at org.restlet.engine.Engine.init(Engine.java:468)
 at org.restlet.engine.Engine.register(Engine.java:346)
 at org.restlet.engine.Engine.register(Engine.java:331)
 at org.restlet.engine.Engine.getInstance(Engine.java:215)
 at org.restlet.Restlet.init(Restlet.java:99)
 at org.restlet.Restlet.init(Restlet.java:77)
 at org.restlet.Component.init(Component.java:177)
 at 
 org.restlet.ext.spring.SpringComponent.init(SpringComponent.java:83)

 Best regards,
 Alex

 On 23.01.2011 19:25, Thierry Boileau wrote:
 Hello Alex,

 the getConnection method has been renamed to 
 getSockectConnectionTimeOutMs by the release number 7068 (3 weeks 
 ago, that is to say after 2.1 M2) :
 Deprecated the Client#connectTimeout property as it is hard to find

  compared to other connector parameters. Also, it isn't available for
  all connectors so it can be confusing to expose it.
  Use the socketConnectTimeoutMs connector parameter instead or

  the maxIoIdleTimeMs parameter for internal NIO connectors.

 I wonder if you are using parts of the framework from several 
 releases which can explain the mix. Can you confirm that?

 Best regards,
 Thierry Boileau

 hi,

 something went very wrong...

 I try to connect to a restlet inside a Wicket application (if you
 don't
 know wicket: it is a web framework based on the Java Servlet
 API). I use
 HttpClientConnector to do so. There is a NoSuchMethodException
 (see below).
 To me, it seems very odd, because Method existance should be
 checked on
 compile time, shouldn't it?
 Are there any tips how to solve it? The problem appears with 2.1-M1,
 2.1-M2 and 2.1-SNAPSHOT of the ClientConnector. The other restlet
 dependencies are 2.1-SNAPSHOT. The application server (with the
 wicket
 application on it) is jetty. Server side the jetty connector is used.

 Here is the error:

 java.lang.NoSuchMethodError:
 org.restlet.ext.httpclient.HttpClientHelper.getConnectTimeout()I
 at
 
 org.restlet.ext.httpclient.HttpClientHelper.configure(HttpClientHelper.java:226)
 at
 
 org.restlet.ext.httpclient.HttpClientHelper.start(HttpClientHelper.java:453)
 at org.restlet.Client.start(Client.java:246)
 at org.restlet.Restlet.handle(Restlet.java:225

Re: NoSuchMethodException in HTTPClientConnector?

2011-01-23 Thread Alexander Kampmann
Hello Thierry,

you are right about that. There was a dependency which should have gone 
long before in my maven- pom. Thanks, removing it even solved another 
bug ;)

I think that solved the problem client side, but another one arises.
On the serverside, the jetty- extension does not start. The problem is a 
ClassNotFoundException. I think it is a moved class again. I found it in 
the jar file, it is just in another package. But there is no newer 
version of the jetty extension than 2.0-M6 on the public repository. Is 
there another problem or do I have to wait until the jetty extension 
gets released?

Here is the exception:

java.lang.NoClassDefFoundError: org/restlet/engine/http/HttpServerHelper
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
 at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
 at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
 at 
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
 at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:314)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
 at org.restlet.engine.Engine.registerHelper(Engine.java:850)
 at org.restlet.engine.Engine.registerHelpers(Engine.java:887)
 at org.restlet.engine.Engine.registerHelpers(Engine.java:927)
 at org.restlet.engine.Engine.discoverConnectors(Engine.java:625)
 at org.restlet.engine.Engine.init(Engine.java:468)
 at org.restlet.engine.Engine.register(Engine.java:346)
 at org.restlet.engine.Engine.register(Engine.java:331)
 at org.restlet.engine.Engine.getInstance(Engine.java:215)
 at org.restlet.Restlet.init(Restlet.java:99)
 at org.restlet.Restlet.init(Restlet.java:77)
 at org.restlet.Component.init(Component.java:177)
 at 
org.restlet.ext.spring.SpringComponent.init(SpringComponent.java:83)

Best regards,
Alex

On 23.01.2011 19:25, Thierry Boileau wrote:
 Hello Alex,

 the getConnection method has been renamed to 
 getSockectConnectionTimeOutMs by the release number 7068 (3 weeks 
 ago, that is to say after 2.1 M2) :
 Deprecated the Client#connectTimeout property as it is hard to find

  compared to other connector parameters. Also, it isn't available for
  all connectors so it can be confusing to expose it.
  Use the socketConnectTimeoutMs connector parameter instead or

  the maxIoIdleTimeMs parameter for internal NIO connectors.

 I wonder if you are using parts of the framework from several releases 
 which can explain the mix. Can you confirm that?

 Best regards,
 Thierry Boileau

 hi,

 something went very wrong...

 I try to connect to a restlet inside a Wicket application (if you
 don't
 know wicket: it is a web framework based on the Java Servlet API).
 I use
 HttpClientConnector to do so. There is a NoSuchMethodException
 (see below).
 To me, it seems very odd, because Method existance should be
 checked on
 compile time, shouldn't it?
 Are there any tips how to solve it? The problem appears with 2.1-M1,
 2.1-M2 and 2.1-SNAPSHOT of the ClientConnector. The other restlet
 dependencies are 2.1-SNAPSHOT. The application server (with the wicket
 application on it) is jetty. Server side the jetty connector is used.

 Here is the error:

 java.lang.NoSuchMethodError:
 org.restlet.ext.httpclient.HttpClientHelper.getConnectTimeout()I
 at
 
 org.restlet.ext.httpclient.HttpClientHelper.configure(HttpClientHelper.java:226)
 at
 
 org.restlet.ext.httpclient.HttpClientHelper.start(HttpClientHelper.java:453)
 at org.restlet.Client.start(Client.java:246)
 at org.restlet.Restlet.handle(Restlet.java:225)
 at org.restlet.Client.handle(Client.java:176)
 at
 org.restlet.resource.ClientResource.handle(ClientResource.java:941)

Re: POST Requests return with a 405 with @Post annotated method

2010-10-21 Thread Alexander Kampmann
hi Thierry,

my thought was, that ANT is capable in building things out of templates, 
so I can choose which edition to build in that properties file. As far 
as I know, there is no such mechanism in maven. Every maven project will 
have exactly one groupId, there is no (easy) way to persuade maven to 
build several editions from more or less the same code.

Of course it is possible to set maven dependencies to different editions.

But back to our original topic:

I found out, that everything works well, when I use @Post- Annotation 
instead of @Post(json). Of course I have to change the method's return 
type to String if I do so. When I use the JsonConverter, the problem 
(Method not allowed) came up.

During my tests I got the feeling, that inheritance (so if the annotated 
method is in a parent class of the actual restlet) didn't work well, but 
I can not validate that feeling.

Greetings,
Alex

On 21.10.2010 16:21, Thierry Boileau wrote:
 Hi Alexander,

 I have a look at these errors right now.


 All in all I got the feeling, maven didn't supporteditions,
  
 hum, each editions has its own group id: org.restlet.edition, 
 whereedition  can have one of the following values =  jse, jee, gae, 
 android, gwt.


 so building with maven it won't be supported anylonger (due to the fact 
 that it is useless without
 editions). Is that correct?
  
 it should work. I have a look at this.

 Best regards,
 Thierry Boileau

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



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


Re: POST Requests return with a 405 with @Post annotated method

2010-10-19 Thread Alexander Kampmann
Same problem, using SpringServer...

I would like to fix that bug by myself, but I still cannot compile restlet.
Ant build just gets stuck somewhere in the Tests (last message is 
Running org.restlet.test.RestletTestSuite), while maven obvirously 
cannot load all dependencies (netty and db4o seems to be problematic).

All in all I got the feeling, maven didn't support editions, so building 
with maven it won't be supported any longer (due to the fact that it is 
useless without editions). Is that correct?

Greetings,
Alex

On 18.10.2010 19:39, webp...@tigris.org wrote:
 I get this problem with 2.0.1 and 2.1 fetched today (18 Oct 2010) (Java SE 
 versions) using the internal server.

 The example FirstResource application fails.
 Problem also occurs with PUT.

 2.0.RC4 works (well, that bit did)

 Peter Furniss

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



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


Re: POST Requests return with a 405 with @Post annotated method

2010-10-18 Thread Alexander Kampmann
Same error with 2.1...

On 17.10.2010 16:32, Alexander Kampmann wrote:
 I would like to try an own build, but neither ant nor maven work for me.

 On 17.10.2010 14:56, Alexander Kampmann wrote:

 hello,

 I am using the restlet- jars from the maven.restlet.org- Repository (so,
 the public ones). That means, they are refreshed on the 1st and the 15th
 of each month.
 Due to that, Thierry's changes should be in there by now (he reported
 them on 22th of September).

 My Version is JEE Restlet 2.0.1. But in fact I get exactly the error
 Dustin reported about. When I try to POST to my resource, the server
 says 405 - Method not allowed, but the header says Allows: GET,
 POST. The @Post- Annotation is present.

 Maybe the change didn't make it to the maven- repository by now?
 Or is there any possibility things went wrong for other reasons? (I've
 got quite a large Inheritance- Hierarchy, in fact the annotation is in
 an interface and the Restlet- class is inherited from a class, which
 implements the interface and ServerResource, could that be a problem?)

 The environment is a RestletApplication packed as war and deployed to
 Tomcat 6.0.29 as it was for Dustin. All the other resources (using get)
 including the get- Method of that resource work fine.

 Greetings,
 Alex

 On 23.09.2010 01:07, Dustin N. Jenkins wrote:

  
 Lovely, thanks Thierry!

 DNJ


 On 09/22/2010 10:20 AM, Thierry Boileau wrote:



 Hello Dustin,

 thanks for your report. I've fixed this bug in the svn repository (trunk 
 and 2.0 branch).

 Best regards,
 Thierry Boileau

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


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

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



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


Re: POST Requests return with a 405 with @Post annotated method

2010-10-17 Thread Alexander Kampmann
hello,

I am using the restlet- jars from the maven.restlet.org- Repository (so, 
the public ones). That means, they are refreshed on the 1st and the 15th 
of each month.
Due to that, Thierry's changes should be in there by now (he reported 
them on 22th of September).

My Version is JEE Restlet 2.0.1. But in fact I get exactly the error 
Dustin reported about. When I try to POST to my resource, the server 
says 405 - Method not allowed, but the header says Allows: GET,  
POST. The @Post- Annotation is present.

Maybe the change didn't make it to the maven- repository by now?
Or is there any possibility things went wrong for other reasons? (I've 
got quite a large Inheritance- Hierarchy, in fact the annotation is in 
an interface and the Restlet- class is inherited from a class, which 
implements the interface and ServerResource, could that be a problem?)

The environment is a RestletApplication packed as war and deployed to 
Tomcat 6.0.29 as it was for Dustin. All the other resources (using get) 
including the get- Method of that resource work fine.

Greetings,
Alex

On 23.09.2010 01:07, Dustin N. Jenkins wrote:
 Lovely, thanks Thierry!

 DNJ


 On 09/22/2010 10:20 AM, Thierry Boileau wrote:

 Hello Dustin,

 thanks for your report. I've fixed this bug in the svn repository (trunk and 
 2.0 branch).

 Best regards,
 Thierry Boileau

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


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


Re: POST Requests return with a 405 with @Post annotated method

2010-10-17 Thread Alexander Kampmann
I would like to try an own build, but neither ant nor maven work for me.

On 17.10.2010 14:56, Alexander Kampmann wrote:
 hello,

 I am using the restlet- jars from the maven.restlet.org- Repository (so,
 the public ones). That means, they are refreshed on the 1st and the 15th
 of each month.
 Due to that, Thierry's changes should be in there by now (he reported
 them on 22th of September).

 My Version is JEE Restlet 2.0.1. But in fact I get exactly the error
 Dustin reported about. When I try to POST to my resource, the server
 says 405 - Method not allowed, but the header says Allows: GET,
 POST. The @Post- Annotation is present.

 Maybe the change didn't make it to the maven- repository by now?
 Or is there any possibility things went wrong for other reasons? (I've
 got quite a large Inheritance- Hierarchy, in fact the annotation is in
 an interface and the Restlet- class is inherited from a class, which
 implements the interface and ServerResource, could that be a problem?)

 The environment is a RestletApplication packed as war and deployed to
 Tomcat 6.0.29 as it was for Dustin. All the other resources (using get)
 including the get- Method of that resource work fine.

 Greetings,
 Alex

 On 23.09.2010 01:07, Dustin N. Jenkins wrote:

 Lovely, thanks Thierry!

 DNJ


 On 09/22/2010 10:20 AM, Thierry Boileau wrote:

  
 Hello Dustin,

 thanks for your report. I've fixed this bug in the svn repository (trunk 
 and 2.0 branch).

 Best regards,
 Thierry Boileau

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


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


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


Re: Use of ClientResource inside a server resource

2010-09-13 Thread Alexander Kampmann
hi,

does that configuration in web.xml even work, if FrameworkServlet is 
used instead of RestletServlet? I am using tomcat+spring on the Server- 
side and got problems which, in my eyes, are related to a missing 
protocol on server side.

Btw: 1) Why isn't HTTP/1.1 added by default when using a Servlet to 
deploy Restlets in a servlet container? I think most users will need it, 
otherwise they wouldn't use a servlet container.
2) And why is it possible to call the Restlet from a Servlet in the same 
container, but not from outside (a ServerResource in a standalone 
Restlet Application on the same machine)? I've even added a Hello- 
World- Restlet and was able to reach it with my browser?

Thanks,
Alex

On 25.08.2010 14:46, Bruno Harbulot wrote:
 Hi Xavier,

 In addition, if you're running the application within a servlet
 environment, you can configure the clients by adding this in the web.xml
 file:

   context-param
   param-nameorg.restlet.clients/param-name
   param-valueHTTP HTTPS CLAP FILE/param-value
   /context-param

 (Adapt the param-value as you need, it's a space-separated list of
 protocols.)


 Best wishes,

 Bruno.

 On 25/08/10 12:13, Xavier Méhaut wrote:

 Hi Fabian,
 We succeeded actually  ; we've only forgottent to write
 getClients().addProtocol(Protocol.HTTP) on the server side ...
 thanks
 regards
 Xavier

 2010/8/25 Fabian Mandelbaumfmandelb...@gmail.com
 mailto:fmandelb...@gmail.com

  Hello Xavier,

  yes, you can, there shouldn't be any problems with this, at least AFAIK.

  On Tue, Aug 24, 2010 at 6:09 AM, Xavier M.xavier.meh...@gmail.com
  mailto:xavier.meh...@gmail.com  wrote:
 Hello,
 I would like to know if we can use a ClientResource call inside a
  server
 resource, and if not, how to do this properly?
 regards
 Xavier
   



  --
  Fabián Mandelbaum
  IS Engineer

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


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



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


Re: Send parameter in @Get method from Android to GAE

2010-08-13 Thread Alexander Kampmann
hi,

consider usage of either a parameter as part of the URI. This may look 
like that

http://myserver.appspot.com/contacts/{contactId}

with {contactId} replaced by the id of the asked Contact.

Another possibility is working with query strings like that:

http://myserver.appspot.com/contacts?contactId=123

for contact with id 123.

Both is explained in the routing- part of the documentation. You may 
find it here 
http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/326-restlet.html

Best regards,
Alex

On 11.08.2010 11:21, Alon wrote:
 Hi,

 I am a new in using restlet framework. I followed this great tutorial to
 make client(Android)-server(GAE) application
 (http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html).
 Everything is working fine. But i would like to add small enhancement in my
 application. To have ability to send parameter in GET method. Please see
 below a code that i have


 public interface ContactResource {
  @Get
  public Contact retrieve(String contactID);
 }

 GAE***

 public class ContactServerResource extends ServerResource implements
 ContactResource {
  @Get
  public Contact retrieve(String contactID) {
  return (Contact)db.GqlQuery(SELECT * FROM MyModel WHERE CONTACTID
 ==  + contactID)
  }
 }



  public Restlet createInboundRoot() {
  Router router = new Router(getContext());
  getConnectorService().getClientProtocols().add(Protocol.FILE);

  // Serve the files generated by the GWT compilation step.
  Directory dir = new Directory(getContext(),
 LocalReference.createFileReference(new File(war/)));
  router.attachDefault(dir);
  router.attach(/contacts, ContactServerResource.class);

  return router;

 Android***

 ClientResource cr = new
 ClientResource(http://myserver.appspot.com/contacts;);
 ContactResource resource = cr.wrap(ContactResource.class);
 Contact contact = resource.retrieve(1234567);

 Everything is running without errors, the problem is that contactID has been
 receiving null(empty) in GAE. I didn’t find any suitable examples for @Get
 method which retrieve parameters.
 Is there anyway to send contactID? Did i miss something in my
 implementation,configuration?

 Thanks


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


Problem using Base64

2010-08-13 Thread Alexander Kampmann
hi,

to use Java's Decryption and Encryption functions, I need a way to de- 
and encode Strings using Base64. It's a restlet- based project, so I 
think it is okay to use restlet's Base64- class (there is one in SUN- 
JDK itself, but it is in an internal sun- package, so it will not exists 
in other JDK- implementations as OpenJDK e.g. ).

I just do:

byte[] bytes=Base64.decode(secret);

with secret as a String. It works all fine, but when I moved from 
Windows Vista to Linux Ubuntu, there was an ArrayIndexOutOfBoundsException:

java.lang.ArrayIndexOutOfBoundsException: 11
 at org.restlet.engine.util.Base64.decode(Base64.java:115)
 at org.restlet.engine.util.Base64.decode(Base64.java:163)
 at com.chancenwerk.util.CryptHelper.decrypt(CryptHelper.java:37)
 ... 37 more

That line 37 in CryptHelper is just:

byte[] bytes=Base64.decode(secret);

Are there any ideas what's going wrong here?

Thanks,
Alex

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


Re: concept of REST and HTTP itself

2010-08-13 Thread Alexander Kampmann
REST just means, that you use common technics/protocolls such as HTML to 
access your or someone else data.
That's wise, cause there are a lot of implementations of that 
protocolls, so it is easy to access your data from any plattform (there 
are restlet- implementations for Android, JEE, JSE ...) and any 
programming language (you may use any html- connector- library to access 
your resources from C++, python, javaScript, erlang, scala, php, ...).

One could say: REST is just a name for what we already are doing using 
HTTP.

regards,
Alex

On 13.08.2010 07:47, sic wrote:
 I hope to understand not the restlet but the concept of REST itself, sorry
 for that.

 What's the meaning of the REST compared with HTTP using commonly all around
 the world?

 Easily, we can already access any data via HTTP web browser and get data
 from them.

 through the HTTP protocol, it is already possible to take some resources
 from somewhere, which is the new main architecture of REST, so irony.

 Even though I try to read some documents and toturial related to the REST
 and consider them deeply, It's so hard for me to find out the meaning of the
 REST.

 Can anyone give me some advice for that whatever you know?

 regards,
 sic


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


Re: How to inject a Spring bean service into a Restlet component

2010-07-24 Thread Alexander Kampmann
hi, 

The Servlet is quite right. For me, it works like that: 

web.xml: 

Register a spring- listener: 

listener
listener-class
 org.springframework.web.context.ContextLoaderListener
/listener-class
/listener

Don't forget about the config file: 

context-param
param-namecontextConfigLocation/param-name
param-value
  classpath:spring-beans.xml
/param-value
/context-param

Register the FrameworkServlet and map it to your path: 

servlet
servlet-namerestlet/servlet-name

servlet-classorg.restlet.ext.spring.RestletFrameworkServlet/servlet-class
load-on-startup1/load-on-startup
 /servlet

servlet-mapping
servlet-namerestlet/servlet-name
url-pattern/restlet/*/url-pattern
 /servlet-mapping


Than, you need an spring- config file which is named  
{servletname}-servlet.xml, so, in that case. restlet-servlet.xml. It looks like 
that: 

?xml version=1.0 encoding=UTF-8?
beans 
xmlns=http://www.springframework.org/schema/beans;
xmlns:cxf=http://cxf.apache.org/core;
xmlns:jaxws=http://cxf.apache.org/jaxws;
xmlns:test=http://apache.org/hello_world_soap_http;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=
http://cxf.apache.org/core
http://cxf.apache.org/schemas/core.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://cxf.apache.org/jaxws 
http://cxf.apache.org/schemas/jaxws.xsd;
 
!-- that beans name is important, it must be root --
 bean id=root class=org.restlet.ext.spring.SpringRouter
property name=attachments
map
entry key=/restlet1
bean 
class=org.restlet.ext.spring.SpringFinder
lookup-method name=create
bean=restlet1 /
/bean
/entry
entry key=/test
bean 
class=org.restlet.ext.spring.SpringFinder
lookup-method name=create
bean=restlet2 /
/bean
/entry
/map
/property
/bean
 
 bean name=restlet1 class=ServerResourceClassName
 /bean
 
 bean name=restlet2 class=ServerResourceClassName
 /bean

I hope that'll do, 

Alex

 Original-Nachricht 
 Datum: Tue, 20 Jul 2010 10:05:17 -0600
 Von: Larry Meadors larry.mead...@gmail.com
 An: discuss@restlet.tigris.org
 Betreff: Re: How to inject a Spring bean service into a Restlet component

 Not Spring...but I used a Finder to inject mine with Guice - it only
 required extending Finder and overriding one method:
 
   public GuiceFinder(Context context, Class? targetClass) {
   super(context, targetClass);
   }
 
   @Override
   public ServerResource create(Class? extends ServerResource
 targetClass, Request request, Response response) {
   return InjectorFactory.getInjector().getInstance(targetClass);
   }
 
 Larry
 
 
 On Tue, Jul 20, 2010 at 9:58 AM, Richard Brewster
 richard.brews...@willowtreeapps.com wrote:
  I really need help getting this to work.  The examples I've found refer
 to a
  restlet Resource, which is deprecated.  For example:
 
 
 http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/70-restlet/196-restlet.html
 
  I think I need to use RestletFrameworkServlet.  But I have not found a
 good
  example.
 
  --
  View this message in context:
 http://restlet-discuss.1400322.n2.nabble.com/How-to-inject-a-Spring-bean-service-into-a-Restlet-component-tp5314211p5317233.html
  Sent from the Restlet Discuss mailing list archive at Nabble.com.
 
  --
 
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2635832
 
 
 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2635842

-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl

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


Re: OpenOffice extension crashes

2010-07-14 Thread Alexander Kampmann
hi david, 

I'm sorry, but you didn't give enough information. Is there any Exception 
(maybe in a log- file)? Or an error code? Any error message? Try starting 
OpenOffice from the command line, does any exception appears there? 

Do you use restlet to connect to an existing Restful Web Service from any third 
party? Or is both, client (as far as I get it, your OpenOffice- extension is 
the client) and server application your work? 

Maybe some of the others owns a magic crystal ball and uses it to get these 
information, but I don't...

Greetings, 
Alex

PS: Consider OpenOffice documentation + change logs. Is there any change in the 
extension Api between version 3.0 and 3.2? If it is not an interface (so API) 
change, it may be something like e.g. class loading, sandboxing...

 Original-Nachricht 
 Datum: Tue, 13 Jul 2010 08:08:31 -0700 (PDT)
 Von: webp...@tigris.org
 An: discuss@restlet.tigris.org
 Betreff: OpenOffice extension crashes

 I've written an OpenOffice extension for Windows using the RESTful web
 framework. It all worked fine with OpenOffice 3.0 and StarOffice 9. Since
 OpenOffice Version 3.2 and Oracle Open Office 3.2.1 the swriter.exe crashes,
 when I launch my extension.
 
 It's a very simple extension that gets some address information from a
 rest webservice. I just use the archives org.restlet.jar 
 com.noelios.restlet.jar.
 
 Has anyone an idea?
 
 thanks in advance
 david
 
 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2632820

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

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


Re: DirectoryServerResource and directoryRedirection

2010-06-25 Thread Alexander Kampmann
hi, 

look at the way routing works: 
http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/326-restlet.html. 
You may either change your matching mode to MODE_START_WITH or use one of the 
tricks from the routing and queries- section. 

Alex

 Original-Nachricht 
 Datum: Wed, 23 Jun 2010 12:05:35 -0700
 Von: William Pietri will...@scissor.com
 An: discuss@restlet.tigris.org
 Betreff: DirectoryServerResource and directoryRedirection

 Hi! I'm just getting into the 2.0 release while building a Facebook app 
 and am puzzled by something.
 
 Right now I have some content, served up by a Directory, at a location 
 like this:
 
  http://example.com/welcome/
 
 
 Outside of the Facebook context, this is fine. However, the way I'm 
 doing the Facebook app, my pages appear inside an iframe on Facebook's 
 page. To pass along context information, they add a bunch of parameters 
 to the URL, so it looks something this:
 
  
 http://example.com/welcome/?fb_sig_in_iframe=1fb_sig_iframe_key=...fb_sig=fe82...ec467a9e
 
 
 The DirectoryServerResource decides that since that doesn't end in a 
 slash, it couldn't possibly be a directory, and so throws a slash on the 
 end and issues a 303. That seems weird to me, but I'm not sure if this 
 is just an odd use case not yet supported, or if there's something 
 irredeemably wrong about the Facebook approach. Or, most likely, that 
 I'm not using Restlet in the right way, and that I should be approaching 
 things differently.
 
 Any thoughts on how I should handle this?
 
 William
 
 --
 http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2625164

-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl

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