Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 519332

Summary: Errors running builder Java Builder: Can't find bundle for XMLSchemaMessages
Product: [Eclipse Project] JDT Reporter: Trevor Robinson <trevor>
Component: APTAssignee: Generic inbox for the JDT-APT component <jdt-apt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: eclipse, jarthana
Version: 4.6   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard: stalebug

Description Trevor Robinson CLA 2017-07-06 11:54:18 EDT
I get continuous error dialog popups with the following information. I've tried reinstalling Eclipse and reimporting my projects, but the issue ends up reoccurring (though for some reason, not usually during the initial build). It seems to be related to APT running the Hibernate JPAMetaModelEntityProcessor. I don't have any XML in my projects, so I don't think the issue is caused by the code being built. I have to dismiss the dialog each time a build is triggered (e.g. saving any file), so it is a very disruptive issue. I was using m2e-apt, but have removed it to verify that it is not involved. If there's some way to disable annotation processing or pass annotation processor options to the compiler (like javac's -A option) that could be a workaround.

Errors occurred during the build.
Errors running builder 'Java Builder' on project 'xxx'.
Can't find bundle for base name org.apache.xerces.impl.msg.XMLSchemaMessages, locale en_US

java.util.MissingResourceException: Can't find bundle for base name org.apache.xerces.impl.msg.XMLSchemaMessages, locale en_US
	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:845)
	at org.apache.xerces.impl.xs.XSMessageFormatter.formatMessage(Unknown Source)
	at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDAbstractTraverser.reportSchemaError(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDSimpleTypeTraverser.getSimpleType(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDSimpleTypeTraverser.traverseSimpleTypeDecl(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDSimpleTypeTraverser.traverseGlobal(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseSchemas(Unknown Source)
	at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
	at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
	at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
	at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:638)
	at javax.xml.validation.SchemaFactory.newSchema(SchemaFactory.java:670)
	at org.hibernate.jpamodelgen.util.xml.XmlParserHelper.loadSchema(XmlParserHelper.java:171)
	at org.hibernate.jpamodelgen.util.xml.XmlParserHelper.getSchema(XmlParserHelper.java:102)
	at org.hibernate.jpamodelgen.xml.JpaDescriptorParser.loadEntityMappings(JpaDescriptorParser.java:144)
	at org.hibernate.jpamodelgen.xml.JpaDescriptorParser.parseXml(JpaDescriptorParser.java:70)
	at org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor.init(JPAMetaModelEntityProcessor.java:100)
	at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.discoverNextProcessor(IdeAnnotationProcessorManager.java:94)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:116)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
	at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:135)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:915)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:437)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:368)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:179)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:305)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:61)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:180)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

eclipse.buildId=4.6.3.M20170301-0400
java.version=1.8.0_121
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product -keyring /Users/trevor/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/trevor/.eclipse_keyring
Comment 1 Trevor Robinson CLA 2017-07-06 14:42:06 EDT
As a workaround (that does not address the underlying issue), I was able to specify fullyAnnotationConfigured=true as an annotation processing property for the affected projects. This bypasses any XML processing in JPAMetaModelEntityProcessor.init().
Comment 2 Walter Harley CLA 2017-07-06 17:52:48 EDT
I don't think this has anything to do with APT as such; APT is just loading processors like it's supposed to.  The error is either with your project configuration or with your installed bundles.  This bug probably needs to be reassigned to whatever component owns the Hibernate JPA processor.

The stack suggests that:
1. annotation processing is active.
2. org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor is being found on the annotation processing classpath.
3. that processor is initializing and trying to load schema.
4. it is failing to parse its schema, and trying to produce an error message.
5. it is failing when trying to format the error message, because of a missing bundle.

So I think there are two questions that you might want to look into.  First, how come org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor is on the annotation processor classpath?  It doesn't sound like you're trying to use it, so I'm wondering why it's there at all.  Does your project have an unintended facet?

Second, given that you clearly have many org.apache.xerces classes in the annotation processor classpath, how come it's not finding org.apache.xerces.impl.msg.XMLSchemaMessage?  What bundle should that be part of, and why do you have some but not all of the Xerces bundles?
Comment 3 Eclipse Genie CLA 2020-05-13 19:10:50 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.