2 Replies Latest reply on Dec 11, 2008 3:57 AM by Lukasz Baran

    Hibernate + MySQL as bundles on Fuse ESB

    Lukasz Baran Newbie

      Hello All,

      Recently I have been playing with Fuse ESB 4.0.0.2 and with application that uses Hibernate for connecting to MySQL server.

      I have deployed Hibernate libraries and MySQL connector as bundles and they seem to work. However, my application throws following exception when it is trying to connect to database:

       

      14:43:07,177 | WARN  | Timer-1          | FileMonitor                      | x.kernel.filemonitor.FileMonitor  558 | Failed to start bundle: org.escapek.osgi.hibernate . Reason: org.osgi.framework.BundleException: Activator start error.

      org.osgi.framework.BundleException: Activator start error.

          at org.apache.felix.framework.Felix._startBundle(Felix.java:1651)

          at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)

          at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:371)

          at org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:554)

          at org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:301)

          at org.apache.servicemix.kernel.filemonitor.FileMonitor$1.filesChanged(FileMonitor.java:146)

          at org.apache.servicemix.kernel.filemonitor.Scanner.reportBulkChanges(Scanner.java:433)

          at org.apache.servicemix.kernel.filemonitor.Scanner.reportDifferences(Scanner.java:322)

          at org.apache.servicemix.kernel.filemonitor.Scanner.scan(Scanner.java:254)

          at org.apache.servicemix.kernel.filemonitor.Scanner$1.run(Scanner.java:214)

          at java.util.TimerThread.mainLoop(Timer.java:512)

          at java.util.TimerThread.run(Timer.java:462)

      Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.mysql.jdbc.ConnectionImpl

          at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)

          at java.sql.DriverManager.getConnection(DriverManager.java:582)

          at java.sql.DriverManager.getConnection(DriverManager.java:154)

          at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)

          at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:84)

          at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2073)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1298)

          at com.swmind.osgi.tutorial.InitSessionFactory.initSessionFactory(InitSessionFactory.java:100)

          at com.swmind.osgi.tutorial.InitSessionFactory.getInstance(InitSessionFactory.java:44)

          at com.swmind.osgi.tutorial.TestExample.createHoney(TestExample.java:80)

          at com.swmind.osgi.tutorial.TestExample.doStuff(TestExample.java:33)

          at com.swmind.osgi.tutorial.impl.Activator.start(Activator.java:38)

          at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:591)

          at org.apache.felix.framework.Felix._startBundle(Felix.java:1607)

       

      Does anyone knows what's happening?

       

      Thanks in advance,

       

      Lukasz Baran