Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » can't import derbyclient bundle
can't import derbyclient bundle [message #633353] Sat, 16 October 2010 15:56 Go to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
I am getting exceptions while trying to import derbyclient 10.6.2000001.999685 .

When I do
Import-Bundle: derbyclient

I get

Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.rits.derby' at vers
ion '1.0.0': Import-Bundle with symbolic name 'derbyclient' in version range '[0.0.0, oo)' could not be satisfied
	at org.eclipse.virgo.kernel.userregion.internal.importexpansion.ImportExpansionHandler.getBundlePackageImports(ImportExpansionHandler.java:271)



When I do

Require-Bundle: derbyclient;version="[10.6.2000001.999685]"


I get

Caused by: org.eclipse.virgo.kernel.osgi.framework.UnableToSatisfyBundleDependenciesException: Unable to satisfy dependencies of bundle 'com.rits.derby' at vers
ion '1.0.0': Cannot resolve: com.rits.derby
    Resolver report:
        A Require-Bundle could not be resolved. Caused by missing constraint in bundle <com.rits.derby_1.0.0>
             constraint: <Require-Bundle: derbyclient; bundle-version="0.0.0">

	at org.eclipse.virgo.kernel.install.pipeline.stage.resolve.internal.QuasiResolveStage.process(QuasiResolveStage.java:45)
....


I do have derby client in my maven repository and I've configured virgo to read bundles from it. This works because I import other bundles from it.

			<dependency>
				<groupId>org.apache.derby</groupId>
				<artifactId>derbyclient</artifactId>
				<version>10.6.2.1</version>
			</dependency>

Any ideas?

Thanks
Re: can't import derbyclient bundle [message #633355 is a reply to message #633353] Sat, 16 October 2010 16:00 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
My bundle is attached.

Also, the manifest of derbyclient:

Manifest-Version: 1.0

Ant-Version: Apache Ant 1.7.1

Created-By: 11.3-b02 (Sun Microsystems Inc.)

Bundle-Vendor: Apache Software Foundation

Bundle-Name: Apache Derby 10.6

Bundle-Version: 10.6.2000001.999685

Bundle-ManifestVersion: 2

Sealed: true

Bundle-SymbolicName: derbyclient

DynamicImport-Package: *

Export-Package: org.apache.derby.jdbc

Class-Path: derbyLocale_cs.jar derbyLocale_de_DE.jar derbyLocale_es.ja

 r derbyLocale_fr.jar derbyLocale_hu.jar derbyLocale_it.jar derbyLocal

 e_ja_JP.jar derbyLocale_ko_KR.jar derbyLocale_pl.jar derbyLocale_pt_B

 R.jar derbyLocale_ru.jar derbyLocale_zh_CN.jar derbyLocale_zh_TW.jar



Name: org/apache/derby/impl/tools/sysinfo/

Sealed: false



Name: org/apache/derby/iapi/services/context/

Sealed: false



Name: org/apache/derby/iapi/services/info/

Sealed: false



Name: org/apache/derby/jdbc/

Sealed: false



Name: org/apache/derby/info/

Sealed: false



Name: org/apache/derby/iapi/services/i18n/

Sealed: false



Name: org/apache/derby/iapi/tools/i18n/

Sealed: false



Name: org/apache/derby/loc/

Sealed: false



Name: org/apache/derby/tools/

Sealed: false



Re: can't import derbyclient bundle [message #633377 is a reply to message #633355] Sun, 17 October 2010 03:56 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Require-Bundle: derbyclient;version="[10.6.2000001.999685]" is invalid syntax. Did you mean Require-Bundle: derbyclient;version="[10.6.2000001.999685, 10.6.2000001.999685]"?

What is the Virgo repository configuration for the Maven repository?
Re: can't import derbyclient bundle [message #633425 is a reply to message #633377] Sun, 17 October 2010 14:44 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Hi, tried with

Require-Bundle: derbyclient;version="[10.6.2000001.999685,10.6.2000001.999685]"

and I got

Caused by: org.osgi.framework.BundleException: The bundle "com.rits.derby_1.0.0 [72]" could not be resolved. Reason: Missing Constraint: Require-Bundle: derbycl
ient; bundle-version="0.0.0"
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)
...



my org.eclipse.virgo.repository.properties :

ext.type=external
ext.searchPattern=repository/ext/{artifact}

usr.type=watched
usr.watchDirectory=repository/usr

mavenrepo.type=external
mavenrepo.searchPattern=${user.home}/.m2/repository/**/{bundle}.jar

mavenrepolibd.type=external
mavenrepolibd.searchPattern=${user.home}/.m2/repository/**/{bundle}.libd

chain=mavenrepo,mavenrepolibd,ext,usr


this should be ok because I am importing other bundles from the mavenrepo. derbyclient is under /home/ariskk/.m2/repository/org/apache/derby/derbyclient/10. 6.2.1 with a filename derbyclient-10.6.2.1.jar .

