External JAXB Context resolver

2012-07-10 Thread Bhagyashree Bhati
Hi,

I want to configure my Restlet Application to start with a JaxbContext
provided through configuration. Lets say, I want to use MOXy
(http://www.eclipse.org/eclipselink/moxy.php) as my Jaxb context resolver.
Is it possible to configure this externally, say through restlet.xml ?

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/External-JAXB-Context-resolver-tp7578194.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


Re: Handling exceptions/errors when using Restlet for Client and Server....

2012-07-10 Thread Richard Berger
And one further note, wrapping the client resource does not seem to change
the results.

That is to say, going from:
  ClientResource commitsResource = new ClientResource(getContext(),
commitsRef);
  commitsRep = commitsResource.get();

To:
ClientResource clientResource = new ClientResource(commitsRef);
CommitmentsResource commitsResource =
clientResource.wrap(CommitmentsResource.class);
Representation commitsRep = null;
commitsRep = commitsResource.represent();

Changes nothing
RB

On Tue, Jul 10, 2012 at 4:22 PM, Richard Berger wrote:

> Yes, I only see this problem when I go through my Restlet client, not when
> using a browser.   In order to make sure the API I am developing is usable
> by real client developers, I figured I should also build a client.  I chose
> Restlet as the technology for that client - perhaps that wasn't the best
> possible choice (if no one else does that).
>
> Thanks for the response...
> RB
>
>
> On Tue, Jul 10, 2012 at 2:09 PM, Bjorn Roche [via Restlet Discuss] <
> ml-node+s1400322n7578191...@n2.nabble.com> wrote:
>
>> I can't help you directly, but I can say that I use restlet server (but
>> not client) and I am pretty sure I DON'T have this problem. Is this a bug
>> in the client that it can't access the http status message? That is what
>> I'm gathering from the thread you linked as well.
>>
>> bjorn
>>
>> On Jul 10, 2012, at 1:18 PM, Richard Berger wrote:
>>
>> > My question is similar to that raised at:
>> >
>> http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
>> >
>> http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
>> > , but since that has not been answered and this seems like a really
>> basic
>> > issue, I thought I would try posting again.
>> >
>> > The question is simply this - how to get the details of an
>> error/exception
>> > that occurs on the Restlet server back to my Restlet client?
>> >
>> > I can see how to do this if my client were just a browser (I could
>> construct
>> > an HTML page on the server and return it).
>> >
>> > I thought that it would be pretty simple - set the Status code and
>> Status
>> > description.  But as the discussion above points out, that doesn't
>> work.
>> >
>> > I then thought that I could just set the Status code and send back a
>> String
>> > Representation of the error message.  But that doesn't work either.  In
>> > particular, if I have:
>> >  msg = "error xyz occurred";
>> >  this.setStatus(Status.SERVER_ERROR_INTERNAL, msg);
>> >  StringRepresentation result = new StringRepresentation(msg,
>> > MediaType.TEXT_PLAIN);
>> >  return result;
>> > The client side call:
>> >  commitsRep = commitsResource.get();
>> > Sets commitsRep == null (!).  Note: it is only set to null when the
>> status
>> > != 200.
>> >
>> > So, I could set the status to 200 and then return the
>> StringRepresentation
>> > and then on the client, check to see if I have a StringRepresentation
>> (which
>> > would be an error) or some other type (which would be a success).
>> >
>> > But surely there has got to be an easier way - what am I missing?  (I
>> have
>> > created my own StatusService on the server, I have thrown my own
>> exception,
>> > but no joy).
>> >
>> > Thanks in advance for any hep - and thanks to Tim P for collecting all
>> the
>> > links in the thread above - but those weren't enough for me to work
>> around
>> > the problem.
>> >
>> > RB
>> >
>> > --
>> > View this message in context:
>> http://restlet-discuss.1400322.n2.nabble.com/Handling-exceptions-errors-when-using-Restlet-for-Client-and-Server-tp7578190.html
>> > Sent from the Restlet Discuss mailing list archive at Nabble.com.
>> >
>> > --
>> >
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2982701
>>
>> -
>> Bjorn Roche
>> http://www.xonami.com
>> Audio Collaboration
>> http://blog.bjornroche.com
>>
>> --
>>
>> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2982833
>>
>>
>> --
>>  If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://restlet-discuss.1400322.n2.nabble.com/Handling-exceptions-errors-when-using-Restlet-for-Client-and-Server-tp7578190p7578191.html
>>  To unsubscribe from Handling exceptions/errors when using Restlet for
>> Client and Server, click 
>> here
>> .
>> NAML

