Search code examples
javaeclipseclasspathbuildpathi2b2

Java classpath folder missing in project but exists in Windows directory structure for project


I downloaded the application server Java source code from the i2b2.org site and compiling it for deployment. This application runs on top of JBoss. There are 8 project folders in the workspace that I switched to in Eclipse (root directory of where these 8 projects live). Got several errors.

Looks like someone else encountered the same issues:

https://www.i2b2.org/software/augrepo.html

Here is the complete list of errors when compiling:

enter image description here

Here's one:

Project 'edu.harvard.i2b2.common' is missing required source folder: 'gensrc'

If I right click the 'edu.harvard.i2b2.common' project, and choose 'Build Path', and choose 'Configure Build Path', and navigate to the 'Source' tab, I see that we have a missing folder.

enter image description here

In Windows, I see that the folder exists. Looks like my CLASSPATH is expecting the folder, but the project doesn't have it included. What is the proper way to fix this in Eclipse?

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry kind="src" path="src/core"/>
    <classpathentry kind="src" path="gensrc"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="lib" path="lib/commons/commons-codec-1.3.jar"/>
    <classpathentry kind="lib" path="lib/commons/commons-collections-2.1.1.jar"/>
    <classpathentry kind="lib" path="lib/commons/commons-httpclient-3.0.jar"/>
    <classpathentry kind="lib" path="lib/commons/commons-logging-1.0.4.jar"/>
    <classpathentry kind="lib" path="lib/jdbc/ojdbc14.jar"/>
    <classpathentry kind="lib" path="lib/dom4j/dom4j-1.6.1.jar"/>
    <classpathentry kind="lib" path="lib/hibernate/hibernate3.jar"/>
    <classpathentry kind="lib" path="lib/j2ee/jbossall-client.jar"/>
    <classpathentry kind="lib" path="lib/jaxb/jaxb-api.jar"/>
    <classpathentry kind="lib" path="lib/jaxb/jaxb-impl.jar"/>
    <classpathentry kind="lib" path="lib/jaxb/jaxb-xjc.jar"/>
    <classpathentry kind="lib" path="lib/spring/spring-2.0.jar"/>
    <classpathentry kind="lib" path="lib/jaxb/jaxb1-impl.jar"/>
    <classpathentry kind="lib" path="lib/jaxb/jsr173_1.0_api.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axiom-api-1.2.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axiom-dom-1.2.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axiom-impl-1.2.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axis2-adb-1.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axis2-adb-codegen-1.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axis2-codegen-1.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axis2-java2wsdl-1.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axis2-jibx-1.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axis2-kernel-1.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/axis2-saaj-1.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/mail-1.4.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/neethi-2.0.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/stax-api-1.0.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/woden-1.0.0M6.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/wsdl4j-1.6.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/wstx-asl-3.0.1.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/xml-apis-1.3.03.jar"/>
    <classpathentry kind="lib" path="lib/axis2-1.1/XmlSchema-1.2.jar"/>
    <classpathentry kind="lib" path="lib/junit/junit-4.4.jar"/>
    <classpathentry kind="lib" path="lib/jaxb/activation-1.1.jar"/>
    <classpathentry kind="output" path="classes"/>
</classpath>

Solution

  • New Answer (i2b2 specific) after a bit of investigation and troubleshooting:

    1. You must run the Apache Ant Scripts first ... follow the CRC_Installation_Guide.pdf in the i2b2 documentation

    2. Then open the parent folder of all of the project folders by going into Eclipse > File > Switch Workspace > Other (choose the parent folder of the 8 project folders) ... normally called "Server". C:\i2b2\Server

    3. You'll again see 19 errors as I mentioned earlier. That's because the Apache Ant script should have created folders and more files, so the references are screwed up.

    4. Refresh all project folders to pull in the newest folders and files .. if you have Eclipse to compile automatically, you're done. Otherwise you must Build your workspace.

    5. Then obviously go and update your JDBC connection strings for the 7 files ... 5 *-ds.xml files and the CRCApplicationContext.xml and CRCLoaderApplicationContext.xml.

    Old Answer (not correct but might help others on a similar issue):

    (Solved with a few different sources)

    1. Follow these steps: http://www.bradjanke.com/2011/04/12/project-%E2%80%98project-name%E2%80%99-is-missing-required-source-folder-%E2%80%98gen%E2%80%99/

    2. Click on Project folder > Source (menu) > Clean Up...

    3. Right click on Project folder > Refresh .. This pulled the file that Windows had in the directory structure for this project

    ... did that for 2 of the projects and that resolved the original 19. Now I have a bunch more errors, but a little easier to fix.