You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by JJ Snyder <j....@oracle.com> on 2009/03/24 15:22:28 UTC

ClientDataSource in OSGi

Hi,
I am running Equinox standalone and have installed and started the derby 
bundle (derby.jar). I am able to access the EmbeddedDataSource from 
another bundle successfully.  I then install and start the 
derbyclient.jar as a bundle but when I try to access the 
ClientDataSource I get a ClassNotFoundException.  It works fine in 
eclipse' PDE environment but not standalone.

Any ideas?

thanks,
JJ


Re: ClientDataSource in OSGi

Posted by JJ Snyder <j....@oracle.com>.
Added bug DERBY-4120

Kristian Waagan wrote:
> JJ Snyder wrote:
>> After further investigation it appears the the derbyclient.jar is not 
>> a complete bundle.  The manifest is terse and does not export 
>> anything.  I grabbed the spring source version of the derby bundles 
>> and their derbyclient manifest is quite detailed including the 
>> correct export package.  I am able to use it without issue.
>
> Good to hear that you have been able to work around the issue.
> I don't know OSGi very well. Would you say that the Derby bundle is 
> broken, and needs to be fixed? Or does it require some extra 
> configuration to work?
>
> If you think this is a Derby bug, feel free to log a Jira issue at 
> https://issues.apache.org/jira/browse/DERBY
>
> Thank you for your feedback!
>
>
> Regards,

Re: ClientDataSource in OSGi

Posted by Kristian Waagan <Kr...@Sun.COM>.
JJ Snyder wrote:
> After further investigation it appears the the derbyclient.jar is not 
> a complete bundle.  The manifest is terse and does not export 
> anything.  I grabbed the spring source version of the derby bundles 
> and their derbyclient manifest is quite detailed including the correct 
> export package.  I am able to use it without issue.

Good to hear that you have been able to work around the issue.
I don't know OSGi very well. Would you say that the Derby bundle is 
broken, and needs to be fixed? Or does it require some extra 
configuration to work?

If you think this is a Derby bug, feel free to log a Jira issue at 
https://issues.apache.org/jira/browse/DERBY

Thank you for your feedback!


Regards,
-- 
Kristian
>
> JJ
>
> Kristian Waagan wrote:
>> JJ Snyder wrote:
>>> Hi,
>>> I am running Equinox standalone and have installed and started the 
>>> derby bundle (derby.jar). I am able to access the EmbeddedDataSource 
>>> from another bundle successfully.  I then install and start the 
>>> derbyclient.jar as a bundle but when I try to access the 
>>> ClientDataSource I get a ClassNotFoundException.  It works fine in 
>>> eclipse' PDE environment but not standalone.
>>>
>>> Any ideas?
>> Hello,
>>
>> I don't have much to offer now, but can you please post the stack trace?
>> Is it the ClientDataSource class that isn't found, or a different class?
>>
>>
>> Regards,


Re: ClientDataSource in OSGi

Posted by JJ Snyder <j....@oracle.com>.
I got the bundles from the Apache Derby download page: 
http://db.apache.org/derby/releases/release-10.4.2.0.cgi



Myrna van Lunteren wrote:
> On Wed, Mar 25, 2009 at 11:53 AM, JJ Snyder <j....@oracle.com> wrote:
>   
>> After further investigation it appears the the derbyclient.jar is not a
>> complete bundle.  The manifest is terse and does not export anything.  I
>> grabbed the spring source version of the derby bundles and their derbyclient
>> manifest is quite detailed including the correct export package.  I am able
>> to use it without issue.
>>
>> JJ
>>
>>     
>
> Would you mind indicating where you found the incomplete bundle?
> Regards,
> Myrna
>   

Re: ClientDataSource in OSGi

Posted by Myrna van Lunteren <m....@gmail.com>.
On Wed, Mar 25, 2009 at 11:53 AM, JJ Snyder <j....@oracle.com> wrote:
> After further investigation it appears the the derbyclient.jar is not a
> complete bundle.  The manifest is terse and does not export anything.  I
> grabbed the spring source version of the derby bundles and their derbyclient
> manifest is quite detailed including the correct export package.  I am able
> to use it without issue.
>
> JJ
>

Would you mind indicating where you found the incomplete bundle?
Regards,
Myrna

Re: ClientDataSource in OSGi

Posted by JJ Snyder <j....@oracle.com>.
After further investigation it appears the the derbyclient.jar is not a 
complete bundle.  The manifest is terse and does not export anything.  I 
grabbed the spring source version of the derby bundles and their 
derbyclient manifest is quite detailed including the correct export 
package.  I am able to use it without issue.