Re: Handling exceptions/errors when using Restlet for Client and Server....

2012-07-10 Thread Richard Berger
Yes, I only see this problem when I go through my Restlet client, not when
using a browser.   In order to make sure the API I am developing is usable
by real client developers, I figured I should also build a client.  I chose
Restlet as the technology for that client - perhaps that wasn't the best
possible choice (if no one else does that).

Thanks for the response...
RB

On Tue, Jul 10, 2012 at 2:09 PM, Bjorn Roche [via Restlet Discuss] <
ml-node+s1400322n7578191...@n2.nabble.com> wrote:

> I can't help you directly, but I can say that I use restlet server (but
> not client) and I am pretty sure I DON'T have this problem. Is this a bug
> in the client that it can't access the http status message? That is what
> I'm gathering from the thread you linked as well.
>
> bjorn
>
> On Jul 10, 2012, at 1:18 PM, Richard Berger wrote:
>
> > My question is similar to that raised at:
> >
> http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
> >
> http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
> > , but since that has not been answered and this seems like a really
> basic
> > issue, I thought I would try posting again.
> >
> > The question is simply this - how to get the details of an
> error/exception
> > that occurs on the Restlet server back to my Restlet client?
> >
> > I can see how to do this if my client were just a browser (I could
> construct
> > an HTML page on the server and return it).
> >
> > I thought that it would be pretty simple - set the Status code and
> Status
> > description.  But as the discussion above points out, that doesn't work.
> >
> > I then thought that I could just set the Status code and send back a
> String
> > Representation of the error message.  But that doesn't work either.  In
> > particular, if I have:
> >  msg = "error xyz occurred";
> >  this.setStatus(Status.SERVER_ERROR_INTERNAL, msg);
> >  StringRepresentation result = new StringRepresentation(msg,
> > MediaType.TEXT_PLAIN);
> >  return result;
> > The client side call:
> >  commitsRep = commitsResource.get();
> > Sets commitsRep == null (!).  Note: it is only set to null when the
> status
> > != 200.
> >
> > So, I could set the status to 200 and then return the
> StringRepresentation
> > and then on the client, check to see if I have a StringRepresentation
> (which
> > would be an error) or some other type (which would be a success).
> >
> > But surely there has got to be an easier way - what am I missing?  (I
> have
> > created my own StatusService on the server, I have thrown my own
> exception,
> > but no joy).
> >
> > Thanks in advance for any hep - and thanks to Tim P for collecting all
> the
> > links in the thread above - but those weren't enough for me to work
> around
> > the problem.
> >
> > RB
> >
> > --
> > View this message in context:
> http://restlet-discuss.1400322.n2.nabble.com/Handling-exceptions-errors-when-using-Restlet-for-Client-and-Server-tp7578190.html
> > Sent from the Restlet Discuss mailing list archive at Nabble.com.
> >
> > --
> >
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2982701
>
> -
> Bjorn Roche
> http://www.xonami.com
> Audio Collaboration
> http://blog.bjornroche.com
>
> --
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2982833
>
>
> --
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://restlet-discuss.1400322.n2.nabble.com/Handling-exceptions-errors-when-using-Restlet-for-Client-and-Server-tp7578190p7578191.html
>  To unsubscribe from Handling exceptions/errors when using Restlet for
> Client and Server, click 
> here
> .
> NAML
>


--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Handling-exceptions-errors-when-using-Restlet-for-Client-and-Server-tp7578190p7578192.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Re: Handling exceptions/errors when using Restlet for Client and Server....

2012-07-10 Thread Bjorn Roche
I can't help you directly, but I can say that I use restlet server (but not 
client) and I am pretty sure I DON'T have this problem. Is this a bug in the 
client that it can't access the http status message? That is what I'm gathering 
from the thread you linked as well.

