I think that's a Hibernate (JPA implementation) thing rather than the application server log. Perhaps the hibernate forums might be a better place for this.
There is only hint that can be found by activating TRACE logging for "org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl" (and probably DEBUG for "org.hibernate.tool.hbm2ddl.SchemaExport"): there are 4 places where this file is searched.
If your log contains those lines, the file was not found:
21:02:55,379 TRACE [org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl] trying via [new URL("/import.sql")]
21:02:55,379 TRACE [org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl] trying via [ClassLoader.getResourceAsStream("/import.sql")]
21:02:55,383 TRACE [org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl] trying via [new URL("import.sql")]
21:02:55,383 TRACE [org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl] trying via [ClassLoader.getResourceAsStream("import.sql")]
21:02:55,385 DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] Import file not found: /import.sql
If the log ends after one of the first 4 "trying via" messages and there is no finale message "Import file not found", the file was found ;-).
Is this still an issue with latest versions of WildFly? If so, can you attach a sample application which reproduces this?
yes, there is still no status report with WildFly 10 CR5.
Attached is my sample. It also contains some security related stuff, so unfortunately you have to add two snippets to "standalone.xml":
A security realm:
A security domain:
<security-domain name="knaufsecurity" cache-type="default">
<login-module code="Database" flag="required">
<module-option name="dsJndiName" value="java:jboss/datasources/ExampleDS"/>
<module-option name="principalsQuery" value="SELECT PASSWORT FROM BENUTZER WHERE LOGIN=?"/>
<module-option name="rolesQuery" value="SELECT R.ROLLE, 'Roles' FROM ROLLE AS R, BENUTZER_ROLLE AS BR, BENUTZER AS B WHERE B.LOGIN=? AND BR.ROLLEN_ID = R.ID AND BR.BENUTZER_ID = B.ID"/>
I think you forgot to attach the sample application
I just had a quick look and it appears that the import scripts are executed fine after being picked up. It's just that their names aren't logged when they are being executed.
Wolfgang Knauf wrote:
This one line "Executing import script..." is quite helpful, because it is the only hint that the file was placed in the correct location and that it is processed at all ;-)
I just submitted a pull request to the hibernate project to add this log message Log a message while executing the import script(s) by jaikiran · Pull Request #1200 · hibernate/hibernate-orm · GitHub. If the Hibernate team accepts it, it should be available whenever they release next.
Perfect, many thanks!
I can confirm that it works perfectly in WildFly 10.0.0.Final.