RE: Re: Matlab With Restlet
hi Thierry Sorry for late reply for ur post.Actually i have found the reason for the behaviour.The problem was in my code in matlab.Im really sorry for taking up ur time but without ur help i would not have found the problem in side matlab code.Im really thankful for your support.(i guess u can also cancel the bug created for the issue). The problem was from the matlab i was passing invaild scheme name.But client was getting created with out any errors for eg.client(Protocol.HTTP).Thats the reason why i was getting a negative return from containAll(). Because of my in experience with the api i had feeling that it would give an error when i pass a invalid scheme name as string to the constructor for creating the client. Thanks a lot for helping me out.Any how im using the API so if i have any more doubts i will get back to u. regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2451691
Re: Matlab With Restlet
Hello Rashik, no problems. bye, Thierry hi Thierry Sorry for late reply for ur post.Actually i have found the reason for the behaviour.The problem was in my code in matlab.Im really sorry for taking up ur time but without ur help i would not have found the problem in side matlab code.Im really thankful for your support.(i guess u can also cancel the bug created for the issue). The problem was from the matlab i was passing invaild scheme name.But client was getting created with out any errors for eg.client(Protocol.HTTP).Thats the reason why i was getting a negative return from containAll(). Because of my in experience with the api i had feeling that it would give an error when i pass a invalid scheme name as string to the constructor for creating the client. Thanks a lot for helping me out.Any how im using the API so if i have any more doubts i will get back to u. regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2451691 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2451856
Re: Matlab With Restlet
Hi, it looks like the containsAll methods behaves oddly, it should return true for both com.noelios.restlet.ext.net.HttpClientHelper, and com.noelios.restlet.http.StreamClientHelper. What may happen also is that the client is not properly initialized. Given its single protocol (HTTP), its member attribute protocols, which is a list, is set using the Arrays#asList method. Could you check that this method works properly by displaying the list of client's protocols? Client client = new Client(Protocol.HTTP); System.out.println(client.getProtocols()); If the list is empty, I suggest, as a workaround, to set the list using another way such as: client.setProtocols(new ArrayListProtocol()); client.getProtocols().add(Protocol.HTTP); Best regards, Thierry Boileau NB: Restlet v2 does not have a com.noelios.restlet package and jar. The org.restlet.jar contains now both the API and reference implementation. hi Thierry I have done the test suggested by you.Im using Restlet 1.1.8.Also i have downloaded (version 2 milestone 7 but i was not able to find com.noelios.restlet.jar inside lib folder. So i havent tried anything with this release). The log from the Matlab Command Window is as follows: Diagnostics START Executing : com.noelios.restlet.Engine engine = (com.noelios.restlet.Engine) org.restlet.util.Engine.getInstance();.And the Output Is: Executing : System.out.println( engine: + engine);.And the Output Is: Engine : com.noelios.restlet.eng...@ae43b8 Executing : System.out.println( client connectors: + engine.getRegisteredClients());.And the Output Is: client Connectors : [com.noelios.restlet.ext.net.httpclienthel...@54919e, com.noelios.restlet.http.streamclienthel...@2437ef, com.noelios.restlet.local.clapclienthel...@1d46259, com.noelios.restlet.local.fileclienthel...@84fa6a] Executing : Client client = new Client(Protocol.HTTP);.And the Output Is: 22.02.2010 18:52:44 com.noelios.restlet.Engine createHelper WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. Client : org.restlet.cli...@18307be Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.ext.net.httpclienthel...@54919e Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [HTTP, HTTPS] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.http.streamclienthel...@2437ef Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [HTTP] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.local.clapclienthel...@1d46259 Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [CLAP] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.local.fileclienthel...@84fa6a Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [FILE] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( chosen helper: + Engine.getInstance().createHelper(client, null));.And the Output Is: 22.02.2010 18:52:44 com.noelios.restlet.Engine createHelper WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. chosen helper: The Value returned from Engine.getInstance().createHelper(client, null)) is Empty Diagnostics END I hope u can easily understand the above log file. If you need any more info pls let me know. Thanks. Regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450560 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450873
Re: Matlab With Restlet
Hello Rashik I've entered an issue for this problem = http://restlet.tigris.org/issues/show_bug.cgi?id=1042. Could you check the value of org.restlet.util.Engine.getInstance() (its class especially). If this is an instance of com.noelios.restlet.Engine, could you check the value of getRegisteredClients()? Best regards, Thierry Boileau hi Thierry Im really sorry for the partial information in the post. i will just explain what i have done till now so it more clear about my problem. In matlab we can add the jar files dynamically or statically. Adding Jar files to matlab math dynamically == I tried to add the following jar files org.restlet.ext.json-1.1.7.jar org.json_2.0.0.jar org.restlet-1.1.7.jar com.noelios.restlet-1.1.7.jar dynamically (using matlab command javaaddpath). The jar files currently inside the matlab environment can been seen with command javaclasspath. Now i was able to see all the jar files mentioned above in the javaclasspath. Then when i tried to create a client Client(Protocol.HTTP) I got the following error ??? Java exception occurred: java.lang.RuntimeException: Unable to fully initialize the Restlet. No Restlet engine available. But this problem was solved when i added the jar files statically to matlab. (We can do that by editing the classpath.txt). (I dont know the reson for this because im not sure how the classloading for matlab works.I got the info from the forums that there has been difference in behaviour between static and dynamic class loading). After this problem was solved When i tried to execute to Client(Protocol.HTTP) i got the warning No available client connector supports the required protocols: 'PROTOCOL.HTTP Protocol' . Please add the JAR of a matching connector to your classpath. But based on your inputs i tried to include following jar files also to matlab class path i.com.noelios.restlet.ext.net.jar and also i tired adding org.apache.commons.httpclient.jar and com.noelios.restlet.ext.httpclient_3.1.jar These were done as separate trials. Still i have the same warning. Can u pls let me know what all information you need from matlab side so that we can figure out this issue. Regards Rashik -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450078 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450306
RE: Re: Matlab With Restlet
Hi Thierry I have checked the values Then value of org.restlet.util.Engine.getInstance() is com.noelios.restlet.eng...@ae43b8 (is an instance of com.noelios.restlet.Engine) and the value returned from the method getRegisteredClients() are [com.noelios.restlet.ext.net.httpclienthel...@54919e, com.noelios.restlet.http.streamclienthel...@2437ef, com.noelios.restlet.local.clapclienthel...@1d46259, com.noelios.restlet.local.fileclienthel...@84fa6a] If you need any more information please let me know. Thanks. Regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450365
Re: Matlab With Restlet
Hi Rashik, the values are correct, and we can notice the presence of the internal connector (denoted by the presence of an instance of com.noelios.restlet.http.StreamClientHelper). Your client code should work. What happens if you display the client's helper? Client client = new Client(Protocol.HTTP); System.out.println(Engine.getInstance().createHelper(client, null)); Besrt regards, Thierry Boileau Hi Thierry I have checked the values Then value of org.restlet.util.EngâEUR -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450402
RE: Re: Matlab With Restlet
hi Thierry If i execute the following in side matlab Client client = new Client(Protocol.HTTP); I get the warning WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. When i execut the following System.out.println(Engine.getInstance().createHelper(client, null)); I get the same warning. WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. But when i checked the code of the createhelper() and so i checked for more values from matlab. client.getProtocol() returns [HTTP]. but for (connector.getprotocols().containsAll(client.getProtocol()) returns 0 for iteration with com.noelios.restlet.http.StreamClientHelper instance.) Can u please let me know why this returning zero.I hope im on right path of debugging the problem. Thanks Regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450425
Re: Matlab With Restlet
Hello Rashik, there's something unclear to me. The StreamClientHelper explicitely supports the HTTP protocol, so connector.getprotocols().containsAll(client.getProtocols()) must return true. Could you tell us what the following code produces on the console? com.noelios.restlet.Engine engine = (com.noelios.restlet.Engine) org.restlet.util.Engine.getInstance(); System.out.println( engine: + engine); System.out.println(client connectors: + engine.getRegisteredClients()); Client client = new Client(Protocol.HTTP); for (ClientHelper helper : engine.getRegisteredClients()) { System.out.println(client helper: + helper); System.out.print( client protocols: + helper.getProtocols()); System.out.println( = + helper.getProtocols().containsAll(client.getProtocols())); } System.out.println(chosen helper: + Engine.getInstance().createHelper(client, null)); Best regards, Thierry Boileau ps: what release of Restlet are you using? hi Thierry If i execute the following in side matlab Client client = new Client(Protocol.HTTP); I get the warning WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. When i execut the following System.out.println(EâEUR null)); I get the same warning. WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. But when i checked the code of the createhelper() and so i checked for more values from matlab. client.getProtocol() returns [HTTP]. but for (connector.getprotocols().containsAll(client.getProtocol()) returns 0 for iteration with com.noelios.restlet.âEUR -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450503
RE: Re: Matlab With Restlet
hi Thierry I have done the test suggested by you.Im using Restlet 1.1.8.Also i have downloaded (version 2 milestone 7 but i was not able to find com.noelios.restlet.jar inside lib folder. So i havent tried anything with this release). The log from the Matlab Command Window is as follows: Diagnostics START Executing : com.noelios.restlet.Engine engine = (com.noelios.restlet.Engine) org.restlet.util.Engine.getInstance();.And the Output Is: Executing : System.out.println( engine: + engine);.And the Output Is: Engine : com.noelios.restlet.eng...@ae43b8 Executing : System.out.println( client connectors: + engine.getRegisteredClients());.And the Output Is: client Connectors : [com.noelios.restlet.ext.net.httpclienthel...@54919e, com.noelios.restlet.http.streamclienthel...@2437ef, com.noelios.restlet.local.clapclienthel...@1d46259, com.noelios.restlet.local.fileclienthel...@84fa6a] Executing : Client client = new Client(Protocol.HTTP);.And the Output Is: 22.02.2010 18:52:44 com.noelios.restlet.Engine createHelper WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. Client : org.restlet.cli...@18307be Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.ext.net.httpclienthel...@54919e Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [HTTP, HTTPS] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.http.streamclienthel...@2437ef Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [HTTP] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.local.clapclienthel...@1d46259 Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [CLAP] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( client helper: + helper);.And the Output Is: Client Helper : com.noelios.restlet.local.fileclienthel...@84fa6a Executing : System.out.print( client protocols: + helper.getProtocols());.And the Output Is: Client Protocols : [FILE] Executing : System.out.println( = + helper.getProtocols().containsAll(client.getProtocols()));.And the Output Is: Value returned by (helper.getProtocols().containsAll(client.getProtocols())) : 0 Executing : System.out.println( chosen helper: + Engine.getInstance().createHelper(client, null));.And the Output Is: 22.02.2010 18:52:44 com.noelios.restlet.Engine createHelper WARNUNG: No available client connector supports the required protocols: 'PROTOCOL.HTTP' . Please add the JAR of a matching connector to your classpath. chosen helper: The Value returned from Engine.getInstance().createHelper(client, null)) is Empty Diagnostics END I hope u can easily understand the above log file. If you need any more info pls let me know. Thanks. Regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2450560
Re: Matlab With Restlet
Hello Rashik, this kind of errors happens when the classpath is not properly configured. The core library (org.restlet.jar) looks for a HTTP client connector by introspecting the classpath. Can you have a look at this documentation http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f4863.html#f4867 ? Should i run my client inside servlet? definitively not. Also which all jar files should i add to make the communication working between the server. you need org.restlet.jar which defines the API, and com.noelios.restlet.jar which contains an implementation of this API plus a default HTTP client connector. Thats' all, and that should basically work. You can add another client implementations at your own convenience: - either com.noelios.restlet.ext.net.jar (Integration with Java HttpURLConnection class) - or com.noelios.restlet.ext.httpclient.jar (Integration with Apache HTTP Client 3.1) Each of them contains some proper characteristics described in the javadocs. You can have a loot here http://wiki.restlet.org/docs_1.1/37-restlet.html. Best regards, Thierry Boileau hi Im newbie to restlet. Im writing matlab client which will interact with server. I have added the following jar files to class path in matlab 1.com.noelios.restlet.jar 2.org.json.jar 3.org.restlet.ext.json.jar 4.org.restlet.jar When i creating the client: Client(Protocol.HTTP) i get the following warning No available client connector supports the required protocols: 'PROTOCOL.HTTP Protocol' . Please add the JAR of a matching connector to your classpath. What should i do to remove this warning. Should i run my client inside servlet? Also which all jar files should i add to make the communication working between the server. (Im new to web applications). But i wrote eclipse application to interact with sever including the above mentioned jar files and the application is running fine. May i know what is difference in both these conditions. Hope i m able to correctly explain my problem. Regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2448864 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2449012
RE: Re: Matlab With Restlet
hi But i wrote java application using eclipse to interact with sever including following jar files 1.com.noelios.restlet.jar 2.org.json.jar 3.org.restlet.ext.json.jar 4.org.restlet.jar and the application is running fine.I m able to interact with the server. Here i didnt add jar files realted to HTTP client connector as well i didnt configure any parameters realted to HTTP inside the api. Why is there a difference. Thanks Regards Rashik -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2449108
Re: Matlab With Restlet
Hi Rashik, my mail simply aims at warning you about the specific case of the Matlab environment. The configuration of the class path in Matlab seems specific, I just want to be sure you are aware of this and that the classpath is correctly configured. The next step is to understand why there is an issue. I just gave you some data about the reasons, just in order you may help us a little bit in this area. As I completely don't know Matlab, I have to install it, be friend with it and investigate. This is time, and as I'm not totally free right now, I hope you understand it can take time to help you. Best regards, Thierry Boileau hi But i wrote java application using eclipse to interact with sever including following jar files 1.com.noelios.restlet.jar 2.org.json.jar 3.org.restlet.ext.json.jar 4.org.restlet.jar and the application is running fine.I m able to interact with the server. Here i didnt add jar files realted to HTTP client connector as well i didnt configure any parameters realted to HTTP inside the api. Why is there a difference. Thanks Regards Rashik -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2449108 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2449112
Matlab With Restlet
hi Im newbie to restlet. Im writing matlab client which will interact with server. I have added the following jar files to class path in matlab 1.com.noelios.restlet.jar 2.org.json.jar 3.org.restlet.ext.json.jar 4.org.restlet.jar When i creating the client: Client(Protocol.HTTP) i get the following warning No available client connector supports the required protocols: 'PROTOCOL.HTTP Protocol' . Please add the JAR of a matching connector to your classpath. What should i do to remove this warning. Should i run my client inside servlet? Also which all jar files should i add to make the communication working between the server. (Im new to web applications). But i wrote eclipse application to interact with sever including the above mentioned jar files and the application is running fine. May i know what is difference in both these conditions. Hope i m able to correctly explain my problem. Regards Rashik.T -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2448864