There is a problem with deploying a BIRT web project when using
Hibernate. Hibernate classes can't be loaded from within the OSGi
framework because they have already been loaded with web classloader.
It is possible to solve this issue in several ways:
1) Using JNDI JDBC datasource.
It is necessary to create a separate session factory within OSGi; the
ODA plugin has to contain Hibernate libraries. In my opinion, this is
the worst solution and I skipped it.
2) Using JNDI SessionFactory and reflection.
The server has to bind the SessionFactory in JNDI, using
<property name="hibernate.session_factory_name"
value="java:/[ODA_DATASOURCE_NAME]"/>
in the persistence.xml file, for instance.
I have implemented this solution.
3) Creating a Session Facade Bean that would execute and analyze a query
for clients (BIRT OSGi engine)
This solution can be easily implemented, but requires an EJB environment.
4) Injecting web classloader into OSGi bundles using Adaptor Hooks
(
http://wiki.eclipse.org/index.php/Adaptor_Hooks). I haven't implemented
this method yet, but think that the problem can be solved this way. I
will try it ASAP.
I have committed the org.jboss.tools.birt.core plugin that fixes the
BIRT facet (see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=235206)
and changed the o.j.t.b.oda and o.j.t.b.oda.ui plugins in order to
implement solution #2.
Tested using Ganymede RC2.
Snjeza