simple spring example help
Hi, I am trying to wire up the following in spring. I can get the topComponent object from my spring context. I invoke start() on it, however the SpringRouter I have setup does not seem to be registered? No matter what URI I go to at localhost:8090/restlet/20140101 i just get 404's What am I missing? Any help appreciated, thanks LOG OUTPUT Starting the internal [HTTP/1.1] server on port 8090 2014-08-20 10:06:210:0:0:0:0:0:0:1%0 - - 8090 GET /restlet/20140101 - 404 439 0 4 http://localhost:8090 my user agent bean id=topComponent class=org.restlet.ext.spring.SpringComponent property name=server bean class=org.restlet.ext.spring.SpringServer constructor-arg value=http / constructor-arg value=8090 / /bean /property property name=defaultTarget ref=defaultRouter / /bean bean id=topComponent.context class=org.springframework.beans.factory.config.PropertyPathFactoryBean / bean id=defaultRouter class=org.restlet.ext.spring.SpringRouter constructor-arg ref=topComponent.context/ property name=attachments map entry key=/restlet value-ref=rootRouter / /map /property /bean bean id=rootRouter class=org.restlet.ext.spring.SpringRouter property name=attachments map entry key=/{apiVersion} ref bean=myResource/ /entry /map /property /bean bean id=myResource class=my.MyResource scope=prototype /bean -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3086957
RE: restlet problem. urgent! Please help me!
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
Re: Re: restlet problem. urgent! Please help me!
Hello, when hosted by a servlet container a Restlet-based application is not started by default and not even instantiated. The first call to the servlet container allows to instantiate the application and start it. I wonder if your code makes some assumptions about the fact that the application is started or not. Could you check that? Havind said that, we have to make some checks also, I've entered an issue for that : https://github.com/restlet/restlet-framework-java/issues/579. Best regards, Thierry Boileau Thank you for your answer. The version of my restlet framework is as below: === Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7.0 Created-By: 1.5.0_22-b03 (Sun Microsystems Inc.) Main-Class: org.restlet.Component Bundle-ManifestVersion: 2 Bundle-Name: Restlet API Bundle-SymbolicName: org.restlet Bundle-Version: 2.0.6.0 Bundle-Vendor: Noelios Technologies Export-Package: org.restlet,org.restlet.data,org.restlet.engine,org.re stlet.engine.application,org.restlet.engine.component,org.restlet.eng ine.converter,org.restlet.engine.http,org.restlet.engine.http.adapter ,org.restlet.engine.http.connector,org.restlet.engine.http.header,org .restlet.engine.http.io,org.restlet.engine.http.security,org.restlet. engine.internal,org.restlet.engine.io,org.restlet.engine.local,org.re stlet.engine.log,org.restlet.engine.resource,org.restlet.engine.riap, org.restlet.engine.security,org.restlet.engine.util,org.restlet.repre sentation,org.restlet.resource,org.restlet.routing,org.restlet.securi ty,org.restlet.service,org.restlet.util Import-Package: javax.net,javax.net.ssl,javax.xml.parsers,org.osgi.fra mework Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-Activator: org.restlet.engine.internal.Activator Class-Path: Name: org.restlet Implementation-Title: org.restlet Implementation-Version: 2.0.6 (build 0) Implementation-Vendor: Noelios Technologies === I am sorry, I can not upload the source code because it will violate the company's rule. Can you give me some clue or some advices? I will appreciate your helping. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2954669 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2957060
Put Method Problems (Help needed)
the request entity. java.io.IOException: Unable to block the thread at the cyclic barrier. at org.restlet.util.SelectionRegistration.block(SelectionRegistration.java:183) at org.restlet.engine.io.NbChannelInputStream.onFill(NbChannelInputStream.java:228) at org.restlet.engine.io.Buffer.process(Buffer.java:597) at org.restlet.engine.io.NbChannelInputStream.read(NbChannelInputStream.java:305) at java.io.InputStream.read(InputStream.java:82) at org.restlet.engine.io.BioUtils.exhaust(BioUtils.java:238) at org.restlet.representation.Representation.exhaust(Representation.java:247) at org.restlet.engine.connector.ServerOutboundWay.onCompleted(ServerOutboundWay.java:174) at org.restlet.engine.connector.HttpServerOutboundWay.onCompleted(HttpServerOutboundWay.java:117) at org.restlet.engine.connector.OutboundWay.processIoBuffer(OutboundWay.java:410) at org.restlet.engine.connector.Way.onSelected(Way.java:412) at org.restlet.util.SelectionRegistration.onSelected(SelectionRegistration.java:295) at org.restlet.engine.connector.Connection.onSelected(Connection.java:603) at org.restlet.util.SelectionRegistration.onSelected(SelectionRegistration.java:295) at org.restlet.engine.connector.ConnectionController.onSelected(ConnectionController.java:200) at org.restlet.engine.connector.ServerConnectionController.onSelected(ServerConnectionController.java:99) at org.restlet.engine.connector.ConnectionController.selectKeys(ConnectionController.java:273) at org.restlet.engine.connector.ConnectionController.doRun(ConnectionController.java:153) at org.restlet.engine.connector.Controller.run(Controller.java:158) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) Caused by: java.util.concurrent.TimeoutException at java.util.concurrent.CyclicBarrier.dowait(CyclicBarrier.java:222) at java.util.concurrent.CyclicBarrier.await(CyclicBarrier.java:399) at org.restlet.util.SelectionRegistration.block(SelectionRegistration.java:179) ... 24 more 2012-04-27 22:54:44127.0.0.1 - - 8182PUT /test/updatepatient - 200 0 - 29 http://localhost:8182Restlet-Framework/2.1rc3 - Although as seen get, put, delete methods worked before.. http://restlet-discuss.1400322.n2.nabble.com/file/n7516346/UpdatePatientAddressServerResource.java UpdatePatientAddressServerResource.java http://restlet-discuss.1400322.n2.nabble.com/file/n7516346/UpdatePatientAddressResource.java UpdatePatientAddressResource.java http://restlet-discuss.1400322.n2.nabble.com/file/n7516346/Testsultan.java Testsultan.java http://restlet-discuss.1400322.n2.nabble.com/file/n7516346/TestClient.java TestClient.java -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Put-Method-Problems-Help-needed-tp7516346.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2956577
RE: Re: restlet problem. urgent! Please help me!
Thank you for your answer. The version of my restlet framework is as below: === Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7.0 Created-By: 1.5.0_22-b03 (Sun Microsystems Inc.) Main-Class: org.restlet.Component Bundle-ManifestVersion: 2 Bundle-Name: Restlet API Bundle-SymbolicName: org.restlet Bundle-Version: 2.0.6.0 Bundle-Vendor: Noelios Technologies Export-Package: org.restlet,org.restlet.data,org.restlet.engine,org.re stlet.engine.application,org.restlet.engine.component,org.restlet.eng ine.converter,org.restlet.engine.http,org.restlet.engine.http.adapter ,org.restlet.engine.http.connector,org.restlet.engine.http.header,org .restlet.engine.http.io,org.restlet.engine.http.security,org.restlet. engine.internal,org.restlet.engine.io,org.restlet.engine.local,org.re stlet.engine.log,org.restlet.engine.resource,org.restlet.engine.riap, org.restlet.engine.security,org.restlet.engine.util,org.restlet.repre sentation,org.restlet.resource,org.restlet.routing,org.restlet.securi ty,org.restlet.service,org.restlet.util Import-Package: javax.net,javax.net.ssl,javax.xml.parsers,org.osgi.fra mework Bundle-RequiredExecutionEnvironment: J2SE-1.5 Bundle-Activator: org.restlet.engine.internal.Activator Class-Path: Name: org.restlet Implementation-Title: org.restlet Implementation-Version: 2.0.6 (build 0) Implementation-Vendor: Noelios Technologies === I am sorry, I can not upload the source code because it will violate the company's rule. Can you give me some clue or some advices? I will appreciate your helping. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2954669
RE: restlet problem. urgent! Please help me!
Does anyone meet this problem? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2949722
Re: restlet problem. urgent! Please help me!
Hello, can you send us a sample app in order to reproduce the error? What is your version of the Restlet framework? Best regards, Thierry Boileau Does anyone meet this problem? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2949722 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2949814
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=2948542
Newbie needs help with @Post
Hi All, I am a Java Restlet newbie, and I want to create a restlet that does a roundtrip to a database, presents the results in HTML Text boxes in a HTML Table and stores any changes back to the database. I am on Exclipse and Restlet 2.1 My code below extends the ServerResource example, but never gets to the @Post annotation. Also I need an example of how to read the HTML variables eg fname and lname. Any help or examples to do with generating HTML pages would be appreciated Cheers Geoff Speedy ** import org.restlet.*; import org.restlet.data.*; import org.restlet.resource.*; public class FifthServerResource extends ServerResource { public static void main(String[] args) throws Exception { // Create the HTTP server and listen on port 8182 new Server(Protocol.HTTP, 8182, FifthServerResource.class).start(); } @Get public String getting() { System.out.println(Started getting ); String outstr = htmlheadtitleSheet/title/headform action=\ http://localhost:8182\; method=\POST\ + First name: input type=\text\ name=\fname\ /br / + Last name: input type=\text\ name=\lname\ /br / + input type=\submit\ value=\Submit\ / + /form ; System.out .println(outstr); return outstr; } @Post public String posting() { System.out.println(Started posting ); String outstr = htmlheadtitleSheet/title/headform action=\ http://localhost:8182\; method=\POST\ + First name: input type=\text\ name=\fname\ /br / + Last name: input type=\text\ name=\lname\ /br / + input type=\submit\ value=\Submit\ / + /form ; System.out .println(outstr); return outstr; } } ** Starting the internal [HTTP/1.1] server on port 8182 Started getting htmlheadtitleSheet/title/headform action=http://localhost:8182 method=POSTFirst name: input type=text name=fname /br /Last name: input type=text name=lname /br /input type=submit value=Submit //form Started getting htmlheadtitleSheet/title/headform action=http://localhost:8182 method=POSTFirst name: input type=text name=fname /br /Last name: input type=text name=lname /br /input type=submit value=Submit //form Started getting htmlheadtitleSheet/title/headform action=http://localhost:8182 method=POSTFirst name: input type=text name=fname /br /Last name: input type=text name=lname /br /input type=submit value=Submit //form ** Cheers, Geoff Speedy | Principal Developer Geoffrey Speedy | Principal Developer, BI Reports Development Team | Information Management and Technology Department of Human Services | Level 10, 2 Lonsdale Street, Melbourne p. 9096 7243 | f. 9096 9100 | e. geoffrey.spe...@dhs.vic.gov.au | www.dhs.vic.gov.au Corporate Services | Innovative business solutions for better client outcomes _ This email contains confidential information intended only for the person named above and may be subject to legal privilege. If you are not the intended recipient, any disclosure, copying or use of this information is prohibited. The Department provides no guarantee that this communication is free of virus or that it has not been intercepted or interfered with. If you have received this email in error or have any other concerns regarding its transmission, please notify postmas...@dhs.vic.gov.au _ -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2946983
JAXB and Restlet - Help needed
I am a newbie in REST and XML related server side coding. The aim is to generate resources based on a given xsd. I have the xsd processed into Java objects via the JAXB. So when I tried marshalling on a sample data, I had the corresponding xml generated. And unmarshalling gave me back the java object. However, I am not able to find the link between using the mashled xml to be treated as a resource. So when a client requests a resource, say, htp://myserver.com/networkInterfaces , Server needs to send back an xml with the networkInterfaces ? So, how do you think my Get and the representation should be created at the resource level. Any pointers ? Thanks for the help. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2928517
Unable to get the template serviceInfo.ftl, protocol used is not declared in the client connectors. (FILE) - I've tried everything it's still not working pls help
i've seriously been at this for hour I'm really stumped something is missing. I can't understand why it doesn't work. I'm trying to pass in the location of my ftl template. I read the restlet wiki, searched the mailing list even read the source I can't figure out wht it doesn't work. In MyApplication extend Application . I've tried getConnectorService().getClientProtocols().add(Protocol.FILE); I even tried this out of disperation... ConnectorService cs =new ConnectorService(); cs.setClientProtocols(UtilMisc.toList(Protocol.FILE, Protocol.HTTP)); setConnectorService(cs); @Override public Restlet createInboundRoot() { //I even added this in to get it to print out which had been set and they were in there! for(Protocol p :getConnectorService().getClientProtocols()){ Debug.log(p.getName()); } // initialize the Freemarker's configuration configuration = new Configuration(); configuration .setTemplateLoader(new ContextTemplateLoader( getContext(), file:/D:/development/myexample/deploy/myexample-integrations/webapp/myexample-base/service)); Then I have this in my HtmlRepresentationHandler. String templateName = serviceInfo.ftl; MediaType mediaType = MediaType.APPLICATION_XHTML; TemplateRepresentationrep = new TemplateRepresentation(templateName, getApp().getConfiguration(), cleanServiceResultMapInstance(results), mediaType); I always get the same error, I even tried other protocols to no avail. Jan 8, 2012 4:45:58 AM org.restlet.engine.component.ClientRouter getNext [java] WARNING: The protocol used by this request is not declared in the list of client connectors. (FILE) [java] Jan 8, 2012 4:45:58 AM org.restlet.engine.component.ClientRouter getNext [java] WARNING: The protocol used by this request is not declared in the list of client connectors. (FILE) [java] Jan 8, 2012 4:45:58 AM org.restlet.ext.freemarker.TemplateRepresentation getTemplate [java] WARNING: Unable to get the template serviceInfo.ftl. Error message: Template serviceInfo.ftl not found. I've read everything on google I can find about this no answers please can someone help. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2906793
No available server connector supports the required protocols: 'HTTP' warning in felix, can someone help me?
Hi, When I use restlet 2.0.6 to start three http server, sometimes I got one warning.Here is the information in osgi console: 2011-10-11 11:13:55 org.restlet.engine.http.connector.HttpServerHelper start 信息: Starting the internal HTTP server on port 8281 2011-10-11 11:13:56 org.restlet.engine.Engine createHelper 警告: No available server connector supports the required protocols: 'HTTP' . Please add the JAR of a matching connector to your classpath. 2011-10-11 11:13:56 org.restlet.engine.http.connector.HttpServerHelper start 信息: Starting the internal HTTP server on port 8182 My environment information is as follows: OS: Windows XP professional Service pack2 Felix 3.2.0 org.restlet-2.0.6.jar org.restlet.ext.jackson-2.0.6.jar org.restlet.ext.xml-2.0.6.jar and the code in every bundle to start restlet component is as follows: Component server = new Component(); server.getServers().add(Protocol.HTTP, port); server.getDefaultHost().attach(uriPattern, target); try { server.start(); } catch (Exception e) { LOGGER.error(exception occors when start server with + uriPattern + and port + port, e); return null; } It seems that I need to add a protocol jar, but I found that one has already existed in org.restlet-2.0.6.jar. It confused me a lot that it happens sometimes, not every time. And furthermore, the other two servers start fine and the middle one start with a warning. Another problem is that I can't stop the server in bundle when I updates the bundle by invoking server.stop(). The application just hangs there. Does someone meet this problem in osgi environment? Can someone help me?Thanks. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2853049
Re: Please HELP - I cant understand this concept
Simply create a new resource with its own URI. Pretty much any concept you want to make available to a client is a resource with a URI. The resource need not map to an object. The resource could read several objects, do some calculation, combine the object, etc, and then return the result. Bryan On Jun 19, 2011, at 7:23 AM, infoSyS wrote: There is this thing which I really can't understand about REST's concept. Suppose I have a resource called Company which has the following attributes : name, address, etc... and another resource called employee with the attributes : name, companyName, etc.. The employeeResource class will implement a method to GET the company name (having the ID identified in the URI) plus the other information ( adrress ... etc ) The employeesResource class will implement a method to GET all the companies names and relevant information same thing for the employee and employees resource class. Suppose the client wants to get the name of all employees and the name of the company they work at and its address. so WHERE should the function that performs this query be placed ? and what should be the URI in this case ? here in this case we are not accessing only one resource, but two at the same time as I can understand. PLEASE can any one help me understand this ? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Please-HELP-I-cant-understand-this-concept-tp6492786p6492786.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2769910 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2769923
Re: Please HELP - I cant understand this concept
Thank you so much for your answer ! this clarified many things for me, I still have one more thing, if for this get request I need to specify some filtering for the search criteria, ex : not just get the names of all the employees and their company name and address, I should instead get the employees that are - older than 40 years, - lives in city X - works in company Y I don't want these three data to be included in the URI, for example, I don't want it to be like this : http://www.example.com/employee?age=over40lives?X; etc I need to send these data in an xml file in the http get request, how could this be possible ? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Please-HELP-I-cant-understand-this-concept-tp6492786p6493051.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2769927
Re: Please HELP - I cant understand this concept
Usually GET requests do specify filtering parameters on the URL, that's fine and standard RESTful practice. IIRC, HTTP discourages sending an entity body with GET requests... I cannot remember right now, but it may be even disallowed. If (for example, for security reasons) you MUST avoid sending filtering parameters in the URL, you should think about designing a 'search' resource that accepts a form with the search parameters, and returns the response you want. You'd be doing a POST to that resource with a form, xml, json, whatever you want, with your search parameters... but HTTP already provides for that, as part of the protocol, in the form of the URL query parameters you'd like to avoid (GET /bla/bla?p1=v1p2=v2p3=v3...) Good luck. On Sun, Jun 19, 2011 at 11:51 AM, infoSyS l@hotmail.com wrote: Thank you so much for your answer ! this clarified many things for me, I still have one more thing, if for this get request I need to specify some filtering for the search criteria, ex : not just get the names of all the employees and their company name and address, I should instead get the employees that are - older than 40 years, - lives in city X - works in company Y I don't want these three data to be included in the URI, for example, I don't want it to be like this : http://www.example.com/employee?age=over40lives?X; etc I need to send these data in an xml file in the http get request, how could this be possible ? -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Please-HELP-I-cant-understand-this-concept-tp6492786p6493051.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2769927 -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2769974
JaxbRepresentation Help
Hello All, I am less used to Restlet framework. My target is to expose the xml representation to client, lets say a RIA package. I have my Java POJO classes generated form the schema, and I could not succeed to marshal them to XML and send it to client, using JaxbRepresentation. Below is the sample code snippet : public Representation getAddress() { ObjectFactory factory = new ObjectFactory(); AddressType addressType = factory.createAddressType(); addressType.setAddress(Address); addressType.setCity(City); addressType.setCountry(Country); addressType.setCustomerID(CustomerID); addressType.setPostalCode(PostalCode); addressType.setRegion(Region); return new JaxbRepresentationAddressType(addressType); } Dev. Env : IBM RAD 7.5.5 WAS with 6.1.0.31 EJB3 service pack, Web Services Service Pack, and Web2.0 installed. I have following jars in my EAR : org.osgi.core.jar org.restlet.ext.jaxb.jar org.restlet.ext.servlet.jar org.restlet.jar I am not sure, there may be conflicts between the Websphere's JAXB implementation and the ones ship with Restlet J2EE bundle. Pls. help me on this. Thanks in advance. Sujeeth -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/JaxbRepresentation-Help-tp6487744p6487744.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2768503
JAXB Extension - need help with error
(Restlet 2.0.7 SE, running in Equinox, with Jetty extension, J2SE 1.6.0_11, Ubuntu 10.04) I am trying to use the JAXB extension (via ClientResource) to serialize some DTO's. I definitely have all the bundles specified in lib/readme.txt for the JAXB extension loaded, and everything resolves. However, I getting this error (more detail below) when trying to put a DTO from client to server: May 7, 2011 1:10:39 PM org.restlet.resource.UniformResource doCatch WARNING: Exception or error caught in resource java.lang.NoClassDefFoundError: javax/xml/transform/sax/SAXSource at org.restlet.ext.jaxb.JaxbConverter.toObject(JaxbConverter.java:155) at org.restlet.service.ConverterService.toObject(ConverterService.java:158) I thought javax.xml.transform.sax.SAXSource was available from the J2SE. The API docs for J2SE 1.6 say it is. -- My DTO class is annotated with JAXB annotations and I do have an ObjectFactory class as well as a jaxb.index in the same package: @XmlRootElement(name=example, namespace=http://example.com/example;) @XmlAccessorType(XmlAccessType.FIELD) public class ExampleDTO { @XmlElement(required=true) private String id; public ExampleDTO() { super(); } public String getId() { return id; } public void setId( String id ) { this.id = id; } } I have the following resource interface: public interface ExampleResource { @Get(xml) ExampleDTO retrieve(); @Put(xml) void store( ExampleDTO dto ); } that is implemented by a ServerResource class. On the client, I have attempted to invoke the ExampleResource.store(ExampleDTO) the following two ways: ExampleDTO example = new ExammpleDTO(); example.setId( anId ); ClientResource clientResource = new ClientResource( uri ); clientResource.put( new JaxbRepresentationProgramDTO( MediaType.APPLICATION_XML, program ) ); and: ExampleDTO example = new ExammpleDTO(); example.setId( anId ); ExampleResource exampleResource = new ClientResource( uri, ExampleResource.class ); exampleResource.store( example ); In both cases, I get the same errors. Client-side error: Exception in thread main Internal Server Error (500) - Server Error at org.restlet.resource.ClientResource$1.invoke(ClientResource.java:1652) at $Proxy6.store(Unknown Source) at com.example.Client.putExample(Client.java:93) Server-side error: May 7, 2011 12:43:55 PM org.restlet.resource.UniformResource doCatch WARNING: Exception or error caught in resource java.lang.NoClassDefFoundError: javax/xml/transform/sax/SAXSource at org.restlet.ext.jaxb.JaxbConverter.toObject(JaxbConverter.java:155) at org.restlet.service.ConverterService.toObject(ConverterService.java:158) at org.restlet.resource.UniformResource.toObject(UniformResource.java:644) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:431) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:490) at org.restlet.resource.ServerResource.put(ServerResource.java:1139) at org.restlet.resource.ServerResource.doHandle(ServerResource.java:375) at org.restlet.resource.ServerResource.doNegotiatedHandle(ServerResource.java:591) at org.restlet.resource.ServerResource.doConditionalHandle(ServerResource.java:299) at org.restlet.resource.ServerResource.handle(ServerResource.java:846) at org.restlet.resource.Finder.handle(Finder.java:510) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:203) at org.restlet.routing.Router.doHandle(Router.java:497) at org.restlet.routing.Router.handle(Router.java:737) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:203) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:203) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.engine.application.StatusFilter.doHandle(StatusFilter.java:151) at org.restlet.routing.Filter.handle(Filter.java:203) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:203) at org.restlet.engine.ChainHelper.handle(ChainHelper.java:111) at org.restlet.engine.application.ApplicationHelper.handle(ApplicationHelper.java:72) at org.restlet.Application.handle(Application.java:388) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:203) at org.restlet.routing.Router.doHandle(Router.java:497) at org.restlet.routing.Router.handle(Router.java:737) at org.restlet.routing.Filter.doHandle(Filter.java:156) at org.restlet.routing.Filter.handle(Filter.java:203)
Help with GWT integration
Hi! I'm trying to replace the GWT RPC by pure rest services. I'm following the examples at ( http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html) with one difference, our services already exist and we use resteasy to expose them. When I invoke the service I'm getting an exception: java.io.IOException: Can't parse the enclosed entity at com.furiousbob.client.services.NodeServiceProxyProxy$1.handle(NodeServiceProxyProxy.java:47) at org.restlet.client.engine.adapter.ClientAdapter$1.handle(ClientAdapter.java:93) at org.restlet.client.engine.adapter.GwtClientCall$2.onResponseReceived(GwtClientCall.java:245) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214) at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:619) I've tried to change my services from json to xml, but I keep getting the same exception. I'm using restlet 2.1m2 for GWT 2.1.0 I don't have access to the generated proxy class, so I could not debug further. Any ideas? -- The intuitive mind is a sacred gift and the rational mind is a faithful servant. We have created a society that honors the servant and has forgotten the gift. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2710624
Re: Help with GWT integration
Hi, I was experiencing a similar issue. Problem manifested itself in the fact that the client was requesting the data object to be represented as application/x-java-serialized-object+gwt while my rest service always provided a JSON representation. In my case this yield to a similar stack trace like you are reporting. Root cause in my case was that I marked the DataObject which is commonly used between GWT client and server(in this case the Rest service) was marked with is the com.google.gwt.user.client.rpc.IsSerializable interface and not the java.io.Serializable interface. This used to work fine with GWT RPC mechanism but didn't work for using the restlet stack. Changing to Serializable solved the issue for me. Cheers, Stefan On Thu, Mar 10, 2011 at 10:32 AM, Vinicius Carvalho viniciusccarva...@gmail.com wrote: Hi! I'm trying to replace the GWT RPC by pure rest services. I'm following the examples at ( http://wiki.restlet.org/docs_2.0/13-restlet/21-restlet/318-restlet/303-restlet.html) with one difference, our services already exist and we use resteasy to expose them. When I invoke the service I'm getting an exception: java.io.IOException: Can't parse the enclosed entity at com.furiousbob.client.services.NodeServiceProxyProxy$1.handle(NodeServiceProxyProxy.java:47) at org.restlet.client.engine.adapter.ClientAdapter$1.handle(ClientAdapter.java:93) at org.restlet.client.engine.adapter.GwtClientCall$2.onResponseReceived(GwtClientCall.java:245) at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287) at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395) at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:326) at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:207) at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:126) at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561) at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269) at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91) at com.google.gwt.core.client.impl.Impl.apply(Impl.java) at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:214) at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103) at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71) at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:157) at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:281) at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:531) at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:352) at java.lang.Thread.run(Thread.java:619) I've tried to change my services from json to xml, but I keep getting the same exception. I'm using restlet 2.1m2 for GWT 2.1.0 I don't have access to the generated proxy class, so I could not debug further. Any ideas? -- The intuitive mind is a sacred gift and the rational mind is a faithful servant. We have created a society that honors the servant and has forgotten the gift. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2710627
Re: Need noob help
Scott, I understand how frustrating it is to try to use something with limited information and no help. My restlet knowledge is pretty basic, and your question is pretty vague, so I don't know whether I could help you or not. If you could be a bit more specific, I might be able to help you. My knowledge is only of the Java version. I haven't used the Google or Android or whatever other versions there are. John --- On Mon, 2/14/11, Scott Shea scott.s...@apollogrp.edu wrote: From: Scott Shea scott.s...@apollogrp.edu Subject: Need noob help To: discuss@restlet.tigris.org Date: Monday, February 14, 2011, 11:31 AM I have coded myself into a hole and need some help out. I would try and post a question with code but seriously, I am not sure where I went wrong at this point. Is there someone who has implemented a Restlet solution that could help me off line? Both from shame and kindness I do not want to pollute the board with my ignorance. Thanks in advance. Scott Shea -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2703986 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2704659
Need noob help
I have coded myself into a hole and need some help out. I would try and post a question with code but seriously, I am not sure where I went wrong at this point. Is there someone who has implemented a Restlet solution that could help me off line? Both from shame and kindness I do not want to pollute the board with my ignorance. Thanks in advance. Scott Shea -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2703986
RE: Need noob help
Hi Scott, For private support, you can consider our professional services: http://www.noelios.com/products/support Best regards, Jerome -- Restlet ~ Founder and Technical Lead ~ http://www.restlet.org Noelios Technologies ~ http://www.noelios.com -Message d'origine- De : Scott Shea [mailto:scott.s...@apollogrp.edu] Envoyé : lundi 14 février 2011 18:31 À : discuss@restlet.tigris.org Objet : Need noob help I have coded myself into a hole and need some help out. I would try and post a question with code but seriously, I am not sure where I went wrong at this point. Is there someone who has implemented a Restlet solution that could help me off line? Both from shame and kindness I do not want to pollute the board with my ignorance. Thanks in advance. Scott Shea -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2703986 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2703994
RE: Need noob help
Hello Scott, if you need some help inline, you can have a look at the user guide: http://wiki.restlet.org/docs_2.0/318-restlet.html Best regards, Thierry Boileau -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2704005
RE: Re: Re: Re: Re: Need help understanding the correct FLOW
Fabian thanks alot for all your help I now have that working. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2701983
Re: Re: Re: Re: Re: Need help understanding the correct FLOW
Good to hear that :-) Good luck with the rest of your project Randy! On Wed, Feb 2, 2011 at 3:30 PM, Randy Paries rtpar...@gmail.com wrote: Fabian thanks alot for all your help I now have that working. -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2702026
Re: Re: Re: Re: Need help understanding the correct FLOW
public Restlet createInboundRoot() { Router router = new Router(getContext()); MapVerifier verifier = new MapVerifier(); verifier.getLocalSecrets().put(scott, tiger.toCharArray()); CookieAuthenticator authenticator = new CookieAuthenticator(getContext(), Cookie Test); //end snippet My usernames and passwords are in a DB So is the flow, each time someone makes a request I need to query and get the username/password so i can put it into the verifier? I am thinking that after they login i will generate somekind of key based on their username/password and that is what will be passed back and forth or set as a cookie. thanks for your help -- Fabián Mandelbaum IS Engineer -- Fabián Mandelbaum IS Engineer -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2701818
RE: Re: Re: Re: Need help understanding the correct FLOW
Fabián, sorry i will try to provide more details. the problem i am having is the what is passed in to verify in my DBverify(see below) the secret is encrypted and i did not encrypt it and i do not know where in the process i am doing something incorrect that it is getting encrypted. In my application i have public Restlet createInboundRoot() { Router router = new Router(getContext()); router.attach(/, RootServerResource.class); router.attach(/login/{username}/, UserAuthorizationResource.class); Router wrouter = new Router(getContext()); wrouter.attach(/tb/,testResource.class); DBVerifier verifier = new DBVerifier(); MyAuthenticator authenticator = new MyAuthenticator(getContext(), Cookie Test); authenticator.setVerifier(verifier); authenticator.setNext(wrouter); router.attach(/{userID}, authenticator); return router; } - in MyAuthenticator (snippet ): protected int beforeHandle(Request request, Response response) { /*passwd is not encrypted here*/ request.setChallengeResponse(new ChallengeResponse( ChallengeScheme.HTTP_BASIC, username, passwd )); return super.beforeHandle(request, response); } - public class DBVerifier extends SecretVerifier { public boolean verify(java.lang.String identifier, char[] secret) { System.out.println(identifier=[+identifier+] secret=[+secret.toString()+]); return true; } } Hello Randy, you usually know the hash function to encrypt the secret to persist in encrypted in the DB. So, you just need to get the secret from the request, apply that hash/encryption function, and compare it with the already encrypted value you read from the DB, in the Verifier's verify() implementation. Maybe you are encrypting the password twice somehow? I couldn't fully understand what you wrote. What you 'cannot get anything useful from'? Hope the above helps guide you in the right direction... On Sat, Jan 29, 2011 at 3:43 PM, Randy Paries rtparies at gmail dot com wrote: Fabian, i am getting closer, but i am one step away i think. each time my service is called i pass in an encrypted string I decrypt it and in my ChallengeAuthenticator i have request.setChallengeResponse( new ChallengeResponse( ChallengeScheme.HTTP_COOKIE, keyArray[1], keyArray[2].toCharArray() )); here is my problem I have created a class DBVerifier extends SecretVerifier i was assuming in the verify method i would query the DB and authenticate, but the secret is in a format that i can not get anything useful from. in the authenticator request.getChallengeResponse().getSecret() gives me what i need, so i know the correct value is in there. thanks for your patience and insight randy Hello Randy, indeed your custom Verifier will have to query the DB on each request to, well, verify, the provided credentials are valid. You can also build an in-memory (provided the passwords are stored on the DB already encrypted, to tighten security a bit) credentials 'cache' which is populated (reading from the DB) when the system starts, and then your custom Verifier can query that credentials cache instead of the DB. As you can see, Restlet is very flexible and provides you with many possibilities to handle authentication. OTOH, that flexibility means a little more work on your side to implement the authentication 'architecture' the way you want or need it. On Wed, Jan 26, 2011 at 7:46 PM, Randy Paries rtparies at gmail dot com wrote: Fabian , thanks for the response. that helped, i am now getting closer. So there is one last part i am not getting. from the book there is the example //snippet @Override public Restlet createInboundRoot() { Router router = new Router(getContext()); MapVerifier verifier = new MapVerifier(); verifier.getLocalSecrets().put(scott, tiger.toCharArray()); CookieAuthenticator authenticator = new CookieAuthenticator(getContext(), Cookie Test); //end snippet My usernames and passwords are in a DB So is the flow, each time someone makes a request I need to query and get the username/password so i can put it into the verifier? I am thinking that after they login i will generate somekind of key based on their username/password and that is what will be passed back and forth or set as a cookie. thanks for your help -- Fabián Mandelbaum IS Engineer -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2701699
Re: Re: Re: Need help understanding the correct FLOW
Hello Randy, you usually know the hash function to encrypt the secret to persist in encrypted in the DB. So, you just need to get the secret from the request, apply that hash/encryption function, and compare it with the already encrypted value you read from the DB, in the Verifier's verify() implementation. Maybe you are encrypting the password twice somehow? I couldn't fully understand what you wrote. What you 'cannot get anything useful from'? Hope the above helps guide you in the right direction... On Sat, Jan 29, 2011 at 3:43 PM, Randy Paries rtpar...@gmail.com wrote: Fabian, i am getting closer, but i am one step away i think. each time my service is called i pass in an encrypted string I decrypt it and in my ChallengeAuthenticator i have request.setChallengeResponse( new ChallengeResponse( ChallengeScheme.HTTP_COOKIE, keyArray[1], keyArray[2].toCharArray() )); here is my problem I have created a class DBVerifier extends SecretVerifier i was assuming in the verify method i would query the DB and authenticate, but the secret is in a format that i can not get anything useful from. in the authenticator request.getChallengeResponse().getSecret() gives me what i need, so i know the correct value is in there. thanks for your patience and insight randy Hello Randy, indeed your custom Verifier will have to query the DB on each request to, well, verify, the provided credentials are valid. You can also build an in-memory (provided the passwords are stored on the DB already encrypted, to tighten security a bit) credentials 'cache' which is populated (reading from the DB) when the system starts, and then your custom Verifier can query that credentials cache instead of the DB. As you can see, Restlet is very flexible and provides you with many possibilities to handle authentication. OTOH, that flexibility means a little more work on your side to implement the authentication 'architecture' the way you want or need it. On Wed, Jan 26, 2011 at 7:46 PM, Randy Paries rtparies at gmail dot com wrote: Fabian , thanks for the response. that helped, i am now getting closer. So there is one last part i am not getting. from the book there is the example //snippet @Override public Restlet createInboundRoot() { Router router = new Router(getContext()); MapVerifier verifier = new MapVerifier(); verifier.getLocalSecrets().put(scott, tiger.toCharArray()); CookieAuthenticator authenticator = new CookieAuthenticator(getContext(), Cookie Test); //end snippet My usernames and passwords are in a DB So is the flow, each time someone makes a request I need to query and get the username/password so i can put it into the verifier? I am thinking that after they login i will generate somekind of key based on their username/password and that is what will be passed back and forth or set as a cookie. thanks for your help -- Fabián Mandelbaum IS Engineer -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2701455
RE: Re: Re: Need help understanding the correct FLOW
Fabian, i am getting closer, but i am one step away i think. each time my service is called i pass in an encrypted string I decrypt it and in my ChallengeAuthenticator i have request.setChallengeResponse( new ChallengeResponse( ChallengeScheme.HTTP_COOKIE, keyArray[1], keyArray[2].toCharArray() )); here is my problem I have created a class DBVerifier extends SecretVerifier i was assuming in the verify method i would query the DB and authenticate, but the secret is in a format that i can not get anything useful from. in the authenticator request.getChallengeResponse().getSecret() gives me what i need, so i know the correct value is in there. thanks for your patience and insight randy Hello Randy, indeed your custom Verifier will have to query the DB on each request to, well, verify, the provided credentials are valid. You can also build an in-memory (provided the passwords are stored on the DB already encrypted, to tighten security a bit) credentials 'cache' which is populated (reading from the DB) when the system starts, and then your custom Verifier can query that credentials cache instead of the DB. As you can see, Restlet is very flexible and provides you with many possibilities to handle authentication. OTOH, that flexibility means a little more work on your side to implement the authentication 'architecture' the way you want or need it. On Wed, Jan 26, 2011 at 7:46 PM, Randy Paries rtparies at gmail dot com wrote: Fabian , thanks for the response. that helped, i am now getting closer. So there is one last part i am not getting. from the book there is the example //snippet @Override public Restlet createInboundRoot() { Router router = new Router(getContext()); MapVerifier verifier = new MapVerifier(); verifier.getLocalSecrets().put(scott, tiger.toCharArray()); CookieAuthenticator authenticator = new CookieAuthenticator(getContext(), Cookie Test); //end snippet My usernames and passwords are in a DB So is the flow, each time someone makes a request I need to query and get the username/password so i can put it into the verifier? I am thinking that after they login i will generate somekind of key based on their username/password and that is what will be passed back and forth or set as a cookie. thanks for your help -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2701437
Re: Re: Need help understanding the correct FLOW
Hello Randy, indeed your custom Verifier will have to query the DB on each request to, well, verify, the provided credentials are valid. You can also build an in-memory (provided the passwords are stored on the DB already encrypted, to tighten security a bit) credentials 'cache' which is populated (reading from the DB) when the system starts, and then your custom Verifier can query that credentials cache instead of the DB. As you can see, Restlet is very flexible and provides you with many possibilities to handle authentication. OTOH, that flexibility means a little more work on your side to implement the authentication 'architecture' the way you want or need it. On Wed, Jan 26, 2011 at 7:46 PM, Randy Paries rtpar...@gmail.com wrote: Fabian , thanks for the response. that helped, i am now getting closer. So there is one last part i am not getting. from the book there is the example //snippet @Override public Restlet createInboundRoot() { Router router = new Router(getContext()); MapVerifier verifier = new MapVerifier(); verifier.getLocalSecrets().put(scott, tiger.toCharArray()); CookieAuthenticator authenticator = new CookieAuthenticator(getContext(), Cookie Test); //end snippet My usernames and passwords are in a DB So is the flow, each time someone makes a request I need to query and get the username/password so i can put it into the verifier? I am thinking that after they login i will generate somekind of key based on their username/password and that is what will be passed back and forth or set as a cookie. thanks for your help -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2700914
RE: Re: Need help understanding the correct FLOW
Fabian , thanks for the response. that helped, i am now getting closer. So there is one last part i am not getting. from the book there is the example //snippet @Override public Restlet createInboundRoot() { Router router = new Router(getContext()); MapVerifier verifier = new MapVerifier(); verifier.getLocalSecrets().put(scott, tiger.toCharArray()); CookieAuthenticator authenticator = new CookieAuthenticator(getContext(), Cookie Test); //end snippet My usernames and passwords are in a DB So is the flow, each time someone makes a request I need to query and get the username/password so i can put it into the verifier? I am thinking that after they login i will generate somekind of key based on their username/password and that is what will be passed back and forth or set as a cookie. thanks for your help -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2700752
Re: Need help understanding the correct FLOW
Hello Randy, 'login' is always a hot topic on RESTful applications. The Restlet flow you mention is basically this: Client --- Request -- Guard -- Protected Server Resource it's the Guard (usually org.restlet.security.ChallengeAuthenticator) the one that authenticates the user, making sure the system knows this user. The way to do that is by means of an Authenticator that will use a Verifier (which you have to implement for your scenario extending usually org.restlet.security.SecretVerifier) to check the user is who he claims to be. In a REST app, all requests to that Protected Server Resource need to provide the correct authentication credentials, there's no idea of 'state' (a session for example): this user has already been logged in, so it's OK to grant him access without credentials. This never happens in a REST app, all guarded resources require authentication. You usually don't see the above happening because the most popular web clients, read: web browsers, only ask you for authentication once, and then send all subsequent requests pre-authenticated. Your client iPhone app (as I understand, the client) will have to take care of doing this: reacting to the 401 the server will answer (with the above flow Restlet takes care of this for you) and asking the user, reading from a config file, or doing whatever it does to get the user's credentials, and retry the request with authentication info, and perform all subsequent such requests pre-authenticated (providing that authentication info). This works fine for HTTP Basic (needs encryption on the comms channel, using SSL for example, because the credentials are transmitted in clear text). I'll let other, more security-versed, people enhance this answer if they see fit. Hope this helps. On Thu, Jan 20, 2011 at 7:52 PM, Randy Paries rtpar...@gmail.com wrote: Hello, I am trying to create a RESTful application Server. I am going to use the RestLet framework. As i am designing the URL's i have some questions. This app server is going to be the backend for an iPhone app. The app will require authentication So here is where i get a little confused with the design. The app will make a call to http://mydomain.com/api/users/{userid}/apps/ this will return a XML with the available apps and their URI's here is where i can not seem to connect the dots, and i would like to do this correctly the restful/reslet way. if they goto directly http://mydomain.com/api/users/{userid}/apps/ initially they will get a 401 (unauthorized) With this app they can not do anything without being authenticated In my application i am using the CookieAuthenticator I do not understand the correct way for this client to start Should the app initially POST username and password to https://mydomain.com/api/users ?? thanks for any help -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2699439 -- Fabián Mandelbaum IS Engineer -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2699916
Need help understanding the correct FLOW
Hello, I am trying to create a RESTful application Server. I am going to use the RestLet framework. As i am designing the URL's i have some questions. This app server is going to be the backend for an iPhone app. The app will require authentication So here is where i get a little confused with the design. The app will make a call to http://mydomain.com/api/users/{userid}/apps/ this will return a XML with the available apps and their URI's here is where i can not seem to connect the dots, and i would like to do this correctly the restful/reslet way. if they goto directly http://mydomain.com/api/users/{userid}/apps/ initially they will get a 401 (unauthorized) With this app they can not do anything without being authenticated In my application i am using the CookieAuthenticator I do not understand the correct way for this client to start Should the app initially POST username and password to https://mydomain.com/api/users ?? thanks for any help -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2699439
help with the correct way to authorize
hello, So i am learning via the fire-hose. i have been reading the RestletinAction book and i need some direction on how best to use it in my env. I have someone creating an iphone app thats going to be calling my existing web app and wants to communicate RESTFUL (i hope that is saying it correctly) all of the calls to my server will need to be authorized , which initially will need to be authenticated. We have our own home grown auth where we have the username/password in a mysql DB and then set cookies once authenticated. So i am looking for some help on how to do this. I looked at the CookieAuthenticator but we are all jsp/servlet and really do not want to user FreeMarker just for this little app. the other part that i am struggling to try to get my head around is the login Flow in a restful env So i think what i would do is every page would be guarded ? and the first time the iphone app connected to any URI ,it would return a 401? thanks for anyhelp / direction / suggestions Randy -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2699159
RE: help, I need my URLS defaulted to https:// not http://
Hello, Restlet has defaulted all my URLS to http://something. How do I change this so that the default is https://something? What do you mean by Restlet has defaulted all my URLS to http://something;? Restlet allows you to define a set of resources. Once that has been done, you set up the server connectors that will serve those resources. First declare the supported protocols (http, https, etc), then complete the classpath with the jar of the implementations that support these protocols. Here is some documentation about Spring configuration [1], and connectors [2]. Best regards, Thierry Boileau [1] http://wiki.restlet.org/docs_2.0/13-restlet/28-restlet/70-restlet/196-restlet.html [2] http://wiki.restlet.org/docs_2.0/13-restlet/27-restlet/325-restlet/37-restlet.html -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2675987
help, I need my URLS defaulted to https:// not http://
Hi I've got a web application from my supervisor using restlet and Spring security. I've got SSL happening at an earlier stage before the a request reach my web application on a virtual machine. Restlet has defaulted all my URLS to http://something. How do I change this so that the default is https://something? As I said the SSL stage is done earlier, I just want my URLS to be set to https not http. The application has a router class which extends import org.restlet.ext.spring.SpringRouter; Is there any simply way to configure this? Cheers, P.S. sorry if this message was already posted, i posted earlier and it didn't turn up on the posted list. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2671490
Rest help needed
Hi all! I need some help with rest as I am new to this programming scene. I'm trying to learn the the basic restlet webservice therefore can someone link me to a forum post somewhere that shows you how you use restlet to POST? Basically I want to POST hello, world to the resource, and upon retrieving the resource it tells me what i have posted before. Sorry if this doesnt make sense and thanks in advance for your help! -- View this message in context: http://restlet-discuss.1400322.n2.nabble.com/Rest-help-needed-tp5312301p5312301.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2635252
RE: Re: Rest help needed
Hello Rachel and Alex, as mentionned by Alex a simple ServerResource is shown here ([1]). In your case, you need to complete it with the following code: @Post public String accept(String message) { return message; } Then, on client side, have a look at this sample code [2]. You can try something like: ClientResource resource = new ClientResource(http://.../yourresource;); // Write the response entity on the console resource.post(hello, world).write(System.out); Best regards, Thierry Boileau [1] http://wiki.restlet.org/docs_2.0/13-restlet/319-restlet.html [2] http://wiki.restlet.org/docs_2.0/13-restlet/320-restlet.html -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2635306
Re: Re: Please help: Standalone RESTLET client works but the GWT RESTLET client doesn't
Hi, Now when I invoke the Restful web svc with POST request, I get an exception: org.restlet.client.resource.ResourceException: *Unsupported Media Type* * * The web service is running on localhost:8080 under tomcat and is designed using SPRING REST framework. Below is the client code from GWT App where I invoke the web service. User.java, UserResource.java and UserResourceProxy.java are attached. *// Submit button on the form - invokes a web service to store the user data * btSubmit.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { invokePostWebSvc(btSubmit,tbFName); // invokes the Restful web svc with a POST method request } }); private void *invokePostWebSvc*(final Button btSubmit, TextBox tbFName) { // Set up the contact resource UserResourceProxy userResource = GWT .create(UserResourceProxy.class); userResource.getClientResource().setReference( http://localhost:8080/webapp/rest/postWithStringResponseUser.xml;); userResource.getClientResource().getClientInfo() .getAcceptedMediaTypes().add( new PreferenceMediaType( MediaType.APPLICATION_JAVA_OBJECT_GWT)); Integer id = new Integer(tbFName.getText()); userResource.store(id, new ResultUser() { public void onFailure(Throwable caught) { System.out.println(Error in submission ); Log.debug(caught.getMessage(), caught); btSubmit.setText(caught.getMessage()); // GWT.log(caught.getMessage(), caught); // caught.printStackTrace(); } public void onSuccess(User v) { btSubmit.setText(v.getName()); System.out.println(Success = + v.getName() ); } }); } On Tue, Apr 13, 2010 at 2:43 PM, Thierry Boileau [via Restlet Discuss] ml-node+4894955-874754734-495...@n2.nabble.comml-node%2b4894955-874754734-495...@n2.nabble.com wrote: Hi deep, can you provide a sample app? Best regards, Thierry Boileau -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2580596 -- View message @ http://n2.nabble.com/Please-help-Standalone-RESTLET-client-works-but-the-GWT-RESTLET-client-doesn-t-tp4876360p4894955.html To start a new topic under Restlet Discuss, email ml-node+1400322-780992574-495...@n2.nabble.comml-node%2b1400322-780992574-495...@n2.nabble.com To unsubscribe from Restlet Discuss, click here (link removed) =. -- View this message in context: http://n2.nabble.com/Please-help-Standalone-RESTLET-client-works-but-the-GWT-RESTLET-client-doesn-t-tp4876360p4900627.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2581980
RE: Re: Please help: Standalone RESTLET client works but the GWT RESTLET client doesn't
Hi deep, can you provide a sample app? Best regards, Thierry Boileau -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2580596
Please help: Standalone RESTLET client works but the GWT RESTLET client doesn't
Hello, I have been trying to debug the issue that I am having while trying to invoke Restful web service via GWT client. I am using GWT 2.0 and restlet-gwt-2.0rc2. What I did today is I tried with a stand alone client (using restlet-jse-2.0rc2) and try to invoke the web service http://localhost:8080/webapp/rest/content [developed using Spring REST framework]. The stand alone client works fine and the web service returns String output Hello world. However, when I try to invoke the same web service using GWT client then I get an error. When I print the status of the response, it prints - *null (0) .* Any idea ? Please help. See the code for GWT client and stand alone client. GWT client: * btSubmit.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { ClientResource cr = new ClientResource( **http://localhost:8080/webapp/rest/content*http://localhost:8080/webapp/rest/content *); cr.setOnResponse(new Uniform() { public void handle(Request request, Response response) { Status status = response.getStatus(); // It prints null (0) System.out.println(status); if (response.getStatus().isSuccess()) { try { System.out.println(Output = + response.getEntity().getText()); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } else { System.out.println(Failure); } } }); System.out.println(Trying.); cr.get(); } });* ** *Stand alone client:* ** try { ClientResource cr = new ClientResource( http://localhost:8080/webapp/rest/content;); Representation rep = cr.get(); rep.write(System.out); } catch (IOException e) { System.out.println(IOException); e.printStackTrace(); } catch (ResourceException e) { System.out.println(ResourceException); e.printStackTrace(); } ** -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2531113
RE: Please help: Standalone RESTLET client works but the GWT RESTLET client doesn't
Hello, do you encounter the Same Origin Policy syndrom (http://en.wikipedia.org/wiki/Same_origin_policy)? What is the URL of the GWT page? Best regards, Thierry Boileau -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2531497
Re: Please help: Standalone RESTLET client works but the GWT RESTLET client doesn't
Thanks. That was same origin policy issue. I deployed the web app to tomcat (localhost:8080 ) and it worked!!. However, my other issue of POST with serialized User object still persists. I had submitted other posts yestereday. Any idea what could be causing that ? Thanks. -Deep On Fri, Apr 9, 2010 at 4:50 PM, Thierry Boileau [via Restlet Discuss] ml-node+4876515-1719982597-495...@n2.nabble.comml-node%2b4876515-1719982597-495...@n2.nabble.com wrote: Hello, do you encounter the Same Origin Policy syndrom ( http://en.wikipedia.org/wiki/Same_origin_policy)? What is the URL of the GWT page? Best regards, Thierry Boileau -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2531497 -- View message @ http://n2.nabble.com/Please-help-Standalone-RESTLET-client-works-but-the-GWT-RESTLET-client-doesn-t-tp4876360p4876515.html To start a new topic under Restlet Discuss, email ml-node+1400322-780992574-495...@n2.nabble.comml-node%2b1400322-780992574-495...@n2.nabble.com To unsubscribe from Restlet Discuss, click here (link removed) =. -- View this message in context: http://n2.nabble.com/Please-help-Standalone-RESTLET-client-works-but-the-GWT-RESTLET-client-doesn-t-tp4876360p4878794.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2535627
RE: need some help with my project design
Hi Duong, The reverse proxy approach is the most flexible as you remove the SOP issues. See the architecture diagrams on this page: http://wiki.restlet.org/docs_2.0/13-restlet/275-restlet/144-restlet/185-rest let.html However, it does require an extra request and adds some latency. So if you can afford to issue only GET requests and received only JSON entities, then JsonpRequestBuilder is an interesting workaround! I have just entered a RFE to directly support this in Restlet/GWT: Support cross-domain HTTP/JSON requests in GWT http://restlet.tigris.org/issues/show_bug.cgi?id=996 Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Duong BaTien [mailto:duong.bat...@gmail.com] Envoyé : lundi 21 décembre 2009 23:02 À : discuss@restlet.tigris.org Objet : Re: need some help with my project design Thanks and keep on with the good works at Restlet. For those interested in the issue, GWT 2.0 seems to offer solution in JsonpRequestBuilder http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/index.html? overview-summary.html Duong BaTien DBGROUPS and BudhNet On Mon, 2009-12-21 at 18:03 +0100, Thierry Boileau wrote: Hello Duong, Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. I wonder if you should instead explore the track of a kinf of reverse proxy implemented by a Restlet redirector. The ajax request goes to the redirector (with the target url as a query parameter for example) which then relays to the target url. I wonder if GWT Reslet client has that facility in place?. A ClientResource instance is dedicated to a single resource (ie a single URI). Thus you can multiply the clientresource/callback pairs. Best regards, Thierry Boileau Hello Duong, 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? Actually, this is at the end pure javascript code, so the restriction applies plainly. see http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? I'm sorry, I'm not sure to fully understand your question. In that cross-site mashup, one needs a facility to store requested callbacks so it can cancel the no-response callback after certain time lapsed and identify the callback actually coming from its request. This may require a facility more sophisticated than just a HashMap of callbacks as shown in GWT StockWatcher. I wonder if GWT Reslet client has that facility in place?. Same as the server to make sure that the request comes from legitimate clients? Since the server exposes resources to the whole Web, I suppose you are talking about the authentication topic. You want the server to check that the incoming request comes from an authenticated client. It can use one of the available authentication mechanism such as HTTP_BASIC, HTTP_DIGEST, HTTP_BASIC+HTTPS, cookies, etc. It is much more complicated than that. When the server serves a resource, it identifies the request with a user profile and its unique token. If the user has not been authenticated, then guest Id with location may be in the user profile. When user is authenticated, the profile is changed accordingly. User second request and/or client state maintained at the browser always has the server token so the server know the client state, and if required can be directed to Authentication process. I wonder if Restlet and/or anyone has explored this area working with GAE. I am also exploring Google Wave where Wave robots are at the Web Server served by servlet urls. The web server uses Reslet for resource Request/Response to be integrated with Wave server. Any comment in this area is appreciated. Thanks Duong BaTien DBGROUPS and BudhNet Best regards, Thierry Boileau Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole
RE: Help with jax-rs @Path matching.
Hi Karel, Do you think it is a bug in Restlet extension for JAX-RS? If so, could you enter a bug report and ideally suggest a patch? Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Karel Vervaeke [mailto:ka...@outerthought.org] Envoyé : lundi 21 décembre 2009 11:41 À : discuss@restlet.tigris.org Objet : Re: Help with jax-rs @Path matching. By the way, when using @Path(foo{dot:\\.}bar), the resource also matches foo.bar/anything. Is there a way to prevent this? That's not true, my mistake. It does match foo.bar/ though. Actually, it should match foo{dot:\\.}bar - according to step 5 of section 3.7.3 of the spec. Regards, Karel -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431935 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2433400
Re: need some help with my project design
Hello, The solution would be a relative url. But how can i do this? Simply instantiate your clientResource with your relative URI (cd http://wiki.restlet.org/docs_2.0/188-restlet.html or http://wiki.restlet.org/docs_2.0/303-restlet.html for some sample code) Best regards, Thierry Boileau I figured out the problem: It is called cross site issue :) At the moment my project looks like this: http://dl.dropbox.com/u/1266822/problem.jpg I tried to do an ajax request to an absolute url (the dyndns url thats routes back to my pc) but this doesnt work, because it is a cross site request. The solution would be a relative url. But how can i do this? Is it possible or do I have to switch to the J2EE solution? Hi, I suspect you are using the 2.0m5 or under version of the Restlet framework. Is it right? In this case, can you test with the 2.0 m6? best regards, Thierry Boileau Hey Thierry, thanks for your answer! I tried to receive the text from the hello world example with ajax. The js code (using jquery): $.ajax({ type: GET, url: myurl/hello, data: , success: function(data){ $(#ajaxcontent).html(data); } }); But it seems to be a difference between an ajax get request and the browser get request? My console shows this for the browser request: 9000GET /hello - 200 12 - 2 And this for the ajax request: 9000OPTIONS /hello - 405 402 - 0 How can I fix this? :) Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431912
Help with jax-rs @Path matching.
Hi, I bumped into a problem when trying to create a resource with uri http://example.com/foo.bar There is only a @Path annotation on the class, not on the method. * Using @Path(foo.bar) also matches fooxbar (The dot stays a dot in the regexp). * Using @Path(foo\\.bar) doesn't match much because foo%5C. in the regexp. After checking the specifications [0] I came up with @Path(foo{dot:\\.}bar) (fugly!). In conclusion, I think @Path(foo.bar) is the correct expression, but the . should be replaced by \. in the regular expression (step 2 under [1]) [0] https://jsr311.dev.java.net/nonav/releases/1.1/spec/spec3.html#x3-33.4 [1] https://jsr311.dev.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3 By the way, when using @Path(foo{dot:\\.}bar), the resource also matches foo.bar/anything. Is there a way to prevent this? Regards, Karel -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431932
Re: Help with jax-rs @Path matching.
By the way, when using @Path(foo{dot:\\.}bar), the resource also matches foo.bar/anything. Is there a way to prevent this? That's not true, my mistake. It does match foo.bar/ though. Actually, it should match foo{dot:\\.}bar - according to step 5 of section 3.7.3 of the spec. Regards, Karel -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431935
Re: need some help with my project design
Hello Duong, Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. I wonder if you should instead explore the track of a kinf of reverse proxy implemented by a Restlet redirector. The ajax request goes to the redirector (with the target url as a query parameter for example) which then relays to the target url. I wonder if GWT Reslet client has that facility in place?. A ClientResource instance is dedicated to a single resource (ie a single URI). Thus you can multiply the clientresource/callback pairs. Best regards, Thierry Boileau Hello Duong, 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? Actually, this is at the end pure javascript code, so the restriction applies plainly. see http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? I'm sorry, I'm not sure to fully understand your question. In that cross-site mashup, one needs a facility to store requested callbacks so it can cancel the no-response callback after certain time lapsed and identify the callback actually coming from its request. This may require a facility more sophisticated than just a HashMap of callbacks as shown in GWT StockWatcher. I wonder if GWT Reslet client has that facility in place?. Same as the server to make sure that the request comes from legitimate clients? Since the server exposes resources to the whole Web, I suppose you are talking about the authentication topic. You want the server to check that the incoming request comes from an authenticated client. It can use one of the available authentication mechanism such as HTTP_BASIC, HTTP_DIGEST, HTTP_BASIC+HTTPS, cookies, etc. It is much more complicated than that. When the server serves a resource, it identifies the request with a user profile and its unique token. If the user has not been authenticated, then guest Id with location may be in the user profile. When user is authenticated, the profile is changed accordingly. User second request and/or client state maintained at the browser always has the server token so the server know the client state, and if required can be directed to Authentication process. I wonder if Restlet and/or anyone has explored this area working with GAE. I am also exploring Google Wave where Wave robots are at the Web Server served by servlet urls. The web server uses Reslet for resource Request/Response to be integrated with Wave server. Any comment in this area is appreciated. Thanks Duong BaTien DBGROUPS and BudhNet Best regards, Thierry Boileau Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId
Re: need some help with my project design
Thanks and keep on with the good works at Restlet. For those interested in the issue, GWT 2.0 seems to offer solution in JsonpRequestBuilder http://google-web-toolkit.googlecode.com/svn/javadoc/2.0/index.html? overview-summary.html Duong BaTien DBGROUPS and BudhNet On Mon, 2009-12-21 at 18:03 +0100, Thierry Boileau wrote: Hello Duong, Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. I wonder if you should instead explore the track of a kinf of reverse proxy implemented by a Restlet redirector. The ajax request goes to the redirector (with the target url as a query parameter for example) which then relays to the target url. I wonder if GWT Reslet client has that facility in place?. A ClientResource instance is dedicated to a single resource (ie a single URI). Thus you can multiply the clientresource/callback pairs. Best regards, Thierry Boileau Hello Duong, 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? Actually, this is at the end pure javascript code, so the restriction applies plainly. see http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? I'm sorry, I'm not sure to fully understand your question. In that cross-site mashup, one needs a facility to store requested callbacks so it can cancel the no-response callback after certain time lapsed and identify the callback actually coming from its request. This may require a facility more sophisticated than just a HashMap of callbacks as shown in GWT StockWatcher. I wonder if GWT Reslet client has that facility in place?. Same as the server to make sure that the request comes from legitimate clients? Since the server exposes resources to the whole Web, I suppose you are talking about the authentication topic. You want the server to check that the incoming request comes from an authenticated client. It can use one of the available authentication mechanism such as HTTP_BASIC, HTTP_DIGEST, HTTP_BASIC+HTTPS, cookies, etc. It is much more complicated than that. When the server serves a resource, it identifies the request with a user profile and its unique token. If the user has not been authenticated, then guest Id with location may be in the user profile. When user is authenticated, the profile is changed accordingly. User second request and/or client state maintained at the browser always has the server token so the server know the client state, and if required can be directed to Authentication process. I wonder if Restlet and/or anyone has explored this area working with GAE. I am also exploring Google Wave where Wave robots are at the Web Server served by servlet urls. The web server uses Reslet for resource Request/Response to be integrated with Wave server. Any comment in this area is appreciated. Thanks Duong BaTien DBGROUPS and BudhNet Best regards, Thierry Boileau Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4
RE: Re: need some help with my project design
I figured out the problem: It is called cross site issue :) At the moment my project looks like this: http://dl.dropbox.com/u/1266822/problem.jpg I tried to do an ajax request to an absolute url (the dyndns url thats routes back to my pc) but this doesnt work, because it is a cross site request. The solution would be a relative url. But how can i do this? Is it possible or do I have to switch to the J2EE solution? Hi, I suspect you are using the 2.0m5 or under version of the Restlet framework. Is it right? In this case, can you test with the 2.0 m6? best regards, Thierry Boileau Hey Thierry, thanks for your answer! I tried to receive the text from the hello world example with ajax. The js code (using jquery): $.ajax({ type: GET, url: myurl/hello, data: , success: function(data){ $(#ajaxcontent).html(data); } }); But it seems to be a difference between an ajax get request and the browser get request? My console shows this for the browser request: 9000GET /hello - 200 12 - 2 And this for the ajax request: 9000OPTIONS /hello - 405 402 - 0 How can I fix this? :) Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431609
RE: Re: need some help with my project design
Hi, no I used the newest version. Firebug also says that it is an OPTION request. (see here: http://dl.dropbox.com/u/1266822/firebug.JPG ) Could be a jquery problem? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431569
RE: Re: need some help with my project design
Hey Thierry, thanks for your answer! I tried to receive the text from the hello world example with ajax. The js code (using jquery): $.ajax({ type: GET, url: myurl/hello, data: , success: function(data){ $(#ajaxcontent).html(data); } }); But it seems to be a difference between an ajax get request and the browser get request? My console shows this for the browser request: 9000GET /hello - 200 12 - 2 And this for the ajax request: 9000OPTIONS /hello - 405 402 - 0 How can I fix this? :) Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431535
Re: need some help with my project design
Hello Duong, 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? Actually, this is at the end pure javascript code, so the restriction applies plainly. see http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? I'm sorry, I'm not sure to fully understand your question. Same as the server to make sure that the request comes from legitimate clients? Since the server exposes resources to the whole Web, I suppose you are talking about the authentication topic. You want the server to check that the incoming request comes from an authenticated client. It can use one of the available authentication mechanism such as HTTP_BASIC, HTTP_DIGEST, HTTP_BASIC+HTTPS, cookies, etc. Best regards, Thierry Boileau Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431075 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431201 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431515
Re: need some help with my project design
Hi, I suspect you are using the 2.0m5 or under version of the Restlet framework. Is it right? In this case, can you test with the 2.0 m6? best regards, Thierry Boileau Hey Thierry, thanks for your answer! I tried to receive the text from the hello world example with ajax. The js code (using jquery): $.ajax({ type: GET, url: myurl/hello, data: , success: function(data){ $(#ajaxcontent).html(data); } }); But it seems to be a difference between an ajax get request and the browser get request? My console shows this for the browser request: 9000 GET /hello - 200 12 - 2 And this for the ajax request: 9000 OPTIONS /hello - 405 402 - 0 How can I fix this? :) Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431563
Re: need some help with my project design
On Fri, 2009-12-18 at 17:04 +0100, Thierry Boileau wrote: Hello Duong, 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? Actually, this is at the end pure javascript code, so the restriction applies plainly. see http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/FAQ_SOP Yes, this is what I referred to: Same Origin Policy (SOP) of browser. I have explored GWT StockWatcher for cross-site JSONP request/response. 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? I'm sorry, I'm not sure to fully understand your question. In that cross-site mashup, one needs a facility to store requested callbacks so it can cancel the no-response callback after certain time lapsed and identify the callback actually coming from its request. This may require a facility more sophisticated than just a HashMap of callbacks as shown in GWT StockWatcher. I wonder if GWT Reslet client has that facility in place?. Same as the server to make sure that the request comes from legitimate clients? Since the server exposes resources to the whole Web, I suppose you are talking about the authentication topic. You want the server to check that the incoming request comes from an authenticated client. It can use one of the available authentication mechanism such as HTTP_BASIC, HTTP_DIGEST, HTTP_BASIC+HTTPS, cookies, etc. It is much more complicated than that. When the server serves a resource, it identifies the request with a user profile and its unique token. If the user has not been authenticated, then guest Id with location may be in the user profile. When user is authenticated, the profile is changed accordingly. User second request and/or client state maintained at the browser always has the server token so the server know the client state, and if required can be directed to Authentication process. I wonder if Restlet and/or anyone has explored this area working with GAE. I am also exploring Google Wave where Wave robots are at the Web Server served by servlet urls. The web server uses Reslet for resource Request/Response to be integrated with Wave server. Any comment in this area is appreciated. Thanks Duong BaTien DBGROUPS and BudhNet Best regards, Thierry Boileau Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431075 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431201 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431515 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431626
Re: need some help with my project design
Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431075
Re: need some help with my project design
Hi Thierry: I am going to upgrade my site to Restlet 2. Currently, I use GWT JSONP JSNI client from different URLs for different applications to 1 central processing server with Restlet on GAE. From your answer with GWT Restlet client, I wonder: 1) Whether the Restlet client has the Same Server Origin (SSO) restriction as with JavaSript? 2) If there is SSO restriction as in the case of JavaScript, are there facilities to manage request/response from the client to different servers to make sure that the response coming from its request? Same as the server to make sure that the request comes from legitimate clients? Thanks Duong Batien DBGROUPS and BudhNet On Thu, 2009-12-17 at 09:38 +0100, Thierry Boileau wrote: Hello Robert, Is restlet appropriate for this needs? yes, as any other kind of server! How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Ajax, surely. When the user click on the load button, the second frame is refreshed and the URL of the target page is sent to the server resource by the ajax client (which is better than sending the whole document). The targeted resource retrieves the HTML page (which can be tidied using *http://tidy.sourceforge.net http://tidy.sourceforge.net/). The server resource then returns data (rdf or xml, or json, etc) to the ajax client in order to refresh the main frame. *So, one server resource either accepting GET request (with a query parameter that contains the target URI), or accepting POST requests (with the target URI in the body). It returns either RDF, XML, etc according to the client preferences. Best regards, Thierry Boileau Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431075 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2431201
need some help with my project design
Hey! I want to develop a webapplication with the following functionality: 0) overview: http://dl.dropbox.com/u/1266822/overview.jpg 1) The html,css,javascript content is delivered by the server. 2) The page consists of 2 frames. the second one loads the webpages the user wants to open. 3) The server receives the DOM of the loaded page. 4) The client receives data in the form of rdf or xml. Is restlet appropriate for this needs? How would you realize the communication between Client (Javascript) and Server (Java) with the help of restlet? Would be really nice if you could give me a short overview of what I have to take care of. Thanks in advance, Robert -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2430835
RE: Re: Jetty integration help
Hi, If for any reason (let say for comparing performances) I want to have both Jetty and Simple on my path, how should I force the selection of one server among all avaialble server? Regards, Martin -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2419982
Re: Jetty integration help
Hello Martin, One way is to put the jar of the desired connector before the others in the classpath. You can also set the list of servers connectors registered on the current Engine instance: Engine.getInstance().getRegisteredServers(). In order to use the Jetty connector, instantiate the server as follow: new org.restlet.ext.jetty.HttpServerHelper(null) and add it to the list. For the Simple one, instantiate the org.restlet.ext.simple.HttpServerHelper class. You can have a look at the BaseConnectorTestCase class of the org.restlet.test module. It illustrates how to test a particular pair of client/server connectors. Best regards, Thierry Boileau Hi, If for any reason (let say for comparing performances) I want to have both Jetty and Simple on my path, how should I force the selection of one server among all avaialble server? Regards, Martin -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2419982 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2419986
Re: do not understand FirstSteps example - help
.nabble.com/do-not-understand-FirstSteps-example-help-tp3694262p3723594.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2400984
RE: Need help on Component configuraion
Hi Evgeny, You indeed need a Component to configure access logging, unless you manually use the LogFilter in the org.restlet.engine.log package. Instead of using the defaultTarget shortcut property, you need to use the hosts property and to manually configure a virtual host (via SpringHost) to attach two applications to it. You could also try to obtain the defaultHost property and to attach two applications to it, but I'm not sure how easy it is with Spring. Hope it helps! Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : news [mailto:n...@ger.gmane.org] De la part de Evgeny Shepelyuk Envoyé : vendredi 28 août 2009 12:44 À : discuss@restlet.tigris.org Objet : Need help on Component configuraion Hello, I'm configuring Restlet from spring and facing a problem with achieving my goals. First of all i need access logs. Only way i can see is creating and configuring component. My goal is to create 2 separate servers on different ports. Each server has own application. when its configured from spring without component - its working OK but without access logs. My problem is that i can not join 2 servers into component. Component only has default target. When i set default target to one of my applications the 2nd becames unavailable. When i don't set defautlTarget - none of applications are available. Another problem with defautlTarget - that my application became availabel on both of configured servers. Can anyone give me a halp on this issue ? -- Regards, Evgeny Shepelyuk -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23882 16 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2399337
Help with basic spring setup
Hi, I am using the 2.0 snapshot and trying to get Restlet to work in a Spring 2.5.6 application. I have read as much as I can from the docs but am unable to get this working. -- MY WEB.XML What am I missing here? I somehow need to hook this into my Spring application already running within this web-app and loaded via a standard ContextLoaderlistener -- servlet servlet-namerest-api-v1/servlet-name servlet-classorg.restlet.ext.servlet.ServerServlet/servlet-class /servlet servlet-mapping servlet-namerest-api-v1/servlet-name url-pattern/api/REST/v1/*/url-pattern /servlet-mapping - Restlet PORTION OF MY APP-CONTEXT.xml -- !-- this Application class configures a single resource that lives at /hello -- bean id=feedbackRestApp class=com.leopard.feedback.rest.v1.application.FeedbackApplication/ !-- So from what I have seen in various guides out there I need this SpringComponent defined, how does the ServerServlet, talk to this or even know about it -- bean id=feedbackRestRoot class=org.restlet.ext.spring.SpringComponent property name=defaultTarget ref=feedbackRestApp / /bean -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2399987
Re: Help with basic spring setup
Use the org.restlet.ext.servlet.SpringServerServlet instead. Dustin norton borf wrote: Hi, I am using the 2.0 snapshot and trying to get Restlet to work in a Spring 2.5.6 application. I have read as much as I can from the docs but am unable to get this working. -- MY WEB.XML What am I missing here? I somehow need to hook this into my Spring application already running within this web-app and loaded via a standard ContextLoaderlistener -- servlet servlet-namerest-api-v1/servlet-name servlet-classorg.restlet.ext.servlet.ServerServlet/servlet-class /servlet servlet-mapping servlet-namerest-api-v1/servlet-name url-pattern/api/REST/v1/*/url-pattern /servlet-mapping - Restlet PORTION OF MY APP-CONTEXT.xml -- !-- this Application class configures a single resource that lives at /hello -- bean id=feedbackRestApp class=com.leopard.feedback.rest.v1.application.FeedbackApplication/ !-- So from what I have seen in various guides out there I need this SpringComponent defined, how does the ServerServlet, talk to this or even know about it -- bean id=feedbackRestRoot class=org.restlet.ext.spring.SpringComponent property name=defaultTarget ref=feedbackRestApp / /bean -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2399987 -- Dustin N. Jenkins | Tel/Tél: 250.363.3101 | dustin.jenk...@nrc-cnrc.gc.ca facsimile/télécopieur: (250) 363-0045 National Research Council Canada | 5071 West Saanich Rd, Victoria BC. V9E 2E7 Conseil national de recherches Canada | 5071, ch. West Saanich, Victoria (C.-B) V9E 2E7 Government of Canada | Gouvernement du Canada -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2399989
RE: Re: Help with basic spring setup
Thanks Dustin, awesome Use the org.restlet.ext.servlet.SpringServerServlet instead. Dustin -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=233
do not understand FirstSteps example - help
Can anyone explain the First Steps example? I was hoping to find a very simple example of simply calling an existing URL that returned some data, parsing the text into an object and using the data. I understand the concept of a resource (in it's simplest form a url that returns some info I believe) but what is this? // This representation has only one type of representation. getVariants().add(new Variant(MediaType.TEXT_PLAIN)); and what is this? @Override public Representation represent(Variant variant) throws ResourceException { Representation representation = new StringRepresentation( hello, world, MediaType.TEXT_PLAIN); return representation; } --- I have been studying rest now for some time but these low level programming concepts do not match with what I know so far. The idea I have so far is that a url is called from a program that returns some data and then that data is parsed and something done with it (some action is taken or an event triggered based on the data). Is there a more simpler example of a first RESTlet example that simply calls an existing url that returns some data and not a url that invokes a servlet that does something? jv 1. /** 2. * Resource which has only one representation. 3. * 4. */ 5. public class HelloWorldResource extends Resource { 6. 7. public HelloWorldResource(Context context, Request request, 8. Response response) { 9. super(context, request, response); 10. 11. // This representation has only one type of representation. 12. getVariants().add(new Variant(MediaType.TEXT_PLAIN)); 13. } 14. 15. /** 16. * Returns a full representation for a given variant. 17. */ 18. @Override 19. public Representation represent(Variant variant) throws ResourceException { 20. Representation representation = new StringRepresentation( 21. hello, world, MediaType.TEXT_PLAIN); 22. return representation; 23. } 24. } -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2397830
RE: Help required for restlet-jee-2.0m4 with spring using apache-tomcat-6.0.18 and JDK 1.6.0_13
Hi Abdur, It is really discouraged to cross-post messages to various mailing lists. In addition, you put my personal email to the list, so I confirm I got three copies of your post :) Let's see if Spring experts in the list are willing to look at your test project to see what is not working properly. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Muhammad Abdur Rasheed [mailto:abdur.rash...@globalnorthstar.com] Envoyé : mercredi 19 août 2009 21:02 À : discuss@restlet.tigris.org; c...@restlet.tigris.org; jerome.lou...@noelios.com Objet : Help required for restlet-jee-2.0m4 with spring using apache-tomcat-6.0.18 and JDK 1.6.0_13 Hi Everyone, I'm using restlet-jee-2.0m4 using apache-tomcat-6.0.18 and JDK 1.6.0_13 with cglib-nodep-2.2.jar. I'm using all other jars from the distribution of restlet-jee-2.0m4 I'm trying to use Restlet with Spring. Attached is the zip file which contains code and configuration. I'm getting the error No target class was defined for this finder: org.restlet.ext.spring.springfinder$$enhancerbycglib$$75c4b...@2264da Following are the details of tomcat terminal step by step. 1- Following is the output on tomcat after startup. Aug 19, 2009 9:07:54 PM org.apache.catalina.core.AprLifecycleListener init INFO: The APR based Apache Tomcat Native library which allows optimal performanc e in production environments was not found on the java.library.path: D:\tools\jd k1.6.0_13\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;%Comm onPr ogramFiles%\Microsoft Shared\Windows Live;C:\WINDOWS\system32;C:\WINDOWS;C:\WIND OWS\System32\Wbem;C:\Program Files\ATI Technologies\ATI.ACE\;D:\tools\jdk1.6.0_1 3\bin;D:\tools\apache-ant-1.7.1\bin;C:\Program Files\Rational\common;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files\CVSNT\;C:\Program Files\IDM Computer Solutions\UltraEdit\ ;C:\Program Files\IDM Computer Solutions\UltraCompare\ Aug 19, 2009 9:07:54 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 Aug 19, 2009 9:07:54 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 748 ms Aug 19, 2009 9:07:54 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina Aug 19, 2009 9:07:54 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/6.0.18 Aug 19, 2009 9:07:55 PM com.liferay.portal.kernel.log.Jdk14LogImpl info INFO: Initializing hot deploy manager 3981922 Aug 19, 2009 9:07:55 PM org.apache.catalina.core.ApplicationContext log INFO: ContextListener: contextInitialized() Aug 19, 2009 9:07:55 PM org.apache.catalina.core.ApplicationContext log INFO: SessionListener: contextInitialized() Aug 19, 2009 9:07:55 PM org.apache.coyote.http11.Http11Protocol start INFO: Starting Coyote HTTP/1.1 on http-8080 Aug 19, 2009 9:07:56 PM org.apache.jk.common.ChannelSocket init INFO: JK: ajp13 listening on /0.0.0.0:8009 Aug 19, 2009 9:07:56 PM org.apache.jk.server.JkMain start INFO: Jk running ID=0 time=0/47 config=null Aug 19, 2009 9:07:56 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 1854 ms 2- After executing http://localhost:8080/test/example in browser, I got follwing ouput on tomcat terminal. 2009-08-19 21:14:47.744::INFO: Logging to STDERR via org.mortbay.log.StdErrLog * * * * ExampleApplication() Aug 19, 2009 9:14:48 PM org.springframework.context.support.AbstractApplicationC ontext prepareRefresh INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationCont e...@1a6a1a7: display name [org.springframework.context.support.ClassPathXmlAppli cationcont...@1a6a1a7]; startup date [Wed Aug 19 21:14:48 PKT 2009]; root of con text hierarchy Aug 19, 2009 9:14:48 PM org.springframework.beans.factory.xml.XmlBeanDefinitionR eader loadBeanDefinitions INFO: Loading XML bean definitions from class path resource [application-context .xml] Aug 19, 2009 9:14:49 PM org.springframework.context.support.AbstractApplicationC ontext obtainFreshBeanFactory INFO: Bean factory for application context [org.springframework.context.support. classpathxmlapplicationcont...@1a6a1a7]: org.springframework.beans.factory.suppo rt.defaultlistablebeanfact...@15b123b Aug 19, 2009 9:14:49 PM org.springframework.beans.factory.support.DefaultListabl eBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support. defaultlistablebeanfact...@15b123b: defining beans [exampleResource,restletRoute r,exampleApplication,restletServer,restletComponent]; root of factory hierarchy * * * * ExampleApplication() before starting restletComponent 2009-08-19 21:14:50.447::INFO: jetty-6.1.18 2009-08-19 21:14:50.729::INFO: Started selectchannelconnec...@0.0.0.0:8182 * * * * ExampleApplication
RE: Help! -- Error handler isn't working
Hi Schley, I could open your link (404). By default, the exception doesn't appear in the browser to not expose too much internal details. You can customize the StatusService if needed. I agree it would be nice to have such an option available so I've updated this RFE: Return clear status description when exception caught http://restlet.tigris.org/issues/show_bug.cgi?id=852 Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Schley Andrew Kutz [mailto:sak...@gmail.com] Envoyé : jeudi 23 juillet 2009 01:07 À : discuss@restlet.tigris.org Objet : Re: Help! -- Error handler isn't working Jerome, Sorry about that (updated). Here is the ViewVC link to the file - http://vangaea.svn.sourceforge.net/viewvc/vangaea/trunk/src/main/java/com/h9labs/vangaea/server/rest/BaseResource.java?view=markup . I've updated the code to take advantage of M4's doCatch handler. However, when I throw a ResourceException in the doInit() method, or any method, the ResourceException is not being displayed in the browser, and I was under the impression that it should. Thanks! -- -a Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Einstein On Jul 21, 2009, at 2:53 AM, Jerome Louvel wrote: Hi Schley, Could you send us your project (or a snippet reproducing the issue) and Restlet environment details (version, OS, etc.)? It should definitely work. BTW, I suggest that you use more meaningful email title when you post, easier for tracking and searching in the archives. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Schley Andrew Kutz [mailto:sak...@gmail.com] Envoyé : mardi 14 juillet 2009 21:52 À : discuss@restlet.tigris.org Objet : Help! The StringRepresentation returned by 'public Representation handle()' is no longer appearing in the browser when I access my server. Here is an example: @Override public Representation handle() { if (true) return new StringRepresentation(Hello, world.); ... That should ALWAYS trump any other logic and show Hell, world. in the browser. Was a bug introduced to the Maven snapshot? Or do you think I could have farked myself somehow. -- -a Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts. -- L. Stein -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23713 20 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372837 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2374613 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2375508
Re: Help! -- Error handler isn't working
I changed the package name last night :( http://vangaea.svn.sourceforge.net/viewvc/vangaea/trunk/src/main/java/com/hyper9/vangaea/server/rest/BaseResource.java?view=markup Here is the updated link. Thanks! -- -a Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Einstein On Jul 25, 2009, at 6:01 AM, Jerome Louvel wrote: Hi Schley, I could open your link (404). By default, the exception doesn't appear in the browser to not expose too much internal details. You can customize the StatusService if needed. I agree it would be nice to have such an option available so I've updated this RFE: Return clear status description when exception caught http://restlet.tigris.org/issues/show_bug.cgi?id=852 Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Schley Andrew Kutz [mailto:sak...@gmail.com] Envoyé : jeudi 23 juillet 2009 01:07 À : discuss@restlet.tigris.org Objet : Re: Help! -- Error handler isn't working Jerome, Sorry about that (updated). Here is the ViewVC link to the file - http://vangaea.svn.sourceforge.net/viewvc/vangaea/trunk/src/main/java/com/h9labs/vangaea/server/rest/BaseResource.java?view=markup . I've updated the code to take advantage of M4's doCatch handler. However, when I throw a ResourceException in the doInit() method, or any method, the ResourceException is not being displayed in the browser, and I was under the impression that it should. Thanks! -- -a Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -- Einstein On Jul 21, 2009, at 2:53 AM, Jerome Louvel wrote: Hi Schley, Could you send us your project (or a snippet reproducing the issue) and Restlet environment details (version, OS, etc.)? It should definitely work. BTW, I suggest that you use more meaningful email title when you post, easier for tracking and searching in the archives. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Schley Andrew Kutz [mailto:sak...@gmail.com] Envoyé : mardi 14 juillet 2009 21:52 À : discuss@restlet.tigris.org Objet : Help! The StringRepresentation returned by 'public Representation handle()' is no longer appearing in the browser when I access my server. Here is an example: @Override public Representation handle() { if (true) return new StringRepresentation(Hello, world.); ... That should ALWAYS trump any other logic and show Hell, world. in the browser. Was a bug introduced to the Maven snapshot? Or do you think I could have farked myself somehow. -- -a Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts. -- L. Stein -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23713 20 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372837 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2374613 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2375508 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2375517
RE: Help!
Hi Schley, Could you send us your project (or a snippet reproducing the issue) and Restlet environment details (version, OS, etc.)? It should definitely work. BTW, I suggest that you use more meaningful email title when you post, easier for tracking and searching in the archives. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : Schley Andrew Kutz [mailto:sak...@gmail.com] Envoyé : mardi 14 juillet 2009 21:52 À : discuss@restlet.tigris.org Objet : Help! The StringRepresentation returned by 'public Representation handle()' is no longer appearing in the browser when I access my server. Here is an example: @Override public Representation handle() { if (true) return new StringRepresentation(Hello, world.); ... That should ALWAYS trump any other logic and show Hell, world. in the browser. Was a bug introduced to the Maven snapshot? Or do you think I could have farked myself somehow. -- -a Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts. -- L. Stein -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=23713 20 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372837
RE: Restlet SSL and Weblogic (even tomcat would help)
Hi Bruno, Thanks for the quick response. You comments have spawned some ideas! Although I won't get to try anything else for a few days (I'm being pulled in several different directions by the management!!), I will get back to it next week and keep the thread informed of my progress. I should point out a couple of things that on second look are confusing. First, the web.xml that I had in the initial posting isn't something I had been using been using while running the code as the Java application I was spreaking of. The application I got working actually consists of a JAva application main() that calls the start method of an org.restlet Component class. I created a class that extends org.restlet.Component (ServicesComponent) and the main starts it something like this org.restlet.Component component = new ServicesComponent(); component.getDefaultHost() .attach(, new ServicesApplication(component.getContext() .createChildContext())); component.start(); The ServicesApplication is a class that extends org.restlet.Application and has the SSL based code that I provided in the initial posting. The SSL based code was something I was fooling with that ended working based on information from http://www.naviquan.com/blog/restlet-ssl, and http://wiki.restlet.org/books/documentation_book_definition--20081027-003425/publication s/html-chunked/output/s171.html#s173(without using the the com.noelios.restlet.ext.ssl.PkixSslContextFactory context factory). When I started this as a Java application, I didn't need any other relavent configuration, no web.xml. I don't really understand how but somehow this starts up a Jetty Container. I am told (please correct if I am wrong) that somewhere in org.restlet.Component or org.restlet.Application code there is black box code that fires off a Jetty container. We do no special container based configuration for this. As best as I understand it, to run this deployed as a web application in another container, I need the web.xml, and need to set the conext-param parameter org.restlet.application to my implementation/extension of an org.restlet.Application as described towards the top of this Javadoc: http://www.restlet.org/documentation/1.0/ext/com/noelios/restlet/ext/servlet/ServerServl et.html. This will not involved the ServicesCompont extension of the component class that I have in the peice of code above. We actually got the ServicesApplication deployed this way to tomcat using Form authentication (with out the SSL code obviously). Trying to deploy my applicaton to Weblogic is what I was trying to do with the web.xml. Bruno, I'm going to try some things based on your input and will let the thread know how it works out, or post more targeted questions if I need to. If you can add anything based on my clarification here, it would be greatly appreciated. Thanks again! -Andy -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372115
Re: Restlet SSL and Weblogic (even tomcat would help)
Hi Andy, webp...@tigris.org wrote: When I started this as a Java application, I didn't need any other relavent configuration, no web.xml. I don't really understand how but somehow this starts up a Jetty Container. I am told (please correct if I am wrong) that somewhere in org.restlet.Component or org.restlet.Application code there is black box code that fires off a Jetty container. We do no special container based configuration for this. As best as I understand it, to run this deployed as a web application in another container, I need the web.xml, and need to set the conext-param parameter org.restlet.application to my implementation/extension of an org.restlet.Application as described towards the top of this Javadoc: http://www.restlet.org/documentation/1.0/ext/com/noelios/restlet/ext/servlet/ServerServlet.html. This will not involved the ServicesCompont extension of the component class that I have in the peice of code above. We actually got the ServicesApplication deployed this way to tomcat using Form authentication (with out the SSL code obviously). Trying to deploy my applicaton to Weblogic is what I was trying to do with the web.xml. Bruno, I'm going to try some things based on your input and will let the thread know how it works out, or post more targeted questions if I need to. If you can add anything based on my clarification here, it would be greatly appreciated. In the stand-alone mode (the way you got it to work, without web.xml), you're starting a Restlet Component that will use the first appropriate connector it finds on the classpath for the relevant protocol [1]. For example, if you put the com.noelios.restlet.ext.jetty.jar file onto the classpath, the Jetty connectors will be used. This is not actually running a Jetty 'container', but only using the HTTP server part of Jetty (that is, the part you can embed in other Java apps, without it being a complete Servlet container). In this case, the socket (and its SSL configuration) is ultimately handled by the Jetty API, via the Restlet configuration layer (which is the way you've done it). If you want to run your application within a Servlet container, you need use the Servlet connector, and thus you need to put com.noelios.restlet.ext.servlet.jar instead of com.noelios.restlet.ext.jetty.jar on your classpath. You also need to package your application in a War format (or equivalent) and to configure everything in the web.xml file. In this mode, the sockets are not directly accessible by the Restlet component, and the SSL configuration needs to be done at the Servlet container level (via the Connector/ in server.xml in Tomcat, for example), and possibly in web.xml (if you want re-negotiation, but it's probably simpler not to configure any CLIENT-CERT auth in web.xml to start with, and to use want or need in the Connector/ configuration instead). Best wishes, Bruno. [1] http://wiki.restlet.org/docs_1.1/13-restlet/27-restlet/37-restlet.html -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372646
Restlet SSL and Weblogic (even tomcat would help)
Hello, I am trying to deploy a Restlet application as a Servlet to weblogic using SSL for authentication and authorization. I have successfully gotten the SSL authentication to work with my Restlet, running it as a Java application using the default Jetty container. Now I'm trying to deploy it to weblogic. I am trying to use mutual authentication. I have client and server keystores and a trustore for each. I used OpenSSL to create a certificate authority and have signed client and server certificates correctly imported into their respective truststores. I have the SSL code used for the class that extends org.restlet.Application. That class gets associated with the necessary org.restlet.application context-param in the web.xml when trying to configure the servlet(see it below the code). Besides A)The code in the class below that extends Application B)The content of the web.xml that follows the class C)Adding a user with a username that matches that of the distinguished name of the client certificate Should I have to do anything else? I have a client(using the HttpsUrlConnection class) that successfully connects when running it as a Java Application in the default Jetty Container, but it doesn't connect to what I am trying to deploy in Weblogic. I get the old connection refused message using the -Djava.net.debug=all switch at the command like (for the client) and it doesn't looking like it's getting into the server side of the handshake. Is There anything else I am missing that anyone on here can think of or can you provide a link to any tutorials deploying Restlets as a Servlet on any web container(Tomcat?) using SSL (besides the default Jetty setup). Thanks! public class ServiceApplication extends org.restlet.Application { . . . //This all works fine running it as a Java Application using the built in Jetty container. Properties properies = getConfiguredProperties(): Server server = getServers().add(Protocol.HTTPS, port); Context context = server.getContext(); context.getParameters() .add(keystorePath, properties.getProperty(serverKeystorePath)); context.getParameters() .add(keystorePassword, properties.getProperty(serverKeystorePassword)); context.getParameters() .add(keystoreType, properties.getProperty(keystoreType)); context.getParameters() .add(keyPassword, properties.getProperty(serverKeystorePassword)); context.getParameters().add(needClientAuthentication, true); System.setProperty(javax.net.ssl.trustStoreType, properties.getProperty(javax.net.ssl.trustStoreType)); System.setProperty(javax.net.ssl.trustStore, properties.getProperty(serverTrustStore)); System.setProperty(javax.net.ssl.trustStorePassword, properties.getProperty(javax.net.ssl.trustStorePassword)); . . . } ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_ID version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-nameData Services/display-name context-param param-nameorg.restlet.application/param-name param-value com.mycompany.service.ServicesApplication /param-value /context-param !-- Restlet adapter -- servlet servlet-nameDataServices/servlet-name servlet-classcom.noelios.restlet.ext.servlet.ServerServlet/servlet-class /servlet servlet-mapping servlet-nameDataServices/servlet-name url-pattern/services/*/url-pattern /servlet-mapping security-constraint web-resource-collection web-resource-nameData Services/web-resource-name url-pattern/*/url-pattern http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-nameuser/role-name /auth-constraint login-config auth-methodCLIENT-CERT/auth-method /login-config security-role role-name user /role-name /security-role /security-constraint /web-app -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2371843
Re: Restlet SSL and Weblogic (even tomcat would help)
Hello, Andrew Whelan wrote: Hello, I am trying to deploy a Restlet application as a Servlet to weblogic using SSL for authentication and authorization. I have successfully gotten the SSL authentication to work with my Restlet, running it as a Java application using the default Jetty container. Now I'm trying to deploy it to weblogic. I am trying to use mutual authentication. I have client and server keystores and a trustore for each. I used OpenSSL to create a certificate authority and have signed client and server certificates correctly imported into their respective truststores. I have the SSL code used for the class that extends org.restlet.Application. That class gets associated with the necessary org.restlet.application context-param in the web.xml when trying to configure the servlet(see it below the code). Besides A)The code in the class below that extends Application B)The content of the web.xml that follows the class C)Adding a user with a username that matches that of the distinguished name of the client certificate Should I have to do anything else? [...] security-constraint web-resource-collection web-resource-nameData Services/web-resource-name url-pattern/*/url-pattern http-methodGET/http-method http-methodPOST/http-method http-methodPUT/http-method /web-resource-collection auth-constraint role-nameuser/role-name /auth-constraint login-config auth-methodCLIENT-CERT/auth-method /login-config security-role role-name user /role-name /security-role /security-constraint /web-app In Tomcat, with a traditional Servlet, when the connector isn't configured to ask for a client certificate (not sure if you have done so), the settings you're using would trigger a re-negotiation (a new SSL/TLS handshake which will ask for a certificate). As far as I know, this feature isn't supported in Jetty (in-built or as a full container). I would have expected com.noelios.restlet.ext.servlet.ServerServlet not to behave differently from other Servlets in that respect (even if it would ignore the container's roles). In the configurations I got to work using this approach (with JSP or other servlets), the login-config and security-role elements are outside (just after) the security-constraint element, and also use user-data-constraint: web-app display-nameMy Webapp/display-name ... security-constraint web-resource-collection web-resource-nameApp/web-resource-name url-pattern//url-pattern /web-resource-collection auth-constraint role-namecert/role-name /auth-constraint user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint login-config auth-methodCLIENT-CERT/auth-method /login-config security-role role-namecert/role-name /security-role /web-app Another solution is to configure the connector (rather than the webapp) to ask for the client certificate. In this case, there is no re-negotiation, since the client certificate is requested during the first handshake when the client makes the connection. I'm not sure how this is done in Weblogic, but in Tomcat, it's in server.xml: Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true maxThreads=150 scheme=https secure=true keystore=... keystoreType=PKCS12 keystorePass=... truststoreFile=... truststoreType=JKS truststorePass=... clientAuth=want sslProtocol=TLS / You get three choices for 'clientAuth': - false: no client auth, - want: requests a client certificate, but it's optional, - need: requires a client certificate; if the client doesn't give one, the connection will be closed at the SSL/TLS level, without giving the server the opportunity to send an error page. Best wishes, Bruno. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2372018
Re: Need help with S3App.java example, from RESTful Web Services (O'Reilly)
Hello Jerome, Any updates on when Restlet: Official Developer's Guide to RESTful Web Applications in Java printing will be available. This is all the information I get from Amazon.co.uk: Currently unavailable. We don't know when or if this item will be back in stock. Cheers, woodHack -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2371669
Help!
The StringRepresentation returned by 'public Representation handle()' is no longer appearing in the browser when I access my server. Here is an example: @Override public Representation handle() { if (true) return new StringRepresentation(Hello, world.); ... That should ALWAYS trump any other logic and show Hell, world. in the browser. Was a bug introduced to the Maven snapshot? Or do you think I could have farked myself somehow. -- -a Ideally, a code library must be immediately usable by naive developers, easily customized by more sophisticated developers, and readily extensible by experts. -- L. Stein -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2371320
RE: Need help with S3App.java example, from RESTful Web Services (O'Reilly)
Jerome Louvel, Thank you very much for the help! As suggested, I signed up for the S3 account. After executing code again, this time I received a response code of 200 (OK). I was initially hesitant to sign-up for S3 account; because, it required credit card info. Was not going to do so until I was able to confirm it was absolutely necessary. Cheers thanks again, woodHack -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2369025
Jetty integration help
I'm trying to use Jetty with a 2.0m3 stand alone application but am struggling despite having read a lot of documentation and web searching. I extend a ServerResource and have the Jetty jars in my runtime path, but Restlet's internal http server is always started with whatever server/component I specify. I want to use a ServerResource instead of the Restlet class and therefore can't seem to use any of the Server constructors (that require a Restlet instance) and thus the Jetty helper. I would appreciate guidance and/or concrete example given the context below. Thank you. Jul 7, 2009 12:44:01 PM org.restlet.engine.http.StreamServerHelper start INFO: Starting the internal HTTP server public class TestComponent extends ServerResource() { public static void main(String[] args) throws Exception { Component component = new Component(); component.getServers().add(Protocol.HTTP, 8182); component.getDefaultHost().attach(/testing, TestComponent.class); component.start(); @Get public String represent() { return testing successful. } } Tony -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2368937
RE: Need help with S3App.java example, from RESTful Web Services (O'Reilly)
Hi woodHack, I've just did a test and it worked for me. I created an AWS account *and* signed up for the S3 service (you need this step). I was able to retrieve the list of buckets (empty initially) fine. See also the slightly updated classes attached. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : R.H. [mailto:lnrha...@gmail.com] Envoyé : mercredi 1 juillet 2009 03:19 À : discuss@restlet.tigris.org Objet : Need help with S3App.java example, from RESTful Web Services (O'Reilly) I am trying to run the S3App.java (RESTful Web Services publisher O'Reilly) and getting a HTTP response code of 403 Forbidden. S3App.java extends S3Authorized.java which defines the following keys (constants), public final static String PUBLIC_KEY = 0F9DBXKB5274JKTJ8DG2; public final static String PRIVATE_KEY = GuUHQ086WawbwvVl3JPl9JIk4VOtLcllkvIb0b7w; which are not allowing me to authenticate properly. I have compiled, S3App, S3Authorized, S3Bucket, and S3Object, successfully. Please might someone shed some light on what I am doing wrong? I tried the following work around. I created an account at AWS. When doing so, I was assigned an Access Key ID and a Secret Access Key. I updated the code's original PUBLIC_KEY value by replacing it with the value of my AWS_Access_Key_ID and PRIVATE_KEY with my AWS_Secret_Access_Key value. The work around failed. I figured this was a long shot and would probably fail; because I was assuming the AWS_Secret_Access_Key is suppose to be used to create signatures for requests made to retrieve S3 content. However, I could have misunderstood the intent of an AWS_Secret_Access_Key and how to use it properly. I have attached all the java code. Cheers and thanks for reading, woodHack -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2368812 S3App.java Description: Binary data S3Authorized.java Description: Binary data
Need help with S3App.java example, from RESTful Web Services (O'Reilly)
I am trying to run the S3App.java (RESTful Web Services publisher O'Reilly) and getting a HTTP response code of 403 Forbidden. S3App.java extends S3Authorized.java which defines the following keys (constants), public final static String PUBLIC_KEY = 0F9DBXKB5274JKTJ8DG2; public final static String PRIVATE_KEY = GuUHQ086WawbwvVl3JPl9JIk4VOtLcllkvIb0b7w; which are not allowing me to authenticate properly. I have compiled, S3App, S3Authorized, S3Bucket, and S3Object, successfully. Please might someone shed some light on what I am doing wrong? I tried the following work around. I created an account at AWS. When doing so, I was assigned an Access Key ID and a Secret Access Key. I updated the code's original PUBLIC_KEY value by replacing it with the value of my AWS_Access_Key_ID and PRIVATE_KEY with my AWS_Secret_Access_Key value. The work around failed. I figured this was a long shot and would probably fail; because I was assuming the AWS_Secret_Access_Key is suppose to be used to create signatures for requests made to retrieve S3 content. However, I could have misunderstood the intent of an AWS_Secret_Access_Key and how to use it properly. I have attached all the java code. Cheers and thanks for reading, woodHack/* * Copyright 2005-2007 Noelios Consulting. * * The contents of this file are subject to the terms of the Common Development * and Distribution License (the License). You may not use this file except in * compliance with the License. * * You can obtain a copy of the license at * http://www.opensource.org/licenses/cddl1.txt See the License for the specific * language governing permissions and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each file and * include the License file at http://www.opensource.org/licenses/cddl1.txt If * applicable, add the following below this CDDL HEADER, with the fields * enclosed by brackets [] replaced with your own identifying information: * Portions Copyright [] [name of copyright owner] */ package org.restlet.example.book.rest.ch3; import java.util.ArrayList; import java.util.List; import org.restlet.data.Response; import org.restlet.resource.DomRepresentation; import org.w3c.dom.Node; /** * Amazon S3 client application. Returns a list of buckets. * * @author Jerome Louvel (cont...@noelios.com) */ public class S3App extends S3Authorized { public static void main(String... args) { for (S3Bucket bucket : new S3App().getBuckets()) { System.out.println(bucket.getName() + : + bucket.getUri()); } } public ListS3Bucket getBuckets() { ListS3Bucket result = new ArrayListS3Bucket(); // Fetch a resource: an XML document with our list of buckets Response response = authorizedGet(HOST); DomRepresentation document = response.getEntityAsDom(); // Use XPath to find the bucket names for (Node node : document.getNodes(//Bucket/Name)) { result.add(new S3Bucket(node.getTextContent())); } return result; } } /* * Copyright 2005-2007 Noelios Consulting. * * The contents of this file are subject to the terms of the Common Development * and Distribution License (the License). You may not use this file except in * compliance with the License. * * You can obtain a copy of the license at * http://www.opensource.org/licenses/cddl1.txt See the License for the specific * language governing permissions and limitations under the License. * * When distributing Covered Code, include this CDDL HEADER in each file and * include the License file at http://www.opensource.org/licenses/cddl1.txt If * applicable, add the following below this CDDL HEADER, with the fields * enclosed by brackets [] replaced with your own identifying information: * Portions Copyright [] [name of copyright owner] */ package org.restlet.example.book.rest.ch3; import org.restlet.Client; import org.restlet.data.ChallengeResponse; import org.restlet.data.ChallengeScheme; import org.restlet.data.Method; import org.restlet.data.Protocol; import org.restlet.data.Request; import org.restlet.data.Response; import org.restlet.resource.Representation; /** * Amazon S3 client. Support class handling authorized requests. * * @author Jerome Louvel (cont...@noelios.com) */ public class S3Authorized { public final static String PUBLIC_KEY = 0F9DBXKB5274JKTJ8DG2; public final static String PRIVATE_KEY = GuUHQ086WawbwvVl3JPl9JIk4VOtLcllkvIb0b7w; public final static String HOST = https://s3.amazonaws.com/;; private static Response handleAuthorized(Method method, String uri, Representation entity) { // Send an authenticated request Request request = new Request(method, HOST, entity); request.setChallengeResponse(new ChallengeResponse( ChallengeScheme.HTTP_AWS, PUBLIC_KEY, PRIVATE_KEY)); return new
Help with a basic Application and Resources (on JBOSS)
Hi, I'm new to RESTful services and Restlets. I'm trying to create a hello world application that is integrated with my company's J2EE app (we're running on JBOSS). From what I can tell from the tutorials and example source code, it seems pretty simple to add an Application and Resources. I'm definitely missing something though. We have a hierarchy of information which I would like to have resources for. For example, I want to have URI's like these: /myapp/zipcodes/{zip}/ /myapp/zipcodes/{zip}/locations/{location} /myapp/zipcodes/{zip}/locations/{location}/users/{user} This way I'll be able to return information depending on what level of the hierarchy I'm interested in. I first tried creating an application in which I used the equivalent of router.attachDefault(DefaultResource.class) to just return Hello to my browser. This worked just fine. My next step though, was to create resources for the other URI's and simply echo back the various values ({zip}, {location}, {user}) found by my Resource to the browser. This is where I'm not having success, and I am wondering what I'm doing wrong, or what concept I'm not catching onto. Since I can't publish the code for work on here, I've re-worded the packages and code... the application class I'm using: package com.myapp.applications; import org.restlet.Application; import org.restlet.Context; import org.restlet.Restlet; import org.restlet.routing.Router; import com.myapp.resources.ZipsResource; import com.myapp.resources.ZipsLocsResource; import com.myapp.resources.ZipsLocsUsersResource; public class MyApplication extends Application { public MyApplication() { // TODO Auto-generated constructor stub } public MyApplication(Context context) { super(context); // TODO Auto-generated constructor stub } @Override public Restlet createRoot() { // Create a router Restlet that routes each call to a Router router = new Router(getContext()); router.attach(/myapp/zipcodes/{zip}/, ZipsResource.class); router.attach(/myapp/zipcodes/{zip}/locations/{location}, ZipsLocsResource.class); router.attach(/myapp/zipcodes/{zip}/locations/{location}/users/{user}, ZipsLocsUsersResource.class); return router; } } And the code for my resources are all basically the same as this one: package com.myapp.resources; import org.restlet.representation.Representation; import org.restlet.representation.StringRepresentation; import org.restlet.resource.Get; import org.restlet.resource.ServerResource; public class Resource extends ServerResource { private String zip; private String location; private String user; @Get public Representation represent() { System.out.println(ZipLocsUsersResource.represent()); this.zip = (String) getRequest().getAttributes().get(zip); this.location = (String) getRequest().getAttributes().get(location); this.user = (String) getRequest().getAttributes().get(user); Representation result = new StringRepresentation(ZipsLocsUsersResource zip[ + this.zip + ] location[ + this.location + ] user[ + this.user + ]); return result; } } Again... in my application class, if I use the .attachDefault() I can hit the URI with my browser and get my Hello World response just fine. The second I remove .attachDefault() and start attaching specific URI's, I get 404 responses with the restlet page that says The server has not found anything matching the request URI. I really appreciate any help on what I'm doing wrong or not understanding... I have read the first steps, read the first resource page, read through the tutorial, and I have been looking at the example code that came with the restlets package (2.0M3). I'm assuming my web.xml is properly configured or I wouldn't have been successful with the attachDefault() first attempt I made. Thanks in advance and regards, Andrew -- View this message in context: http://n2.nabble.com/Help-with-a-basic-Application-and-Resources-%28on-JBOSS%29-tp3032757p3032757.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2359837
Re: Help with a basic Application and Resources (on JBOSS)
Well... I figured it out. And I am an idiot. I had setup my web.xml to associate my Application class with /myapp. I was then attaching my resources to a URI that started with /myapp/ So therefore, in my browser the URI which properly returned me my resource was: /myapp/myapp/zipcodes/{zip}/... I had been trying this instead: /myapp/zipcodes/{zip}/... Yes, I do feel extremely cool now... (and yes that was some self deprecating sarcasm...) ~ Andrew -- View this message in context: http://n2.nabble.com/Help-with-a-basic-Application-and-Resources-%28on-JBOSS%29-tp3032757p3033033.html Sent from the Restlet Discuss mailing list archive at Nabble.com. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2359846
RE: help on PUT
Hi Helen, Thanks for following up and clarifying this question. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : helen chen [mailto:hc...@aip.org] Envoyé : jeudi 23 avril 2009 16:13 À : discuss@restlet.tigris.org Cc : Helen Chen Objet : Re: help on PUT I worked with weblogic support and we proved that weblogic support the PUT request. helen chen hc...@aip.org 04/06/09 8:37 AM Hi Thierry, I tested the POST method and it works. So I think you are right, there maybe some configuration in weblogic that stoped PUT request. I'm going to contact weblogic support and see what I can get and I'll post back. Thanks a lot for your help. Helen Thierry Boileau thierry.boil...@noelios.com 04/06/09 5:55 AM Hello Helen, I have no knowledge of weblogic, but it seems that the access to PUT requests is securized. Is it possible that by default Weblogic forbids that kind of request? Is there any configuration that allows you to specific the authorized methods for a deployed application? Best regards, Thierry Boileau Hi there, I'm using restlet 1.1.3. I created a simple restlet with get and put. then I use client try to test it. I have a local machine using tomcat and it works fine. But when I move to QA server which use weblogic 10, even for the same command, only GET works, PUT somehow complains: Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized It looks like the apache httpclient is asking something. Has anyone had this problem? the whole output after running the client is as following: Apr 3, 2009 3:05:41 PM org.aip.pubtech.testRestlet.client.RLclient PUTtpForm INFO: ===PUTtpForm Apr 3, 2009 3:05:41 PM com.noelios.restlet.ext.httpclient.HttpClientHelper start INFO: Starting the HTTP client Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: response for the uri : http://test.int.aip.org/testRestlet/articles/ Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: request success Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: entity available now in represent, this is get —-- the following is my class for resource — package org.aip.pubtech.testRestlet.aps; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.restlet.Context; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Request; import org.restlet.data.Response; import org.restlet.data.Status; import org.restlet.resource.DomRepresentation; import org.restlet.resource.Representation; import org.restlet.resource.Resource; import org.restlet.resource.ResourceException; //import org.restlet.resource.ResourceException; import org.restlet.resource.StringRepresentation; import org.restlet.resource.Variant; public class RLResource extends Resource{ protected static Logger log = Logger.getLogger(getName()); public RLResource(Context context, Request request, Response response) { super(context, request, response); this.articleExists = false; this.aipkey = (String) this.getRequest().getAttributes().get(aipkey); if(this.aipkey != null this.aipkey.trim().length()0) { this.articleExists = true; this.getVariants().add(new Variant(MediaType.TEXT_PLAIN)); this.setModifiable(true); }else{ // this resource is not available this.setAvailable(false); } } /** * this is GET, return the string to client */ @Override public Representation represent(Variant variant) throws ResourceException { if(MediaType.TEXT_PLAIN.equals(variant.getMediaType())) { // try{ StringRepresentation sr = new StringRepresentation(test,MediaType.TEXT_PLAIN); sr.setText(now in represent, this is get); return sr; // }catch(IOException e) { // e.printStackTrace(); // } } return null; } @Override
Re: help on PUT
I worked with weblogic support and we proved that weblogic support the PUT request. helen chen hc...@aip.org 04/06/09 8:37 AM Hi Thierry, I tested the POST method and it works. So I think you are right, there maybe some configuration in weblogic that stoped PUT request. I'm going to contact weblogic support and see what I can get and I'll post back. Thanks a lot for your help. Helen Thierry Boileau thierry.boil...@noelios.com 04/06/09 5:55 AM Hello Helen, I have no knowledge of weblogic, but it seems that the access to PUT requests is securized. Is it possible that by default Weblogic forbids that kind of request? Is there any configuration that allows you to specific the authorized methods for a deployed application? Best regards, Thierry Boileau Hi there, I'm using restlet 1.1.3. I created a simple restlet with get and put. then I use client try to test it. I have a local machine using tomcat and it works fine. But when I move to QA server which use weblogic 10, even for the same command, only GET works, PUT somehow complains: Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized It looks like the apache httpclient is asking something. Has anyone had this problem? the whole output after running the client is as following: Apr 3, 2009 3:05:41 PM org.aip.pubtech.testRestlet.client.RLclient PUTtpForm INFO: ===PUTtpForm Apr 3, 2009 3:05:41 PM com.noelios.restlet.ext.httpclient.HttpClientHelper start INFO: Starting the HTTP client Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: response for the uri : http://test.int.aip.org/testRestlet/articles/ Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: request success Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: entity available now in represent, this is get —-- the following is my class for resource — package org.aip.pubtech.testRestlet.aps; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.restlet.Context; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Request; import org.restlet.data.Response; import org.restlet.data.Status; import org.restlet.resource.DomRepresentation; import org.restlet.resource.Representation; import org.restlet.resource.Resource; import org.restlet.resource.ResourceException; //import org.restlet.resource.ResourceException; import org.restlet.resource.StringRepresentation; import org.restlet.resource.Variant; public class RLResource extends Resource{ protected static Logger log = Logger.getLogger(getName()); public RLResource(Context context, Request request, Response response) { super(context, request, response); this.articleExists = false; this.aipkey = (String) this.getRequest().getAttributes().get(aipkey); if(this.aipkey != null this.aipkey.trim().length()0) { this.articleExists = true; this.getVariants().add(new Variant(MediaType.TEXT_PLAIN)); this.setModifiable(true); }else{ // this resource is not available this.setAvailable(false); } } /** * this is GET, return the string to client */ @Override public Representation represent(Variant variant) throws ResourceException { if(MediaType.TEXT_PLAIN.equals(variant.getMediaType())) { // try{ StringRepresentation sr = new StringRepresentation(test,MediaType.TEXT_PLAIN); sr.setText(now in represent, this is get); return sr; // }catch(IOException e) { // e.printStackTrace(); // } } return null; } @Override public void storeRepresentation(Representation entity) throws ResourceException { if(this.aipkey ==null || this.aipkey.trim().length()==0) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); return; } if( !this.articleExists) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED
Re: help on PUT
Hello Helen, I have no knowledge of weblogic, but it seems that the access to PUT requests is securized. Is it possible that by default Weblogic forbids that kind of request? Is there any configuration that allows you to specific the authorized methods for a deployed application? Best regards, Thierry Boileau Hi there, I'm using restlet 1.1.3. I created a simple restlet with get and put. then I use client try to test it. I have a local machine using tomcat and it works fine. But when I move to QA server which use weblogic 10, even for the same command, only GET works, PUT somehow complains: Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized It looks like the apache httpclient is asking something. Has anyone had this problem? the whole output after running the client is as following: Apr 3, 2009 3:05:41 PM org.aip.pubtech.testRestlet.client.RLclient PUTtpForm INFO: ===PUTtpForm Apr 3, 2009 3:05:41 PM com.noelios.restlet.ext.httpclient.HttpClientHelper start INFO: Starting the HTTP client Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: response for the uri : http://test.int.aip.org/testRestlet/articles/ Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: request success Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: entity available now in represent, this is get —-- the following is my class for resource — package org.aip.pubtech.testRestlet.aps; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.restlet.Context; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Request; import org.restlet.data.Response; import org.restlet.data.Status; import org.restlet.resource.DomRepresentation; import org.restlet.resource.Representation; import org.restlet.resource.Resource; import org.restlet.resource.ResourceException; //import org.restlet.resource.ResourceException; import org.restlet.resource.StringRepresentation; import org.restlet.resource.Variant; public class RLResource extends Resource{ protected static Logger log = Logger.getLogger(getName()); public RLResource(Context context, Request request, Response response) { super(context, request, response); this.articleExists = false; this.aipkey = (String) this.getRequest().getAttributes().get(aipkey); if(this.aipkey != null this.aipkey.trim().length()0) { this.articleExists = true; this.getVariants().add(new Variant(MediaType.TEXT_PLAIN)); this.setModifiable(true); }else{ // this resource is not available this.setAvailable(false); } } /** * this is GET, return the string to client */ @Override public Representation represent(Variant variant) throws ResourceException { if(MediaType.TEXT_PLAIN.equals(variant.getMediaType())) { // try{ StringRepresentation sr = new StringRepresentation(test,MediaType.TEXT_PLAIN); sr.setText(now in represent, this is get); return sr; // }catch(IOException e) { // e.printStackTrace(); // } } return null; } @Override public void storeRepresentation(Representation entity) throws ResourceException { if(this.aipkey ==null || this.aipkey.trim().length()==0) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); return; } if( !this.articleExists) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); return; } this.getResponse().setStatus(Status.SUCCESS_OK); }catch(Exception e) { log.warning(record data exception); this.getResponse().setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE); } } —-- the following is client code —--- package org.aip.pubtech.testRestlet.client; import java.io.IOException; import org.restlet.Client;
Re: help on PUT
Hi Thierry, I tested the POST method and it works. So I think you are right, there maybe some configuration in weblogic that stoped PUT request. I'm going to contact weblogic support and see what I can get and I'll post back. Thanks a lot for your help. Helen Thierry Boileau thierry.boil...@noelios.com 04/06/09 5:55 AM Hello Helen, I have no knowledge of weblogic, but it seems that the access to PUT requests is securized. Is it possible that by default Weblogic forbids that kind of request? Is there any configuration that allows you to specific the authorized methods for a deployed application? Best regards, Thierry Boileau Hi there, I'm using restlet 1.1.3. I created a simple restlet with get and put. then I use client try to test it. I have a local machine using tomcat and it works fine. But when I move to QA server which use weblogic 10, even for the same command, only GET works, PUT somehow complains: Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized It looks like the apache httpclient is asking something. Has anyone had this problem? the whole output after running the client is as following: Apr 3, 2009 3:05:41 PM org.aip.pubtech.testRestlet.client.RLclient PUTtpForm INFO: ===PUTtpForm Apr 3, 2009 3:05:41 PM com.noelios.restlet.ext.httpclient.HttpClientHelper start INFO: Starting the HTTP client Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: response for the uri : http://test.int.aip.org/testRestlet/articles/ Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: request success Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: entity available now in represent, this is get —-- the following is my class for resource — package org.aip.pubtech.testRestlet.aps; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.restlet.Context; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Request; import org.restlet.data.Response; import org.restlet.data.Status; import org.restlet.resource.DomRepresentation; import org.restlet.resource.Representation; import org.restlet.resource.Resource; import org.restlet.resource.ResourceException; //import org.restlet.resource.ResourceException; import org.restlet.resource.StringRepresentation; import org.restlet.resource.Variant; public class RLResource extends Resource{ protected static Logger log = Logger.getLogger(getName()); public RLResource(Context context, Request request, Response response) { super(context, request, response); this.articleExists = false; this.aipkey = (String) this.getRequest().getAttributes().get(aipkey); if(this.aipkey != null this.aipkey.trim().length()0) { this.articleExists = true; this.getVariants().add(new Variant(MediaType.TEXT_PLAIN)); this.setModifiable(true); }else{ // this resource is not available this.setAvailable(false); } } /** * this is GET, return the string to client */ @Override public Representation represent(Variant variant) throws ResourceException { if(MediaType.TEXT_PLAIN.equals(variant.getMediaType())) { // try{ StringRepresentation sr = new StringRepresentation(test,MediaType.TEXT_PLAIN); sr.setText(now in represent, this is get); return sr; // }catch(IOException e) { // e.printStackTrace(); // } } return null; } @Override public void storeRepresentation(Representation entity) throws ResourceException { if(this.aipkey ==null || this.aipkey.trim().length()==0) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); return; } if( !this.articleExists) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); return; } this.getResponse().setStatus(Status.SUCCESS_OK); }catch(Exception e
help on PUT
Hi there, I'm using restlet 1.1.3. I created a simple restlet with get and put. then I use client try to test it. I have a local machine using tomcat and it works fine. But when I move to QA server which use weblogic 10, even for the same command, only GET works, PUT somehow complains: Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized It looks like the apache httpclient is asking something. Has anyone had this problem? the whole output after running the client is as following: Apr 3, 2009 3:05:41 PM org.aip.pubtech.testRestlet.client.RLclient PUTtpForm INFO: ===PUTtpForm Apr 3, 2009 3:05:41 PM com.noelios.restlet.ext.httpclient.HttpClientHelper start INFO: Starting the HTTP client Apr 3, 2009 3:05:41 PM org.apache.commons.httpclient.HttpMethodDirector isAuthenticationNeeded INFO: Authentication requested but doAuthentication is disabled PUT output: Unauthorized (401) - Unauthorized Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: response for the uri : http://test.int.aip.org/testRestlet/articles/ Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: request success Apr 3, 2009 3:05:42 PM org.aip.pubtech.testRestlet.client.RLclient get INFO: entity available now in represent, this is get —-- the following is my class for resource — package org.aip.pubtech.testRestlet.aps; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import org.restlet.Context; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Request; import org.restlet.data.Response; import org.restlet.data.Status; import org.restlet.resource.DomRepresentation; import org.restlet.resource.Representation; import org.restlet.resource.Resource; import org.restlet.resource.ResourceException; //import org.restlet.resource.ResourceException; import org.restlet.resource.StringRepresentation; import org.restlet.resource.Variant; public class RLResource extends Resource{ protected static Logger log = Logger.getLogger(getName()); public RLResource(Context context, Request request, Response response) { super(context, request, response); this.articleExists = false; this.aipkey = (String) this.getRequest().getAttributes().get(aipkey); if(this.aipkey != null this.aipkey.trim().length()0) { this.articleExists = true; this.getVariants().add(new Variant(MediaType.TEXT_PLAIN)); this.setModifiable(true); }else{ // this resource is not available this.setAvailable(false); } } /** * this is GET, return the string to client */ @Override public Representation represent(Variant variant) throws ResourceException { if(MediaType.TEXT_PLAIN.equals(variant.getMediaType())) { // try{ StringRepresentation sr = new StringRepresentation(test,MediaType.TEXT_PLAIN); sr.setText(now in represent, this is get); return sr; // }catch(IOException e) { // e.printStackTrace(); // } } return null; } @Override public void storeRepresentation(Representation entity) throws ResourceException { if(this.aipkey ==null || this.aipkey.trim().length()==0) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); return; } if( !this.articleExists) { this.getResponse().setStatus(Status.CLIENT_ERROR_UNAUTHORIZED); return; } this.getResponse().setStatus(Status.SUCCESS_OK); }catch(Exception e) { log.warning(record data exception); this.getResponse().setStatus(Status.SERVER_ERROR_SERVICE_UNAVAILABLE); } } —-- the following is client code —--- package org.aip.pubtech.testRestlet.client; import java.io.IOException; import org.restlet.Client; import org.restlet.data.Form; import org.restlet.data.MediaType; import org.restlet.data.Method; import org.restlet.data.Protocol; import org.restlet.data.Reference; import org.restlet.data.Request; import org.restlet.data.Response; import org.restlet.resource.Representation; import org.restlet.resource.StringRepresentation; import java.util.logging.Level; import java.util.logging.Logger; public class RLclient { protected static Logger log
RE: Help!!!!! Restlet ?!?!?!?!?
-Our problem is to understand how makes the client thet have to get or post a resource to know resource's location and therefore the final url to use in the GET or POST HTTP messages to refer to the correct locations. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1390627
RE: Help!!!!! Restlet ?!?!?!?!?
thank you Jerome Louvel and Thierry Boileau for help! -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1373791
Help!!!!! Restlet ?!?!?!?!?
Hi we're 3 italian students and we have to plan a restful architecture using RESTLET. We ask help to you becouse you're the developer of RESTLET. If you are not, we ask to you a e-mail contact of the developer if you know it. The architecture have to implement a B2B message exchange in xml format powered by GS1 XML. -Our problem is to understand how makes the client thet have to get or post a resource to know resource's location and therefore the final url to use in the GET or POST HTTP messages to refer to the correct locations. -HTTP packets interpretation, is powered by HTTP server created as in the examples in the RESTLET's site, or we need of a server side application running on a http server like Apache Tomcat? Or the server receives the packets only and we have to process this packets via java code or with RESTLET library? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1340239
RE: Help request
Endrio, What a creative email title! Not sure it usually helps to get a prompt answer :) To get you started, you just need the org.restlet.jar (if you are using Restlet 1.2 M1), otherwise you also need com.noelios.restlet.jar. With those two JARs in your classpath, you have built-in/internal HTTP server and client connectors that will handle all the HTTP communication for you. No need to install Tomcat to get you started, unless you have other constraints. For more details, see this page: User Guide: Connectors http://wiki.restlet.org/docs_1.2/13-restlet/27-restlet/37-restlet.html Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : endrio [mailto:endrio.tora...@hotmail.it] Envoyé : mardi 17 mars 2009 12:31 À : discuss@restlet.tigris.org Objet : Help! Restlet ?!?!?!?!? Hi we're 3 italian students and we have to plan a restful architecture using RESTLET. We ask help to you becouse you're the developer of RESTLET. If you are not, we ask to you a e-mail contact of the developer if you know it. The architecture have to implement a B2B message exchange in xml format powered by GS1 XML. -Our problem is to understand how makes the client thet have to get or post a resource to know resource's location and therefore the final url to use in the GET or POST HTTP messages to refer to the correct locations. -HTTP packets interpretation, is powered by HTTP server created as in the examples in the RESTLET's site, or we need of a server side application running on a http server like Apache Tomcat? Or the server receives the packets only and we have to process this packets via java code or with RESTLET library? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=13402 39 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1341063
Re: Help request
Hello Endrio, as said Jérôme, the client and server connectors interpretes the HTTP packets in order to build high level objects = Request [1] and Response [2]. From the point of view of a Restlet-based client, the Response object contains a representation of the requested resource (assuming the client has sent a GET request). If you want to parse this XML representation, you can use either the DomRepresentation [3], or the SaxRepresentation [4] as follow: SaxRepresentation saxRep = new SaxRepresentation(response.getEntity()); Then, you can use the parse(ContentHandler) method, which gives you access to the content of the XML representation. In the case you want to send a POST request with a representation, just prepare it (You can use SaxRepresentation, DomRepresentation, FileRepresentation, StringRepresentation, etc). Then add to the request, and let the client handle it. From the point of view of a Restlet-based server, the Request object contains the POSTed representation, that you can parse with SaxRepresentation, or with DomRepresentation, etc. You can have a look at the firstSteps, firstResource and the tutorial for more details = http://www.restlet.org/documentation/1.1/ best regards, Thierry Boileau [1] http://www.restlet.org/documentation/1.1/api/org/restlet/data/Request.html [2] http://www.restlet.org/documentation/1.1/api/org/restlet/data/Response.html [3] http://www.restlet.org/documentation/1.1/api/org/restlet/resource/DomRepresentation.html [4] http://www.restlet.org/documentation/1.1/api/org/restlet/resource/SaxRepresentation.html Endrio, What a creative email title! Not sure it usually helps to get a prompt answer :) To get you started, you just need the org.restlet.jar (if you are using Restlet 1.2 M1), otherwise you also need com.noelios.restlet.jar. With those two JARs in your classpath, you have built-in/internal HTTP server and client connectors that will handle all the HTTP communication for you. No need to install Tomcat to get you started, unless you have other constraints. For more details, see this page: User Guide: Connectors http://wiki.restlet.org/docs_1.2/13-restlet/27-restlet/37-restlet.html Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : endrio [mailto:endrio.tora...@hotmail.it] Envoyé : mardi 17 mars 2009 12:31 À : discuss@restlet.tigris.org Objet : Help! Restlet ?!?!?!?!? Hi we're 3 italian students and we have to plan a restful architecture using RESTLET. We ask help to you becouse you're the developer of RESTLET. If you are not, we ask to you a e-mail contact of the developer if you know it. The architecture have to implement a B2B message exchange in xml format powered by GS1 XML. -Our problem is to understand how makes the client thet have to get or post a resource to know resource's location and therefore the final url to use in the GET or POST HTTP messages to refer to the correct locations. -HTTP packets interpretation, is powered by HTTP server created as in the examples in the RESTLET's site, or we need of a server side application running on a http server like Apache Tomcat? Or the server receives the packets only and we have to process this packets via java code or with RESTLET library? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=13402 39 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1341063 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1341291
RE: jax-rs example throwing exception: please help
Hi Ty, Note that in recent snapshots (1.1 and 1.2), there is no a lazy loading of JAX-RS providers so it won't complain about the javax/activation/DataSource missing anymore. Just be sure to include the JARs you do need in order to have the corresponding providers available to your JAX-RS application. Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : stephan.ko...@web.de [mailto:stephan.ko...@web.de] Envoyé : vendredi 13 mars 2009 21:07 À : discuss@restlet.tigris.org Objet : Re: jax-rs example throwing exception: please help Hi Ty, Do you put the JAR (I think javax.activation.jar) into your classpath? best regards Stephan Ty schrieb: Hi, This is most likely a really basic problem in my configuration but I can't work it out. Any help is greatly appreciated. I have v1.2 of restlet and I'm trying to run the jax-rs example (as an application) from the org.restlet.example.jar: org.restlet.example.jaxrs I get this exception stack when I start the ExampleServer: Exception in thread main java.lang.NoClassDefFoundError: javax/activation/DataSource at org.restlet.ext.jaxrs.JaxRsRestlet.loadDefaultProviders(JaxRsRestlet.java:20 7) at org.restlet.ext.jaxrs.JaxRsRestlet.init(JaxRsRestlet.java:197) at org.restlet.ext.jaxrs.JaxRsRestlet.init(JaxRsRestlet.java:168) at org.restlet.ext.jaxrs.JaxRsApplication.init(JaxRsApplication.java:95) at org.restlet.example.jaxrs.ExampleServer.main(ExampleServer.java:57) I am using Eclipse Ganemede on OS-X 10.5 (java 1.5.0). I have included the libraries: org.restlet.jar, org.restlet.example.jar, javax.ws.rs.jar, org.restlet.ext.jaxrs_1.0.jar I must admit that I'm still quite lost as to how all the libraries fit together. Probably why I can't work out what's wrong myself. Thanks. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=13184 86 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1333455
RE: Re: jax-rs example throwing exception: please help
Thanks, the activation jar was the first of many that I needed to add before I could get the example to work. Eventually I did get it to work though. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1319909
RE: Re: jax-rs example throwing exception: please help
Thanks for the help Stephan. You got me started on a journey of adding libraries. In the end I had to include the following before the example would run: com.sun.jaxb.jar javax.activation.jar javax.mail.jar javax.ws.rs.jar javax.xml.bind.jar org.apache.commons.fileupload.jar org.json.jar org.restlet.example.jar org.restlet.ext.jaxrs_1.0.jar org.restlet.jar I'm not sure why I didn't have to also include these: org.restlet.ext.fileupload_1.2.jar org.restlet.ext.javamail_1.4.jar org.restlet.ext.jaxb_2.1.jar org.restlet.ext.json_2.0.jar It's all a bit of a mystery for me at the moment. Thanks again for you help, T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1318708
jax-rs example throwing exception: please help
Hi, This is most likely a really basic problem in my configuration but I can't work it out. Any help is greatly appreciated. I have v1.2 of restlet and I'm trying to run the jax-rs example (as an application) from the org.restlet.example.jar: org.restlet.example.jaxrs I get this exception stack when I start the ExampleServer: Exception in thread main java.lang.NoClassDefFoundError: javax/activation/DataSource at org.restlet.ext.jaxrs.JaxRsRestlet.loadDefaultProviders(JaxRsRestlet.java:207) at org.restlet.ext.jaxrs.JaxRsRestlet.init(JaxRsRestlet.java:197) at org.restlet.ext.jaxrs.JaxRsRestlet.init(JaxRsRestlet.java:168) at org.restlet.ext.jaxrs.JaxRsApplication.init(JaxRsApplication.java:95) at org.restlet.example.jaxrs.ExampleServer.main(ExampleServer.java:57) I am using Eclipse Ganemede on OS-X 10.5 (java 1.5.0). I have included the libraries: org.restlet.jar, org.restlet.example.jar, javax.ws.rs.jar, org.restlet.ext.jaxrs_1.0.jar I must admit that I'm still quite lost as to how all the libraries fit together. Probably why I can't work out what's wrong myself. Thanks. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1316996
Re: jax-rs example throwing exception: please help
Hi Ty, Do you put the JAR (I think javax.activation.jar) into your classpath? best regards Stephan Ty schrieb: Hi, This is most likely a really basic problem in my configuration but I can't work it out. Any help is greatly appreciated. I have v1.2 of restlet and I'm trying to run the jax-rs example (as an application) from the org.restlet.example.jar: org.restlet.example.jaxrs I get this exception stack when I start the ExampleServer: Exception in thread main java.lang.NoClassDefFoundError: javax/activation/DataSource at org.restlet.ext.jaxrs.JaxRsRestlet.loadDefaultProviders(JaxRsRestlet.java:207) at org.restlet.ext.jaxrs.JaxRsRestlet.init(JaxRsRestlet.java:197) at org.restlet.ext.jaxrs.JaxRsRestlet.init(JaxRsRestlet.java:168) at org.restlet.ext.jaxrs.JaxRsApplication.init(JaxRsApplication.java:95) at org.restlet.example.jaxrs.ExampleServer.main(ExampleServer.java:57) I am using Eclipse Ganemede on OS-X 10.5 (java 1.5.0). I have included the libraries: org.restlet.jar, org.restlet.example.jar, javax.ws.rs.jar, org.restlet.ext.jaxrs_1.0.jar I must admit that I'm still quite lost as to how all the libraries fit together. Probably why I can't work out what's wrong myself. Thanks. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1318486
RE: help with spring/servlet integration and applicaiton modificaton
Hi Matt, Were you able to solve this? Did you specify your application class properly in your ServerServlet parameters? context-param param-nameorg.restlet.application/param-name param-valuecom.mycompany.HwApplication/param-value /context-param Best regards, Jerome Louvel -- Restlet ~ Founder and Lead developer ~ http://www.restlet.org Noelios Technologies ~ Co-founder ~ http://www.noelios.com -Message d'origine- De : matt [mailto:mattcam...@gmail.com] Envoye : mercredi 31 decembre 2008 21:02 A : discuss@restlet.tigris.org Objet : help with spring/servlet integration and applicaiton modificaton Hi There- I have been using restlet for a few weeks steady now and love it but now have a problem with spring and servlets and complete integration. I am using as a base the spring cvs repository pointed to on the wiki and using. Here is my situation, not sure if I am attacking it correctly or if i can. I want to make modifications to my 'base application' that is used in my servlet with the spring router. For example suppose I have a base application like this: // Extends Application public HwApplication() { super(); TunnelService ts = new TunnelService(true,true,true,true,true); ts.setMediaTypeParameter(mt); this.setTunnelService(ts); } Here is one of the variations of my applicationContext-router.xml file that I used. I thought this would work from the docs on the wiki. bean id=application class=com.hw.rest.HwApplication /bean bean id=root class=org.restlet.ext.spring.SpringRouter constructor-arg ref=application / property name=attachments map entry key=/foo value=com.hw.rest.HwResource / /map /property /bean What happens is that when com.hw.rest.HwResource is used it does not have a handle to my application but a generic restlet application. I have tried a variety of things from the wiki examples and also the CVS repo and nothing seems to work. So in my use case I am not getting the tunneling or the media conversion i need via my custom application.. Somewhere something is not getting bound correctly. This is happening in the servlet situation only. I am digging around the code now the best I can to see where things get switched up. I obviously and more sure on the correct binding order. If anybody has advice or an example from their own work that does this I am super appreciative! matt -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=997142 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=1022118
help with spring/servlet integration and applicaiton modificaton
Hi There- I have been using restlet for a few weeks steady now and love it but now have a problem with spring and servlets and complete integration. I am using as a base the spring cvs repository pointed to on the wiki and using. Here is my situation, not sure if I am attacking it correctly or if i can. I want to make modifications to my 'base application' that is used in my servlet with the spring router. For example suppose I have a base application like this: // Extends Application public HwApplication() { super(); TunnelService ts = new TunnelService(true,true,true,true,true); ts.setMediaTypeParameter(mt); this.setTunnelService(ts); } Here is one of the variations of my applicationContext-router.xml file that I used. I thought this would work from the docs on the wiki. bean id=application class=com.hw.rest.HwApplication /bean bean id=root class=org.restlet.ext.spring.SpringRouter constructor-arg ref=application / property name=attachments map entry key=/foo value=com.hw.rest.HwResource / /map /property /bean What happens is that when com.hw.rest.HwResource is used it does not have a handle to my application but a generic restlet application. I have tried a variety of things from the wiki examples and also the CVS repo and nothing seems to work. So in my use case I am not getting the tunneling or the media conversion i need via my custom application.. Somewhere something is not getting bound correctly. This is happening in the servlet situation only. I am digging around the code now the best I can to see where things get switched up. I obviously and more sure on the correct binding order. If anybody has advice or an example from their own work that does this I am super appreciative! matt -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=997142