Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » WLS 12.2.1 with TopLink and weird Exception(URI scheme is not "file")
WLS 12.2.1 with TopLink and weird Exception [message #1759047] Wed, 05 April 2017 14:53
Michael Saladin is currently offline Michael SaladinFriend
Messages: 1
Registered: April 2017
Junior Member
Hi all,

For a web-application I updated the application server WLS to 12.2.1 which is using TopLink for JPA and JAXB, and as I understand it, TopLink is actually using EclipseLink underneath.

The web application has a problem with the new version of WLS 12.2.1: it worked fine with earlier versions. The web application is using a lot of validation, so we have the following setup:

1) EAR file with WAR files
2) Inside the EAR files, we have JAR files
3) Inside one of the JAR file, we have a META-INF/validation.xml file

As far as I understand, this should work fine. It even works because in WLS we try to use JAXB from the application (and not from WLS), so by using the WLS feature "<prefer-application-packages>" everything works fine when we do some constraint validation in the GUI (by including org.hibernate:hibernate-validator into the WAR).

The problem happens when we invoke a JAXWS client (from the WAR), and this JAXWS client seems to ignore all our fancy WLS-change-of-classloader-magic and uses TopLink for validation. Nevertheless, in the end I get the following exception in the logfile:

WARNING: Error parsing validation.xml the async way
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: URI scheme is not "file"


In the end of the stacktrace, I see that the problem happens in class org.eclipse.persistence.jaxb.ValidationXMLReader:

/*     */   private void parseValidationXML() throws SAXException, IOException, URISyntaxException {
/* 145 */     URL validationXml = Thread.currentThread().getContextClassLoader().getResource("META-INF/validation.xml");
/* 146 */     if (validationXml != null) {
/* 147 */       getSaxParser().parse(new File(validationXml.toURI()), this.validationHandler);
/*     */     }
/*     */   }


I can even reproduce it very easily:

The URL.toString is: zip:/local/saladin/wls12/weblogic/12.2.1.0.0/domains/XXXX/servers/AdminServer/tmp/_WL_user/xxxx-application_1.5.5_dev-SNAPSHOT/s86txs/lib/xxx-xxxx-xxxxdatamodel-1.5.5_dev-SNAPSHOT.jar!/META-INF/validation.xml

And when I do:
new File(theAboveUrl.toURI())

I get the same exception, because this is not a file but seemingly a ZIP-file. So my question to you is:

1) Is this a bug in EclipseLink? IMHO validation.xml should never be a file, but always a Stream?

2) I do not really understand why the same web application uses once the hibernate-validator library for validation, but then, in the same session, it is using TopLink for validation. Is there some kind of switch where to once-and-for-all define from an application POV which implementation to use and not rely on some classloader-magic which seems to be overly complex and not work.

Actually, the exception seems to be on a warning level only, because the JAXWS client call is really working, so somewhere this kind of exceptions are caught, written to the logfile as warning, and then continued.

Thanks a lot, I appreciate any help in this.

Michael

2017-04-05 16:20:39,224 [Default (self-tuning)'] INFO c.a.s.e.s.n.service.IdmClient - saladinsaladin: Before adminService.queryUsers: zip:/local/saladin/wls12/weblogic/12.2.1.0.0/domains/smc-elvis/servers/AdminServer/tmp/_WL_user/smc-elvis-application_1.5.5_dev-SNAPSHOT/s86txs/lib/smc-elvis-e2bdatamodel-1.5.5_dev-SNAPSHOT.jar!/META-INF/validation.xml

Previous Topic:Do we have commercial support for eclipselink?
Next Topic:BatchFetch examples?
Goto Forum:
  


Current Time: Tue Mar 19 09:40:32 GMT 2024

Powered by FUDForum. Page generated in 0.02468 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top