Forum Problems Installing LAMS: Sakai - Lams integration Create problem


 
You may request notification for Sakai - Lams integration Create problem.
Search: 

1: Sakai - Lams integration Create problem
12/01/05 05:25 AM
[ Reply | Forward ]
So
I now have Lams running and I can go to the url and get in as admin ok.
I also have sakai running and the lams tool in the mercury worksite.

When I go to the lams tool, click create,
I get "public" appearing in the select workspace and 5 entries in the Select Sequence drop down.

1.
If I
Enter things into the Name and Description click teh Create button and I get
2 Validate Errors on the drop downs.

2.
If I click the Edit selected sequence a window pops up with 404 - /lams/j_security_check

3.
If I click Create New Sequence I get a popup with 404 - /lams/j_security_check


4. If I now go to a new Tab in the same browser and browse to http://bort:8280/lams/ I get logged straight in as Saka_admin (my prefix was Sakai_ )

Without being asked to log in.

If there is anywhere I can attache files I can give you screen shots

Posted by Ian Boston

2: Re: Sakai - Lams integration Create problem
In response to 1 12/01/05 05:28 AM
[ Reply | Forward ]
The only thing in either of the logs is

INFO: org.lamsfoundation.ld.integration.sakai.controller.SequenceActionController@4c4a0d.processCreate() (2005-12-01 09:59:10,817 http-8180-Processor2_org.sakaiproject.compon
ent.framework.log.CommonsLogger)
WARN: addSession: already have a session (2005-12-01 10:05:19,572 http-8180-Processor3_org.sakaiproject.component.adaptor.UsageSessionServiceAdaptor)
INFO: org.lamsfoundation.ld.integration.sakai.controller.SequenceActionController@4c4a0d.processCreate() (2005-12-01 10:05:32,230 http-8180-Processor2_org.sakaiproject.compon
ent.framework.log.CommonsLogger)


In tha sakai catalina.out

Posted by Ian Boston

3: Re: Sakai - Lams integration Create problem
In response to 1 12/01/05 07:25 PM
[ Reply | Forward ]
G'day Ian,

> 1. If I Enter things into the Name and Description click teh
> Create button and I get 2 Validate Errors on the drop
> downs.

Is it javascript error? Hmmm... that's odd. I wonder if that could be a browser issue? I just tried with Safari and Firefox on our Sakai-LAMS demo server and haven't seen that error.

When you select a sequence and then complete the name and description, there's a pop-up javascript message that ask you to confirm what you are about to do. Can you see that message?

> 404 - /lams/j_security_check

Ah... ok. Yeah, we have address that one here. Just apply that patch and the j_security_check issue should be gone.

Ernie

Posted by Ernie Ghiglione

4: Re: Sakai - Lams integration Create problem
In response to 1 12/01/05 07:37 PM
[ Reply | Forward ]
For problem 1
Hmmm... I'm not quite sure, can you please provide more info?

For problems 2, 3 & 4
It's caused by a corrupted lams-valve.jar file which should be fixed with the latest version of LAMS 1.0.2

Anyway, you can download the attached lams-valve.jar and overwrite the copy on your system. This should should solve problems 2, 3 & 4.

> If there is anywhere I can attache files I can give you screen shots
you can attach files by selecting "Yes" to Attach? when you post or reply a message.

Posted by Anthony Xiao

Attachments:
5: Re: Sakai - Lams integration Create problem
In response to 1 12/02/05 05:40 AM
[ Reply | Forward ]
Sorry Still got problems.

