db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Derby networked server in OSGi
Date Thu, 05 May 2011 09:03:53 GMT
Hi All,

I have problems running derby with network connector in an OSGi environment.

I created my own bundle for the starter and use an Activator to start 
derby (see below).
I have also attached to Manifest of my bundle. Probably there are more 
imports missing but this is as far as I got.

To install all this I use Karaf and a feature file (see below).

The derby jar seems to bea bundle already so I simply install it from 
maven. The derbynet jar is no bundle so I use the wrap syntax of Karaf 
so a Manifest is created for it on the fly.

So the problem is that when I install a bundle I get a non resolvable import
Error executing command: The bundle "derby-starter_4.1.0.SNAPSHOT [159]" 
could not be resolved. Reason: Missing Constraint: Import-Package: 
org.apache.derby.iapi.tools.i18n; version="0.0.0"

The package is in the bundle derby but it is not exported.

So I think either that export and perhaps some more is missing or I am 
doing something wrong.

Can anyone help me with this?

If you want to test this yourself I can provide a complete maven project 
and some instructions.

Christian


-------------------
Feature file for Karaf
--------------------

<feature name='tesb-derby-starter' version='4.1-SNAPSHOT'>
<bundle>mvn:org.apache.derby/derby/10.8.1.2</bundle>
<bundle>wrap:mvn:org.apache.derby/derbynet/10.8.1.2</bundle>
<bundle>mvn:org.talend.esb/derby-starter/4.1-SNAPSHOT</bundle>
</feature>



-------------------------------
Starter class
-------------------------------
package org.talend.esb.derby.starter;

import java.net.InetAddress;

import org.apache.derby.drda.NetworkServerControl;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

public class NetworkActivator implements BundleActivator {
      NetworkServerControl server;

      public void start(BundleContext context) throws Exception {
          server = new 
NetworkServerControl(InetAddress.getByName("localhost"),1527);
          server.start(null);
      }

      public void stop(BundleContext context) throws Exception {
          server.shutdown();
      }

}

---
Manifest of starter bundle
----
Manifest-Version: 1.0
Export-Package: org.talend.esb.derby.starter;uses:="org.apache.derby.d
   rda,org.osgi.framework"
Built-By: chris
Tool: Bnd-1.15.0
Bundle-Name: Service Activity Monitoring :: Derby Starter
Created-By: Apache Maven Bundle Plugin
Bundle-Vendor: Talend Inc.
Build-Jdk: 1.6.0_20
Bundle-Version: 4.1.0.SNAPSHOT
Bnd-LastModified: 1304585222883
Bundle-Activator: org.talend.esb.derby.starter.NetworkActivator
Bundle-ManifestVersion: 2
Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt
Bundle-DocURL: www.talend.com
Bundle-SymbolicName: derby-starter
Import-Package: org.apache.derby.drda,org.apache.derby.iapi.tools.i18n
   ,org.osgi.framework;version="[1.5,2)"



-- 
Christian Schneider
http://www.liquid-reality.de

CXF and Camel Architect

Mime
View raw message