org.xml.sax.SAXParseException: Attribute "generator-class" must be declared for element type "id".

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

The persistence_2_0.xsd enforces the order of the elements in the xml. Re-ordering them makes then error go away.

Solutions on the web

via Hibernate JIRA by sudhir srinivasan, 1 year ago
Attribute "generator-class" must be declared for element type "id".
via Hibernate JIRA by sudhir srinivasan, 1 year ago
Attribute "generator-class" must be declared for element type "id".
via Google Groups by mwyc...@gmail.com, 5 months ago
Attribute "validator" is required and must be specified for element type "isofieldpackager".
via Oracle Community by 843830, 1 year ago
Attribute "validation" must be declared for element type "action".
via Google Groups by bill blackmon, 2 years ago
Attribute "initialValue" must be declared for element type "form-property".
via GitHub by jafin
, 2 years ago
cvc-complex-type.2.4.a: Invalid content was found starting with element 'emphasis'. One of '{"http://docbook.org/ns/docbook":inlinemediaobject, "http://docbook.org/ns/docbook":remark, "http://docbook.org/ns/docbook":superscript, "http://docbook.org
org.xml.sax.SAXParseException: Attribute "generator-class" must be declared for element type "id".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:354)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:707)
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:689)
at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:208)
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:150)
at org.apache.tools.ant.taskdefs.Java.run(Java.java:443)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:163)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:569)
at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:367)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.eclipse.ant.core.AntRunner.run(AntRunner.java:335)
at org.eclipse.ui.externaltools.internal.ant.launchConfigurations.AntLaunchDelegate$1.run(AntLaunchDelegate.java:172)
at java.lang.Thread.run(Thread.java:536)

Users with the same issue

2 times, 2 months ago
2 times, 2 months ago
7 times, 8 months ago
2 times, 8 months ago
2 times, 8 months ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.