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


 
Search: 

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

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