LabKey says that Java module "was not compiled in production mode" even after 'ant production'

LabKey Support Forum (Inactive)
LabKey says that Java module "was not compiled in production mode" even after 'ant production' j142857z  2016-10-27 07:20
Status: Closed
 
I'm trying to figure out how to develop a Java module and I'm struggling even after following the instructions provided in the documentation.

I have installed the LabKey 16.2 with Tomcat 8.0.38 on a Linux machine. The LabKey installation is in folder /usr/local/labkey. Both Tomcat and LabKey are up and running.

Separately from the LabKey installation described above, I downloaded a local copy of trunk to my home folder and created a new module by running 'ant create_module'. The module is called hellomod. I immediately compile with 'ant build' and then 'ant production' and then manually copy the generated hellomod.module into /usr/local/labkey/modules and restart Tomcat.

LabKey restarts correctly but shows an error message saying that the module "was not compiled in production mode".

I don't understand why I get this error if I'm doing exactly what is indicated in the documentation below.

https://www.labkey.org/home/Documentation/wiki-page.view?name=productionBuilds

Since the above fails then I tried another test by compiling module kiem from /trunk/server/customModules with 'ant build' and 'ant production'. After this I manually copied kiem.module from trunk/build/deploy/modules to /usr/local/labkey/modules and restarted Tomcat. Again I get the error saying that kiem "was not compiled in production mode".

Could someone please what I'm doing wrong and how I can successfully compile and deploy a Java module? Thanks.
 
 
dennisw responded:  2016-10-27 07:29
Did you try, in your module.properties file, adding the line:

BuildType: Production
 
j142857z responded:  2016-10-27 08:04
I managed to deploy it the module, thanks. I added 'BuildType: Production' to the properties file and ran 'ant production'.
 
Jon (LabKey DevOps) responded:  2016-10-27 12:35
Glad your module is working now.

Alternatively, rather than manually setting it, you can also do an "ant clean" and then an "ant production" to get this to work.

When you do an "ant build", then "ant production", that reuses development-style artifacts that are already up-to-date, which can create that odd "was not compiled in production mode" message you saw.

Regards,

Jon