For Info
Clicking on Refresh Sequence List generates
10:15:03,751 DEBUG [UserManagementServiceBean] Starting getCompleteUser(String loginName)
10:15:03,756 DEBUG [UserManagementServiceBean] Starting getCompleteUser(ShwaaUserLocal user)
10:15:03,806 DEBUG [UserManagementServiceBean] Ending getCompleteUser(ShwaaUserLocal user)
10:15:03,806 DEBUG [UserManagementServiceBean] Ending getCompleteUser(String loginName)
10:15:03,810 DEBUG [LearningDesignDefnDAO] findAllLD validOnly=true userId=1040
10:15:03,810 DEBUG [LearningDesignDefnDAO] Calling find with from lddefn_ld in class com.webmcq.ld.activities.LearningDesignDefnVO where ( objectType='LearningDesign') and ( ( readAccess = '0') or ( readAccess='-1' and owner = ? ) or ( readAccess= ?) ) and validDesign=1
10:15:03,925 DEBUG [LearningDesignServiceSoapBindingImpl] Got designs:[Lcom.webmcq.ld.ws.SimpleLearningDesignVO;@231e35

in the lams jboss server

+++++++++++++++
Problem 1

Firefox
Clciking create gives a Javascript Popup with This will start a sequence in LAMS are you sure you want to continue ?

Screen refreshes, followed by a iframe refresh, followed by a Ajax refresh of the drop down, followed by both dropdowns with the error messages.

Safari
Same, but the popup also says http://bort:8180/ which is probably just a safari title.

IE 5.2 Mac
Cant do anything as the lists dont load



Problems 2,3,4
++++++++++++++

Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4
Clicking on Edit Selected Sequence, or Create new Sequence I get

HTTP Status 400 - Invalid direct reference to form login page

type Status report

message Invalid direct reference to form login page

description The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).
Apache Tomcat/4.1.24-LE-jdk14

++++++++++++++
in Safari 1.3.1 (v312.3.3)
Clicking on Edit Selected Sequence, or Create new Sequence I get
HTTP Status 404 - /lams/j_security_check

type Status report

message /lams/j_security_check

description The requested resource (/lams/j_security_check) is not available.

Apache Tomcat/4.1.24-LE-jdk14


++++++++++++++++++++++++
In Mac IE 5.2

I get about 8 or 9 Javascript errors (XMLHTTP, HTTPArea etc)

When I click on the Create Sequence (because I cant click on anything else now)

HTTP Status 400 - Invalid direct reference to form login page
------------------------------------------------------------------------

type Status report

message Invalid direct reference to form login page

description The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).
------------------------------------------------------------------------

Apache Tomcat/4.1.24-LE-jdk14
++++++++++++++++++

Having replaced the lams-value.jar, I have checked that it is the only one running,
The lams-value.jar that is running has an md5sum of

ieb@bort:~/lams/runtime$ md5sum ./jboss/server/default/lib/lams-value.jar ~/lams-value.jar
aa118a08d86b75e3f750f2c373f29b3c ./jboss/server/default/lib/lams-value.jar
aa118a08d86b75e3f750f2c373f29b3c /home/ieb/lams-value.jar
ieb@bort:~/lams/runtime$

( the second one is the download)

Sorry for the long post

If we can get this working, John Normal has a VPN token and may be able to help you demo it at the Sakai Conference at Austin..... but we also want to get it ready for a pilot in Jan/Feb

Posted by Ian Boston

6: Re: Sakai - Lams integration Create problem
In response to 1 12/04/05 09:10 PM
[ Reply | Forward ]
Hi Ian,

Is it possible for you to generate another tcp dump?

With the 404 errors, it could of be a cookie issue. Try remove all the cookie first then try using LAMS Monitor and Author interface thru Sakai.

For problem 4.
It proved one thing, Sakai and LAMS is communicating with eachother, therefore the user Saka_admin is created. The Sakai-LAMS module automatically logs the sakai user into lams. So if you go into LAMS directly, you'll get logged straight in since he was previously logged in thru Sakai.

Is your prefix "Sakai" or "Sakai_" but I dont understand why the user created by LAMS is Saka_admin that's strange. This could cause a problem as well. LAMS might be looking for the user sakai_admin but the user logged in is saka_admin.

Could you please dump your ext_server_org_map again?


