Hi!

I'm trying to import h2-latest.jar in an existing OSGi (Eclipse) bundle. 
I've simply added the jar file to my project and added it to Java build 
path. While there are no problems at compiation time with this code in my 
bundle Activator:

        JdbcDataSource ds = new JdbcDataSource();
        ds.setURL("jdbc:h2:˜/test");
        ds.setUser("sa");
        ds.setPassword("sa");
        Connection conn = ds.getConnection();

When executed I'm getting NFE:

Caused by: java.lang.ClassNotFoundException: org.h2.jdbcx.JdbcDataSource
    at 
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
    at 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
    at 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
    at 
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:268)

That said...what I'm missing here? I've seen in the docs that the jar 
itself can be used as a bundle, but I don't want to try this yet, I don't 
need that all the rest of bundles can access the embedded database, the one 
I'm creating will act as a Facade to the data itself.

Any clues?

Thanks!
Alex

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to