Skip to content
This repository has been archived by the owner on May 31, 2022. It is now read-only.

Command line launcher for sparklr and tonr not working #164

Closed
shahabyunus opened this issue Mar 21, 2014 · 6 comments
Closed

Command line launcher for sparklr and tonr not working #164

shahabyunus opened this issue Mar 21, 2014 · 6 comments

Comments

@shahabyunus
Copy link

I downloaded the project from https://github.com/spring-projects/spring-security-oauth/archive/2.0.0.M4.tar.gz

I then did 'mvn install -P bootstrap' at the base directory. It builds an installed everything with success. (I do see some test failures when sparklr is accessed though, "http://localhost:8080/sparklr2/login.jsp": Connection refused", but then these tests are skipped and everything seems OK at the end.)

Then I went in to the following directories one by one (not simultaneously as they share the tomcat port 8080) and start the webapp by executing 'mvn tomcat:run'

/samples/oauth2/sparklr
/samples/oauth2/tonr

Both apps were accessible through the browser individually:
localhost:8080/tonr2
localhost:8080/sparklr2

Now to access them both at the same time, I followed the instructions in the README.md file which states that do not run /samples/oauth2/sparklr but run from within /samples/oauth2/tonr. I did that using 'mvn tomcat:run' in this directory. The tonr webapp comes up!

Now on localhost:8080/tonr2 when I click on any of the Sparklr links for facebook I get an error.

If I click 'Facebook friends', it tries to go to http://localhost:8080/tonr2/sparklr/photos and fails (404)

If I click Sparklr, I get blank page.

If I click on login on the tonr page, I do see marissa's credentials but when I click the button, it tries to go to http://localhost:8080/tonr2/login.do and I get 404.

What am I missing?

Thanks lot.

@shahabyunus
Copy link
Author

So it turns out that if I give the following command (tomcat7 instead of tomcat):
mvn tomcat7:run

then the UI that comes up for tonr2 is a bit richer and seems to be using CSS.

But the startup log has following exception and at the UI level earlier mentioned issues persist:

SEVERE: IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.security.oauth2.client.OAuth2RestTemplate
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.security.oauth2.client.OAuth2RestTemplate
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1354)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)

@dsyer
Copy link
Contributor

dsyer commented Mar 24, 2014

I think that serialization issue is just Tomcat saying it can't re-create the dead sessions from your last startup. Ignorable.

We had to switch to tomcat7 (since we no longer have a web.xml) and the Maven support is quite different as you have found. I haven't found the right incantation yet to get the sparklr war to deploy as well from the command line (if you can figure it out please do). You can build the wars and install them in tomcat, or you can run from an IDE (what I normally do).

@shahabyunus shahabyunus changed the title sparklr not accessible through tonr Command line launcher for sparklr and tonr not working Mar 24, 2014
@dsyer dsyer closed this as completed in 47f7552 Mar 24, 2014
@shahabyunus
Copy link
Author

Thanks Dave.

After your changes, it is working through the command line with "mvn integration-test -P integration" command (even if not through 'run'), given within the tonr directory and the sample actually works as well. So, in a way, I can successfully replicate the use-case.

@dsyer
Copy link
Contributor

dsyer commented Mar 25, 2014

Works for me:

$ mvn install
$ (cd samples/oauth2/tonr/; mvn tomcat7:run)

@shahabyunus
Copy link
Author

Ok, so I got the latest zip today. I do 'mvn install -P bootstrap' from the parent directory (parent of samples) and everything works.

'mvn tomcat7: run' runs successfully. The embedded server starts up. I can access both sparklr2 and tonr2.

To execute the use-case, I go to tonr2. Click on the top left 'Sparklr pics' tab. I am then taken to the login screen for Sparklr with user=Marissa and password (koala now, not wombat). I click login and I see 2 buttons for Authorize and Deny. This is different from what I was seeing before, small dialog with radio buttons. Anyway, I click Authorize and fails and I get the following error:

type Exception report

message Request processing failed; nested exception is error="access_denied", error_description="User denied access", state="Ng6UVY"

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is error="access_denied", error_description="User denied access", state="Ng6UVY"
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:973)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
javax.servlet.htt...

I apologize if I have misunderstood something. I first thought that they you are saying that with tomcat7 it is not possible to deploy both apps through command line (mvn tomcat7:run), but from your latest comment it seemed to me it is?

@dsyer
Copy link
Contributor

dsyer commented Mar 25, 2014

Yes it is possible, as you have verified. The error is expected (tonr is not very friendly to its users), since you didn't approve the access (the default radio button setting is deny all).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants