ant build error ARD  2016-09-08 10:26
Status: Closed
 
I have problem while compiling labkey source code (latest version).


 /Users/xxxxx/labkey/server/bootstrap/src/org/labkey/bootstrap/LabkeyServerBootstrapClassLoader.java:39: error: cannot access PermissionCheck

I don't understand this error. What will be the reason to get this error and how to fix it!


#ant build

Buildfile: /Users/xxxxx/labkey/server/build.xml

set_prod_props:

ensure_enlistment_id:

set_dev_props:

echo_props:
     [echo] GWT gwt-user-firefox
     [echo] tomcat.home=/Users/xxxxx/apache-tomcat-8.5.5
     [echo] java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre
     [echo] ant.java.version=1.8
     [echo] java.source.and.target=1.8
     [echo] java.rt.dir=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home/jre/lib
     [echo] labkey.xml.template=../webapps/labkey.xml
     [echo] enlistment.id=89dc87c0-d811-4899-8b6f-f13f2e4d54f5

query_svn_number:
   [delete] Deleting: /Users/xxxxx/labkey/build/#vcs.properties#
     [echo] ## query_svn_number loaded revision: ${Revision} ${URL}
[propertyfile] Updating property file: /Users/xxxxx/labkey/build/#vcs.properties#

build:

uptodate_build_schemas:

build_schemas:

build_log4j:
     [copy] Copying 1 file to /Users/xxxxx/labkey/build/staging/labkeyWebapp/WEB-INF/classes

build_classes:

build_bootstrap_jar:
    [javac] Compiling 22 source files to /Users/xxxxx/labkey/build/bootstrap
    [javac] /Users/xxxxx/labkey/server/bootstrap/src/org/labkey/bootstrap/LabkeyServerBootstrapClassLoader.java:39: error: cannot access PermissionCheck
    [javac] public class LabkeyServerBootstrapClassLoader extends WebappClassLoader
    [javac] ^
    [javac] class file for org.apache.tomcat.util.security.PermissionCheck not found
    [javac] /Users/xxxxx/labkey/server/bootstrap/src/org/labkey/bootstrap/LabkeyServerBootstrapClassLoader.java:127: error: cannot find symbol
    [javac] MethodHandle handle = MethodHandles.lookup().findSpecial(WebappClassLoader.class, "setResources", MethodType.methodType(void.class, parameterType), getClass());
    [javac] ^
    [javac] symbol: method getClass()
    [javac] location: class LabkeyServerBootstrapClassLoader
    [javac] /Users/xxxxx/labkey/server/bootstrap/src/org/labkey/bootstrap/LabkeyServerBootstrapClassLoader.java:128: error: cannot find symbol
    [javac] handle.invoke(this, resources);
    [javac] ^
    [javac] symbol: variable this
    [javac] location: class LabkeyServerBootstrapClassLoader
    [javac] /Users/xxxxx/labkey/server/bootstrap/src/org/labkey/bootstrap/LabkeyServerBootstrapClassLoader.java:146: error: cannot find symbol
    [javac] addURL(jarFileUrl);
    [javac] ^
    [javac] symbol: method addURL(URL)
    [javac] location: class LabkeyServerBootstrapClassLoader
    [javac] /Users/xxxxx/labkey/server/bootstrap/src/org/labkey/bootstrap/LabkeyServerBootstrapClassLoader.java:161: error: cannot find symbol
    [javac] if (super.modified())
    [javac] ^
    [javac] symbol: variable super
    [javac] location: class LabkeyServerBootstrapClassLoader
    [javac] Note: Some input files use unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 5 errors

BUILD FAILED
/Users/xxxxx/labkey/server/build.xml:2401: The following error occurred while executing this line:
/Users/xxxxx/labkey/server/build.xml:716: The following error occurred while executing this line:
/Users/xxxxx/labkey/server/build.xml:2471: Compile failed; see the compiler error output for details.
 
 
Jon (LabKey DevOps) responded:  2016-09-08 11:11
Hello,

Have you tried doing an 'ant rebuild'? If so, do you get the same results?

Regards,

Jon
 
ARD responded:  2016-09-08 11:21
I tried "ant rebuild" but same error/output!

ARD
 
Jon (LabKey DevOps) responded:  2016-09-08 15:31
Hello,

I think this might be a problem with the version of Tomcat you're using.

I noticed that your version of Tomcat is at 8.5.5, which technically isn't supported per our docs (https://www.labkey.org/home/Documentation/wiki-page.view?name=supported).

The error in question indicates org.apache.tomcat.util.security.PermissionCheck not being found.

It's possible that your version of Tomcat doesn't have that functionality that we need to run LabKey with.

Do you think you can install Tomcat 8.0.36 instead and give this another try?

Regards,

Jon
 
ARD responded:  2016-09-09 06:20
Now, I have tomcat (Tomcat 8.0.37), but same errors with ant build.

Main errors are at org.apache.catalina.loader.WebappClassLoader;

1. Cannot resolve symbol 'loader'
2. Cannot resolve symbol 'WebappClassLoader'

public class LabkeyServerBootstrapClassLoader extends WebappClassLoader {

...
...
...

}
Attached a screen shot.

Thanks,
ARD
 
jeckels responded:  2016-09-09 09:03
This indicates that IntelliJ may not have the right TOMCAT_HOME/CATALINA_HOME environment variable set. You can pull up IntelliJ's Preferences and check that they're set appropriately under the Path Variables pane.

https://www.jetbrains.com/help/idea/2016.2/path-variables-2.html

If that doesn't help, check your Tomcat deployment to make sure that it has a lib/catalina.jar directory and file.

Thanks,
Josh
 
adam responded:  2016-09-10 08:49
ARD,

Thank you for your report. I have confirmed that the very latest Apache Tomcat versions (8.0.37 as well as 8.5.5, though we don't recommend using 8.5.x at this point) include a change that breaks compatibility with our LabkeyBootstrapClassLoader build. We're still investigating their change and whether our code can work around this incompatibility, but for now, please install and build against Tomcat version 8.0.36, as Jon has recommended.

Thanks,
Adam
 
ARD responded:  2016-09-10 09:28
I will try with 8.0.36.
 
adam responded:  2016-09-10 09:52
 
adam responded:  2016-09-19 15:14
This fix was committed to the release16.2 branch last week and merged to trunk as of this morning. If you svn update to the latest revision on either of those branches you should be able to build LabKey against Tomcat 8.0.37.

Adam
 
Anthony Corbett responded:  2016-10-19 22:37
In case others find this thread in the future... This same error happens for 16.2 with tomcat 7.0.x (I'm specifically using 7.0.72). The fixes in issue 27801 to bootstrap.iml and build.xml fixed it.

Note: One can always checkout/update to the latest revision of 16.2 branch and these fixes will be included, but our group always checks out the revision of the branch that we have deployed on our production system so we are developing against the same revision we deploy into (which often isn't the latest of the branch) so I had to add the fixes myself.