Cheers
Re: can't import derbyclient bundle [message #633430 is a reply to message #633425] Sun, 17 October 2010 15:18 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Next, let's eliminate the possibility that ${user.home} is not being substituted properly by replacing it in the repository properties file with the value you would expect and restarting Virgo.

(BTW, this isn't relevant to this particular issue, but you should really keep ext and usr at the beginning of the repository chain as these are intended to be relatively stable repositories with ext containing some of Virgo's own dependencies.)
Re: can't import derbyclient bundle [message #633436 is a reply to message #633430] Sun, 17 October 2010 17:29 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Oh, found what was wrong! Sorry for spending your time on this. An oversight on my side, somehow virgo wasn't aware of changes in the .m2 repo. Dunno why the -clean didn't work (I am always running virgo with the -clean). So -clean didn't work but as soon as I deleted everything under the work folder and restarted the server, the derby bundle was located just fine!

I am starting virgo within eclipse with these VM arguments:
-XX:ErrorFile=./serviceability/error.log 
-XX:HeapDumpPath=./serviceability/heap_dump.hprof 
-Djava.security.auth.login.config=./config/org.eclipse.virgo.kernel.authentication.config 
-Dorg.eclipse.virgo.kernel.authentication.file=./config/org.eclipse.virgo.kernel.users.properties
-Djava.io.tmpdir=./work/tmp 
-Dorg.eclipse.virgo.kernel.home=.
-Djavax.net.ssl.keyStore=./config/keystore 
-Djavax.net.ssl.keyStorePassword=changeit
-Xmx512m -XX:PermSize=256m


and these program arguments:
-config ./lib/org.eclipse.virgo.kernel.launch.properties 
-Forg.eclipse.virgo.kernel.home=. 
-Forg.eclipse.virgo.kernel.config=./config 
-Fosgi.configuration.area=./work/osgi/configuration 
-Fosgi.java.profile=file:./lib/java6-server.profile
-clean


I got those back from the springsource dm server days and updated them up to today. Is the -clean still valid?

Thanks
Re: can't import derbyclient bundle [message #633479 is a reply to message #633436] Mon, 18 October 2010 03:44 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
The crucial point here is that an external repository is only scanned when Virgo starts up and Virgo has not already indexed the external repository, so the restart of Virgo with -clean is necessary to delete the index and rescan to pick up the changes. See the user guide for details.

(Watched repositories are actively scanned and pick up changes without having to restart Virgo, but these are flat directories only and therefore not suitable for Maven repositories.)

Glad you are sorted now!

[Updated on: Mon, 18 October 2010 03:49]

Report message to a moderator

Re: can't import derbyclient bundle [message #633529 is a reply to message #633425] Mon, 18 October 2010 06:41 Go to previous messageGo to next message
Steve Powell
Messages: 23
Registered: January 2010
Location: Southampton
Junior Member
Just a comment -- surely you should have coded:
Require-Bundle: derbyclient;bundle-version="[10.6.2000001.999685,10.6.2000001.999685]"
that is, used the bundle-version attribute and not the version attribute.

That would explain the message:
Missing Constraint: Require-Bundle: derbyclient; bundle-version="0.0.0"
referring to version 0.0.0 (which you 'specified').

I don't think if affects the rest of the discussion, however. Smile


Steve Powell :-/
Re: can't import derbyclient bundle [message #633667 is a reply to message #633479] Mon, 18 October 2010 14:56 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Glyn Normington wrote on Mon, 18 October 2010 03:44
The crucial point here is that an external repository is only scanned when Virgo starts up and Virgo has not already indexed the external repository, so the restart of Virgo with -clean is necessary to delete the index and rescan to pick up the changes. See the user guide for details.

(Watched repositories are actively scanned and pick up changes without having to restart Virgo, but these are flat directories only and therefore not suitable for Maven repositories.)

Glad you are sorted now!


I've restarted the virgo server with the -clean but still it couldn't locate the derbyclient bundle. Had the issue for a couple of days and in 2 PC's and I did several restarts. Anyway,I'll give it a try with a new bundle to see if it actually reoccurs.
Re: can't import derbyclient bundle [message #633670 is a reply to message #633529] Mon, 18 October 2010 15:08 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Steve Powell wrote on Mon, 18 October 2010 06:41
Just a comment -- surely you should have coded:
Require-Bundle: derbyclient;bundle-version="[10.6.2000001.999685,10.6.2000001.999685]"
that is, used the bundle-version attribute and not the version attribute.

That would explain the message:
Missing Constraint: Require-Bundle: derbyclient; bundle-version="0.0.0"
referring to version 0.0.0 (which you 'specified').

I don't think if affects the rest of the discussion, however. Smile


I use

Import-Bundle: com.springsource.org.apache.log4j;version="[1.2.15,1.3.0)"
,org.apache.commons.dbcp
,derbyclient

and that works. both versioned and unversioned bundles are loaded (I think unversioned means it will load the max version found)

