Resource paths with Restlet and Jax Rs

2010-08-25 Thread webpost
Hello,

I set up a small standalone server as JaxRsApplication like in the "JAX-RS 
extension" example on the website.

My resources are annotated with Jax-Rs Annotations. Every Resource should have 
the same entry point. So I was thinking to put @Path("") on each resource class 
and the specified resource path to the dedicated methods. When I add these 
resources to the application class I get a warning that more than one resource 
uses the same root path. The main problem is that I want to add a type 
extention to the URI. My URIs should look like this:

www.sample.com/blogs.json
www.sample.com/blogs/3.json
www.sample.com/notes.json
www.sample.com/notes/3.json

So my class definition looks like

@Path("")
public class Blog{
  @GET
  @Path("/blogs.{extension: [bj]son}")
  public String getBlogs(...){
...
  }

  @GET
  @Path("/blogs/{blogId}.{extension: [bj]son}")
  public String getBlog(...){
...
  }
}

@Path("")
public class Note{
  @GET
  @Path("/notes.{extension: [bj]son}")
  public String getNotes(...){
...
  }

  @GET
  @Path("/notes/{noteId}.{extension: [bj]son}")
  public String getNote(...){
...
  }
}

Is there a way to get around this?

Thanks a lot in advance.

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


What is the point of JaxbRepresentation.getJaxbSource()?

2010-08-25 Thread webpost
This method creates and returns a new object that appears to have no relation 
to the one used for marshalling. Am I missing something?

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


Re: restlets : communicating in SSL with tomcat

2010-08-25 Thread Xavier Méhaut
Thanks a lot for these explanations, we're going to try this right now ; it
could be good to add this explanation in the SSl chapter in The Restlet in
Action" book (up to now only the server side aspect is processed)...
Best regards
Xavier
ps : yes , it was keytool -genkey, which is become genkey under my fingers
:)

2010/8/25 Bruno Harbulot 

