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


 
Search: 

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

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