views:

1619

answers:

3
Description Resource    Path Location Type
No grammar constraints (DTD or XML schema) detected for the document.   TEST-net.kindleit.gae.example.server.MessageRepositoryTest.xml  /projecttest-gae-example/target/surefire-reports line 1 XML Problem
No grammar constraints (DTD or XML schema) detected for the document.   appengine-web.xml   /projecttest-gae-example/src/main/webapp/WEB-INF line 1 XML Problem
No grammar constraints (DTD or XML schema) detected for the document.   appengine-web.xml   /projecttest-gae-example/target/projecttest-gae-example-1.0-SNAPSHOT/WEB-INF line 1 XML Problem
No grammar constraints (DTD or XML schema) detected for the document.   datastore-indexes-auto.xml  /projecttest-gae-example/WEB-INF/appengine-generated line 1 XML Problem
No grammar constraints (DTD or XML schema) detected for the document.   jdoconfig.xml   /projecttest-gae-example/src/main/resources/META-INF line 1 XML Problem
No grammar constraints (DTD or XML schema) detected for the document.   jdoconfig.xml   /projecttest-gae-example/target/projecttest-gae-example-1.0-SNAPSHOT/WEB-INF/classes/META-INF line 1 XML Problem
No grammar constraints (DTD or XML schema) detected for the document.   webapp-cache.xml    /projecttest-gae-example/target/war/work line 1 XML Problem

how to fix the above problem on eclipse? my project is maven based. Is it because I miss out some dtd files? how to include it?

example jdoconfig.xml

<?xml version="1.0" encoding="utf-8"?>
<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"&gt;

    <persistence-manager-factory name="transactions-optional">
        <property name="javax.jdo.PersistenceManagerFactoryClass"
            value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
        <property name="javax.jdo.option.ConnectionURL" value="appengine"/>
        <property name="javax.jdo.option.NontransactionalRead" value="true"/>
        <property name="javax.jdo.option.NontransactionalWrite" value="true"/>
        <property name="javax.jdo.option.RetainValues" value="true"/>
        <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
    </persistence-manager-factory>
</jdoconfig>
+3  A: 

If you have WTP (with the XML part included):

Preferences->Validation->XML Validator-> unclick manual and/or build should prevent eclipse checking the DTD

Or:

From the Preference page, choose XML > XML Files. Under the section "Validating files" you can change the severity in the drop down from Warning to Ignore. Just note that this is for all XML files, not just build.xml. But you can just add build.xml to the exclude filter if you would still like this warning for other XML files.

alt text

VonC
+1  A: 

It's just a warning. In preferences: XML/XML Files/Validation, you can turn it off.

bmargulies
+3  A: 

How to fix the above problem on eclipse?

It's more a warning than an real problem. You can tell Eclipse to ignore this when validating files (Windows > Preferences > XML > XML Files > Editor > Validation).

Is it because I miss out some dtd files?

No, it's because the XML document doesn't declare any DTD or XSD.

How to include it?

You could of course add the declaration manually (if you know which DTD or Schema to add). Or you could tell Eclipse to ignore the fact that no grammar is specified as previously mentioned. Or you could just live with it.

Pascal Thivent