Hey Guys,
I am bit confused with Service-mix class-loaders in 4.2. Although I read
this http://servicemix.apache.org/classloaders.html
here's what I am doing:
We are using shared library and referring the shared library in Service
Units as below.
In my xbean.xml of my SU.
<classpath>
<library>eqcache</library>
</classpath>
eqcache is installed as shared library.
Now my rest of the settings in xbean.xml for Hibernate SessionFactory are as
below.
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<!-- <property name="dataSource" ref="dartDataSource"/> -->
<property name="hibernateProperties">
<props>
<prop
key="hibernate.connection.driver_class">com.mysql.jdbc.Driver</prop>
<prop
key="hibernate.connection.url">jdbc:mysql://192.168.5.511234/lic_training_20023423110
</prop>
<prop
key="hibernate.connection.username">ssasdas</prop>
<prop
key="hibernate.connection.password">asdasds</prop>
<prop
key="hibernate.dialect">org.hibernate.dialect.MySQLDialect
</prop>
<prop key="hibernate.show_sql">true</prop>
<prop
key="hibernate.bytecode.use_reflection_optimizer">true</prop>
<prop key="hibernate.use_outer_join">true</prop>
<prop
key="hibernate.statement_cache.size">2000</prop>
<prop key="hibernate.max_fetch_depth">5</prop>
<prop key="hibernate.jdbc.batch_size">0</prop>
<prop
key="hibernate.connection.autocommit">false</prop>
<!--
Set the release mode to auto, so that
the DB connections are
released as soon as the transaction is
complete.
-->
<prop
key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
<property name="lobHandler" ref="defaultLobHandler" />
</bean>
In the above properties when I deploy my SU notice the driver class in bold.
I get the error
java.sql.SQLException: No suitable driver found for
jdbc:mysql://192.168.5.51/lic_training_200110
I tried Changing a few things and I came to know Classloader is unable to
load driver class and it searches for driver class in eqcache which is my
shared library and if I add driver dependency in my shared library
everything works not sure why though??
--
View this message in context:
http://servicemix.396122.n5.nabble.com/Service-mix-classLoader-Issues-when-combined-with-shared-library-tp1044933p1044933.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.