> On 25/08/10 13:53, Xavier Méhaut wrote:
> > Hi Bruno,
> > Actually our architecture is the following :
> > A PC runs a restlet server locally (withou a servlet container); the
> > resources served by this server call themselves other restlets which are
> > located into another restlet serveron another PC, but this restlet
> > server  one is hosted in Tomcat with SSL setted.
> > The problem occurs when trying to call these remote restlets from the
> > first PC.
> > SSL is managed by tomcat and the certificate has been generated by java
> > keygen.
>
> Ah, this makes sense. When you say "the certificate has been generated
> by java keygen", presumably, you haven't sent the certificate request to
> a Certification Authority, so you're effectively using a self-signed
> certificate on your Tomcat server (presumably, you meant "keytool"
> instead of "keygen" too?).
> There's nothing wrong with that (although this could become an issue if
> you expect other clients to connect). However, for the client to be able
> to connect, you need to tell it to trust your server's certificate
> explicitly. This means that the trust store you're using on the client
> side needs to contain this self-signed certificate.
>
> The default trust store in Java is usually in
> $JAVA_HOME/lib/security/cacerts (and the default password is "changeme").
> I wouldn't necessarily modify that file, but you can take a copy of it
> and import the certificate you've generated on the server into it.
>
> * On the server:
>
> 1. Find the alias you need from the keystore (otherwise, the default
> will be "mykey":
>keytool -list -keystore keystore.jks
>
> You should see a list like this:
> Certificate fingerprint (MD5):
> 5B:91:3D:BB:A7:0D:04:F9:92:A0:79:0E:EA:30:45:6A
> the alias name, 25-Aug-2010, PrivateKeyEntry,
>
> 2. Export the certificate:
>keytool -exportcert -keystore keystore.jks -alias "the alias name"
> -file servercert.der
>
> (Note that you only export the certificate here, not the private key,
> which is not to be distributed.)
>
>
> * On the client:
>
> 1. It's not strictly required, but I would copy
> $JAVA_HOME/lib/security/cacerts to a file that doesn't affect the whole
> system, let's say "mycacerts.jks".
>
> 2. Import the server certificate into that store:
>keytool -importcert -keystore mycacerts.jks -trustcacerts -file
> servercert.der
>
> (Optionally, use '-alias "some alias name"' if you want it to be easier
> to identity later on in the list. I'd go for the host name there, but
> it's just an internal indication in the store.)
>
> 3. Configure your Restlet client to use that as a trust store.
>
> If you think it's a good idea to use this as a trust store across
> everything that runs within that JVM, you can use the
> javax.net.ssl.trustStore properties.
>
> Otherwise, you can set it on a per-connector basis, using the Context
> parameters:
> parameters.add("truststorePath", "mycacerts.jks");
> parameters.add("truststorePassword", "password");
> // parameters.add("truststoreType", "JKS");
>
>
>
> Best wishes,
>
> Bruno.
>
> --
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651208
>
>

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

Re: restlets : communicating in SSL with tomcat

2010-08-25 Thread Bruno Harbulot
On 25/08/10 13:53, Xavier Méhaut wrote:
> Hi Bruno,
> Actually our architecture is the following :
> A PC runs a restlet server locally (withou a servlet container); the
> resources served by this server call themselves other restlets which are
> located into another restlet serveron another PC, but this restlet
> server  one is hosted in Tomcat with SSL setted.
> The problem occurs when trying to call these remote restlets from the
> first PC.
> SSL is managed by tomcat and the certificate has been generated by java
> keygen.

Ah, this makes sense. When you say "the certificate has been generated 
by java keygen", presumably, you haven't sent the certificate request to 
a Certification Authority, so you're effectively using a self-signed 
certificate on your Tomcat server (presumably, you meant "keytool" 
instead of "keygen" too?).
There's nothing wrong with that (although this could become an issue if 
you expect other clients to connect). However, for the client to be able 
to connect, you need to tell it to trust your server's certificate 
explicitly. This means that the trust store you're using on the client 
side needs to contain this self-signed certificate.

The default trust store in Java is usually in 
$JAVA_HOME/lib/security/cacerts (and the default password is "changeme").
I wouldn't necessarily modify that file, but you can take a copy of it 
and import the certificate you've generated on the server into it.

* On the server:

1. Find the alias you need from the keystore (otherwise, the default 
will be "mykey":
keytool -list -keystore keystore.jks

You should see a list like this:
Certificate fingerprint (MD5): 
5B:91:3D:BB:A7:0D:04:F9:92:A0:79:0E:EA:30:45:6A
the alias name, 25-Aug-2010, PrivateKeyEntry,

2. Export the certificate:
keytool -exportcert -keystore keystore.jks -alias "the alias name" 
-file servercert.der

(Note that you only export the certificate here, not the private key, 
which is not to be distributed.)


* On the client:

1. It's not strictly required, but I would copy 
$JAVA_HOME/lib/security/cacerts to a file that doesn't affect the whole 
system, let's say "mycacerts.jks".

2. Import the server certificate into that store:
keytool -importcert -keystore mycacerts.jks -trustcacerts -file 
servercert.der

(Optionally, use '-alias "some alias name"' if you want it to be easier 
to identity later on in the list. I'd go for the host name there, but 
it's just an internal indication in the store.)

3. Configure your Restlet client to use that as a trust store.

If you think it's a good idea to use this as a trust store across 
everything that runs within that JVM, you can use the 
javax.net.ssl.trustStore properties.

Otherwise, you can set it on a per-connector basis, using the Context 
parameters:
parameters.add("truststorePath", "mycacerts.jks");
parameters.add("truststorePassword", "password");
// parameters.add("truststoreType", "JKS");



Best wishes,

Bruno.

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


Re: HTTPS server

2010-08-25 Thread Bruno Harbulot
Hi Nicho,

The second command (parameters.add("DefaultSslContextFactory", ...)) 
actually doesn't do anything, since it's the "sslContextFactory" 
parameter name that is user ("DefaultSslContextFactory" is a possible 
value but not the parameter name), so this falls back to the default 
configuration.

If you use "com.noelios.restlet.ext.ssl.PkixSslContextFactory", you need 
to set the trust store explicitly with the old version.
If you're not using client-certificates or doing anything fancy with the 
SSL settings, you might as well use 
"com.noelios.restlet.util.DefaultSslContextFactory" or no specific 
settings at all (and use the parameter names for setting the trust 
stores and key stores).

This should have been fixed in Restlet 2.0 (and the SSL configuration 
has been harmonized across all connectors).

Best wishes,

Bruno.


On 17/08/10 09:50, webp...@tigris.org wrote:
> Hi
>
> I want to implement https server by using Simple connector and Restlet 1.1. I 
> put com.noelios.restlet.ext.simple_3.1.jar, org.simpleframework.jar, 
> com.noelios.restlet.ext.ssl.jar and org.jsslutils.jar in my classpath.
But I encountered a SSLContextFactory$SSLContextFactoryException when I 
call parameters.add("sslContextFactory", 
"com.noelios.restlet.ext.ssl.PkixSslContextFactory");
> if I call parameters.add("DefaultSslContextFactory", 
> "com.noelios.restlet.ext.ssl.PkixSslContextFactory"); it looks fine.
>
> anybody tell me the reason?
>
> Thanks,
>
> Nicho
>
>
> The Exception message:
>
> org.jsslutils.sslcontext.SSLContextFactory$SSLContextFactoryException: 
> Exception in SSLContextFactory
>  at 
> org.jsslutils.sslcontext.PKIXSSLContextFactory.getPKIXParameters(PKIXSSLContextFactory.java:231)
>  at 
> org.jsslutils.sslcontext.PKIXSSLContextFactory.getTrustParams(PKIXSSLContextFactory.java:190)
>  at 
> org.jsslutils.sslcontext.PKIXSSLContextFactory.getRawTrustManagers(PKIXSSLContextFactory.java:163)
>  at 
> org.jsslutils.sslcontext.X509SSLContextFactory.getTrustManagers(X509SSLContextFactory.java:346)
>  at 
> org.jsslutils.sslcontext.SSLContextFactory.buildSSLContext(SSLContextFactory.java:256)
>  at 
> com.noelios.restlet.ext.ssl.PkixSslContextFactory.createSslContext(PkixSslContextFactory.java:72)
>  at 
> com.noelios.restlet.ext.simple.HttpsServerHelper.start(HttpsServerHelper.java:267)
>  at org.restlet.Server.start(Server.java:383)
>  at org.restlet.Component.startServers(Component.java:1233)
>  at org.restlet.Component.start(Component.java:1194)
>  at uk.ngs.ca.server.HttpsServerRun.(HttpsServerRun.java:72)
>  at uk.ngs.ca.server.HttpsServerRun.main(HttpsServerRun.java:86)
> Caused by: java.security.InvalidAlgorithmParameterException: the trustAnchors 
> parameter must be non-empty
>  at 
> java.security.cert.PKIXParameters.setTrustAnchors(PKIXParameters.java:183)
>  at java.security.cert.PKIXParameters.(PKIXParameters.java:140)
>  at 
> java.security.cert.PKIXBuilderParameters.(PKIXBuilderParameters.java:113)
>  at 
> org.jsslutils.sslcontext.PKIXSSLContextFactory.getPKIXParameters(PKIXSSLContextFactory.java:215)
>  ... 11 more
>
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2647748
>

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


Re: Use of ClientResource inside a server resource

2010-08-25 Thread Xavier Méhaut
Thanks Bruno

2010/8/25 Bruno Harbulot 

> 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:
>
>
>org.restlet.clients
>HTTP HTTPS CLAP FILE
>
>
> (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 Mandelbaum  > >
> >
> > 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.  > > 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=4447&dsMessageId=2651067
> > <
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651067
> >
> >
> >
>
> --
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2651196
>
>

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

Re: restlets : communicating in SSL with tomcat

2010-08-25 Thread Xavier Méhaut
Hi Bruno,
Actually our architecture is the following :
A PC runs a restlet server locally (withou a servlet container); the
resources served by this server call themselves other restlets which are
located into another restlet serveron another PC, but this restlet server
one is hosted in Tomcat with SSL setted.
The problem occurs when trying to call these remote restlets from the first
PC.
SSL is managed by tomcat and the certificate has been generated by java
keygen.
regards
xavier

2010/8/25 Bruno Harbulot 

> Just to clarify, if I understand well, you're using a ClientResource
> from within the Restlet environment running within Tomcat (so
> effectively, your server is a client in that respect)?
>
> How do you configure SSL on the client connector?
>
> A priori, it looks like there's something wrong with the trust store
> settings: either the server to which you're trying to connect has a
> certificate that's not trusted by the default trust store available (if
> you haven't specified anything), or the trust store is set up for
> something that doesn't have the required CA certificate.
>
> Best wishes,
>
> Bruno.
>
>
> On 24/08/10 12:48, Xavier Méhaut wrote:
> > We use tomcat 5.5 with SSL, and restlet 2.0... The problem occurs when
> > trying to access through the ClientResource setted with HTTPS protocol...
> > regards
> > Xavier
> >
> > 24 août 2010 11:56:38 org.restlet.engine.http.connector.Connection
> > writeMessage
> > ATTENTION: Exception while writing the message headers.
> > javax.net.ssl.SSLHandshakeException:
> > sun.security.validator.ValidatorException: PKIX path building failed:
> > sun.security.provider.certpath.SunCertPathBuilderException: unable to
> > find valid certification path to requested target
> >  at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown
> Source)
> >  at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
> >  at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
> >  at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
> >  at
> > com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
> > Source)
> >  at
> > com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown
> Source)
> >  at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown
> Source)
> >  at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
> > Source)
> >  at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
> > Source)
> >  at
> >
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
> > Source)
> >  at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown
> > Source)
> >  at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown
> Source)
> >  at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
> >  at java.io.BufferedOutputStream.flush(Unknown Source)
> >  at
> >
> org.restlet.engine.http.connector.Connection.writeMessageHead(Connection.java:919)
> >  at
> >
> org.restlet.engine.http.connector.Connection.writeMessageHead(Connection.java:933)
> >  at
> >
> org.restlet.engine.http.connector.Connection.writeMessage(Connection.java:806)
> >  at
> >
> org.restlet.engine.http.connector.ClientConnection.writeMessage(ClientConnection.java:297)
> >  at
> >
> org.restlet.engine.http.connector.Connection.writeMessages(Connection.java:966)
> >  at
> > org.restlet.engine.http.connector.Controller$1.run(Controller.java:81)
> >  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> > Source)
> >  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
> >  at java.lang.Thread.run(Unknown Source)
> > Caused by: sun.security.validator.ValidatorException: PKIX path building
> > failed: sun.security.provider.certpath.SunCertPathBuilderException:
> > unable to find valid certification path to requested target
> >  at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
> >  at sun.security.validator.PKIXValidator.engineValidate(Unknown
> Source)
> >  at sun.security.validator.Validator.validate(Unknown Source)
> >  at
> > com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown
> Source)
> >  at
> >
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> > Source)
> >  at
> >
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> > Source)
> >  ... 19 more
> > Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
> > unable to find valid certification path to requested target
> >  at
> > sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
> > Source)
> >  at java.security.cert.CertPathBuilder.build(Unknown Source)
> >  ... 25 more
> >
> > 2010/8/24 Bruno Harbulot  > >
> >
> > Hi Xavier,
> >
> > If you're using Restlet within a Servlet environment, it's the
> co

