RE: Calling OData FunctionImport

2012-06-19 Thread Giuseppe Porcelli
Hi Rheim,
I am looking for your same question, do you found the answer?

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


RE: Re: ServerResource getRequest() returns null

2012-06-19 Thread Richard Berger
On my resource:
public class UserActsServerResource extends ServerResource implements 
UserActsResource {...

I am able to use:
public final Representation represent() {
...
  User user = UserHelpers.getCurrentUser(this.getRequest(), this.getResponse());

and this.getRequest() returns a useful value.  But I have no idea why this is 
not working for you.  I am using the GAE Edition.  Perhaps the problem is in 
some other location of your code/configuration??

RB

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


RE: Restlet + GAE + OAuth - anyone get this to work?

2012-06-19 Thread Richard Berger
Took a week, but I did get it to work.  For anyone else who runs into this

1. I was following the Ericsson documentation at:
https://labs.ericsson.com/apis/oauth2-framework/documentation#Web_Client_Flow
that got me as far as getting things to work on my local Google-app-engine dev 
server.  But when deploying to appspot and the real GAE world, it failed.
2. Problem seems to be that the in-memory storage of authTokens doesn't work in 
google's cloud - perhaps due to how the processing is distributed (??).
3. The fix was to replace the in-memory storage of authTokens with db storage 
of the tokens (for me that was Objectify and Google's BigTable)
4. This required changing the clientStore code from:
ClientStore clientStore = ClientStoreFactory.getInstance();
clientStore.clientStore(123456789, secret1, yourCallbackURI);
To:
ClientStoreFactory.setClientStoreImpl(MyDBClientStore.class, params);
ClientStoreMyDBTokenGenerator clientStore = 
(ClientStoreMyDBTokenGenerator) ClientStoreFactory.getInstance();

And we need the two new classes referenced above:
MyDBClientStore - only difference here is that we extend 
ClientStoreMyDBTokenGenerator
  public class MyDBClientStore extends ClientStoreMyDBTokenGenerator 

and

MyDBTokenGenerator - this is where the real work is as you have to save the 
AuthToken in the database and that AuthToken consists of a token name and an 
AuthenticatedUser.  I had to change generateToken() (store to db) and 
findToken() (retrieve from db) to get the basics to work.  

And finally, I had to create classes MyAuthToken and MyAuthenticatedUser to 
store this information through Objectify.

Now it works on the local dev server and on appspot.  

RB

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


RE: Restlet + GAE + OAuth - anyone get this to work?

2012-06-19 Thread Richard Berger
One more note... there is a more complete code sample at:
http://fni.googlecode.com/svn/!svn/bc/622/trunk/fniCloud/src/fi/foyt/fni/cloud/
(it's much better than my code - although most of the Restlet relevant classes 
seem to no longer be available in the owner's current version - they may have 
given up on Restlet).

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


RE: RestletFrameworkServlet - HTTP 500 on first request.

2012-06-19 Thread Jerome Louvel
Hi David,

Even though it took us a while, I'm happy to report that this issue is now
fixed:
https://github.com/restlet/restlet-framework-java/issues/437

Best regards,
Jerome
--
http://www.restlet.com
http://twitter.com/#!/jlouvel


-Message d'origine-
De : Crogdor [mailto:da...@davidfuchs.ca] 
Envoyé : mardi 17 mai 2011 13:54
À : discuss@restlet.tigris.org
Objet : RestletFrameworkServlet - HTTP 500 on first request.

Hello - I'm running Restlet 2.1-M4 (JEE edition) with the Spring extensions
on Tomcat 7/JRE6.  I'm using Spring 3.0.5-RELEASE.  I've also reproduced
these results with Restlet 2.0.7 and Spring 3.0.1-RELEASE.

I'm receiving an HTTP 500 error error the first time I call my Restlet. 
Subsequent calls succeed, however, as do calls after a server restart - it
only happens with a newly deployed WAR for some reason.

The server log shows one of the following two errors - it's pretty
arbitrary, but I definitely see the first one more often:

17-May-2011 1:27:01 PM org.restlet.engine.CompositeHelper handle
SEVERE: The org.restlet.Application class has no Restlet defined to process
calls. Maybe it wasn't properly started.

17-May-2011 1:48:34 PM org.restlet.routing.Filter doHandle
WARNING: The filter org.restlet.engine.application.StatusFilter@16f8789 was
executed without a next Restlet attached to it.

I believe my servlet are router are defined correctly, as subsequent calls
succeed:

servlet
servlet-nameMyRestlet/servlet-name
   
servlet-classorg.restlet.ext.spring.RestletFrameworkServlet/servlet-class

load-on-startup1/load-on-startup
/servlet

bean id=root class=org.restlet.ext.spring.SpringRouter
property name=attachments
map
entry key=/item
bean class=org.restlet.ext.spring.SpringFinder
lookup-method name=create bean=itemResource/
/bean
/entry
/map
/property
/bean

It's interesting that it only occurs for a new deployment - perhaps
something is resolving the issue behind the scenes and caching the results.

Has anyone else experienced this, or know of a solution?

Thanks!

--
View this message in context:
http://restlet-discuss.1400322.n2.nabble.com/RestletFrameworkServlet-HTTP-50
0-on-first-request-tp6375129p6375129.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

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


RE: CompositeHelper returns 500 on GAE

2012-06-19 Thread Jerome Louvel
Hi Danny,

Even though it took us a while, I'm happy to report that this issue is now
fixed:
https://github.com/restlet/restlet-framework-java/issues/437

Best regards,
Jerome
--
http://www.restlet.com
http://twitter.com/#!/jlouvel

-Message d'origine-
De : Danny Leshem [mailto:dles...@gmail.com] 
Envoyé : vendredi 20 mai 2011 03:42
À : discuss@restlet.tigris.org
Objet : CompositeHelper returns 500 on GAE

I'm running Restlet 2.1 M4 for Google AppEngine.

Things generally work well, but every once in a requests fail with 500, and
the logs show-

---
org.restlet.engine.CompositeHelper handle: The [MyClass] class has no
Restlet defined to process calls. Maybe it wasn't properly started.
---

This happens for resources that worked well up to this point, and that
generally work well for following requests.

Initialization is performed like this:

---
public class SystemApplication extends Application {
  public SystemApplication() {
final MetadataService metadataService = getMetadataService();
metadataService.addExtension(multipart, MediaType.MULTIPART_FORM_DATA,
true);
metadataService.setDefaultMediaType(MediaType.APPLICATION_XHTML);

getTunnelService().setUserAgentTunnel(true);
  }

  @Override
  public Restlet createInboundRoot() {
final Router router = new Router(getContext());
router.attach(/version, VersionResource.class);
return router;
  }
}
---

Any ideas?

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

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


RE: restlet problem. urgent! Please help me!

2012-06-19 Thread Jerome Louvel
Hi Zhu,

I'm happy to report that this issue is now fixed:
https://github.com/restlet/restlet-framework-java/issues/437

Best regards,
Jerome
--
http://www.restlet.com
http://twitter.com/#!/jlouvel


-Message d'origine-
De : yunwu zhu [mailto:zhuywt...@gmail.com] 
Envoyé : dimanche 15 avril 2012 19:12
À : discuss@restlet.tigris.org
Objet : restlet problem. urgent! Please help me!

Now, I am building a web service using Restlet. It works well. but when I
use jmeter to make performance test, there is a problem. 

When 50 users send the http request at the same time, The first several
requests will be discarded. The eclipse console will print the log as below:

=
INFORMATIN: FrameworkServlet 'restlet': initialization completed in 2078 ms
2012-4-16 9:59:44 org.restlet.engine.ChainHelper handle

SEVERE: The org.restlet.Application class has no Restlet defined to process
calls. Maybe it wasn't properly started.
2012-4-16 9:59:44 org.restlet.engine.ChainHelper handle




Does it anyone how should I solve this problem? I will appreciate for your
advice.

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

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