[KULRICE-2764] Deploy Rice standalone server to our test environments Created: 03/Mar/09  Updated: 17/Aug/09  Resolved: 16/Mar/09

Status: Closed
Project: Kuali Rice Development
Component/s: Application Server, Configuration, Packaging, Sample Application
Affects Version/s: None
Fix Version/s: 1.0

Type: Task Priority: Blocker
Reporter: Eric Westfall Assignee: Casey Boettcher (Inactive)
Resolution: Complete Votes: 0
Labels: None
Σ Remaining Estimate: 2 days, 4 hours Remaining Estimate: 2 days
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: 2 days, 4 hours Original Estimate: 2 days

Attachments: File mylyn-context.zip     File mylyn-context.zip    
Issue Links:
relates to KULCFG-284 make it so we can use the USERS table... Closed
relies on KULRICE-2607 Test the standalone war Closed
is relied upon by KULRICE-2649 Verify that our jsps and tag librarie... Closed
KULRICE-2807 Test server setup and managment needs... Sub Task Closed Casey Boettcher  
KULRICE-2815 Deploy CAS-enabled Rice standalone s... Sub Task Closed  
KULRICE-2816 Deploy Rice standalone server with Re... Sub Task Closed Eric Westfall  


Here are the notes from our meeting today regarding this:

  • Update the build.xml in rice and add dist-external and dist-war
    • generated war file from dist-war will get automatically deployed to wsa131 via the j2ee_deploy_war script on wsa123
  • We need to update do-daily-updates.sh in kul-cfg-envs to add "kupdate" statements in our script so that we execute the daily update
    • Initially, let's start with just the STG environment and use the RICESTG database
    • part of the kupdate script should be able to create the RICESTG database using our nightly database export
    • so our first environments will use the STG database
  • Update /usr/local/rice/rice-config.xml to reflect configuration changes in rice 1.0, verify files in /usr/local/rice/stg/...
  • at any point during the day we can probably just run do-daily-updates.sh to test an initial deployment
    • IMPORTANT: no two projects can run their updates scripts at the same time
  • We also need to update (and move to KULRICE) the documentation at the following location:

Comment by Casey Boettcher (Inactive) [ 04/Mar/09 ]

Added "kupdate stg standard true true Oracle9i" to do-daily-updates.sh
Copied dist-external and dist-war to ant file, sans init target for properties (presumably these are passed in when called by kant).
Changed package name of Oracle9iPlatform in stg-rice-config.xml to point to correct class.

    • Do you really mean RICESTG for the DB schema? Are you sure you don't want to use RICE094STG? I don't think the former conforms to bash script naming conventions for schemas (though I think it can be worked around by passing an empty string for the second argument to kupdate)
Comment by Eric Westfall [ 04/Mar/09 ]

When you say you copied dist-external and dist-war, what do you mean? Where did you copy them from? We probably need to write our own versions of those so that they build and package the Rice standalone war properly.

As for the RICESTG db, yes I think that's the name we want since we will only have one particular version of Rice deployed to STG at a time. Is this going to cause issues with our deployment scripts?

Comment by Casey Boettcher (Inactive) [ 04/Mar/09 ]

I'll modify the ant targets as necessary.

The script breaks when the following occurs:

In do-daily-updates.sh, kupdate is called (the shared-functions file having been sourced).
kupdate generates a properties file called, appropriately, "generated-build.properties" by calling ksetprops
kupdate then calls kcheckout and then...
kupdate calls kant
kant calls ant with a target of import, passing it the following argument: -Dgenerated.properties.file=/home/j2eemgr/kuali/generated-build.properties
ant uses the default build file in kul-cfg-envs and executes the import target which then calls other ant targets:
<target name="init-base-properties">
<property file="$


" />
<property file="$


/build.properties" />
<property file="$


/build.properties" />
<property file="$


/build.properties" />
<condition property="import.into.mysql">
<equals arg1="$


" arg2="MySQL" />

<!-- note: init-mysql-properties depends upon init-base-properties -->
<target name="init-properties" depends="init-mysql-properties">
<property file="$


" />
<loadfile property="impex-build.properties" srcfile="$


"><filterchain><expandproperties /></filterchain></loadfile>
<delete file="$

{impex.properties.file}" />
<echo message="${impex-build.properties}" file="${impex.properties.file}

" />

<!-- note: create-mysql user depends upon init-properties -->
<target name="import" depends="create-mysql-user">
<ant antfile="$