Anthony

Posted by Anthony Xiao

7: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 04:33 AM
[ Reply | Forward ]
Problem 4.

I think that saka_admin was a typo and I meant sakai_admin.
This is not what I meant by the problem.

What I meants that there appeared to be a session already setup since I was logged in as sakai_admin without having to put a password, indicating the the previous problems had logged me into lams... even though a problem was reported.


Here is the dump of tables (dont worry about password hashes this is a test install with defaullt passwords)

mysql> select * from tbl_user
-> ;
+------+-------------+----------------------------------+---------------+---------------+---------------+
| uid | login | password | fname | lname | creation_date |
+------+-------------+----------------------------------+---------------+---------------+---------------+
| 0 | root | 2757142c2111b8bd34a0d1b718f59c0c | System | Administrator | 1050021517000 |
| 1 | admin | 2757142c2111b8bd34a0d1b718f59c0c | administrator | demo | 1050021517000 |
| 2 | learner | 2757142c2111b8bd34a0d1b718f59c0c | learner | demo | 1046128213942 |
| 3 | teacher | 2757142c2111b8bd34a0d1b718f59c0c | teacher | demo | 1046128228489 |
| 4 | author | 2757142c2111b8bd34a0d1b718f59c0c | author | demo | 1046128240224 |
| 1040 | sakai_admin | f3beb2ff779fc89fb9f24456cebe39b5 | Sakai | Administrator | 1133431092915 |
+------+-------------+----------------------------------+---------------+---------------+---------------+
6 rows in set (0.17 sec)

mysql> select * from ext_server_org_map;
+-----+---------------+---------------+------------+------------+--------+----------------------------------------------------------------------------------------------------+-------------+----------+-------+
| sid | serverid | serverkey | servername | serverdesc | prefix | userinfo_url | timeout_url | disabled | orgid |
+-----+---------------+---------------+------------+------------+--------+----------------------------------------------------------------------------------------------------+-------------+----------+-------+
| 1 | sakaicamtools | lamsserverkey | sakai | sakai | sakai | http://bort:8180/sakai-lams-tool/servlet/UserDataServlet?uid=%username%&ts=%timestamp%&hash=%hash% | 300 | 0 | 1020 |
+-----+---------------+---------------+------------+------------+--------+----------------------------------------------------------------------------------------------------+-------------+----------+-------+
1 row in set (0.00 sec)

mysql>

Posted by Ian Boston

8: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 04:34 AM
[ Reply | Forward ]
I will get a tcpdump and attach it this time (so you dont have to restart .lrn :) )

Posted by Ian Boston

9: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 07:13 AM
[ Reply | Forward ]
Attached is the tcp dump

At Frame 77 the POST on clicking the create button happens.
The response is at 79, not redirect imbetween. Looking at the parameters, the request includes valid items for both the drop downs.... so this is probably something in the java code.


At Frame 151 I click on the edit button
152 is the redirect to lams (LoginRequest)
156 is the get of the redirect to lams (LoginRequest)
158 is the response from lams a redirect to j_security_check
with a session cookie (ending 325D; path=/lams)
161 is the browser get of j_security_check BUT
the above cookie is NOT sent, instead the sakai cookies are sent
163 lams says no way, no session, direct access (as it should as it didnt get the cookie)

Looking at the spec of SetCookie you cannot bind a cookie to the port, only the hostname and the path. Since Sakai and Lams both use the same session cookie name, you cant run sakai and lams on the same hostname otherwise the sakai cookie takes presidence.


Solutions:
1. Change the cookie name in lams from JSESSION_ID to LAMSSESSION_ID ?
2. Run on a different host on the same box (I will try this) ?
3. Buy dedicated hardware for the lams server. ?


That still leaves use with the Create problem.

Posted by Ian Boston

Attachments:
10: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 07:26 AM
[ Reply | Forward ]
Tried the change in host name,

lams now on bort.caret.local
sakai on bort

