1 of 1 people found this helpful
I don't know which versions are suggested by grails, but all the Hibernate libraries you have chosen are not designed to work together: you can't mix random libraries.
For sure you have to remove: hibernate-commons-annotations-3.2.0.Final.jar
For the others it depends on other framework requirements; generally I would advise you to not use JBoss AS6 anymore but take JBoss AS 7.1 or even better to go with JBoss EAP 6.1:
in these versions all the libraries you need (except hibernate-search) are already aligned, known to be compatible and tested together. If you take that the version of Hibernate Search you need is 4.2.0.Final.
a question from my side: in the documentation related to infinispan plugin for grails URLs provided to the created quick starts (demos) - the section Plugin Test / Demo Applications .
Have you tried them? I've tried the one for Grails 2.0 and it worked properly (although for the application from the scratch I had the same error as you).
Maybe you can compare the configuration files (BuildConfig.groovy, Config.groovy, Datasource.groovy) to see what's the difference between your implementation and the provided one.
I've decided to replace using the grails plugin with a direct dependency so I can have more control over the version of infinispan included and its dependencies. However even trying different versions I still get the same ClassNotFoundException even though the class is there.
The demo does not have the level 2 caching configuration, but when its changed I still get the same ClassNotFoundException. Just wondering did you get it working after making the required changed to DataSource.groovy (ie adding cache.region.factory_class='org.hibernate.cache.infinispan.InfinispanRegionFactory'). What version of Grails did you use?
I've tried the demo for Grails < 2.0.0 (there the Datasource.groovy is changed properly). I've tried the demo with grails 1.3.7 and it worked like a charm. But for another demo, you are right - it still throws ClassNotFoundException, which I can't tell why it happens.
Anyway, I liked the idea of including the infinispan dependency directly into application as this way you will not be dependent on the plugin impl (plugin was not developed by us so I can't say why and what is wrong there).
Definetly the exception tells that the application doesn't see the hibernate-infinispan library. But should you add it as a dependency in BuildConfig.groovy or something else, I don't know.