jcabi-github icon indicating copy to clipboard operation
jcabi-github copied to clipboard

validation.xml ?

Open oliviercailloux opened this issue 7 years ago • 5 comments

Hi,

What’s the file validation.xml for in META-INF in jcabi-aspects-0.22.5.jar?

That file makes Glassfish refuse to deploy my application (which includes jcabi-github, hence, jcabi-aspects by transitive dependency mechanisms).

Glassfish complains when deploying (in its log file), as follows (partial).

[2018-02-05T00:33:49.083+0100] [glassfish 4.1] [INFO] [] 
 [org.hibernate.validator.internal.xml.ValidationXmlParser]
 [tid: _ThreadID=44 _ThreadName=AutoDeployer]
 [timeMillis: 1517787229083] [levelValue: 800] [[
  HV000007: META-INF/validation.xml found. Parsing XML based configuration.]]

[2018-02-05T00:33:49.104+0100] [glassfish 4.1] [WARNING] [] 
 [org.glassfish.jersey.internal.Errors] 
 [tid: _ThreadID=44 _ThreadName=AutoDeployer]
 [timeMillis: 1517787229104] [levelValue: 900] [[
 The following warnings have been detected: WARNING: Unknown HK2 failure detected:
 MultiException stack 1 of 1
 org.apache.xerces.impl.dv.ObjectFactory$ConfigurationError: 
 Provider org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl could not be instantiated: 
 java.lang.IllegalStateException: This web container has not yet been started

(I ask here rather than in jcabi-aspects because this bug hits me as a user of jcabi-github, and possible solutions might be available because of this. Sorry if it is inappopriate.)

oliviercailloux avatar Feb 04 '18 23:02 oliviercailloux

@yegor256/z please, pay attention to this issue

0crat avatar Feb 04 '18 23:02 0crat

@oliviercailloux this file is coming from Hibernate, I believe. I think you should just add Hibernate Validator to classpath and the problem will disappear. We can't remove the file...

yegor256 avatar Feb 05 '18 15:02 yegor256

Sorry to insist, but are you sure you can’t remove the file? According to jcabi-aspects pom, hibernate-validator is used only as a test dependency. Thus, I suspect that the validator.xml file is required only for the tests. Would you perhaps consider moving it from src/main/resources/META-INF to src/test/resources/META-INF?

It would be good not to export validator.xml in the produced artifact, as not only does it introduce complications in Java EE projects (such as in my case), but also, this file will conflict with a user supplied validator file if a user of jcabi-aspects wishes to use one.

oliviercailloux avatar Feb 06 '18 17:02 oliviercailloux

@oliviercailloux I will also have a look over this, soon. It's strange, I never had issues with jcabi-github on Glassfish. I have 2 JavaEE apps using it. I only had issues with that Manifest.MF stuff (not sure if you know about that bug)

amihaiemil avatar Mar 15 '18 08:03 amihaiemil

Thanks. But, TBH, I switched to Graph QL in the meantime, for most of my queries, and use a home backed fetcher for the rest. So don’t feel compelled to look into this bug for me…

oliviercailloux avatar Mar 16 '18 18:03 oliviercailloux