These are the same machines

This fixes the cookie issues so now LAMS is getting the correct session....

BUT

It is still complaining about direct access to the login form.

I think that you have to do a POST to make j_security_check work relayable. A redirect is not good enough.

----

Frame 18 LoginRequest
Frame 20 redirect with cookie set
Frame 21 Get the rredirect with the correct cookie
Frame 22 Rejection due to direct access.

Posted by Ian Boston

Attachments:
11: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 08:12 AM
[ Reply | Forward ]
The message on direct access appears because the session note containing the target request object was not available after j_security_check completed.

catalina/src/share/org/apache/catalina/authenticator/FormAuthenticator.java
So.
Either jboss never executed the FormAuthenticator code (saveRequest)


I would debug, but it looks like the Source code 1.0.2 posted on you site does not contain this code. lams-valve.jar looks like the jar for this.


If you want support from the communty under a GPL license, you have to post the matching source code to the community.

Posted by Ian Boston

12: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 09:36 AM
[ Reply | Forward ]
Just re-installed you latest version form the Oz main site.

This has exactly the same behaviour as the previous version.

To be clear, this is the lams-server-1.0.2-20051121.zip version.

Posted by Ian Boston

13: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 08:25 PM
[ Reply | Forward ]
From analysing the tcpdump,

when /lams/j_security_check?j_username..... is requested it's followed by a "HTTP1.1 400 Invalid direct reference to form login page"

it looks like the lams-valve.jar is not working for whatever reason. I've attached a new copy of lams-valve.jar and the cooresponding source. I've inserted more debugging statement so we can trace it easier.

Try run lams with the new lams-valve.jar see if you can see any of the debugging messages.

> I think that you have to do a POST to make j_security_check work relayable. A redirect is not good enough.

That's not true, you can try several experiment for yourself. The behaviour of j_security_check should be;

CASE 1. Invalid direct reference....
clear all the cookies (clears the session) then goto
http://10.0.0.79:8280/lams/j_security_check?j_username=sakai_admin&j_password=f3beb2ff779fc89fb9f24456cebe39b5

you should get "HTTP Status 400 - Invalid direct reference to form login page" because after j_security_check log the user in it doesn't know where to forward the user. Then if you goto http://10.0.0.79:8280/lams/ you should be logged in.

CASE 2. Login Successful
clear all the cookie again then goto http://10.0.0.79:8280/lams/ (setup the session) you should see the login page. Then goto
http://10.0.0.79:8280/lams/j_security_check?j_username=sakai_admin&j_password=f3beb2ff779fc89fb9f24456cebe39b5
you should get log straight in because the session has been setup.

CASE 3. HTTP Status 404
clear all the cookie again then goto
http://10.0.0.79:8280/lams/j_security_check?j_username=sakai_admin&j_password=f3beb2ff779fc89fb9f24456cebe39b5
you should get "HTTP Status 400 - Invalid direct reference to form login page" (same as 1) but this time goto
http://10.0.0.79:8280/lams/j_security_check?j_username=sakai_admin&j_password=f3beb2ff779fc89fb9f24456cebe39b5
again. This time you'll get "HTTP Status 404 - /lams/j_security_check" because j_security_check doesn't exist after the user has been logged in.

The role of lams-valve.jar is to intercept calls to j_security_check and setup a session. This session tells where j_security_check should forward the user after authentication has finish. So we should get case 2 instead of case 1 above, the LoginRequestServlet prevents case 3, by making sure j_security_check is not called if user is already logged it.

Posted by Anthony Xiao

14: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 08:32 PM
[ Reply | Forward ]
There was problem attaching files in my last post.

md5sum lams-valve.jar: 204f7f19e1b981e10462b5662dc784d9

Posted by Anthony Xiao

Attachments:
15: Re: Sakai - Lams integration Create problem
In response to 1 12/05/05 08:33 PM
[ Reply | Forward ]
Damn, you can't attach more than one files :(

