Trying to develop a little application with the Netbeans-Platform I encountered a little problem with Netbeans module structure. Since I don't want to have the database module (Derby) included in the JPA-Provider module (Hibernate-Entitymanger) I tried to simply let the derby-module export the token "java.sql.Driver" and let the JPA-mdodule require that token. But this led to runtime exception, since the DriverManager inside of the JPA-module couldn't see the driver included in the derby-module.
Finally I wrote my own LookupConnectionProvider (implementing org.hibernate.connection.ConnectionProvider), which uses Netbeans Lookup mechanism to find the required driver. With this new connection provider no "hard" reference to the derby module is needed to let the JPA-module find the driver.
Finally I wrote my own LookupConnectionProvider (implementing org.hibernate.connection.ConnectionProvider), which uses Netbeans Lookup mechanism to find the required driver. With this new connection provider no "hard" reference to the derby module is needed to let the JPA-module find the driver.