I don't know the schemantics of Required-Bundle though - I don't use it. I suppose I used it incorrectly.
Re: can't import derbyclient bundle [message #633703 is a reply to message #633667] Mon, 18 October 2010 21:24 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
I just wanted to check the operating system of the PCs which were showing this problem as there are certain issues listing files in some circumstances under Windows.
Re: can't import derbyclient bundle [message #633705 is a reply to message #633670] Mon, 18 October 2010 21:31 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Kostas Kougios wrote on Mon, 18 October 2010 20:08

I use

Import-Bundle: com.springsource.org.apache.log4j;version="[1.2.15,1.3.0)"
,org.apache.commons.dbcp
,derbyclient

and that works. both versioned and unversioned bundles are loaded (I think unversioned means it will load the max version found)

I don't know the schemantics of Required-Bundle though - I don't use it. I suppose I used it incorrectly.



An unversioned Import-Bundle has the same effect as coding version="0" which represents a range from 0 to infinity. The semantics of Import-Bundle are that it always chooses the highest bundle version available that fits in the specified range, which in this case equates to the highest bundle version available.

Require-Bundle is a little more complicated because its base semantics in OSGi are pretty complex and then there's Virgo's automatic provisioning behaviour as well. However, I don't think using version instead of bundle-version will have helped.
Re: can't import derbyclient bundle [message #633915 is a reply to message #633705] Tue, 19 October 2010 16:19 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Glyn Normington wrote on Mon, 18 October 2010 21:31
Kostas Kougios wrote on Mon, 18 October 2010 20:08

I use

Import-Bundle: com.springsource.org...



An unversioned Import-Bundle has the same effect as coding version="0" which represents a range from 0 to infinity. The semantics of Import-Bundle are that it always chooses the highest bundle version available that fits in the specified range, which in this case equates to the highest bundle version available.

Require-Bundle is a little more complicated because its base semantics in OSGi are pretty complex and then there's Virgo's automatic provisioning behaviour as well. However, I don't think using version instead of bundle-version will have helped.


Thanks, useful info, I was never sure which version will virgo pick up from my .m2 repository - the old jar's are still there after I upgrade to newer version of libs.

Regarding my OS, I am using Ubuntu 10.10, JDK 1.6.0_21. I still didn't replicate the issue due to lack of time but will try in the next few days.
Re: can't import derbyclient bundle [message #633929 is a reply to message #633915] Tue, 19 October 2010 18:26 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Ok, I can verify that -clean doesn't work as (I?) expect...

I've updated to RC1. I have a bundle of my own that imports an other bundle from the maven repository. I delete everything under virgo/work and start the server with the -clean. The bundle loads just fine.

Now I delete all under virgo/work and also delete the bundle under .m2/repository. I start virgo, my bundle can't find the deleted bundle.

I run mvn to re-download the deleted bundle.

I re-run virgo with -clean, my bundle still fails because can't find the bundle under .m2/repository

I delete all under virgo/work and restart virgo. Now all work ok.

Should I enter a bug?

I've attached my bundle. The bundle that I delete is the logback bundle:

maven stuff:
			<dependency>
				<groupId>org.slf4j</groupId>
				<artifactId>slf4j-api</artifactId>
				<version>1.6.1</version>
			</dependency>
			<dependency>
				<groupId>ch.qos.logback</groupId>
				<artifactId>logback-core</artifactId>
				<version>0.9.25</version>
			</dependency>
Re: can't import derbyclient bundle [message #633989 is a reply to message #633929] Wed, 20 October 2010 04:12 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Yes, please log a bug. The strange thing is that -clean is meant to delete the work directory!
Re: can't import derbyclient bundle [message #634222 is a reply to message #633989] Wed, 20 October 2010 16:03 Go to previous messageGo to next message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Glyn Normington wrote on Wed, 20 October 2010 04:12
Yes, please log a bug. The strange thing is that -clean is meant to delete the work directory!


Ok, before I log a bug... is the -clean handled by the batch file that starts the server or by the java code? I am starting virgo within eclipse using a runconfig, which means java is called with the -clean parameter. So if it is handled by the batch file it is not a bug.
Re: can't import derbyclient bundle [message #634290 is a reply to message #634222] Thu, 21 October 2010 03:34 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
It's handled by dmk.sh/dmk.bat. If you use the Virgo tooling, there is an option to clean start the server.
Re: can't import derbyclient bundle [message #634452 is a reply to message #634290] Thu, 21 October 2010 14:36 Go to previous message
Kostas Kougios is currently offline Kostas Kougios
Messages: 42
Registered: August 2010
Member
Glyn Normington wrote on Thu, 21 October 2010 03:34
It's handled by dmk.sh/dmk.bat. If you use the Virgo tooling, there is an option to clean start the server.


aha, thats why it doesn't work for me. I was invoking java straight away with the -clean param. Not a bug then.
Previous Topic:Successful completion of Virgo 2.1.0 Release and Graduation Review
Next Topic:Could Fragment bundles be used on Virgo?
Goto Forum:
  


Current Time: Thu Jul 24 14:00:29 EDT 2014

Powered by FUDForum. Page generated in 0.02554 seconds