here's the source file

Posted by Anthony Xiao

Attachments:
16: Re: Sakai - Lams integration Create problem
In response to 1 12/11/05 07:36 PM
[ Reply | Forward ]
Ian,

I'm assumming the new valve worked alrigth? Please let us know.

Thanks,

Ernie

Posted by Ernie Ghiglione

17: Re: Re: Sakai - Lams integration Create problem
In response to 16 12/12/05 07:05 PM
[ Reply | Forward ]
Sorry,
It didnt work,
Im on vacation and will try again after christmas.
Ian

Posted by Ian Boston

18: Re: Sakai - Lams integration Create problem
In response to 1 12/14/05 10:14 PM
[ Reply | Forward ]
Fellas,

Note that Tony has done some changes to the LAMS-Sakai integration code. The new binaries and source are on the integration page.

Here's the change log.

Thanks,

Ernie

Posted by Ernie Ghiglione

19: Re: Sakai - Lams integration Create problem
In response to 1 01/09/06 10:38 AM
[ Reply | Forward ]
Hi,
Back from a long break ( in Oz :), 1 month) which was great!.....


So I tried the latest integration binary from the site, downloaded today.....

And exactly the same as above.


From memory and looking at the tomcat cateilina code, it sets a "note" in a session attribute when re-directing to do j_security checks, so you cant just post into the j_security check url, you MUST let tomcat serve the page for you and then post a response...... or you must set the note yourself to fool catalina that it is a genuine j_security redirect


However I see you have replaced the catalinia valve, BUT there is no source code for this in the 1.0.2 source code bundle.

If it is relevant, could you post it as I might be able to put some debug in to see where the problem is. (btw, strictly speaking, shouldnt that be in the source bundle, its GPL ? Isnt it ? )

Ian

Posted by Ian Boston

20: Re: Re: Sakai - Lams integration Create problem
In response to 19 01/09/06 04:46 PM
[ Reply | Forward ]
Hi Ian,

Sorry about the missing source file. We'll add that file to the source code bundle next time when the bundle is updated. But I've already attached the source code for lams-valve.jar. If you scroll up in this thread you should be able to see it.

Cheers,
Anthony

Posted by Anthony Xiao

21: Re: Re: Re: Sakai - Lams integration Create problem
In response to 20 01/09/06 05:05 PM
[ Reply | Forward ]
Sorry, I missed the post.

Thanks for the valve, I'll give it a go and get back to you tomorrow.

Ian

Posted by Ian Boston

22: Re: Sakai - Lams integration Create problem
In response to 1 01/10/06 06:43 AM
[ Reply | Forward ]
Ok I've now got some sensible debug,