{impex.build.file}" target="empty-schema" inheritall="false" />
<ant antfile="${impex.build.file}

" target="import" inheritall="false" />
<delete file="$


" />

So, at this point, I"m not really sure what the state of the environment is, or how many properties files have bee read. Let's just assume that generated-build.properties and impex-build.properties are in the mix.

ant then invokes itself, only with the impex build file of the kul-cfg-dbs project and calls empty-schema....

<target name="oracle-empty-schema" depends="inittasks">
<adminsql sql="$


" />

adminsql executes the following:
"DECLARE temp NUMBER; BEGIN temp := kulcfgusr.kuluser_maint_pk.recreate_user( '<generated-user-name>' ); END;"

Where <generated-user-name> is a string formed from the $DATABASE_APPLICATION_CODE variable in 0.9.4-settings file. Setting this to "rice" and not "rice094" (to make use of the existing RICESTG schema) is not feasible because the same generated user name is used to export data from the RICE094DBA schema (not "RICEDBA").

Comment by Casey Boettcher (Inactive) [ 05/Mar/09 ]

If you'd like me to create a RICE094STG schema, I've got everything in place to do that, apart from the tablespace.

The problem with creating a tablespace is that the package currently on the server seems to be at odds with all the other RICE users that have been created prior to this point. The following in the KULUSER_MAINT_PK package that is currently installed on the esdbk02 server (leading comment is not mine):