JJ

Kristian Waagan wrote:
> JJ Snyder wrote:
>> Hi,
>> I am running Equinox standalone and have installed and started the 
>> derby bundle (derby.jar). I am able to access the EmbeddedDataSource 
>> from another bundle successfully.  I then install and start the 
>> derbyclient.jar as a bundle but when I try to access the 
>> ClientDataSource I get a ClassNotFoundException.  It works fine in 
>> eclipse' PDE environment but not standalone.
>>
>> Any ideas?
> Hello,
>
> I don't have much to offer now, but can you please post the stack trace?
> Is it the ClientDataSource class that isn't found, or a different class?
>
>
> Regards,

Re: ClientDataSource in OSGi

Posted by JJ Snyder <j....@oracle.com>.
It was ClientDataSource but I've changed the code a little.  Now it's 
ClientDataSource40 (also in the derbyclient.jar) but basically the same 
problem.  Maybe I'm not installing the bundles correctly.  I installed 
and started the "derby.jar" bundle.  I also installed and started the 
derbyclient.jar but get the same stack trace.

Here's the trace...thanks,JJ

org.osgi.framework.BundleException: Exception in 
clienttest.Activator.start() of bundle clienttest.
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1028)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
        at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:257)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:257)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java
:150)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:302)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:287)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:223)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: 
org/apache/derby/jdbc/ClientDataSource40
        at 
org.osgi.impl.service.jdbc.DerbyDataSourceFactory.createClientDataSource(DerbyDataSourceFactory.java:194)
        at 
org.osgi.impl.service.jdbc.DerbyDataSourceFactory.createDataSource(DerbyDataSourceFactory.java:98)
        at clienttest.Activator.start(Activator.java:37)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
        ... 14 more
Nested Exception:
java.lang.NoClassDefFoundError: org/apache/derby/jdbc/ClientDataSource40
        at 
org.osgi.impl.service.jdbc.DerbyDataSourceFactory.createClientDataSource(DerbyDataSourceFactory.java:194)
        at 
org.osgi.impl.service.jdbc.DerbyDataSourceFactory.createDataSource(DerbyDataSourceFactory.java:98)
        at clienttest.Activator.start(Activator.java:37)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
        at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:257)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:257)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java
:150)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:302)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:287)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:223)
        at java.lang.Thread.run(Unknown Source)
Nested Exception:
java.lang.NoClassDefFoundError: org/apache/derby/jdbc/ClientDataSource40
        at 
org.osgi.impl.service.jdbc.DerbyDataSourceFactory.createClientDataSource(DerbyDataSourceFactory.java:194)
        at 
org.osgi.impl.service.jdbc.DerbyDataSourceFactory.createDataSource(DerbyDataSourceFactory.java:98)
        at clienttest.Activator.start(Activator.java:37)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:1009)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:1003)
        at 
org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:984)
        at 
org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:265)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:257)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:257)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java
:150)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:302)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.console(FrameworkConsole.java:287)
        at 
org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:223)
        at java.lang.Thread.run(Unknown Source)

osgi>

Kristian Waagan wrote:
> JJ Snyder wrote:
>> Hi,
>> I am running Equinox standalone and have installed and started the 
>> derby bundle (derby.jar). I am able to access the EmbeddedDataSource 
>> from another bundle successfully.  I then install and start the 
>> derbyclient.jar as a bundle but when I try to access the 
>> ClientDataSource I get a ClassNotFoundException.  It works fine in 
>> eclipse' PDE environment but not standalone.
>>
>> Any ideas?
> Hello,
>
> I don't have much to offer now, but can you please post the stack trace?
> Is it the ClientDataSource class that isn't found, or a different class?
>
>
> Regards,

Re: ClientDataSource in OSGi

Posted by Kristian Waagan <Kr...@Sun.COM>.
JJ Snyder wrote:
> Hi,
> I am running Equinox standalone and have installed and started the 
> derby bundle (derby.jar). I am able to access the EmbeddedDataSource 
> from another bundle successfully.  I then install and start the 
> derbyclient.jar as a bundle but when I try to access the 
> ClientDataSource I get a ClassNotFoundException.  It works fine in 
> eclipse' PDE environment but not standalone.
>
> Any ideas?
Hello,

I don't have much to offer now, but can you please post the stack trace?
Is it the ClientDataSource class that isn't found, or a different class?


Regards,
-- 
Kristian

>
> thanks,
> JJ
>