Welcome Guest  |  Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 8
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1535 times and has 7 replies Next Thread
Male Filippo1980
Novice




Joined: Nov 20, 2008
Post Count: 40
Status: Offline
Reply to this Post  Reply with Quote 
Cannot find the declaration of element 'jdo'.

Hi all,
I have this error in my log file:

WARN [MetaData] MetaData Parser encountered an error in file "file:/[file's path]" at line 3, column 6 : cvc-elt.1: Cannot find the declaration of element 'jdo'. - Please check your specification of DTD and the validity of the MetaData XML that you have specified.

And I have this error for all jdo's files and all orm's files!
All jdo's files start with:

<?xml version="1.0"?>
<!DOCTYPE jdo PUBLIC "-//Sun Microsystems, Inc.//DTD Java Data Objects Metadata 2.0//EN" "http://java.sun.com/dtd/jdo_2_0.dtd">
<jdo>


and all orm's files start with:

<?xml version="1.0"?>
<!DOCTYPE orm SYSTEM "file:/javax/jdo/orm.dtd">
<orm>


Do you know where is the problem?
Thank you in advance for your help!
[Jun 25, 2009 2:37:37 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male chrisco
Expert
Member's Avatar

Australia
Joined: Nov 24, 2005
Post Count: 562
Status: Offline
Reply to this Post  Reply with Quote 
Re: Cannot find the declaration of element 'jdo'.

Try using this at the start of your .jdo files instead:




We were having a similar problem a few months ago. We changed our Javelin tool to output the above element instead of what it used to output and invoked a complete synchronization of all java files in our projects and the problem dissappeared.
----------------------------------------
Chris Colman
http://visualclassworks.com
Javelin: Visual modeling & coding with automatic JDO 2/DataNucleus meta data generation.
http://expojo.com
expojo: Simple dependency injection and exposed POJO domain model pattern
[Jun 29, 2009 12:06:16 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male Filippo1980
Novice




Joined: Nov 20, 2008
Post Count: 40
Status: Offline
Reply to this Post  Reply with Quote 
Re: Cannot find the declaration of element 'jdo'.

Thank you Chris, but there is a problem... Now I receive this error from the enchanter tool:

(main) ERROR [DataNucleus.MetaData] - Parser error with file "file:/D:/Eclipseworkspace/Portale_Cyborg/home/build/classes/com/cdg/shared/business/Risorse.jdo" has cause Invalid byte 1 of 1-byte UTF-8 sequence.

and I receive this error for all jdo's files!
Are you sure of code?
Perhaps you forgot some thing on the last row... but I don't know what it could be!
Thanks again for your help!
[Jun 29, 2009 2:49:54 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male ganzuoni
Expert
Member's Avatar


Joined: Nov 16, 2005
Post Count: 844
Status: Offline
Reply to this Post  Reply with Quote 
Re: Cannot find the declaration of element 'jdo'.

Try to remove
encoding="UTF-8"
from your xml declaration

Guido
----------------------------------------
Guido Anzuoni
http://www.objectmagic.org
[Jun 29, 2009 3:24:15 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male chrisco
Expert
Member's Avatar

Australia
Joined: Nov 24, 2005
Post Count: 562
Status: Offline
Reply to this Post  Reply with Quote 
Re: Cannot find the declaration of element 'jdo'.

The UTF-8 worked for our projects but I think I'll change Javelin to remove the UTF-8 if it's causing problems on yours.
----------------------------------------
Chris Colman
http://visualclassworks.com
Javelin: Visual modeling & coding with automatic JDO 2/DataNucleus meta data generation.
http://expojo.com
expojo: Simple dependency injection and exposed POJO domain model pattern
[Jun 29, 2009 3:30:43 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male Filippo1980
Novice




Joined: Nov 20, 2008
Post Count: 40
Status: Offline
Reply to this Post  Reply with Quote 
Re: Cannot find the declaration of element 'jdo'.

Thank you Guido and Chris, I tried to delete the encoding from the JDO's files but I didn't resolve...
However, as I wrote in another post I have some problem with the charset and perhaps this could be the solution because the problem is only after the commit!
Can you suggest me something for resolve it?
Chris, I ask you a stupid thing: what do you mean with: "I'll change Javelin to remove the UTF-8"?
Are you speaking about the jsp's files? Or about the files on my persistence's package (JDO, ORM and Java files)?
(I suppose the second thing, but as I said it doesn't resolve the problem...)
[Jun 30, 2009 9:22:19 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male Filippo1980
Novice




Joined: Nov 20, 2008
Post Count: 40
Status: Offline
Reply to this Post  Reply with Quote 
Re: Cannot find the declaration of element 'jdo'.

I have some news!!!
I resolve the problem!
I found this web page:
http://db.apache.org/jdo/jdo_dtd.html

and I simply copied the code that I found on it:

<?xml version="1.0" encoding="UTF-8" ?>
<jdo xmlns="http://java.sun.com/xml/ns/jdo/jdo"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/jdo/jdo
http://java.sun.com/xml/ns/jdo/jdo_2_0.xsd">

It seems like the Chris' code but it works!
I use a screen reader on my computer because I'm blind so perhaps I didn't see some some difference on letters' case however now It works and thank you again for your help!!!
[Jun 30, 2009 10:17:35 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male chrisco
Expert
Member's Avatar

Australia
Joined: Nov 24, 2005
Post Count: 562
Status: Offline
Reply to this Post  Reply with Quote 
Re: Cannot find the declaration of element 'jdo'.



The difference I can see is that my example uses jdo_2_2.xsd intead od jdo_2_0.xsd. We're using the latest DN with the latest JDO Jar and using jdo_2_2.xsd seems to work fine with that for us.

The main thing I recall was that using the DTD form of schema definition seemed to stop working for us a while back and the only solution we could find was to switch to the .xsd form of the schema definition. We never quite worked out why the DTD stopped working but as the .xsd form of the definition worked fine we just switched over to that form for everything.
----------------------------------------
Chris Colman
http://visualclassworks.com
Javelin: Visual modeling & coding with automatic JDO 2/DataNucleus meta data generation.
http://expojo.com
expojo: Simple dependency injection and exposed POJO domain model pattern
----------------------------------------
[Edit 1 times, last edit by chrisco at Jun 30, 2009 10:36:26 PM]
[Jun 30, 2009 10:33:29 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread