<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<base href="https://hibernate.atlassian.net">
<title>Message Title</title>
</head>
<body class="jira" style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429">
<table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0" bgcolor="#f5f5f5">
<!-- header here -->
<tbody>
<tr>
<td id="header-pattern-container" style="padding: 0; border-collapse: collapse; padding: 10px 20px">
<table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0">
<tbody>
<tr>
<td id="header-avatar-image-container" valign="top" style="padding: 0; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px" width="32"> <img id="header-avatar-image" class="image_fix" src="https://avatar-cdn.atlassian.com/557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b?by=id&sg=VKY%2FyE4BMfcMsTv5IGLd1kPPynU%3D&d=https%3A%2F%2Favatar-management--avatars.us-west-2.prod.public.atl-paas.net%2Finitials%2FYR-6.png&size=48&s=48" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"> </td>
<td id="header-text-container" valign="middle" style="padding: 0; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="yrodiere" style="color:#6c797f;; color: #3b73af; text-decoration: none" id="email_yrodiere" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b"> Yoann Rodière </a> <strong>updated</strong> an issue </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td id="email-content-container" style="padding: 0; border-collapse: collapse; padding: 0 20px">
<table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; border-spacing: 0; border-collapse: separate">
<tbody>
<tr>
<!-- there needs to be content in the cell for it to render in some clients -->
<td class="email-content-rounded-top mobile-expand" style="padding: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 15px; background-color: #ffffff; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly" height="10" bgcolor="#ffffff"> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff">
<table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0">
<tbody>
<tr>
<td class="page-title-pattern-first-line " style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; padding-top: 10px"> <a href="https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjY1MjQ4Y2UxMGEyNDczMWI1MDFiN2FhYmM1YWNmNTciLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none">Hibernate ORM</a> / <a href="https://hibernate.atlassian.net/browse/HHH-13409?atlOrigin=eyJpIjoiMjY1MjQ4Y2UxMGEyNDczMWI1MDFiN2FhYmM1YWNmNTciLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-ce843111-47bc-4aa3-9526-005ad913db86" height="16" width="16" border="0" align="absmiddle" alt="Bug" style="vertical-align: text-bottom"></a> <a href="https://hibernate.atlassian.net/browse/HHH-13409?atlOrigin=eyJpIjoiMjY1MjQ4Y2UxMGEyNDczMWI1MDFiN2FhYmM1YWNmNTciLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none">HHH-13409</a> </td>
</tr>
<tr>
<td style="vertical-align: top;; padding: 0; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HHH-13409?atlOrigin=eyJpIjoiMjY1MjQ4Y2UxMGEyNDczMWI1MDFiN2FhYmM1YWNmNTciLCJwIjoiaiJ9" style="color: #3b73af; text-decoration: none">Hibernate ORM does not detect services provided by libraries in the module path</a> </span> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand wrapper-special-margin" style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 10px; padding-bottom: 5px" bgcolor="#ffffff">
<table class="keyvalue-table" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0">
<tbody>
<tr>
<th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Change By:</th>
<td style="padding: 0; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <a class="user-hover" rel="yrodiere" style="color:#6c797f;; color: #3b73af; text-decoration: none" id="email_yrodiere" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A58fa1ced-171a-4c00-97e8-5d70d442cc4b"> Yoann Rodière </a> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand issue-description-container" style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 5px; padding-bottom: 10px" bgcolor="#ffffff">
<table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px">
<tbody>
<tr>
<td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0; border-collapse: collapse; padding: 0 0 10px"> <span class="diffcontext">Classifying this as a bug because it effectively prevents from using Hibernate ORM in a modular environment beyond the very simple use cases, even though we did some work to make Hibernate ORM usable, as an automatic module.<br><br>In short, when a user deploys an application in the module path, they have no choice but to only ever use modules. As a result, they will use Hibernate ORM as an automatic module, and more importantly they will also use other libraries, such as Hibernate Search, as automatic modules. They simply cannot leave those in the classpath: they couldn't access them.<br><br>The problem is, as soon as other libraries are in the module path, Hibernate ORM seems unable to detect their declared services.<br><br>I investigated a bit, and the problem is not that automatic modules cannot declare services or use services from other modules (that works just fine), it's really only Hibernate ORM that fails to load the modules. You can see this live in this reproducer: https://github.com/yrodiere/java-module-sandbox/<br><br>Just clone it, set JDK11 as your default JDK, and run {{mvn clean install}}.<br><br>You'll see this in the logs:<br><br>{noformat}<br> [exec] ======================================================<br> [exec] STARTING EXECUTION <br> [exec] ======================================================<br> [exec] <br> [exec] <br> [exec] module { name: org.hibernate.sandbox.java.service.provider@1.0-SNAPSHOT, [mandated java.base], provides: [org.hibernate.sandbox.java.service.consumer.MyService with [org.hibernate.sandbox.java.service.provider.MyServiceImpl]] }<br> [exec] module { name: org.hibernate.search.util.common@6.0.0-SNAPSHOT, [mandated java.base] }<br> [exec] module { name: org.hibernate.search.mapper.pojo@6.0.0-SNAPSHOT, [mandated java.base] }<br> [exec] module { name: org.hibernate.search.engine@6.0.0-SNAPSHOT, [mandated java.base] }<br> [exec] module { name: org.hibernate.sandbox.java.main@1.0-SNAPSHOT, [org.hibernate.orm.core, org.hibernate.search.mapper.orm, mandated java.base (@11.0.3), net.bytebuddy, java.xml.bind, java.sql (@11.0.3), java.naming (@11.0.3), h2, org.hibernate.sandbox.java.service.consumer], exports: [org.hibernate.sandbox.java.main] }<br> [exec] module { name: org.hibernate.search.mapper.orm@6.0.0-SNAPSHOT, [mandated java.base], provides: [org.hibernate.service.spi.ServiceContributor with [org.hibernate.search.mapper.orm.impl.HibernateSearchContextServiceContributor], org.hibernate.integrator.spi.Integrator with [org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchIntegrator]] }<br> [exec] module { name: org.hibernate.orm.core@5.4.2.Final, [mandated java.base], provides: [javax.persistence.spi.PersistenceProvider with [org.hibernate.jpa.HibernatePersistenceProvider]] }<br> [exec] module { name: org.hibernate.commons.annotations@5.1.0.Final, [mandated java.base] }<br> [exec] module { name: org.hibernate.sandbox.java.service.consumer@1.0-SNAPSHOT, [mandated java.base] }<br> [exec] <br> [exec] <br> [exec] ===== RESULT:<br> [exec] My services loaded from consumer module (automatic module without module-info.java): <br> [exec] [org.hibernate.sandbox.java.service.provider.MyServiceImpl]<br> [exec] <br> [exec] <br> [exec] ===== RESULT:<br> [exec] Hibernate ORM services loaded from consumer module (automatic module without module-info.java): <br> [exec] [org.hibernate.search.mapper.orm.bootstrap.impl.HibernateSearchIntegrator@5f3a4b84, org.hibernate.search.mapper.orm.impl.HibernateSearchContextServiceContributor@27f723]<br> [exec] <br> [exec] <br> [exec] Booting Hibernate ORM service registry...<br> [exec] May 23, 2019 10:05:17 AM org.hibernate.Version logVersion<br> [exec] INFO: HHH000412: Hibernate Core {[WORKING]}<br> [exec] Finished booting Hibernate ORM service registry.<br> [exec] <br> [exec] <br> [exec] ===== RESULT:<br> [exec] Hibernate services loaded from Hibernate ORM module by bootstrapping a service registry only: <br> [exec] [org.hibernate.cfg.beanvalidation.BeanValidationIntegrator@22eeefeb, org.hibernate.secure.spi.JaccIntegrator@64485a47, org.hibernate.cache.internal.CollectionCacheInvalidator@77846d2c]<br> [exec] <br> [exec] <br> [exec] Booting Hibernate ORM session factory...<br> [exec] May 23, 2019 10:05:17 AM org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit><br> [exec] INFO: HCANN000001: Hibernate Commons Annotations {5.1.0.Final}<br> [exec] May 23, 2019 10:05:17 AM org.hibernate.engine.jdbc.connections.internal.ConnectionProviderInitiator initiateService<br> [exec] WARN: HHH000181: No appropriate connection provider encountered, assuming application will be supplying connections<br> [exec] May 23, 2019 10:05:17 AM org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator initiateService<br> [exec] WARN: HHH000342: Could not obtain connection to query metadata : The application must supply JDBC connections<br> [exec] May 23, 2019 10:05:17 AM org.hibernate.dialect.Dialect <init><br> [exec] INFO: HHH000400: Using dialect: org.hibernate.dialect.H2Dialect<br> [exec] May 23, 2019 10:05:18 AM org.hibernate.engine.transaction.jta.platform.internal.JtaPlatformInitiator initiateService<br> [exec] INFO: HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]<br> [exec] Finished booting Hibernate ORM session factory.<br> [exec] <br> [exec] <br> [exec] ===== RESULT:<br> [exec] Hibernate services loaded from Hibernate ORM module by bootstrapping a whole session factory: <br> [exec] [org.hibernate.cfg.beanvalidation.BeanValidationIntegrator@36916eb0, org.hibernate.secure.spi.JaccIntegrator@7bab3f1a, org.hibernate.cache.internal.CollectionCacheInvalidator@437da279]<br> [exec] <br> [exec] <br> [exec] ======================================================<br> [exec] ENDING EXECUTION <br> [exec] ======================================================<br>{noformat}<br><br>What's important here are the information below the "RESULT" lines:<br><br># The first one</span> <span class="diffremovedchars" style="background-color: #ffe7e7; text-decoration:line-through;"> demonstrate</span> <span class="diffaddedchars" style="background-color:#ddfade;"> demonstrates</span> <span class="diffcontext"> that an automatic module can load services provided by another automatic module. I created custom modules just for that.<br># The second one</span> <span class="diffremovedchars" style="background-color: #ffe7e7; text-decoration:line-through;"> demonstrate</span> <span class="diffaddedchars" style="background-color:#ddfade;"> demonstrates</span> <span class="diffcontext"> that an automatic module can load services provided by Hibernate Search used as an automatic module.<br># The third and fourth ones demonstrate that Hibernate ORM does not see Hibernate Search services when booted as an automatic module. Interestingly, libraries that stay in the classpath (because the application does not use them directly) have their services correctly detected.<br><br>I think the root cause of the problem may have something to do with how ORM uses an aggregated classloader.<br><br>Indeed, I've also experienced {{NoClassDefFoundError}} in my modular application, and I had to declare dependencies from my application to other modules such as {{java.xml.bind}}, even though my application doesn't use those: only Hibernate ORM does. There is something fishy here...<br><br>Related: HSEARCH-3551</span> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> <script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"description": "View Issue",
"potentialAction": {
"@type": "ViewAction",
"target": "https://hibernate.atlassian.net/browse/HHH-13409?inbox=true&",
"name": "View Issue"
},
"publisher": {
"@type": "Organization",
"name": "Atlassian",
"url": "https://www.atlassian.com"
}
}
</script>
<table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px">
<tbody>
<tr>
<td id="actions-pattern-container" valign="middle" style="padding: 0; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0">
<table align="left" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0">
<tbody>
<tr>
<td class="actions-pattern-action-icon-container" style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HHH-13409#add-comment?atlOrigin=eyJpIjoiMjY1MjQ4Y2UxMGEyNDczMWI1MDFiN2FhYmM1YWNmNTciLCJwIjoiaiJ9" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-116becb6-913f-4d51-bb61-11f9e69ea22a" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle"> </a> </td>
<td class="actions-pattern-action-text-container" style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="https://hibernate.atlassian.net/browse/HHH-13409#add-comment?atlOrigin=eyJpIjoiMjY1MjQ4Y2UxMGEyNDczMWI1MDFiN2FhYmM1YWNmNTciLCJwIjoiaiJ9" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> </td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table> </td>
</tr>
<!-- there needs to be content in the cell for it to render in some clients -->
<tr>
<td class="email-content-rounded-bottom mobile-expand" style="padding: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #ffffff; border-top: 0; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly" height="5" bgcolor="#ffffff"> </td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td id="footer-pattern" style="padding: 0; border-collapse: collapse; padding: 12px 20px">
<table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0">
<tbody>
<tr>
<td id="footer-pattern-mobile-separated-links" class="mobile-resize-text" width="100%" colspan="2" style="padding: 0; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> Get Jira notifications on your phone! Download the Jira Cloud app for <a href="https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail" style="color: #3b73af; text-decoration: none">Android</a> or <a href="https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8" style="color: #3b73af; text-decoration: none">iOS</a>
<hr> </td>
</tr>
<tr>
<td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> This message was sent by Atlassian Jira <span id="footer-build-information">(v1001.0.0-SNAPSHOT#100102-<span title="6aed351483f51db19e92c7372d0e9846145371c5" data-commit-id="6aed351483f51db19e92c7372d0e9846145371c5}">sha1:6aed351</span>)</span> </td>
<td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0; border-collapse: collapse; padding-left: 20px; vertical-align: top">
<table style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0">
<tbody>
<tr>
<td id="footer-pattern-logo-desktop-padding" style="padding: 0; border-collapse: collapse; padding-top: 3px; opacity: 0.150"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-0830d5e5-4f88-491b-ac3b-fddc4cb455af" alt="Atlassian logo" title="Atlassian logo" width="192" height="24" class="image_fix"> </td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table> </td>
</tr>
</tbody>
</table>
<img border="0" width="1" height="1" alt="" src="http://atlassian.et.e.sparkpost.com/q/3Bs0J0vVLjA8nv8zpuBvsw~~/AAAAAQA~/RgRex4x6PlcLYXRsYXNzaWFudXNCCgAA-ljmXNwL7TlSIGhpYmVybmF0ZS1pc3N1ZXNAbGlzdHMuamJvc3Mub3JnWAQAAAAE">
</body>
</html>