UseUserNameForTablespace CONSTANT BOOLEAN := TRUE;
– create user
IF PasswordHash THEN
CreateUserDDL := CreateUserDDL||'VALUES '''||UserPW||''' ';
CreateUserDDL := CreateUserDDL||UserPW||' ';
IF UseUserNameForTablespace THEN
CreateUserDDL := CreateUserDDL||'DEFAULT TABLESPACE '||UserID;
CreateUserDDL := CreateUserDDL||'DEFAULT TABLESPACE '||PrimaryTablespace;

Maybe I'm reading the PL/SQL wrong, but this would seemingly create a RICE094STG tablespace. Were UseUserNameForTablespace 'FALSE', I wouldn't have to create a tablespace for the RICE094STG user – it would use a default. Note that all other Rice-related users (incl RICESTG) use a default tablespace of "KUALI_TABLES"

Let me know how you'd like to proceed. If we use RICESTG, I think we'll have to alter something outside of Rice settings/scripting in kul-cfg-envs. If we use RICE094STG, then we would either need to create a tablespace for that user or alter the maintenance package on the server (note that the package body in the repo has the variable in question set to FALSE).

Comment by Casey Boettcher (Inactive) [ 06/Mar/09 ]

Decided to go with tablespace per schema. Have asked IU DBA team to advise on sane tablespace DDL and amount of space on esdbk02 machine.

>The Database Administration (DBA) team has received your message (IM683228). Priority is currently being assigned.
>Please include the incident number in any follow up communications.
>Thank you for using our services.
>Indiana University

Comment by Casey Boettcher (Inactive) [ 13/Mar/09 ]

Deploy failed last night with error:

          • begin error log *****
            20090313.00.45.02: executing command: /usr/local/ant/bin/ant -Dgenerated.properties.file=/home/j2eemgr/kuali/generated-build.properties -f /home/j2eemgr/kuali/build.xml dist-war
            Buildfile: /home/j2eemgr/kuali/build.xml



[delete] Deleting: /home/j2eemgr/impex-build.properties

Trying to override old definition of task maven

[echo] The Kuali Rice version is 0.9.4-SNAPSHOT
[echo] [Dependency

{groupId=org.springframework, artifactId=spring-aop, version=2.0.4, type=jar}

, Dependency

{groupId=org.springframework, artifactId=spring-beans, version=2.0.4, type=jar}

, Dependency {groupId=org.springframework, <snip>
[mkdir] Created dir: /opt/ears/stg/kr/rice/target/ant-build

[java] [INFO] Scanning for projects...
[java] [INFO] Reactor build order:
[java] [INFO] Kuali Rice
[java] [INFO] Kuali Rice API
[java] [INFO] Kuali Rice Implementation
[java] [INFO] Kuali Rice Web
[java] [INFO] ksb
[java] [INFO] kcb
[java] [INFO] kns
[java] [INFO] kim
[java] [INFO] kew
[java] [INFO] ken
[java] [INFO] [compiler:compile]
[java] [INFO] Compiling 215 source files to /opt/ears/stg/kr/rice/api/target/classes
[java] [INFO] ------------------------------------------------------------------------
[java] [INFO] ------------------------------------------------------------------------
[java] [INFO] Fatal error compiling

[java] Embedded error: Error while executing the external compiler.
[java] java.io.IOException: javac: not found
[java] [INFO] ------------------------------------------------------------------------
[java] [INFO] For more information, run Maven with the -e switch
[java] [INFO] ------------------------------------------------------------------------
[java] [INFO] Total time: 9 seconds
[java] [INFO] Finished at: Fri Mar 13 00:45:17 EDT 2009
[java] [INFO] Final Memory: 13M/69M
[java] [INFO] ------------------------------------------------------------------------

/home/j2eemgr/kuali/build.xml:50: The following error occurred while executing this line:
/opt/ears/stg/kr/rice/build.xml:134: The following error occurred while executing this line:
/opt/ears/stg/kr/rice/build.xml:293: Java returned: 1

          • end error log *****

This is part of the kupdate process initiated in do-daily-updates.sh. kupdate calls 'kant dist-war' which invokes the dist-war target in the build file of the kul-cfg-envs project.

This target (dist-war) then invokes dist-ant in the same file. dist-ant calls "ant dist"; that is you have an ant process calling itself with a different build file, to wit, that of the rice project. In the error log output above, you'll see "Trying to override old definition of task maven". This string doesn't exist in a kuali project – it's ant reporting that it's attempting to overwrite an existing macro definition, one that's already defined in the kul-cfg-envs build file. What's the macro called?


A long story shorter, "ant dist" depends upon dist-server, which depends on prepare-lib which calls install-rice-jars, which calls the maven macro.

I'd like to set the maven.build flag to true and have the dist-war target in kul-cfg-envs invoke its own maven macro definition via dist-maven. This will have to wait, however, as KFS is running its weekly build today.

Comment by Casey Boettcher (Inactive) [ 13/Mar/09 ]

Files related to KULRICE-2764

Comment by Eric Westfall [ 13/Mar/09 ]

Casey, that sounds like a good idea if we can get that to work. A couple of things we need to consider though:

1) dist-server is currently overlaying files from web/src/main/config into the standalone war, this includes things like license acknowledgements and an updated index.html that doesn't include the sample application links. We'll need to try and figure out how to do something similar in maven
2) dist-server is executing a replacement of "dev" with the environment code in web.xml in the WAR file. We will need to figure out how to do this as well so that the packaged web.xml has the correct environment code.

Comment by Casey Boettcher (Inactive) [ 15/Mar/09 ]

More info on the problem reported in this comment: https://test.kuali.org/jira/browse/KULRICE-2764?focusedCommentId=119846#action_119846

Both j2eemgr and tomcat users have javac on their paths, both on wsa123 and wsa131

I've forced the PATH environment variable to include /usr/local/java/bin for the forked JVM created by the maven macro in rice's build.xml. I've also turned on debugging and included an echo task that will hopefully echo the true PATH used by the forked JVM, though, on reflection, the output might not accurately reflect its environment. Does a JVM inherit the environment from which it's spawned?

Note that, even were I to want to set the maven.build flag (as I suggested at the end of the referenced comment) I could not have done so, because of the way this system of scripts is set up and because of the logic behind ant's if/unless target attributes. In order to have maven.build in the generated ant properties file, I would have to alter the ksetprops function to echo this into the generated file from the rice settings file. But this would occur for every project (KC, KFS and rice). That's not a problem, since I could set a default of "false" in the shared-properties file and a value of "true" in the Rice settings file. That would be superfluous code, however, because regardless of the value maven.build is set to, the dist-maven target would be run instead of dist-ant for every project. In ant, "if" and "unless" check for the existence of a property and disregard its value entirely.

Comment by Casey Boettcher (Inactive) [ 16/Mar/09 ]

Potential further work would involve understanding why PATH had to be set explicitly in 'maven' macro in order to avoid javac FileNotFound error

Comment by Eric Westfall [ 17/Aug/09 ]

Bulk change of all Rice 1.0 issues to closed after public release.

Generated at Fri Sep 25 17:16:17 CDT 2020 using JIRA 7.0.11#70121-sha1:19d24976997c1d95f06f3e327e087be0b71f28d4.