Teammates: Eclipse compilation errors after commit c74ff60

Created on 12 Apr 2017  Â·  6Comments  Â·  Source: TEAMMATES/teammates

After merging from the 'TEAMMATES/master' now(13 April) to a test branch (no other commits except a merge from 'TEAMMATES/master' 9 days ago), I was given multiple compile errors by eclipse. After refreshing and cleaning the project, only one error remained.

The error is in src/test/java/teammates/test/pageobjects/AppPage.java on the following lines:

public static LoginPage createCorrectLoginPageType(Browser browser) {
        return getNewPageInstance(browser, TestProperties.isDevServer() ? DevServerLoginPage.class
                                                                        : GoogleLoginPage.class);
    }

Error description by Eclipse:

Multiple markers at this line

  • Type mismatch: cannot convert from Class \
  • The method getNewPageInstance(Browser, Class) in the type AppPage is not applicable for the arguments (Browser,
    (TestProperties.isDevServer() ? DevServerLoginPage.class : GoogleLoginPage.class))

When I force it to proceed with the build to deploy to local server, it gives lots of errors before saying _"Dev App Server is now running"_: The entire console output before the success message is here.

On visiting `localhost:8888' (because dev server was running) I get an HTTP ERROR 503 which says:

Problem accessing /. Reason:
SERVICE_UNAVAILABLE

Pull requests for #7063 and #6805 are on hold for this

a-DevHelp c.Message

All 6 comments

@HirdayGupta I've found that sometimes you need to do it a few times before it recognizes the updates to all the files.

@HirdayGupta This is due to c74ff60 which changes some of the IDE settings which breaks existing projects but should be fine for freshly setup ones. To fix, go to project properties -> Java Compiler and set the JDK Compliance level to 1.7. You may also need to follow step 4 subsection Google App Engine of this document.

@Neurrone @whipermr5 Thanks! Changing the compiler compliance level worked.

@whipermr5 @Neurrone Eclipse is giving new problems. I made no preference changes after the previous issue was fixed and somehow managed to get some XML errors out of nowhere. I currently have the following four compilation errors. All of them are only on XML Files.

  1. Error Message: cvc-complex-type.2.4.a: Invalid content was found starting with element 'exclude-pattern'. One of '{"http://pmd.sourceforge.net/ruleset/2.0.0":rule}' is expected.

    • File: /teammates/static-analysis/teammates-pmdMain.xml
    • Line in Code: <exclude-pattern>.*/test/java/.*</exclude-pattern>
  2. Error Message: Referenced file contains errors (http://java.sun.com/xml/ns/jdo/jdoconfig).

    • File: /teammates/src/main/resources/META-INF/jdoconfig.xml
    • Line in Code(indicated by eclipse): <?xml version="1.0" encoding="utf-8"?>
  3. Error Message: cvc-elt.1: Cannot find the declaration of element 'jdoconfig'.

    • File: /teammates/src/main/resources/META-INF/jdoconfig.xml
    • Line in Code: <jdoconfig xmlns="http://java.sun.com/xml/ns/jdo/jdoconfig" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://java.sun.com/xml/ns/jdo/jdoconfig">
  4. Error Message: cvc-identity-constraint.4.1: Duplicate unique value [appstats] declared for identity constraint "web-app-filter-name-uniqueness" of element "web-app".

    • File: /teammates/src/main/webapp/WEB-INF/web.xml
    • Line in Code: <filter-name>appstats</filter-name>

NOTE: When I run this project as a web application, it runs on the local server with no problems. However, I am unable to deploy to a staging server as it cannot, for some reason, locate appengine-web.xml

UPDATE: This error persists even when I switch to branches where I have not performed the latest merge. Not sure what this means.

@HirdayGupta Make sure XML validation is disabled:

Validation: We do not validate HTML, JSP, and XML.
Validation → uncheck the Build option for HTML Syntax Validator, JSP Content Validator, JSP Syntax Validator, and XML Validator.

After that, redo the steps listed above. Note that the settings are lost and you'll need to do those steps again every time you switch to an older branch (even after switching back to the newer branch), so try to update all your branches.

@whipermr5 Thank you so much for the assistance. That seems to have solved the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LiHaoTan picture LiHaoTan  Â·  4Comments

wkurniawan07 picture wkurniawan07  Â·  4Comments

whipermr5 picture whipermr5  Â·  3Comments

keoren3 picture keoren3  Â·  3Comments

JosephineKwa picture JosephineKwa  Â·  4Comments