You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shindig.apache.org by "Eric Rose (erose)" <er...@cisco.com> on 2010/05/10 17:45:55 UTC
makeRequest fails
Greetings,
We are writing a gadget that uses makeRequest to contact an SSL secured
API that uses a self-signed certificate and basic authentication. We
are base 64 encoding username:password and specifying:
Params[gadget.io.RequestParamters.HEADERS] = headers;
Where headers = {"Authorization":"Basic " +
encode64('<username:password>')};
Note there is a space after the word 'Basic' before the quote. Also of
note the URL created by the makeRequest has a portion that is %2520. I
think the space is being encoded twice. %20 is becoming %2520. Which
seems wrong but I don't know how to prevent it. This may be the
problem. The self-signed cert may be the problem. But because the
request is SSL encrypted we can't look at the request directly using
WireShark.
The response we get is as follows:
Throw l; <don't be evil'
>{"https:10.86.190.41:7890/icm-dp/rest/DiagnosticPortal/ListServices":{"
body":"", "rc":500}}
The error is 'Internal Server Error', so we're not sure what's the
problem with this.
Any insight or assistance you may be able to provide would be
appreciated.
Thank you,
David and Eric
Eric Rose
Software Engineer
Product Development
erose@cisco.com <ma...@cisco.com>
Phone :(978) 936-1858
Cisco Systems, Inc.
500 Beaver Brook Road
Boxborough, MA 01719
www.cisco.com <http://www.cisco.com>
Re: How to build in eclipse
Posted by Paul Lindner <li...@inuus.com>.
You can also do this:
cd java/server
mvn jetty:run
This starts a jetty instance running on most resources in place (including content and webapp directories). After you do a build you can press enter to reload the server instance.
On May 17, 2010, at 2:42 AM, franck tankoua wrote:
> My guess is that the jar files get's loaded when the server starts.
> So this is why you need to reboot the server.
>
> If I had consistent modification to do on the jar project , I would test
> them via unittest classes to validate my changes. After this step, I would
> then build the jar and reboot the server.
>
>
> On Sat, May 15, 2010 at 10:50 AM, Evgeny Bogdanov
> <ev...@epfl.ch>wrote:
>
>> Thank you for the info (I do want the changes on jar projects)
>> I seem to have found a solution. Though there is still one more problem.
>>
>> 1) My jetty server in eclipse points now to shindig/java/server
>> 2) debugger is linked to this jetty server
>> 3) I use "mvn" command to build the project
>>
>> Now for the changes to be taken I have to re-run all 3 command above.
>> Here it sais that normally I have to only rebuild project, and don't have
>> to restart jetty:
>>
>>
>> http://shindig.apache.org/developers/java/build.html
>>
>> Is this the case for you?
>>
>>
>> On 14/5/10 19:47, franck tankoua wrote:
>>
>>> Hi,
>>> I am using "war:inplace: for my server project ( which replace the
>>> shindig-server)
>>> THis helps building automatically my code in eclipse and having my changes
>>> ready to test. But if you are doing changes in on the jar projects
>>> (gadgets,
>>> social-api, common...) you will need to build them again as Han said.
>>>
>>> One example which comes to mind is : changing the container.js in
>>> shindig-common will require running the mvn build command again to have
>>> you
>>> jar file updated.
>>>
>>>
>>> On Fri, May 14, 2010 at 7:35 PM, Han Nguyen<hn...@us.ibm.com> wrote:
>>>
>>>
>>>
>>>> Evgeny,
>>>> Shindig is a maven project, setting eclipse build automatically on is not
>>>> enough. You will need to run the maven build again to update your
>>>> changes.
>>>> Hope that helps.
>>>> Han
>>>>
>>>>
>>>>
>>>> From: Evgeny Bogdanov<ev...@epfl.ch>
>>>> To: "dev@shindig.apache.org"<de...@shindig.apache.org>
>>>> Date: 05/14/2010 11:34 AM
>>>> Subject: How to build in eclipse
>>>>
>>>>
>>>>
>>>> I am trying to debug a java version in eclipse ... no luck (
>>>>
>>>> I set it up according to:
>>>> http://shindig.apache.org/developers/java/build.html
>>>>
>>>> The debugger works as expected.
>>>> However if I change the code, the changes are not taken.
>>>> "Project -> Build automatically" is checked in eclipse
>>>>
>>>> "Right click on the project -> Run As.. -> Maven build " gives
>>>> [INFO] Scanning for projects...
>>>> [ERROR] The build could not read 1 project -> [Help 1]
>>>> [ERROR] The project
>>>> org.apache.shindig:shindig-gadgets:1.1-BETA6-SNAPSHOT
>>>> (/Library/WebServer/Documents/shindig/java/gadgets/pom.xml) has 2 errors
>>>> [ERROR]
>>>> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
>>>> unique: net.sourceforge.nekohtml:nekohtml:jar -> duplicate declaration
>>>> of version (?)
>>>> [ERROR]
>>>> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
>>>> unique: org.apache.shindig:shindig-common:test-jar -> duplicate
>>>> declaration of version (?)
>>>> [ERROR]
>>>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>>>> -e switch.
>>>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>>>> [ERROR]
>>>> [ERROR] For more information about the errors and possible solutions,
>>>> please read the following articles:
>>>> [ERROR] [Help 1]
>>>> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>>>>
>>>> Thanks in advance
>>>> Evgeny
>>>> PS:
>>>> Eclipse Java EE IDE for Web Developers.
>>>> Build id: 20100218-1602
>>>> Mac OSX 10.6.3
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>
>
> --
> Franck
Re: How to build in eclipse
Posted by franck tankoua <ft...@gmail.com>.
My guess is that the jar files get's loaded when the server starts.
So this is why you need to reboot the server.
If I had consistent modification to do on the jar project , I would test
them via unittest classes to validate my changes. After this step, I would
then build the jar and reboot the server.
On Sat, May 15, 2010 at 10:50 AM, Evgeny Bogdanov
<ev...@epfl.ch>wrote:
> Thank you for the info (I do want the changes on jar projects)
> I seem to have found a solution. Though there is still one more problem.
>
> 1) My jetty server in eclipse points now to shindig/java/server
> 2) debugger is linked to this jetty server
> 3) I use "mvn" command to build the project
>
> Now for the changes to be taken I have to re-run all 3 command above.
> Here it sais that normally I have to only rebuild project, and don't have
> to restart jetty:
>
>
> http://shindig.apache.org/developers/java/build.html
>
> Is this the case for you?
>
>
> On 14/5/10 19:47, franck tankoua wrote:
>
>> Hi,
>> I am using "war:inplace: for my server project ( which replace the
>> shindig-server)
>> THis helps building automatically my code in eclipse and having my changes
>> ready to test. But if you are doing changes in on the jar projects
>> (gadgets,
>> social-api, common...) you will need to build them again as Han said.
>>
>> One example which comes to mind is : changing the container.js in
>> shindig-common will require running the mvn build command again to have
>> you
>> jar file updated.
>>
>>
>> On Fri, May 14, 2010 at 7:35 PM, Han Nguyen<hn...@us.ibm.com> wrote:
>>
>>
>>
>>> Evgeny,
>>> Shindig is a maven project, setting eclipse build automatically on is not
>>> enough. You will need to run the maven build again to update your
>>> changes.
>>> Hope that helps.
>>> Han
>>>
>>>
>>>
>>> From: Evgeny Bogdanov<ev...@epfl.ch>
>>> To: "dev@shindig.apache.org"<de...@shindig.apache.org>
>>> Date: 05/14/2010 11:34 AM
>>> Subject: How to build in eclipse
>>>
>>>
>>>
>>> I am trying to debug a java version in eclipse ... no luck (
>>>
>>> I set it up according to:
>>> http://shindig.apache.org/developers/java/build.html
>>>
>>> The debugger works as expected.
>>> However if I change the code, the changes are not taken.
>>> "Project -> Build automatically" is checked in eclipse
>>>
>>> "Right click on the project -> Run As.. -> Maven build " gives
>>> [INFO] Scanning for projects...
>>> [ERROR] The build could not read 1 project -> [Help 1]
>>> [ERROR] The project
>>> org.apache.shindig:shindig-gadgets:1.1-BETA6-SNAPSHOT
>>> (/Library/WebServer/Documents/shindig/java/gadgets/pom.xml) has 2 errors
>>> [ERROR]
>>> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
>>> unique: net.sourceforge.nekohtml:nekohtml:jar -> duplicate declaration
>>> of version (?)
>>> [ERROR]
>>> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
>>> unique: org.apache.shindig:shindig-common:test-jar -> duplicate
>>> declaration of version (?)
>>> [ERROR]
>>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>>> -e switch.
>>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>>> [ERROR]
>>> [ERROR] For more information about the errors and possible solutions,
>>> please read the following articles:
>>> [ERROR] [Help 1]
>>> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>>>
>>> Thanks in advance
>>> Evgeny
>>> PS:
>>> Eclipse Java EE IDE for Web Developers.
>>> Build id: 20100218-1602
>>> Mac OSX 10.6.3
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
--
Franck
Re: How to build in eclipse
Posted by Evgeny Bogdanov <ev...@epfl.ch>.
Thank you for the info (I do want the changes on jar projects)
I seem to have found a solution. Though there is still one more problem.
1) My jetty server in eclipse points now to shindig/java/server
2) debugger is linked to this jetty server
3) I use "mvn" command to build the project
Now for the changes to be taken I have to re-run all 3 command above.
Here it sais that normally I have to only rebuild project, and don't
have to restart jetty:
http://shindig.apache.org/developers/java/build.html
Is this the case for you?
On 14/5/10 19:47, franck tankoua wrote:
> Hi,
> I am using "war:inplace: for my server project ( which replace the
> shindig-server)
> THis helps building automatically my code in eclipse and having my changes
> ready to test. But if you are doing changes in on the jar projects (gadgets,
> social-api, common...) you will need to build them again as Han said.
>
> One example which comes to mind is : changing the container.js in
> shindig-common will require running the mvn build command again to have you
> jar file updated.
>
>
> On Fri, May 14, 2010 at 7:35 PM, Han Nguyen<hn...@us.ibm.com> wrote:
>
>
>> Evgeny,
>> Shindig is a maven project, setting eclipse build automatically on is not
>> enough. You will need to run the maven build again to update your changes.
>> Hope that helps.
>> Han
>>
>>
>>
>> From: Evgeny Bogdanov<ev...@epfl.ch>
>> To: "dev@shindig.apache.org"<de...@shindig.apache.org>
>> Date: 05/14/2010 11:34 AM
>> Subject: How to build in eclipse
>>
>>
>>
>> I am trying to debug a java version in eclipse ... no luck (
>>
>> I set it up according to:
>> http://shindig.apache.org/developers/java/build.html
>>
>> The debugger works as expected.
>> However if I change the code, the changes are not taken.
>> "Project -> Build automatically" is checked in eclipse
>>
>> "Right click on the project -> Run As.. -> Maven build " gives
>> [INFO] Scanning for projects...
>> [ERROR] The build could not read 1 project -> [Help 1]
>> [ERROR] The project
>> org.apache.shindig:shindig-gadgets:1.1-BETA6-SNAPSHOT
>> (/Library/WebServer/Documents/shindig/java/gadgets/pom.xml) has 2 errors
>> [ERROR]
>> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
>> unique: net.sourceforge.nekohtml:nekohtml:jar -> duplicate declaration
>> of version (?)
>> [ERROR]
>> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
>> unique: org.apache.shindig:shindig-common:test-jar -> duplicate
>> declaration of version (?)
>> [ERROR]
>> [ERROR] To see the full stack trace of the errors, re-run Maven with the
>> -e switch.
>> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>> [ERROR]
>> [ERROR] For more information about the errors and possible solutions,
>> please read the following articles:
>> [ERROR] [Help 1]
>> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>>
>> Thanks in advance
>> Evgeny
>> PS:
>> Eclipse Java EE IDE for Web Developers.
>> Build id: 20100218-1602
>> Mac OSX 10.6.3
>>
>>
>>
>>
>>
>
>
Re: How to build in eclipse
Posted by franck tankoua <ft...@gmail.com>.
Hi,
I am using "war:inplace: for my server project ( which replace the
shindig-server)
THis helps building automatically my code in eclipse and having my changes
ready to test. But if you are doing changes in on the jar projects (gadgets,
social-api, common...) you will need to build them again as Han said.
One example which comes to mind is : changing the container.js in
shindig-common will require running the mvn build command again to have you
jar file updated.
On Fri, May 14, 2010 at 7:35 PM, Han Nguyen <hn...@us.ibm.com> wrote:
> Evgeny,
> Shindig is a maven project, setting eclipse build automatically on is not
> enough. You will need to run the maven build again to update your changes.
> Hope that helps.
> Han
>
>
>
> From: Evgeny Bogdanov <ev...@epfl.ch>
> To: "dev@shindig.apache.org" <de...@shindig.apache.org>
> Date: 05/14/2010 11:34 AM
> Subject: How to build in eclipse
>
>
>
> I am trying to debug a java version in eclipse ... no luck (
>
> I set it up according to:
> http://shindig.apache.org/developers/java/build.html
>
> The debugger works as expected.
> However if I change the code, the changes are not taken.
> "Project -> Build automatically" is checked in eclipse
>
> "Right click on the project -> Run As.. -> Maven build " gives
> [INFO] Scanning for projects...
> [ERROR] The build could not read 1 project -> [Help 1]
> [ERROR] The project
> org.apache.shindig:shindig-gadgets:1.1-BETA6-SNAPSHOT
> (/Library/WebServer/Documents/shindig/java/gadgets/pom.xml) has 2 errors
> [ERROR]
> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
> unique: net.sourceforge.nekohtml:nekohtml:jar -> duplicate declaration
> of version (?)
> [ERROR]
> 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
> unique: org.apache.shindig:shindig-common:test-jar -> duplicate
> declaration of version (?)
> [ERROR]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR]
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
>
> Thanks in advance
> Evgeny
> PS:
> Eclipse Java EE IDE for Web Developers.
> Build id: 20100218-1602
> Mac OSX 10.6.3
>
>
>
>
--
Franck
Re: How to build in eclipse
Posted by Han Nguyen <hn...@us.ibm.com>.
Evgeny,
Shindig is a maven project, setting eclipse build automatically on is not
enough. You will need to run the maven build again to update your changes.
Hope that helps.
Han
From: Evgeny Bogdanov <ev...@epfl.ch>
To: "dev@shindig.apache.org" <de...@shindig.apache.org>
Date: 05/14/2010 11:34 AM
Subject: How to build in eclipse
I am trying to debug a java version in eclipse ... no luck (
I set it up according to:
http://shindig.apache.org/developers/java/build.html
The debugger works as expected.
However if I change the code, the changes are not taken.
"Project -> Build automatically" is checked in eclipse
"Right click on the project -> Run As.. -> Maven build " gives
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR] The project
org.apache.shindig:shindig-gadgets:1.1-BETA6-SNAPSHOT
(/Library/WebServer/Documents/shindig/java/gadgets/pom.xml) has 2 errors
[ERROR]
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
unique: net.sourceforge.nekohtml:nekohtml:jar -> duplicate declaration
of version (?)
[ERROR]
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
unique: org.apache.shindig:shindig-common:test-jar -> duplicate
declaration of version (?)
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the
-e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Thanks in advance
Evgeny
PS:
Eclipse Java EE IDE for Web Developers.
Build id: 20100218-1602
Mac OSX 10.6.3
How to build in eclipse
Posted by Evgeny Bogdanov <ev...@epfl.ch>.
I am trying to debug a java version in eclipse ... no luck (
I set it up according to:
http://shindig.apache.org/developers/java/build.html
The debugger works as expected.
However if I change the code, the changes are not taken.
"Project -> Build automatically" is checked in eclipse
"Right click on the project -> Run As.. -> Maven build " gives
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR] The project
org.apache.shindig:shindig-gadgets:1.1-BETA6-SNAPSHOT
(/Library/WebServer/Documents/shindig/java/gadgets/pom.xml) has 2 errors
[ERROR]
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
unique: net.sourceforge.nekohtml:nekohtml:jar -> duplicate declaration
of version (?)
[ERROR]
'dependencies.dependency.(groupId:artifactId:type:classifier)' must be
unique: org.apache.shindig:shindig-common:test-jar -> duplicate
declaration of version (?)
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the
-e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions,
please read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
Thanks in advance
Evgeny
PS:
Eclipse Java EE IDE for Web Developers.
Build id: 20100218-1602
Mac OSX 10.6.3
Re: Shindig doesn't handle relative oauth service URLs properly
Posted by Paul Lindner <pl...@linkedin.com>.
A fixfor this is checked in.
On Fri, May 14, 2010 at 8:03 AM, Paul Lindner <pl...@linkedin.com> wrote:
> Looks like a check for http/https is done before the Uri is resolved
> against it's base. I'll have a patch soonish to fix this which will also
> catch some other non-base-resolved URLs in <Preload..> and <Link...>
>
> On Mon, May 10, 2010 at 12:00 PM, Randy Hudson <hu...@us.ibm.com> wrote:
>
>> There seems to be a consistency issue with shindig's treatment of relative
>> URIs in gadget specs. Some more details are at:
>>
>>
>> http://groups.google.com/group/opensocial-api/browse_thread/thread/756ecef6c4d70a2c#
>>
>> The method ModulePrefs#getUriAttribute should probably be some static
>> utility method that can be called from multiple places, in this case,
>> OAuthService, which via XmlUtil is not allowing URIs that don't start with
>> http or https. Relative URIs need to be resolved first before this
>> validation is done.
>>
>> -Randy Hudson
>
>
>
Re: Shindig doesn't handle relative oauth service URLs properly
Posted by Paul Lindner <pl...@linkedin.com>.
Looks like a check for http/https is done before the Uri is resolved against
it's base. I'll have a patch soonish to fix this which will also catch some
other non-base-resolved URLs in <Preload..> and <Link...>
On Mon, May 10, 2010 at 12:00 PM, Randy Hudson <hu...@us.ibm.com> wrote:
> There seems to be a consistency issue with shindig's treatment of relative
> URIs in gadget specs. Some more details are at:
>
>
> http://groups.google.com/group/opensocial-api/browse_thread/thread/756ecef6c4d70a2c#
>
> The method ModulePrefs#getUriAttribute should probably be some static
> utility method that can be called from multiple places, in this case,
> OAuthService, which via XmlUtil is not allowing URIs that don't start with
> http or https. Relative URIs need to be resolved first before this
> validation is done.
>
> -Randy Hudson
Shindig doesn't handle relative oauth service URLs properly
Posted by Randy Hudson <hu...@us.ibm.com>.
There seems to be a consistency issue with shindig's treatment of relative
URIs in gadget specs. Some more details are at:
http://groups.google.com/group/opensocial-api/browse_thread/thread/756ecef6c4d70a2c#
The method ModulePrefs#getUriAttribute should probably be some static
utility method that can be called from multiple places, in this case,
OAuthService, which via XmlUtil is not allowing URIs that don't start with
http or https. Relative URIs need to be resolved first before this
validation is done.
-Randy Hudson
Re: makeRequest fails
Posted by Paul Lindner <li...@inuus.com>.
Is your backend generating the 500 error (should be easy to check the logs
there)
Otherwise you may be encountering problems with the self-signed cert. Java
shindig's default fetcher will not retrieve data from sites with self-signed
certs. Either add the ssl cert using the keytool command or see
http://hc.apache.org/httpcomponents-client/tutorial/html/connmgmt.html#d4e505
for info on how to loosen this requirement.
On Mon, May 10, 2010 at 8:45 AM, Eric Rose (erose) <er...@cisco.com> wrote:
>
>
> Greetings,
>
>
>
> We are writing a gadget that uses makeRequest to contact an SSL secured
> API that uses a self-signed certificate and basic authentication. We are
> base 64 encoding username:password and specifying:
>
>
>
> Params[gadget.io.RequestParamters.HEADERS] = headers;
>
>
>
> Where headers = {“Authorization”:”Basic ” + encode64(‘<username:password
> >’)};
>
>
>
> Note there is a space after the word ‘Basic’ before the quote. Also of
> note the URL created by the makeRequest has a portion that is %2520. I
> think the space is being encoded twice. %20 is becoming %2520. Which seems
> wrong but I don’t know how to prevent it. This may be the problem. The
> self-signed cert may be the problem. But because the request is SSL
> encrypted we can’t look at the request directly using WireShark.
>
>
>
> The response we get is as follows:
>
> Throw l; <don’t be evil’ >{“https:
> 10.86.190.41:7890/icm-dp/rest/DiagnosticPortal/ListServices”:{“body”:””,
> “rc”:500}}
>
>
>
> The error is ‘Internal Server Error’, so we’re not sure what’s the problem
> with this.
>
> Any insight or assistance you may be able to provide would be appreciated.
>
>
>
> Thank you,
>
> David and Eric
>
>
>
>
>
> [image: Description: cid:image001.gif@01C7EFF5.57209E90]
>
> *Eric Rose*
> *Software Engineer*
> *Product Development
> *
> erose@cisco.com
> Phone :*(978) 936-1858*
>
> *Cisco Systems, Inc.*
> 500 Beaver Brook Road
> Boxborough, MA 01719
>
> www.cisco.com
>
>
>
>
>
>
>