Re: Use of ClientResource inside a server resource

2010-08-25 Thread Bruno Harbulot
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:


org.restlet.clients
HTTP HTTPS CLAP FILE


(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 Mandelbaum  >
>
> 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.  > 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=4447&dsMessageId=2651067
> 
> 
>
>

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


Re: HTTPS connector

2010-08-25 Thread Bruno Harbulot
Hi Nicho,

It looks like you need to add the com.noelios.ext.net or 
com.noelios.ext.httpclient jars to your classpath.

Best wishes,

Bruno.

On 16/08/10 17:30, webp...@tigris.org wrote:
> I am writing HTTPs client code as below, but encountered warning message. I 
> am using Restlet 1.1. I suspect I lost jar file in my classpath. could youi 
> please point out whiat jar files I need to.
>
> my client code is:
>
> System.setProperty("javax.net.ssl.trustStore", "c:\\storefile");
>  System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
>  System.setProperty("javax.net.ssl.keyStore", "c:\\storefile");
>  System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
>
> Client c = new Client(Protocol.HTTPS);
> Request request = new Request(Method.GET, new Reference(uri));
> Response response = c.handle(request);
>
> The warning message is:
>
> WARNING: No available client connector supports the required protocols: 
> 'HTTPS' . Please add the JAR of a matching connector to your classpath.
>
>
> Thanks,
>
> Nicho
>
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2647498
>

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


Re: restlets : communicating in SSL with tomcat

2010-08-25 Thread Bruno Harbulot
Just to clarify, if I understand well, you're using a ClientResource 
from within the Restlet environment running within Tomcat (so 
effectively, your server is a client in that respect)?

How do you configure SSL on the client connector?

A priori, it looks like there's something wrong with the trust store 
settings: either the server to which you're trying to connect has a 
certificate that's not trusted by the default trust store available (if 
you haven't specified anything), or the trust store is set up for 
something that doesn't have the required CA certificate.

Best wishes,

Bruno.


On 24/08/10 12:48, Xavier Méhaut wrote:
> We use tomcat 5.5 with SSL, and restlet 2.0... The problem occurs when
> trying to access through the ClientResource setted with HTTPS protocol...
> regards
> Xavier
>
> 24 août 2010 11:56:38 org.restlet.engine.http.connector.Connection
> writeMessage
> ATTENTION: Exception while writing the message headers.
> javax.net.ssl.SSLHandshakeException:
> sun.security.validator.ValidatorException: PKIX path building failed:
> sun.security.provider.certpath.SunCertPathBuilderException: unable to
> find valid certification path to requested target
>  at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
>  at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
>  at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>  at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
>  at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown
> Source)
>  at
> com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
>  at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
>  at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown
> Source)
>  at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown
> Source)
>  at
> com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown
> Source)
>  at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown
> Source)
>  at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
>  at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
>  at java.io.BufferedOutputStream.flush(Unknown Source)
>  at
> org.restlet.engine.http.connector.Connection.writeMessageHead(Connection.java:919)
>  at
> org.restlet.engine.http.connector.Connection.writeMessageHead(Connection.java:933)
>  at
> org.restlet.engine.http.connector.Connection.writeMessage(Connection.java:806)
>  at
> org.restlet.engine.http.connector.ClientConnection.writeMessage(ClientConnection.java:297)
>  at
> org.restlet.engine.http.connector.Connection.writeMessages(Connection.java:966)
>  at
> org.restlet.engine.http.connector.Controller$1.run(Controller.java:81)
>  at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
> Source)
>  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
>  at java.lang.Thread.run(Unknown Source)
> Caused by: sun.security.validator.ValidatorException: PKIX path building
> failed: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target
>  at sun.security.validator.PKIXValidator.doBuild(Unknown Source)
>  at sun.security.validator.PKIXValidator.engineValidate(Unknown Source)
>  at sun.security.validator.Validator.validate(Unknown Source)
>  at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.validate(Unknown Source)
>  at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> Source)
>  at
> com.sun.net.ssl.internal.ssl.X509TrustManagerImpl.checkServerTrusted(Unknown
> Source)
>  ... 19 more
> Caused by: sun.security.provider.certpath.SunCertPathBuilderException:
> unable to find valid certification path to requested target
>  at
> sun.security.provider.certpath.SunCertPathBuilder.engineBuild(Unknown
> Source)
>  at java.security.cert.CertPathBuilder.build(Unknown Source)
>  ... 25 more
>
> 2010/8/24 Bruno Harbulot  >
>
> Hi Xavier,
>
> If you're using Restlet within a Servlet environment, it's the container
> configuration that matters regarding SSL. If you have configured SSL on
> your Tomcat container, this should be enough.
> What kind of errors do you get (and which version of Restlet, just
> in case)?
>
> Best wishes,
>
> Bruno.
>
> On 23/08/2010 15:39, Xavier M. wrote:
>  > Hello,
>  > We use Tomcat with SSL configuration to host our restlet
> application. Up
>  > to now we don't succeed accessing restlets in ssl mode ; Do we
> need to
>  > add ssl parameters in restlets too, or is the tomcat configuration
>  > sufficient?
>  > regards
>  > Xavier
>
> --
> 
> http://restlet.tigris.org/ds

