You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I was developing something using wro4j and noted that it started giving me this exception:
Jul 29, 2014 12:37:16 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [default] in context with path [] threw exception [Filter execution threw an exception] with root cause
java.lang.ClassNotFoundException: groovy.lang.GroovyShell
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
at ro.isdc.wro.extensions.model.factory.GroovyModelFactory.create(GroovyModelFactory.java:64)
at ro.isdc.wro.extensions.model.factory.GroovyModelFactory.create(GroovyModelFactory.java:42)
at ro.isdc.wro.model.factory.LazyWroModelFactoryDecorator.create(LazyWroModelFactoryDecorator.java:28)
[...]
After a while trying to figure it out, I turned on WRO's debug option and found out the real error was this one:
00:37:16,388 DEBUG [SmartWroModelFactory] [FAIL] creating model... will try another factory: {}
org.xml.sax.SAXParseException; cvc-id.2: There are multiple occurrences of ID value 'user-list'.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:437)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:325)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:458)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3237)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processOneAttribute(XMLSchemaValidator.java:2832)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2769)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2056)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:746)
at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277)
at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244)
at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190)
at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109)
at javax.xml.validation.Validator.validate(Validator.java:124)
at ro.isdc.wro.model.factory.XmlModelFactory.validate(XmlModelFactory.java:215)
at ro.isdc.wro.model.factory.XmlModelFactory.createDocument(XmlModelFactory.java:199)
at ro.isdc.wro.model.factory.XmlModelFactory.create(XmlModelFactory.java:167)
at ro.isdc.wro.model.factory.XmlModelFactory.create(XmlModelFactory.java:56)
[...]
Meaning the XML itself is invalid, having two <group> tags with the same name - but the error thrown by wro was about not being able to find Groovy o_O
It doesn't fail there because at SmartWroModelFactory:195 you expect a WroRuntimeException, which in turn is never expected/thrown at XmlModelFactory:215. God (and prob you, hehe) knows why this ends up with a "GroovyShell not found" exception :P
A quick solution would be to change it to:
try {
schema.newValidator().validate(newDOMSource(document));
} catch (SAXParseExceptionspe) {
thrownewWroRuntimeException("Invalid wro.xml, please check it for errors like repeated ID's, malformed XML or something like that", spe);
}
Last but not least, congrats for maintaining this amazing project! It really grown into something incredibly useful!
The text was updated successfully, but these errors were encountered:
Yeah, the SmartWroModelFactory is not so smart after all :)... I would gladly deprecate this feature and would keep things simpler: less is more. Some of the features cause more problems than the benefit they bring....
Hi! I was developing something using wro4j and noted that it started giving me this exception:
After a while trying to figure it out, I turned on WRO's debug option and found out the real error was this one:
Meaning the XML itself is invalid, having two
<group>
tags with the samename
- but the error thrown by wro was about not being able to find Groovy o_OIt doesn't fail there because at
SmartWroModelFactory:195
you expect aWroRuntimeException
, which in turn is never expected/thrown atXmlModelFactory:215
. God (and prob you, hehe) knows why this ends up with a "GroovyShell not found" exception :PA quick solution would be to change it to:
Last but not least, congrats for maintaining this amazing project! It really grown into something incredibly useful!
The text was updated successfully, but these errors were encountered: