Hey guy,
I looked into http://www.liquibase.org/documentation/cdi.html and have some trouble with this code. My Resource is always null. Well I expected it to be null.
I played around with it and declaring the thing to an EJB works fine. Should we update the documentation or do I miss simply something
- @Stateless
- public class LiquibaseProducer {
- @Resource(name = "jdbc/easyScrum")
- private DataSource myDataSource;
- @Produces @LiquibaseType
- public CDILiquibaseConfig createConfig() {
- CDILiquibaseConfig config = new CDILiquibaseConfig();
- config.setChangeLog("/changelog.xml");
- return config;
- }
- @Produces @LiquibaseType
- public DataSource createDataSource() throws SQLException, NamingException {
- if (myDataSource == null) throw new IllegalStateException("Missing jdbc/easyScrum in container!");
- return myDataSource;
- }
- @Produces @LiquibaseType
- public ResourceAccessor create() {
- return new ClassLoaderResourceAccessor(getClass().getClassLoader());
- }
I get also the anoing error im my glassfish:
No valid EE environment for injection of liquibase.integration.cdi.CDILiquibase
And a lot of Spring class not found … well of course not it is a JEE project and not Spring.
Does this make sense?
Cheers,
Paul