Element <cache> does not allow nested <searchable> elements - java

When I am trying to use ehcache with an old war, I am getting the following error in JBoss 7.1.0EAP server:
Caused by: net.sf.ehcache.CacheException: Error configuring from input stream. Initial cause was null:10: Element <cache> does not allow nested <searchable> elements.
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:157)
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:101)
... 94 more
Caused by: org.xml.sax.SAXException: null:10: Element <cache> does not allow nested <searchable> elements.
at net.sf.ehcache.config.BeanHandler.createChild(BeanHandler.java:121)
at net.sf.ehcache.config.BeanHandler.startElement(BeanHandler.java:73)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.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.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:155)
... 95 more
My pom.xml has the following
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.4.5</version>
</dependency>
What am I doing wrong

Related

How do you configure the spring integration poller after XSD changes have invalidated the fixed-delay and fixed-rate attributes?

Original xml:
<int:poller default="true" task-executor="stepTaskExecutor" fixed-delay="1000">
The fixed-delay attribute is no longer legal, and fails XML parsing in the (eclipse) IDE.
Alternative configuration:
An alternative suggested elsewhere (including https://docs.spring.io/spring-integration/docs/2.0.0.M3/spring-integration-reference/html/samples.html):
<!-- Globally scoped Spring Integration bean resources -->
<!-- see https://stackoverflow.com/questions/73450768/how-to-configure-channels-and-amq-for-spring-batch-integration-where-all-steps-a/73455134#73455134 -->
<!-- see https://stackoverflow.com/questions/28625635/attribute-fixed-rate-is-not-allowed-to-appear-in-element-intpoller -->
<int:poller default="true" task-executor="stepTaskExecutor">
<int:interval-trigger interval="1000"/>
</int:poller>
This passes the XML parsing in the IDE, but fails at runtime
Log snip:
Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'int:interval-trigger'. One of '{"http://www.springframework.org/schema/integration":transactional, "http://www.springframework.org/schema/integration":advice-chain}' is expected.
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.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.reportSchemaError(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.xs.XMLSchemaValidator.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(Unknown Source)
at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.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.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:432)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
... 50 common frames omitted
Please advise.
Use Spring Tool Suite (eclipse), or add the spring tools plugin to your eclipse so that the schema is loaded from the jar file instead of from the internet.
https://spring.io/tools

Spring app runs in eclipse, not on jvm outside eclipse

Okay, this is weird. I have a regular java console application. It uses spring and hibernate and works as expected when is do Run As... from inside eclipse. When I package a runnable JAR with all the dependencies and export that, it fails while initializing the spring context with the below exception.
I strongly suspect that the difference is that because I work for the government, our security folks must have an exception that allows eclipse to go to the internet and get the xsd, while the jvm outside eclipse does not. I confirmed this using curl...it cannot get the xsd, being rejected by the firewall.
There's no chance I'm going to get a firewall exception as it's very bureaucratic and they are inclined to say 'no' unless you have a really compelling reason. I found an article talking about putting the xsd's local in meta-inf, but that seems aimed as web projects. Mine is a console app. I'm not sure how to do something similar in the console project.
I tried just creating a meta-inf directory off the root and adding it to the classpath, but that didn't work. So how can i get spring to consume local copies of the xsd files in a console application?
WARNING: Ignored XML validation warning
org.xml.sax.SAXParseException; lineNumber: 22; columnNumber: 115; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/beans/spring-beans-3.0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaWarning(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument1(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:77)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadDocument(XmlBeanDefinitionReader.java:428)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:335)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:303)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:187)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:223)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:194)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:258)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:128)
at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:94)
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:621)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:522)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:144)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:85)
at gov.usdoj.afms.umc.cli.DoUmc.initializeSpring(DoUmc.java:191)
at gov.usdoj.afms.umc.cli.DoUmc.<init>(DoUmc.java:102)
at gov.usdoj.afms.umc.cli.DoUmc.main(DoUmc.java:77)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.http.HttpClient.New(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaParsingConfig.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.xs.opti.SchemaDOMParser.parse(Unknown Source)
... 37 more

XPath query in jlibs-xmldog throws NegativeArraySizeException

I have a project in which I try to run queries on XML files using in.jlibs.jlibs-xmldog.2.2.1.
The XPath that I'm using is
(//server[#id=123])[1]
and the file to be queried looks like this
<servers>
<server id="123" name="servername3">
<cpu_count>3</cpu_count>
<ram_gb>3</ram_gb>
<mac>aabbccaabbcc</mac>
<domain>test.internal</domain>
<ip>192.168.1.20</ip>
</server>
<server id="124" name="servername4">
<cpu_count>4</cpu_count>
<ram_gb>4</ram_gb>
<mac>aabbccaabbcc</mac>
<domain>test.internal</domain>
<ip>192.168.1.20</ip>
</server>
<server id="125" name="servername5">
<cpu_count>5</cpu_count>
<ram_gb>5</ram_gb>
<mac>aabbccaabbcc</mac>
<domain>test.internal</domain>
<ip>192.168.1.20</ip>
</server>
</servers>
As you can see, there is already only one result that is returned by the inner xpath statement, but I have some reasons for which I need to do the query like this. Anyway, the same behaviour happens if I have more results returned by the inner statement. I've tested the xpath online and it seems to be valid.
Code:
public static void main(String[] args) throws Exception{
final String filePath = "C:\\Users\\NCsorba\\Desktop\\xml\\sample_11433_entries.xml";
final String xPathExpression = "(//server[#id=123])[1]";
DefaultNamespaceContext namespaceContext = new DefaultNamespaceContext();
namespaceContext.declarePrefix("xsd", Namespaces.URI_XSD);
XMLDog xmlDog = new XMLDog(namespaceContext);
Expression compiledXPath = xmlDog.addXPath(xPathExpression);
XPathResults xPathResults = xmlDog.sniff(new InputSource(filePath)); // exception thrown
// System.out.println(xPathResults.getResult(compiledXPath));
}
Here is the stack trace:
Exception in thread "main" java.lang.NegativeArraySizeException
at jlibs.core.util.LongTreeMap$Values.toArray(LongTreeMap.java:534)
at java.util.ArrayList.<init>(ArrayList.java:178)
at jlibs.xml.sax.dog.expr.nodset.PathEvaluation.finished(PathExpression.java:218)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.fireFinished(LocationEvaluation.java:215)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.finished(LocationEvaluation.java:208)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.resultPrepared(LocationEvaluation.java:190)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.expired(LocationEvaluation.java:176)
at jlibs.xml.sax.dog.path.EventID.expireList(EventID.java:244)
at jlibs.xml.sax.dog.path.EventID.expire(EventID.java:230)
at jlibs.xml.sax.dog.path.EventID.pop(EventID.java:322)
at jlibs.xml.sax.dog.sniff.Event.firePop(Event.java:266)
at jlibs.xml.sax.dog.sniff.Event.pop(Event.java:712)
at jlibs.xml.sax.dog.sniff.Event.onEndDocument(Event.java:587)
at jlibs.xml.sax.dog.sniff.SAXHandler.endDocument(SAXHandler.java:75)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:189)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:174)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:205)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:212)
at com.hp.oo.content.actions.xml.Main.main(Main.java:24)
--------------- linked to ------------------
javax.xml.xpath.XPathException: java.lang.NegativeArraySizeException
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:192)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:174)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:205)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:212)
at com.hp.oo.content.actions.xml.Main.main(Main.java:24)
Caused by: java.lang.NegativeArraySizeException
at jlibs.core.util.LongTreeMap$Values.toArray(LongTreeMap.java:534)
at java.util.ArrayList.<init>(ArrayList.java:178)
at jlibs.xml.sax.dog.expr.nodset.PathEvaluation.finished(PathExpression.java:218)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.fireFinished(LocationEvaluation.java:215)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.finished(LocationEvaluation.java:208)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.resultPrepared(LocationEvaluation.java:190)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.expired(LocationEvaluation.java:176)
at jlibs.xml.sax.dog.path.EventID.expireList(EventID.java:244)
at jlibs.xml.sax.dog.path.EventID.expire(EventID.java:230)
at jlibs.xml.sax.dog.path.EventID.pop(EventID.java:322)
at jlibs.xml.sax.dog.sniff.Event.firePop(Event.java:266)
at jlibs.xml.sax.dog.sniff.Event.pop(Event.java:712)
at jlibs.xml.sax.dog.sniff.Event.onEndDocument(Event.java:587)
at jlibs.xml.sax.dog.sniff.SAXHandler.endDocument(SAXHandler.java:75)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:189)
... 4 more
--------------- linked to ------------------
javax.xml.xpath.XPathException: javax.xml.xpath.XPathException: java.lang.NegativeArraySizeException
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:176)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:205)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:212)
at com.hp.oo.content.actions.xml.Main.main(Main.java:24)
Caused by: javax.xml.xpath.XPathException: java.lang.NegativeArraySizeException
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:192)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:174)
... 3 more
Caused by: java.lang.NegativeArraySizeException
at jlibs.core.util.LongTreeMap$Values.toArray(LongTreeMap.java:534)
at java.util.ArrayList.<init>(ArrayList.java:178)
at jlibs.xml.sax.dog.expr.nodset.PathEvaluation.finished(PathExpression.java:218)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.fireFinished(LocationEvaluation.java:215)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.finished(LocationEvaluation.java:208)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.resultPrepared(LocationEvaluation.java:190)
at jlibs.xml.sax.dog.expr.nodset.LocationEvaluation.expired(LocationEvaluation.java:176)
at jlibs.xml.sax.dog.path.EventID.expireList(EventID.java:244)
at jlibs.xml.sax.dog.path.EventID.expire(EventID.java:230)
at jlibs.xml.sax.dog.path.EventID.pop(EventID.java:322)
at jlibs.xml.sax.dog.sniff.Event.firePop(Event.java:266)
at jlibs.xml.sax.dog.sniff.Event.pop(Event.java:712)
at jlibs.xml.sax.dog.sniff.Event.onEndDocument(Event.java:587)
at jlibs.xml.sax.dog.sniff.SAXHandler.endDocument(SAXHandler.java:75)
at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.load(Unknown Source)
at org.apache.xerces.impl.XMLEntityScanner.skipSpaces(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher.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.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at jlibs.xml.sax.dog.XMLDog.sniff(XMLDog.java:189)
... 4 more
I'll appreciate any help! Thanks!

Exception in plugin Android Support: SAXParseException; Premature end of file

After temporarily working on my project on a Mac, I updated my SVN again with the newly committed files on Windows.
When I click Run, it says "Initializing ADB...", it does not find my connected Android phone anymore, and it shows Internal IDE error in the top right corner of the screen. When I click on it, it shows the following error:
Premature end of file.
org.xml.sax.SAXParseException; Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(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.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at com.android.sdklib.devices.DeviceParser.parseImpl(DeviceParser.java:483)
at com.android.sdklib.devices.DeviceParser.parse(DeviceParser.java:455)
at com.android.sdklib.devices.DeviceManager.loadDevices(DeviceManager.java:649)
at com.android.sdklib.devices.DeviceManager.initSysImgDevices(DeviceManager.java:385)
at com.android.sdklib.devices.DeviceManager.initDevicesLists(DeviceManager.java:253)
at com.android.sdklib.devices.DeviceManager.getDevice(DeviceManager.java:184)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1579)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1479)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:373)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:411)
at com.android.tools.idea.avdmanager.AvdManagerConnection.initIfNecessary(AvdManagerConnection.java:159)
at com.android.tools.idea.avdmanager.AvdManagerConnection.getAvds(AvdManagerConnection.java:255)
at com.android.tools.idea.run.editor.DevicePicker$3.run(DevicePicker.java:234)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
org.xml.sax.SAXParseException; Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(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.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at com.android.sdklib.devices.DeviceParser.parseImpl(DeviceParser.java:483)
at com.android.sdklib.devices.DeviceParser.parse(DeviceParser.java:455)
at com.android.sdklib.devices.DeviceManager.loadDevices(DeviceManager.java:649)
at com.android.sdklib.devices.DeviceManager.initSysImgDevices(DeviceManager.java:385)
at com.android.sdklib.devices.DeviceManager.initDevicesLists(DeviceManager.java:253)
at com.android.sdklib.devices.DeviceManager.getDevice(DeviceManager.java:184)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1579)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1479)
at com.android.sdklib.internal.avd.AvdManager.<init>(AvdManager.java:373)
at com.android.sdklib.internal.avd.AvdManager.getInstance(AvdManager.java:411)
at com.android.tools.idea.avdmanager.AvdManagerConnection.initIfNecessary(AvdManagerConnection.java:159)
at com.android.tools.idea.avdmanager.AvdManagerConnection.getAvds(AvdManagerConnection.java:255)
at com.android.tools.idea.run.editor.DevicePicker$3.run(DevicePicker.java:234)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
org.xml.sax.SAXParseException; Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(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.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
at com.android.sdklib.devices.DeviceParser.parseImpl(DeviceParser.java:483)
at com.android.sdklib.devices.DeviceParser.parse(DeviceParser.java:455)
at com.android.sdklib.devices.DeviceManager.loadDevices(DeviceManager.java:649)
at com.android.sdklib.devices.DeviceManager.initSysImgDevices(DeviceManager.java:385)
at com.android.sdklib.devices.DeviceManager.initDevicesLists(DeviceManager.java:253)
at com.android.sdklib.devices.DeviceManager.getDevice(DeviceManager.java:184)
at com.android.sdklib.internal.avd.AvdManager.parseAvdInfo(AvdManager.java:1579)
at com.android.sdklib.internal.avd.AvdManager.buildAvdList(AvdManager.java:1479)
at com.android.sdklib.internal.avd.AvdManager.reloadAvds(AvdManager.java:725)
at com.android.tools.idea.avdmanager.AvdManagerConnection.getAvds(AvdManagerConnection.java:260)
at com.android.tools.idea.run.editor.DevicePicker$3.run(DevicePicker.java:234)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
I tried to delete the .idea folder, clear the cache, clean the project and restarted, but nothing seemed to work.
Any ideas?

Upgrading to Struts 2.3.15 - Convention Plugin cause crash on startup

I'm in the process of upgrading my Struts2 installation to 2.3.15. After adding the struts2-convention-plugin-2.3.15.jar my web-app fails to start. The relevant part of the exception listing is;
Caused by: Attribute "order" must be declared for element type "struts". - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:119)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1017)
... 16 more
Anyone got any idea what's going on?
EDIT:
The full trace is;
SEVERE: Exception sending context initialized event to listener instance of class org.apache.struts2.dispatcher.ng.listener.StrutsListener
Unable to load configuration. - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:502)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.listener.StrutsListener.contextInitialized(StrutsListener.java:46)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: Unable to load configuration. - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
... 10 more
Caused by: Unable to load jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1022)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:225)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 12 more
Caused by: Attribute "order" must be declared for element type "struts". - jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml:29:20
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:119)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1017)
... 16 more
Caused by: org.xml.sax.SAXParseException; systemId: jar:file:/H:/apache-tomcat-7.0.20/wtpwebapps/FaultmateGenesis-Server/WEB-INF/lib/struts2-convention-plugin-2.3.15.jar!/struts-plugin.xml; lineNumber: 29; columnNumber: 20; Attribute "order" must be declared for element type "struts".
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.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.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:117)
... 17 more
You should use the correct doctype in the struts.xml
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">

Categories

Resources