12:32:50,369 ERROR [STDERR] LoginRequestValve invoked
12:32:50,370 ERROR [STDERR] Request URI is //lams/LoginRequest
12:32:50,610 ERROR [STDERR] After invoke Next
12:32:50,610 ERROR [STDERR] Status is 302:null
12:32:50,611 ERROR [STDERR] Cookie:JSESSIONID::ED8494080BF8F1165A3C1727E7EBEB73
12:32:50,614 ERROR [STDERR] Header:Set-Cookie
12:32:50,614 ERROR [STDERR] Value:0:JSESSIONID=ED8494080BF8F1165A3C1727E7EBEB73; Path=/lams
12:32:50,615 ERROR [STDERR] Header:Location
12:32:50,615 ERROR [STDERR] Value:0:http://bort.caret.local:8280/lams/j_security_check?j_username=sakai_admin&j_password=b705004d38a3c1d30dd7b8d2f797645b
12:32:50,615 ERROR [STDERR] LoginRequest requested
12:32:50,617 ERROR [STDERR] header=Location=http://bort.caret.local:8280/lams/j_security_check?j_username=sakai_admin&j_password=b705004d38a3c1d30dd7b8d2f797645b
12:32:50,623 ERROR [STDERR] LOGIN REQUEST DETECTED - LOGIN SUCCESSFUL
12:32:50,629 ERROR [STDERR] Set Note with reuquestURI as /lams/home.do?method=author
12:32:50,665 ERROR [STDERR] LoginRequestValve invoked
12:32:50,666 ERROR [STDERR] Request URI is /lams/j_security_check
12:32:50,748 ERROR [STDERR] After invoke Next
12:32:50,749 ERROR [STDERR] Status is 400:Invalid direct reference to form login page
12:32:50,749 ERROR [STDERR] Cookie:JSESSIONID::9AAC4FF0AAE67C4FD3171644C62368FF
12:32:50,749 ERROR [STDERR] Header:Set-Cookie
12:32:50,749 ERROR [STDERR] Value:0:JSESSIONID=9AAC4FF0AAE67C4FD3171644C62368FF; Path=/lams
12:32:50,750 ERROR [STDERR] Header:Content-Type
12:32:50,750 ERROR [STDERR] Value:0:text/html;charset=ISO-8859-1
12:32:50,750 ERROR [STDERR] Header:Content-Language
12:32:50,750 ERROR [STDERR] Value:0:en-US
12:32:50,750 ERROR [STDERR] Header:Transfer-Encoding
12:32:50,751 ERROR [STDERR] Value:0:chunked
12:32:50,751 ERROR [STDERR] Header:Date
12:32:50,751 ERROR [STDERR] Value:0:Tue, 10 Jan 2006 12:32:50 GMT
12:32:50,751 ERROR [STDERR] Header:Server
12:32:50,752 ERROR [STDERR] Value:0:Apache Coyote/1.0


It looks like my installation of tomcat is ignoring the note that you have set as after the redirect I am getting a new session.

The JSESSIONID is differnt on the first request and redirect so the Note is never picked up, hence Tomcat correctly thinks that the request is invalid.

This is using Safari on OSX. and before you ask, it works perfectly with every other Tomcat application that uses sessions,


I will check with Firefox to see what happens, just in case its an issue with the browser.

Posted by Ian Boston

23: Re: Sakai - Lams integration Create problem
In response to 1 01/10/06 06:56 AM
[ Reply | Forward ]
Ok


Works with Firefox

Does not work with Safari

I suspect Safari does not store cookies on a redirect,

You might consider a http-meta to force the browser to store the cookie correctly.

There may be other browsers where this does not work.



To be clear,

The version of lams-valve.jar (check the md5sum above) in this thread works for Firefox 1.0.4 on OSX but does not work Safari 1.3 on OSX


With that caveat, I think this thread can be closed.

I will continue testing the integration in Firefox only to see if there are other problems.

BTW, Im seeing 60% cpu consumed by firefox permanently when the Flash environment comes up, with no server activity. Perhapse there is a loop running away in the flash editor ? (My Flash version is 7,0,24,0), or it might be a Flash plugin issue, but I havent seen the same with other flash sites.

Posted by Ian Boston

25: Re: Re: Sakai - Lams integration Create problem
In response to 23 01/11/06 06:34 PM
[ Reply | Forward ]
Hi Ian,

Safari is quite a case.

I have tested this with Safari 2.0.x (Mac 10.4.4) and it does work fine.

Also I just tested it using Safari 1.3.2 (v 312.5) on Mac 10.3.9 and it seems to work OK. I managed to create a sequence from scratch and then add it to a Sakai course.

Could it be some configuration in Safari?

Thanks,

Ernie

Posted by Ernie Ghiglione

24: Re: Sakai - Lams integration Create problem
In response to 1 01/10/06 07:07 AM
[ Reply | Forward ]
On last thing on this thread,

It would be really nice if it did work with Safari, as we have a significant number of users with Safari, and I wouldnt want to go throught the same process with a help desk operator !

Posted by Ian Boston

Reply to first post on this page
Back to Problems Installing LAMS