Forum LAMS for Tech-Heads - General Forum: Problems deploying lams_tool_example


 
You may request notification for Problems deploying lams_tool_example.
Search: 

1: Problems deploying lams_tool_example
08/22/06 09:14 AM
[ Reply | Forward ]
I tried to deploy the example tool and got this error:

[javac] C:\lams\lams_tool_example\src\java\org\lamsfoundation\lams\tool\example\service\ExampleService.java:50: org.lamsfoundation.lams.tool.example.service.ExampleService is not abstract and does not override abstract method importToolContent(java.lang.Long,java.lang.Integer,java.lang.String) in org.lamsfoundation.lams.tool.ToolContentManager
[javac] public class ExampleService implements ToolSessionManager, ToolContentManager,
[javac] ^
[javac] 1 error

I also tried to deploy Alex Little's lams_tool_alexforum and got nearly the same error:

[javac] C:\lams\lams_tool_alexforum\src\java\uk\ac\open\lams\tool\alexforum\service\AlexForumServiceImpl.java:36: uk.ac.open.lams.tool.alexforum.service.AlexForumServiceImpl is not abstract and does not override abstract method importToolContent(java.lang.Long,java.lang.Integer,java.lang.String) in org.lamsfoundation.lams.tool.ToolContentManager
[javac] public class AlexForumServiceImpl implements IAlexForumService,ToolContentManager, ToolSessionManager{
[javac] ^
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

Should these work as is?

Also do people think that a good strategy for building a tool is to start with the example tool and edit it into the desired functionality?

Best,

-ken

Posted by Ken Kahn

2: Re: Problems deploying lams_tool_example
In response to 1 08/22/06 05:06 PM
[ Reply | Forward ]
The builds are failing as we have added a couple of new method to the interface that tool's implement since Alex did his tool, and we haven't updated either tool.

The idea of the lams_tool_example was to create a basic structure that people edit and not updating it for the interface change was my oversight and so I apologise. I'll try to get back to being able to be built today. Not sure if I'll do Alex's as well - I'll see how I go.

So starting with the lams_tool_example is a good strategy.

The other alternative (and the ones most of the guys on the team use) is to take an existing tool and modify it. One of our developers wrote some scripts to help him to this so I'll see if they are good enough for us to distribute or if they need more work.

I'll look into this further and get back to you as soon as I can.

Fiona Malikoff
Senior Java Developer

Posted by Fiona Malikoff

3: Re: Problems deploying lams_tool_example
In response to 1 08/23/06 11:45 PM
[ Reply | Forward ]
Ken,

Sorry for the delay and for the length of the answer - just trying to get you the best answer I can.

The lams_tool_example should now build, and I've put an updated copy of Alex's code on the wiki.

I also spoke to our developer who had the script for copying an existing tool. It is a small Java program. He cleaned it up a bit and it is now available from:

http://wiki.lamsfoundation.org/display/lams/RenameTool

Now this isn't beautiful. Its a programmer's utility to make life easier. Do you know the "Cobblers children have the worst shoes" thing? Well it applies here - the utilities to make a developer's life a breeze will always take second priority to what teachers need in LAMS.

In the readme file, it suggests using lams_tool_submit as the base. That is correct but there are two caveats:

(1) We have had a problem with our tools using the HttpSession too much. Both the learner and authoring screens potentially could appear twice for the same user (at the same time). So the normal use of the session like session.putAttribute("mydto",mydto) can cause problems.

We are in the process of fixing this in our tools but submit hasn't been done yet.

You can't see this happening at the moment as we have restricted the popup screens in such a way that the two instances of the same screen can't happen. That's why at the moment you can't run preview and learner at the same time. But we plan on removing this restriction before 2.0 is release.

I've added a warning about this to the tool contract.

(2) In LAMS 1.0.2 we had a separate tool for reflection, that is the notebook entries that learners made based on what they experiences in the sequence. In LAMS 2.0 it will be built into all the tools and the tools will call a shared service.

This has been done for some tools but not for the Submit tool yet.

Both of these items are on our developers' current list of tasks. So you can take a copy of the submit code now but be aware you might want to take another look at in a week or so time to see how the code has changed.

Finally, before you go to far, think about your tool signature. http://wiki.lamsfoundation.org/display/lams/Tool+Signatures

You will need to make one up for your database tables and jar/war filenames. If you are planning on throwing this code away, then just call it anything. But if you might want to keep the code then I suggest making up a sensible signature so you don't have to go back and rename your tables later, change the hibernate files, etc, etc.

You don't need to tell us the signature, but if you could tell me a two character code that you would like to use as your "maker of the tool" code then I can add it to our list and then hopefully no else will use it. We use "la" (for "LAMS"). You can email me directly if you want (fmalikoff@lamsinternational.com).

Regards,

Fiona

Posted by Fiona Malikoff

4: Re: Re: Problems deploying lams_tool_example
In response to 3 08/29/06 09:41 AM
[ Reply | Forward ]
Hi. Thanks -- The RenameTool worked fine and I'm making good progress but:

I wasn't careful about using CVS and got some of the latest code and the version that was first made available in a large zip file. So I got the latest version of the code and re-built everything (including the lams MySQL database). When I launched JBOSS I got an error about

lams-www.jar missing

so I manually copied it from C:\lams\lams_www\build\lib to

C:\Program Files\jboss-4.0.2\server\default\deploy\lams.ear

and JBOSS seemed to start fine.

I was able to launch LAMS but didn't see my new tool (even though when I ran the ANT deploy-tool script it ran sucessfully).

But clearly something else is wrong. The LAMS tools all showed a question mark with a red circle and slash on top. When I tried to double click on one of these icons (after dragging it from the side as normal) I got:

"The page you requested was not found."

So, I'm stuck. Any help would be greatly appreciated.

Best,

-ken

Posted by Ken Kahn

5: Re: Re: Re: Problems deploying lams_tool_example
In response to 4 08/29/06 10:32 AM
[ Reply | Forward ]
It occured to me that my problems must be due to not really rebuilding LAMS correctly. Sure enough the shared.properties file I used was one I had customised a while ago that didn't refer to lams_www. When I re-edited the latest version of shared.properites (and the other such files) and started to build again, I now get stopped in deploy-ear with:

BUILD FAILED
C:\lams\lams_build\build.xml:188: Failed to copy C:\lams\lams_build\assembly\lams.ear\lams-www.war\404.jsp to C:\program files\jboss-4.0.2\server\default\deploy\lams.ear\lams-www.war\404.jsp due to C:\program files\jboss-4.0.2\server\default\deploy\lams.ear\lams-www.war\404.jsp (The system cannot find the path specified)

So I'm stuck again.

Best,

-ken

Posted by Ken Kahn

7: Re: Re: Re: Re: Problems deploying lams_tool_example
In response to 5 08/29/06 06:12 PM
[ Reply | Forward ]
Now onto the build problems.

First - the lams-www.war not deploying:

> BUILD FAILED
> C:\lams\lams_build\build.xml:188: Failed to copy
>C:\lams\lams_build\assembly\lams.ear\lams-www.war\404.jsp to C:\program
> files\jboss-4.0.2\server\default\deploy\lams.ear\lams-www.war\404.jsp due to
>C:\program files\jboss-4.0.2\server\default\deploy\lams.ear\lams-www.war\404.jsp
>(The system cannot find the path specified)

This one has me pretty stumped. My guess is that the file copy is being done but windows is reporting a general error to ANT and we are getting a misleading error message.

I have attached an image builddirectory.jpg. It shows what the assembly directory (under lams_build) should look like after a build has run. The thing is, if the assembly directory wasn't right, then I don't know why the build would be trying to copy the file. We don't specify the 404.jsp file specifically - the ant command just says to copy the whole lams-www.war directory!

Could the files in C:\program files\jboss-4.0.2\server\default\deploy\lams.ear\lams-www.war\ be read only? Could you try doing the copy manually in Windows Explorer and see what the error is that Windows gives you?




Second - your tool not deploying:

First up, check you did deploy-tool and not deploy-war. Deploy-war builds and copies the files to the JBOSS directory but it doesn't do any of the database or configuration file updates that tell LAMS about your tool. So although it will be sitting in the JBOSS directory, LAMS will ignore it completely.

Can you run the tool deployment again and post me the output from the console. It should be something like:

Buildfile: D:\EclipseWorkspace\lams_tool_sbmt\build.xml
delete-exploded-tool-folder:
preparedirs:
webdoclet:
[webdoclet] (XDocletMain.start 47 ) Running ..deploymentdescriptor/..
[webdoclet] (XDocletMain.start 47 ) Running ..strutsconfigxml/..
[webdoclet] (XDocletMain.start 47 ) Running ..strutsdynaformvalidationxml/..
clean:
[delete] Deleting 48 files from D:\EclipseWorkspace\lams_tool_sbmt\build\classes\java
[delete] Deleting 11 files from D:\EclipseWorkspace\lams_tool_sbmt\build\classes\test\java
compile:
[javac] Compiling 36 source files to D:\EclipseWorkspace\lams_tool_sbmt\build\classes\java
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
compile.test:
[javac] Compiling 11 source files to D:\EclipseWorkspace\lams_tool_sbmt\build\classes\test\java
[javac] Note: D:\EclipseWorkspace\lams_tool_sbmt\test\java\org\lamsfoundation\lams\tool\sbmt\dao\TestModel.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
copyContext:
[copy] Copying 22 files to D:\EclipseWorkspace\lams_tool_sbmt\build\web
[copy] Copying 7 files to D:\EclipseWorkspace\lams_tool_sbmt\build\classes\java\org\lamsfoundation\lams
build-jar:
[delete] Deleting: D:\EclipseWorkspace\lams_tool_sbmt\build\lib\lams-tool-lasbmt11.jar
[jar] Building jar: D:\EclipseWorkspace\lams_tool_sbmt\build\lib\lams-tool-lasbmt11.jar
build-war:
[delete] Deleting: D:\EclipseWorkspace\lams_tool_sbmt\build\lib\lams-tool-lasbmt11.war
[war] Building war: D:\EclipseWorkspace\lams_tool_sbmt\build\lib\lams-tool-lasbmt11.war
create-deploy-package:
[copy] Copying 5 files to D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\sql
[copy] Copying 2 files to D:\EclipseWorkspace\lams_tool_sbmt\build\deploy
[copy] Copying 9 files to D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\lib
[copy] Copying 10 files to D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language
[generateDeployProperties] Create Deployment Package.
[generateDeployProperties] Applying task properties
[generateDeployProperties] File D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\deploy.xml written.
deploy-tool:
[echo] Deploying the Submission tool
[java] Starting Tool Deploy
[java] Reading Configuration FileD:\EclipseWorkspace\lams_tool_sbmt\build\deploy\deploy.xml
[java] Removing old tool entries from database
[java] Deleting rows where toolId = 10 and learningLibraryId = 11
[java] Running Tool DB Deploy
[java] Deploying files to ear
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_ar_JO.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_bg_BG.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_el_GR.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_es_ES.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_fr_FR.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_it_IT.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_ko_KR.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_no_NO.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Copying file D:\EclipseWorkspace\lams_tool_sbmt\build\deploy\language\ApplicationResources_sv_SE.properties to D:\jboss-4.0.2\server\default\deploy\lams.ear\lams-dictionary.jar\org\lamsfoundation\lams\tool\sbmt
[java] Writing out doc [#document: null]
[java] Updating expanded war lams-central.war
[java] Application context entry classpath:/org/lamsfoundation/lams/tool/sbmt/submitFilesApplicationContext.xml already in document.
[java] ./lams-tool-lasbmt11.jar already on the classpath.
[java] Updating zipped war lams-learning.war
[java] ./lams-tool-lasbmt11.jar already on the classpath.
[java] Application context entry classpath:/org/lamsfoundation/lams/tool/sbmt/submitFilesApplicationContext.xml already in document.
[java] Updating zipped war lams-monitoring.war
[java] ./lams-tool-lasbmt11.jar already on the classpath.
[java] Application context entry classpath:/org/lamsfoundation/lams/tool/sbmt/submitFilesApplicationContext.xml already in document.
[java] Updated file web.xml
[java] Updated file lams-learning.war
[java] Updated file lams-monitoring.war
[java] Updated file MANIFEST.MF
[java] Activating Tool in LAMS
[java] Tool Deployed
BUILD SUCCESSFUL
Total time: 35 seconds


I've had to replace less than and greater than signs in the text with ..




Finally, about your tool icon. You will probably have realised by now that you will need an icon for authoring. Initially just reuse one of ours or live with the "missing" icon. At present our advice on the tool icon (on the wiki) is that it has to be a swf or a jpeg. A swf is better as it will scale. I've asked our Flash developer to give me some more detailed guidelines (programs that produce swfs, preferred size of jpeg, etc). I'll post the details later this week.

Posted by Fiona Malikoff

8: Tool Icon details
In response to 7 08/30/06 03:11 AM
[ Reply | Forward ]
At the risk of making this thread unreadable... I promised to let you know when I had some details on the tool icon. The details are now on:

http://wiki.lamsfoundation.org/display/lams/JSP+and+HTML+Conventions

In summary:
* If you have access to Adobe Illustrator (or a similar package) then make it up there and save it as a SWF. The size on the screen is approximately 20 to 30 pixels.
* If you don't have access to something that will create a SWF then you can make it a JPEG of about 30 to 35 pixels in height and width.

The SWF is preferred as it should scale nicely, whereas a JPEG may look bad scaled.

Posted by Fiona Malikoff

9: Re: Re: Re: Re: Re: Problems deploying lams_tool_example
In response to 7 08/30/06 10:42 AM
[ Reply | Forward ]
Hi. Thanks.

Regarding the lams-www.war not deploying, the problem was that when I retrieved the latest source code I continued to use the shared.properties that I had previously edited. That version didn't have an lams-www entry. I fixed the problem by editing the new version.

What is a good way to deal with CVS and these configuration files? Should I edit them each time I grab some new source code version?

The second problem with lams-www.war was due to me getting the file and folder with the same name confused. So the copy failed since I had copied the war file to where the folder of the same name should have been. Sorry about that.

After fixing this and continuing to build by
Run "assemble-ear"
Run "deploy-ear"
Run "deploy-tools"
Run "copyfiles"

I still had the problem with icons and other missing files. I then built it over again starting with Run "rebuild-db" and everything (except my tool) worked!

I tried to deploy my tool again and noticed this:

deploy-tool:
[echo] Deploying the Submission tool
[java] Starting Tool Deploy
[java] Reading Configuration FileC:\lams\lams_tool_behaviourComposer\build\deploy\deploy.xml
[java] Removing old tool entries from database
[java] Deleting rows where toolId = 10 and learningLibraryId = 10
[java] Running Tool DB Deploy
[java] TOOL DEPLOY FAILED
[java] org.lamsfoundation.lams.tool.deploy.DeployException: Could not execute statements
[java] at org.lamsfoundation.lams.tool.deploy.ScriptRunner.executeStatements(ScriptRunner.java:112)
[java] at org.lamsfoundation.lams.tool.deploy.ScriptRunner.run(ScriptRunner.java:66)
[java] at org.lamsfoundation.lams.tool.deploy.ToolDBDeployTask.runScript(ToolDBDeployTask.java:312)
[java] at org.lamsfoundation.lams.tool.deploy.ToolDBDeployTask.execute(ToolDBDeployTask.java:169)
[java] at org.lamsfoundation.lams.tool.deploy.Deploy.main(Deploy.java:101)
[java] Caused by: java.sql.BatchUpdateException: Can't create table '.\lams\#sql-28c_51.frm' (errno: 121)
[java] at com.mysql.jdbc.Statement.executeBatch(Statement.java:709)
[java] at org.lamsfoundation.lams.tool.deploy.ScriptRunner.executeStatements(ScriptRunner.java:107)
[java] ... 4 more
BUILD SUCCESSFUL
Total time: 12 seconds

Kind of confusing to say "BUILD SUCCESSFUL" when "TOOL DEPLOY FAILED" -- particularly since as suggested I added my tool to the build/build.xml script.

So then I dropped the whole lams schema using the MySQL Adminstrator tool, created a new "lams" schema and rebuilt evertyhing from the beginning. (I'm unclear when I need to rebuild like this?). But I still get the above error when I run deploy-tool. Everything else seems to be working.

Suggestions?

Best,

-ken

Posted by Ken Kahn

10: Re: Re: Re: Re: Re: Re: Problems deploying lams_tool_example
In response to 9 08/30/06 03:09 PM
[ Reply | Forward ]
> What is a good way to deal with CVS and these configuration files?
> Should I edit them each time I grab some new source code version?

I have to rebuild LAMS a lot everyday and at the beginning it was getting really tedious to do the re-editing again and again. So I create a batch file (.bat) that does the whole lot for me. Here's the content on my update.bat (of course this is for windows):

--
cd c:\lams2.0\
rmdir /S /Q lams-source
rmdir /S /Q repository
mkdir repository
mkdir lams-source
cd lams-source
c:\lams2.0\cvs.exe -z3 -d :pserver:anonymous@lamscvs.melcoe.mq.edu.au:/usr/local/cvsroot co all
copy /Y c:\lams2.0\common.properties c:\lams2.0\lams-source\lams_build\common.properties
copy /Y c:\lams2.0\windows.properties c:\lams2.0\lams-source\lams_build\windows.properties
cd C:\lams2.0\lams-source
cd lams_common
call ant rebuild-db
cd c:\lams2.0\lams-source\lams_build
call ant assemble-ear
call ant deploy-ear
call ant deploy-tools
call ant copyfiles
echo "Done!"
copy /Y c:\lams2.0\lams.xml c:\lamsconf
--

Note that my c:\lams2.0 directory contains all the LAMS 2.0 application "stuff". the c:\lams2.0\lams-source dir contains all the cvs code.

So the batch first gets to the lams2.0 directory and wipes out the entire source code directory and the repository one as well, then it creates them back again and checks out the source from cvs completely (you might want to do a cvs update instead of a complete new checkout -your call). Then it copies the backed up common.properties (here's when you can copy any other .properties file as well) to their correponding directories (overwriting the cvs ones) and then starts the building process again. Finally after compiling, it copies the lams.xml file to the directory that is specified in the .properties file that you copied before.

Note that your lams_tool_[your_tool_name] goes in the lams-source directory and since it isn't in CVS you need to make sure you back it up *before* you run the script and the copy it back to the lams-source directory before you start the building process again.

Hope that helps.

Ernie

Posted by Ernie Ghiglione

6: Re: Re: Re: Problems deploying lams_tool_example
In response to 4 08/29/06 05:30 PM
[ Reply | Forward ]
Ken,

I'll deal with the two problems separately as the replies are rather long. First the tool icons in authoring. As you might have guessed, the "question mark with a red circle and slash on top" indicates that the Flash client couldn't get the image from the server for some reason. I suspect whatever is stopping it getting the icon is also causing the file not found.

Have a look in your access log. When you try to start authoring you should get similar entries to this:

127.0.0.1 - mmm [30/Aug/2006:09:09:07 +1000] "GET /lams/lams_preloader.swf?loadFile=lams_authoring.swf&loadLibrary=lams_authoring_library.swf&userID=4&serverURL=http://127.0.01:8080/lams/&build=2.0.200608291840&lang=en&country=AU&theme=default&uniqueID=190127664 HTTP/1.1" 200 34513
127.0.0.1 - mmm [30/Aug/2006:09:09:07 +1000] "GET /lams/lams_authoring_library.swf HTTP/1.1" 200 362339
127.0.0.1 - mmm [30/Aug/2006:09:09:07 +1000] "GET /lams/lams_authoring.swf?userID=4&serverURL=http://127.0.01:8080/lams/&build=2.0.200608291840&lang=en&country=AU&theme=default&uniqueID=190127664 HTTP/1.1" 200 254714
127.0.0.1 - mmm [30/Aug/2006:09:09:07 +1000] "GET /lams/lams_authoring.swf?userID=4&serverURL=http://127.0.01:8080/lams/&build=2.0.200608291840&lang=en&country=AU&theme=default&uniqueID=190127664 HTTP/1.1" 200 254714
127.0.0.1 - mmm [30/Aug/2006:09:09:07 +1000] "GET /lams/lams_authoring_library.swf HTTP/1.1" 200 362339
127.0.0.1 - mmm [30/Aug/2006:09:09:08 +1000] "GET /lams/flashxml/configData.xml HTTP/1.1" 200 2613
127.0.0.1 - mmm [30/Aug/2006:09:09:08 +1000] "GET /lams/flashxml/defaultTheme.xml HTTP/1.1" 200 8095
127.0.0.1 - mmm [30/Aug/2006:09:09:08 +1000] "GET /lams/flashxml/authoring/en_AU_dictionary.xml HTTP/1.1" 200 37343
127.0.0.1 - mmm [30/Aug/2006:09:09:10 +1000] "GET /lams/authoring/author.do?method=getAvailableLicenses HTTP/1.1" 200 3168
127.0.0.1 - mmm [30/Aug/2006:09:09:10 +1000] "GET /lams/authoring/author.do?method=createUniqueContentFolder&userID=4 HTTP/1.1" 200 337
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/authoring/author.do?method=getAllLearningLibraryDetails HTTP/1.1" 200 23758
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/lasbmt11/images/icon_reportsubmission.swf HTTP/1.1" 200 1085
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/lavote11/images/icon_ranking.swf HTTP/1.1" 200 476
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/images/icon_urlcontentmessageboard.swf HTTP/1.1" 200 617
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/larsrc11/images/icon_rsrc.swf HTTP/1.1" 200 573
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/laqa11/images/icon_questionanswer.swf HTTP/1.1" 200 307
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/lanb11/images/icon_htmlnb.swf HTTP/1.1" 200 370
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/lamc11/images/icon_mcq.swf HTTP/1.1" 200 279
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/lantbk11/images/icon_notebook.swf HTTP/1.1" 200 308
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/lafrum11/images/icon_forum.swf HTTP/1.1" 200 291
127.0.0.1 - mmm [30/Aug/2006:09:09:13 +1000] "GET /lams/tool/lachat11/images/icon_chat.swf HTTP/1.1" 200 284

Pick one of the entries, say the last one, and turn it into a full request and try it in your browser. For example http://localhost:8080/lams/tool/lachat11/images/icon_chat.swf. If it is working, then the icon will appear in your browser window. As it is a swf (ie a Flash file) it will probably scale - the icons scale themselves up to fill the browser window normally.

If that doesn't work then check that:

** Your server address is correct (e.g. localhost:8080). You need to double check that the url you are using to access LAMS matches the server name in lams.xml. The lams.xml is in lams_build/conf/windows/lams and is copied to c:/lamsconf when you do the "copyfiles" step in the build. The file in c:/lamsconf is the one used when JBOSS runs so if want to try out values without having to keep rebuilding, modify c:/lamsconf/lams.xml but remember it will be overwritten next time you do a complete build. The file is read when JBOSS starts up so if you change a value then you will need to restart JBOSS.

For example, if lams.xml has localhost:8080 you must use http://localhost:8080/lams/. Even using http://127.0.0.1:8080/lams/ won't work properly as the browser will see this as a different "server".

** Check if the war files have actually deployed correctly. You might want to find the matching war file (lachat11 is in [jboss]\server\default\deploy\lams.ear\lams-tool-lachat11.war) and unzip it and make sure the .swf file is actually in the .war file. If the .war file is missing, or the file is not in the .war file then we need to go back and check the build again.

** Check for any errors in system.log that may have occurred during the JBOSS startup. I'm thinking of errors that would have stopped the war files deploying. All the logs are in [jboss]\server\default\log

When a tool is deployed (as part of the build), it writes entries to the lams_tool, lams_learning_activity and lams_learning_library tables. If you are getting entries for the tools in authoring, then it suggests the tools built and deployed okay, just that something has gone wrong either during JBOSS starting up or with the servername.

Regards,

Fiona

Posted by Fiona Malikoff

11: More Problems deploying lams_tool_example
In response to 6 08/30/06 08:16 PM
[ Reply | Forward ]
>What is a good way to deal with CVS and these configuration files? Should I edit them each time I grab some new source code version?

> [java] Caused by: java.sql.BatchUpdateException: Can't create table '.\lams\#sql-28c_51.frm' (errno: 121)
> [java] at com.mysql.jdbc.Statement.executeBatch(Statement.java:709)
> [java] at org.lamsfoundation.lams.tool.deploy.ScriptRunner.executeStatements(ScriptRunner.java:107)
> [java] ... 4 more
> BUILD SUCCESSFUL
> Total time: 12 seconds

> Kind of confusing to say "BUILD SUCCESSFUL" when "TOOL DEPLOY FAILED" --
>particularly since as suggested I added my tool to the build/build.xml script.

Yeah that is a bit misleading but I've never managed to get all the ant flags just right so that it detects all the errors and gives the right message. Works right sometimes, not other times.

An unfortunately the error message "Can't create table '.\lams\#sql-28c_51.frm' (errno: 121)" isn't very helpful. I suspect there is something wrong relating to foreign keys in one of the db scripts.

Can you email me (fmalikoff@lamsinternational.com) the build.xml and the sql scripts and I'll try them out for myself. You can send me the entire project if you want, just clear out the build directory (build/classes, build/deploy, build/lib, etc) first - it will make it a bit smaller. :->

I'll try to log on again about 9:30pm tonight Brisbane time which I think is about 11:30 am in the UK (give or take daylight saving)? If you can get me the scripts then I'll try to look at them tonight and get back to you straight away.


>So then I dropped the whole lams schema using the MySQL Adminstrator tool, created a new "lams" schema and rebuilt evertyhing from the beginning.
>(I'm unclear when I need to rebuild like this?). But I still get the above error when I run deploy-tool. Everything else seems to be working.

You don't need to drop the database very often - normally just running rebuild-db will do the trick as it actually drops and recreates the database. (So you ask, why do I need to configure the database the first place? So that ANT doesn't throw a hissy fit. One of these days I'll find a way to work around it.)

But when I feel like I'm in the twilight zone and MySQL just doesn't want to work, then I delete and recreate the LAMS database. I usually find out afterwards that it was something I was doing wrong but I feel so much better for doing it.

And now you have the rest of the system and deployed okay, just keep running "deploy-tool" in your own project (rather than running the full build) until we get it deployed. You won't need to do another full build until either
(1) you check out the code again or
(2) you have run your tool and put data in the tool's database tables and then you get to the point where you want to clean out the tables and rebuild your tool.

We'll get your tool running first and I'll explain (2) in more detail then.


Regards,

Fiona

Posted by Fiona Malikoff

12: Re: More Problems deploying lams_tool_example
In response to 11 08/30/06 08:18 PM
[ Reply | Forward ]
I seem to have lost part of my previous post while editing. Ken asked:

>What is a good way to deal with CVS and these configuration files? Should I edit them each time I grab some new source code version?

I've yet to find a really good way. Ernie's way works really well until we go and change one of the configuration files and then you will be back to your original problem - you will miss out on the update.

Are you working within Eclipse? If so then this is what I do.

Doing "Team, Synchronise with Repository" for the lams_build directory. This will show you if there have been updates to the configuration files. lams.jar is updated regularly but the other files aren't updated very often. If you get a little
red arrow on a file, then you know you have a conflict i.e. there is an update to a a file you have changed. Then you update the file and then check
it to make sure your entries are okay.

For the other projects, its fine to do just do Team, Update as you aren't changing any files in the other projects, so you aren't likely to get any conflicts.

I'll have a think about adding a "custom tool" properties file which might save you some fiddling. But I'll have to think exactly how I can do it and if it would really make it any easier. Which entries have you changed in the properties file?

Regards,

Fiona

Posted by Fiona Malikoff

13: Re: Re: More Problems deploying lams_tool_example
In response to 12 09/01/06 03:40 AM
[ Reply | Forward ]
Regarding which configuration files I changed:

shared.properties -- to list my tool

windows.properties -- to say where JBOSS is

build.xml -- to add my tool (though as you suggested I could use deploy-tool directly in its folder)

C:\lams\lams_build\conf\windows\lams\lams.xml -- again to say where JBOSS is

I have JBOSS in c:\program files\ (rather than d:\ in the originals) which may be a better default but maybe that would cause too much trouble.

Posted by Ken Kahn

14: Re: More Problems deploying lams_tool_example
In response to 11 09/01/06 03:55 AM
[ Reply | Forward ]
Hi Fiona,

I tried to send you email (both from the Oxford account and my Gmail account) and they bounced. Details below.

Thanks for all your help with this. The attached was created by using RenameTool on the submit file tool.

Best,

-ken

From Gmail:

Delivery to the following recipient failed permanently:

    fmalikoff@lamsinternational.com

Technical details of permanent failure:
PERM_FAILURE: SMTP Error (state 9): 553 sorry, relaying denied from your location [64.233.182.188] (#5.7.1)


From oucs.ox.ac.uk:

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  fmalikoff@lamsinternational.com
    SMTP error from remote mail server after RCPT TO:<fmalikoff@lamsinternational.com>:
    host smtp.secureserver.net [64.202.166.12]: 553 sorry, relaying denied from your location [129.67.1.165] (#5.7.1)

Posted by Ken Kahn

Attachments:
15: Re: Re: More Problems deploying lams_tool_example
In response to 14 09/01/06 06:13 AM
[ Reply | Forward ]
Ken,

I'm not sure why you aren't getting through on the email address. I've had a quick look at the script and the foriegn key definitions are the problem. The horrible FKA75538F9785A173A names must be conflicting with the existing tables.

Attached is a modified script. All I've done is remove the FKA75538F9785A173A entries in the foriegn key definitions - our sql generator puts them in but I'm not sure if they are really needed. I'm to tired to start reading MySQL manuals right now but the script at least runs and your tool deploys.

I'm attaching the updated script.

But there is another error. When I start up the server:

21:56:11,722 ERROR [ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'submitFilesServiceTarget' defined in class path resource [org/lamsfoundation/lams/tool/sbmt/submitFilesApplicationContext.xml]: Error setting property values; nested exception is PropertyAccessExceptionsException (2 errors)
PropertyAccessExceptionsException (2 errors)
org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.lamsfoundation.lams.tool.behaviourComposer.dao.hibernate.SubmissionDetailsDAO] to required type [org.lamsfoundation.lams.tool.sbmt.dao.ISubmissionDetailsDAO] for property 'submissionDetailsDAO'
at org.springframework.beans.BeanWrapperImpl.doTypeConversionIfNecessary(BeanWrapperImpl.java:951)

For some reason the submit tool configuration is picking up your class over its own class, but I'm not sure why we are getting a clash now when we haven't got a clash in the past. The quick and dirty fix is just to not deploy the submitFiles project at the moment.

I can't think of an easy way around this right now except go into the main build.xml in lams_build and go to deploy-tools comment out the entry for the submit tool. Then do a complete build (sorry!). Hopefully then your tool will deploy okay and LAMS should start up.

Right now, its 10pm at night on a day that I've taken an awful lot of headache tablets and my husband is nagging me to stop working so I hope you will forgive me if I leave it at that.

Regards,

Fiona

Posted by Fiona Malikoff

16: Re: Re: Re: More Problems deploying lams_tool_example
In response to 15 09/01/06 06:15 AM
[ Reply | Forward ]
Might help if I attached the attachment!

Posted by Fiona Malikoff

Attachments:
17: Re: Re: Re: More Problems deploying lams_tool_example
In response to 15 09/06/06 06:12 AM
[ Reply | Forward ]
Hi. Thanks for all your help with this. (I just returned from a conference and plan to work on this every day until I get it working.)

Your script did indeed fix the problem I reported.

Regarding the new problem recall that I created my tool using RenameTool on the submit file tool. So the conflict isn't too mysterious. I figured there was a conflict with the submit file tool's SubmissionDetails so I added these lines to the RenameTool's config file:

Rename SubmissionDetails BCSubmissionDetails
Rename submissionDetails bCSubmissionDetails

But now I get the error:

13:04:20,363 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'learnerDAO' defined in class path resource [org/lamsfoundation/lams/tool/behaviourComposer/behaviourComposerApplicationContext.xml]: Cannot resolve reference to bean 'behaviourComposerSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'behaviourComposerSessionFactory' defined in class path resource [org/lamsfoundation/lams/tool/behaviourComposer/behaviourComposerApplicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for bCSubmissionDetails in class org.lamsfoundation.lams.tool.behaviourComposer.Learner
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'behaviourComposerSessionFactory' defined in class path resource [org/lamsfoundation/lams/tool/behaviourComposer/behaviourComposerApplicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.PropertyNotFoundException: Could not find a getter for bCSubmissionDetails in class org.lamsfoundation.lams.tool.behaviourComposer.Learner
org.hibernate.PropertyNotFoundException: Could not find a getter for bCSubmissionDetails in class org.lamsfoundation.lams.tool.behaviourComposer.Learner

In the meanwhile I'll try your suggestion to just remove the submit tool for the time being and go back to the version of my tool before the renaming of the SubmissionDetails.

Thanks again.

Best,

-ken

Posted by Ken Kahn

18: Re: Re: Re: Re: More Problems deploying lams_tool_example
In response to 17 09/07/06 12:03 AM
[ Reply | Forward ]
Ken,

I think you need to make change bCSubmissionDetails to bcSubmissionDetails. I tried changing the classes manually (ie I didn't run the RenameTool) and it seemed to work if I was using bcSubmissionDetails (and hence the getters become getBcSubmissionDetails(), the setters setBcSubmissionDetails()).

Ugly but it seems to work. I'm going to try to sort out your other issues and then I'll email you a zip file with my version of your code.

Regards,

Fiona

Posted by Fiona Malikoff

Reply to first post on this page
Back to LAMS for Tech-Heads - General Forum