bjorn

On Jul 10, 2012, at 1:18 PM, Richard Berger wrote:

> My question is similar to that raised at: 
> http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
> http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
> , but since that has not been answered and this seems like a really basic
> issue, I thought I would try posting again.
> 
> The question is simply this - how to get the details of an error/exception
> that occurs on the Restlet server back to my Restlet client?  
> 
> I can see how to do this if my client were just a browser (I could construct
> an HTML page on the server and return it).  
> 
> I thought that it would be pretty simple - set the Status code and Status
> description.  But as the discussion above points out, that doesn't work.
> 
> I then thought that I could just set the Status code and send back a String
> Representation of the error message.  But that doesn't work either.  In
> particular, if I have:
>  msg = "error xyz occurred";
>  this.setStatus(Status.SERVER_ERROR_INTERNAL, msg);
>  StringRepresentation result = new StringRepresentation(msg,
> MediaType.TEXT_PLAIN);
>  return result;
> The client side call: 
>  commitsRep = commitsResource.get();
> Sets commitsRep == null (!).  Note: it is only set to null when the status
> != 200.  
> 
> So, I could set the status to 200 and then return the StringRepresentation
> and then on the client, check to see if I have a StringRepresentation (which
> would be an error) or some other type (which would be a success).
> 
> But surely there has got to be an easier way - what am I missing?  (I have
> created my own StatusService on the server, I have thrown my own exception,
> but no joy).
> 
> Thanks in advance for any hep - and thanks to Tim P for collecting all the
> links in the thread above - but those weren't enough for me to work around
> the problem.
> 
> RB
> 
> --
> View this message in context: 
> http://restlet-discuss.1400322.n2.nabble.com/Handling-exceptions-errors-when-using-Restlet-for-Client-and-Server-tp7578190.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
> 
> --
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2982701

-
Bjorn Roche
http://www.xonami.com
Audio Collaboration
http://blog.bjornroche.com

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


Handling exceptions/errors when using Restlet for Client and Server....

2012-07-10 Thread Richard Berger
My question is similar to that raised at: 
http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
http://restlet-discuss.1400322.n2.nabble.com/Sending-server-side-exceptions-error-codes-back-to-client-td7219795.html#a7229629
, but since that has not been answered and this seems like a really basic
issue, I thought I would try posting again.

The question is simply this - how to get the details of an error/exception
that occurs on the Restlet server back to my Restlet client?  

I can see how to do this if my client were just a browser (I could construct
an HTML page on the server and return it).  

I thought that it would be pretty simple - set the Status code and Status
description.  But as the discussion above points out, that doesn't work.

I then thought that I could just set the Status code and send back a String
Representation of the error message.  But that doesn't work either.  In
particular, if I have:
  msg = "error xyz occurred";
  this.setStatus(Status.SERVER_ERROR_INTERNAL, msg);
  StringRepresentation result = new StringRepresentation(msg,
MediaType.TEXT_PLAIN);
  return result;
The client side call: 
  commitsRep = commitsResource.get();
Sets commitsRep == null (!).  Note: it is only set to null when the status
!= 200.  

So, I could set the status to 200 and then return the StringRepresentation
and then on the client, check to see if I have a StringRepresentation (which
would be an error) or some other type (which would be a success).

But surely there has got to be an easier way - what am I missing?  (I have
created my own StatusService on the server, I have thrown my own exception,
but no joy).

Thanks in advance for any hep - and thanks to Tim P for collecting all the
links in the thread above - but those weren't enough for me to work around
the problem.

RB

--
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Handling-exceptions-errors-when-using-Restlet-for-Client-and-Server-tp7578190.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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


Restlet and VM Problem

2012-07-10 Thread Igna TT
Hi!
I've just run across this list, and need to expose my problems.

Just downloaded the Restlet for Android, installed it, and added the
"org.restlet.jar" to my testing Android project.
I copy and paste the "HelloClient" java code, and, when I'm trying to run
it, as a pure java example came across with this problem:

"Error occurred during initialization of VM
java/lang/NoClassDefFoundError: java/lang/ref/FinalReference"

Did I something wrong?

Thanks in advance for your time!

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