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


 
Search: 

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