Setting Up a Development Environment - svnant.classpath not found

LabKey Support Forum (Inactive)
Setting Up a Development Environment - svnant.classpath not found trent  2011-06-06 17:13
Status: Closed
 
Hoping someone can be of some assistance- just trying to set up a development machine to go through the building modules lessons - so I am attempting to follow this guide: https://www.labkey.org/wiki/home/Documentation/page.view?name=build

I am up to the bit: Build and Run LabKey

(Actually, I also have an issue before that - setting up the Tomcat RUN configuration; it says it can't find org.apache.catalina.startup.Bootstrap in module LabKey. Looking at the existing LabKey Development configuration, it has API specified for the 'Use classpath and JDK of module' field, and doesn't throw the error - but the doco says to use the LabKey item in that field (which from an earlier step points to the 1.6 JDK), so not sure if that's safe to do or not...)

Anyway, so I ran the pick_pg ant target - all good; then tried to run build , but get a bunch (4) of errors which seem to be surrounding the reference to svnant.classpath parameter, from the build.xml file

<path>\build.xml:6: Reference svnant.classpath not found.

I am thinking perhaps in the Ant build properties, I am supposed to add additional classpath?

Thanks for any help in advance. :-)

edit: relevant line from build.xml:

<typedef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="svnant.classpath" />
 
 
jeckels responded:  2011-06-06 18:11
Hello,

Are you running Ant version 1.8 and trying to build LabKey Server version 11.1 or earlier? IntelliJ 10 and later come bundled with Ant 1.8. This was a problem until I recently fixed it in the trunk:

https://www.labkey.org/issues/home/Developer/issues/details.view?issueId=11403

Two possible solutions are to either use the version of Ant (1.7) that's included in the SVN repository (<LABKEY_ROOT>/external/ant) or switch to the trunk.

As for the error about failing to resolve org.apache.catalina.startup.Bootstrap, I've seen that in the past but the IDE has still been able to launch the server. If it's causing problems when you launch, be sure to check your setting for CATALINA_HOME in the IntelliJ settings (File->Settings->Path Variables).

Thanks,
Josh
 
trent responded:  2011-06-06 22:30
Hi, Thanks. I got the trunk and am now getting some different errors:

Execute failed: java.io.IOException: Cannot run program "svn": CreateProcess error=2, The system cannot find the file specified

From the comments, I guess this means I need an empty file at <root>/server called svn.properties? (well just tried, and still seem to get this error)

build.xml:1217: Java returned: 2147483647

not really sure what to make of that

The other one is build.xml:199: java.lang.OutOfMemoryError: PermGen space

So have to see if I can work that out tomorrow. Im presuming I need to increase the VM parameter -Xmx768M so it doesn't run out of RAM.

.. in the IDE, its a bid hard to find the errors due to tree it puts them in, but I think they are mostly about the svn.

(seems to be varying number of errors each time I attempt to build)
 
trent responded:  2011-06-08 20:02
Alrighty, I've built a new Windows VM, to start everything from scratch - and it seems to build no problem now (although, took a while first build - but that's probably to be expected). So I guess there may have been some conflicts with trying to build from source where the binary installation exists; or some other conflict on my system.

One thing though, when I went to run, I did get an error:

java.lang.NoClassDefFoundError: com/intellij/rt/execution/application/AppMain
Caused by: java.lang.ClassNotFoundException: com.intellij.rt.execution.application.AppMain
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202) <snip>

I found this thread: https://www.labkey.org/announcements/home/Developer/Forum/thread.view?rowId=569 , with the solution: "You'll need to add another JAR to your -classpath argument. On my machine it's C:/Program Files/JetBrains/IntelliJ IDEA 5.1/lib/idea_rt.jar." Which is exactly what was needed, so, dunno whether its worth adding that to the suggested vm parameters in the documentation?
 
jeckels responded:  2011-06-09 09:29
Hi Trent,

The error attempting to execute svn should be harmless. We use it to try to include the current SVN revision as metadata in each of the modules. If it fails, you just won't get that metadata. It's unfortunate that we can't suppress the error message during the build.

If you see errors about running out of PermGen, you'll need to add the -XX:MaxPermSize=128M JVM argument. PermGen is a separate space from the normal Java heap.

Thanks for the suggestion, I just added a note about adding idea_rt.jar to this page:

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

Thanks,
Josh