Re: Use of ClientResource inside a server resource

2010-08-25 Thread Fabian Mandelbaum
Ah, indeed you have to add all protocols you intend to support (FILE,
HTTP, HTTPS...) as clients on the server.

You are welcomed.
Kind regards.

On Wed, Aug 25, 2010 at 8:13 AM, 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 Mandelbaum 
>>
>> 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. 
>> 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=4447&dsMessageId=2651067
>>
>
>



-- 
Fabián Mandelbaum
IS Engineer

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


Re: Use of ClientResource inside a server resource

2010-08-25 Thread Xavier Méhaut
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 Mandelbaum 

> 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. 
> 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=4447&dsMessageId=2651067
>
>

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

Re: Use of ClientResource inside a server resource

2010-08-25 Thread Fabian Mandelbaum
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.  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=4447&dsMessageId=2651067


Re: Problems with hanging client calls

2010-08-25 Thread Rickard Öberg
On 2010-08-24 21.13, Thierry Boileau wrote:
> Hello Rickard,
>
> to my mind, this should be fixed by using the httpclient connector
> (or net also). Adding a connector to your application is explained
> here:
> http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/325-restlet/37-restlet.html

Thanks, we will look into that.

But shouldn't the default one work properly? Are you looking into fixing 
this as well?

regards, Rickard

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