It's all about the answers!

Ask a question

OSGI bundle problems when deploying server extension


Annie Ying (2062103) | asked Mar 24 '08, 4:45 p.m.
JAZZ DEVELOPER
Hi,

I'm trying to deploy a server extension using the provisioning server, but I am running into problems with OSGI:

$ ./repotools.bat -import fromFile=backup.tar
log4j:WARN No appenders could be found for logger (com.ibm.team.repository.common.transport.internal.registry.AbstractActivationManagerOwner).
log4j:WARN Please initialize the log4j system properly.
Repo Tools, Version 0.6.0.I20071214-0415
Provisioning using ./profile.ini.
Bundle 'x1' with id 147 is invalid, it is not RESOLVED.
Bundle 'x2' with id 148 is invalid, it is not RESOLVED.
Bundle 'x3' with id 149 is invalid, it is not RESOLVED.
To ignore invalid bundles, re-run repotools with the following property defined:
-Dcom.ibm.team.repotools.rcp.allowInvalidBundles=true
Migration failed

Any body has any ideas?
Annie

24 answers



permanent link
Simon Archer (2661) | answered Mar 26 '08, 3:17 p.m.
Hi Annie

What you're seeing is repotools pointing out that some of your bundles have resolution problems that will likely cause your use of repotools to fail. A bundle MUST at least be RESOLVED, and in your case you have 3 bundles that are not.

The easiest way to diagnose this is to re-run repotools with the command line option -console (this is an Equinox command, so you won't see it in the repotools help). Now when you run repotools you'll get the chance to interact with the OSGi runtime to figure out what's going on.

Upon running repotools you'll get the same "not RESOLVED" errors, but if you press return a few times you'll get an "osgi>" prompt. Here you should use the Equinox console's "diag" command to diagnose the problems. You use diag like this:

osgi> diag 147

And what you should see is a diagnosis of the problem, and I'd bet that you are either missing a bundle or two, or your bundles do not have their dependencies described in the manifest correctly. Please give this a try and post back your findings. I'd be interested to see both the results of diag'ing one of your bundles, plus the contents of your bundle's META-INF/MANIFEST.MF.

Good luck,

Simon

permanent link
Annie Ying (2062103) | answered Mar 26 '08, 6:09 p.m.
JAZZ DEVELOPER
Simon,

Thank you SO much for your help! I tried using the -console option, but somehow the script still returned back to my cygwin prompt, so I didn't get a chance to use the diag command at the osgi prompt. Here's the repotool command I ran:

$ ./repotools.bat -console -importfromFile=backup.tar

Another thing I'm wondering is that one of my bundles (149) does not even have any plugin nor jar dependencies. What else can go wrong?

Thanks again for your patience with me, an OSGI novice.

Annie

permanent link
Simon Archer (2661) | answered Mar 26 '08, 8:25 p.m.
Hi Anne,

There are a few issues here...

1. If you're using cygwin, you should be running repotools.sh, not repotools.bat which is for Windows.

2. There must be a space between -import and fromFile.

3. The -console cannot be first, it must be after the fromFile parameter.

4. I forgot to tell you to use -noexit too.

So please try:

./repotools.bat -import fromFile=backup.tar -console -noexit

Using both -console and -noexit will give you access to the OSGi console and will prevent the process from exiting, giving you the chance to diagnose your application.

Let me know how it goes,

Simon

permanent link
Annie Ying (2062103) | answered Mar 27 '08, 6:36 p.m.
JAZZ DEVELOPER
Simon,

Thanks so much for your help! As we were discussing on a separate thread, repotool -import seems to run through after we removed the hard-coded version numbers, but the server still fails with the following problems:

15:59:50,254 ERROR eam.repository.provision.internal.ProvisionService - Failed to start bundle
org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Require-Bundle: com.ibm.team.workitem.common; bundle-version="0.0.0"

15:59:50,304 ERROR eam.repository.provision.internal.ProvisionService - Failed to start bundle
org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Require-Bundle: com.ibm.team.process.web; bundle-version="0.0.0"

As you noted, it is very wierd that the provisioning server is having trouble finding com.ibm.team.workitem.common and com.ibm.team.process.web.

Anybody has any ideas? Thanks!

Annie

permanent link
Richard Backhouse (6661) | answered Apr 11 '08, 2:18 p.m.
JAZZ DEVELOPER
Hi Annie,

Can you provide a bit more detail on what your extension feature
contains. In reading between the lines I'm guessing that your feature
contains some bundles that depend on repository and process bundles.

If you are starting from an completely unprovisioned war (ie no
repository or process installed) then you will need to make sure your
component dependencies are defined in your feature.xml. You do this by
adding the feature ids to a "requuires" element.

e.g

<requires>
<import feature="com.ibm.team.repository.server.feature"/>
<import feature="com.ibm.team.process.server.feature"/>
</requires>

You can also add the dependenices from PDE Feature dependencies page
however you may have to remove a version attribute that PDE will
probably add for you.

I would suggest for now that you provision the RTC server feature first.
That is install with the default profile.ini. Once you have done that
you can change the profile.ini to point to your own update-site and
feature id (or just point the
"com.ibm.team.repository.provision.profile" system property to your own
custom profile file).

I' sure you are looking at this saying that this is alot of work. In
fact for RC1 we plan to ease this by supporting multiple profile files.
You will be able to leave the existing profile.ini as and just add your
own custom profile.ini to a directory. The provisioner will install from
both the profiles.

HTH

Richard
Jazz Web UI and Server Development

aying wrote:
Simon,

Thanks so much for your help! As we were discussing on a separate
thread, repotool -import seems to run through after we removed the
hard-coded version numbers, but the server still fails with the
following problems:

15:59:50,254 ERROR
eam.repository.provision.internal.ProvisionService - Failed to start
bundle
org.osgi.framework.BundleException: The bundle could not be resolved.
Reason: Missing Constraint: Require-Bundle:
com.ibm.team.workitem.common; bundle-version="0.0.0"

15:59:50,304 ERROR
eam.repository.provision.internal.ProvisionService - Failed to start
bundle
org.osgi.framework.BundleException: The bundle could not be resolved.
Reason: Missing Constraint: Require-Bundle: com.ibm.team.process.web;
bundle-version="0.0.0"

As you noted, it is very wierd that the provisioning server is having
trouble finding com.ibm.team.workitem.common and
com.ibm.team.process.web.

Anybody has any ideas? Thanks!

Annie

permanent link
Annie Ying (2062103) | answered Apr 14 '08, 11:59 a.m.
JAZZ DEVELOPER
Hi Richard,

Thank you so much for your help! Sorry to keep bugging you, but I'm still having trouble to deploy my component, using the ways I tried below. Also, I've attached the console at the end of this message.

Regarding the dependencies in the feature.xml file, I actually do have all the plugin dependencies there:

<requires>
...my...plugins...
<import plugin="org.eclipse.core.runtime"/>
<import plugin="javax.servlet"/>
<import plugin="net.jazz.ajax"/>
<import plugin="com.ibm.team.workitem.common"/>
<import plugin="com.ibm.team.repository.common"/>
<import plugin="com.ibm.team.process.common"/>
<import plugin="com.ibm.team.repository.service"/>
<import plugin="com.ibm.team.workitem.service"/>
<import plugin="com.ibm.team.process.service"/>
<import plugin="com.ibm.team.repository.web"/>
<import plugin="com.ibm.team.process.web"/>
</requires>

I did also try to add the feature dependencies you suggested, but it still complains about the missing dependencies.

Any ideas?
Annie

admin@ANNIE /cygdrive/c/TeamConcert/20080414-provisioningServer/jazz/server
$ ./repotools.bat -import fromFile=backup1.tar
log4j:WARN No appenders could be found for logger (com.ibm.team.repository.commo
n.transport.internal.registry.AbstractActivationManagerOwner).
log4j:WARN Please initialize the log4j system properly.
Repo Tools, Version 0.6.0.I20080110-1623
Provisioning using ./profile.ini.
Dependency Bundle is not installed
Failed to install profile feature
com.ibm.team.repository.provision.ProvisionException: Error: Dependency Bundle i
s not installed for feature
at com.ibm.team.repository.provision.internal.ProvisionService.installFe
ature(ProvisionService.java:232)
at com.ibm.team.repository.provision.internal.ProvisionService.installFr
omProfile(ProvisionService.java:539)
at com.ibm.team.repotools.rcp.RepositoryToolsApplication.provision(Repos
itoryToolsApplication.java:528)
at com.ibm.team.repotools.rcp.RepositoryToolsApplication.run(RepositoryT
oolsApplication.java:566)
at com.ibm.team.repotools.rcp.RepositoryToolsApplication.start(Repositor
yToolsApplication.java:637)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl
e.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
cation(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
lipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Migration failed

permanent link
Richard Backhouse (6661) | answered Apr 14 '08, 1:15 p.m.
JAZZ DEVELOPER
Annie,

Its looks like you are getting further. So the message is telling us the
the bundle "com.ibm.team.scorecard.estimation.common" bundle is not
available. Now this may be because it is not getting installed as part
of your feature, however I'm guessing that in this case it is actually a
dependency the "com.ibm.team.scorecard.estimation.common" bundle itself
has that is not available.

The best way to debug these sort of things is to use the osgi console.
If you are trying this via repotools then I think Simon has already
explained how to turn on the console in repotools. If you are trying
this in the server then you can turn on the osgi console by modifying
the WAR's web.xml. Uncomment out the elements detail below in the
web.xml found in "jazz\server\tomcat\webapps\jazz\WEB-INF".

<!--
<init-param>
<param-name>commandline</param-name>
<param-value>-console</param-value>
</init-param>
-->

After restarting the server you should now see the osgi> prompt in the
console. (I assuming you are running windows, if not then we will have
to do something different).

To find the bundle id of the "com.ibm.team.scorecard.estimation.common"
bundle do an "ss" command. Scan through the response to find the id. You
can either use diag <id> or start <id> to see what the problems are with
the offending bundle.

Richard

Jazz Web UI and Server Development


aying wrote:
Hi Richard,

Thank you so much for your help! Sorry to keep bugging you, but I'm
still having trouble to deploy my component, using the ways I tried
below. Also, I've attached the console at the end of this message.

Regarding the dependencies in the feature.xml file, I actually do have
all the plugin dependencies there:

requires
..my...plugins...
import plugin="org.eclipse.core.runtime"/
import plugin="javax.servlet"/
import plugin="net.jazz.ajax"/
import plugin="com.ibm.team.workitem.common"/
import
plugin="com.ibm.team.repository.common"/
import plugin="com.ibm.team.process.common"/
import
plugin="com.ibm.team.repository.service"/
import
plugin="com.ibm.team.workitem.service"/
import plugin="com.ibm.team.process.service"/
import plugin="com.ibm.team.repository.web"/
import plugin="com.ibm.team.process.web"/
/requires

I did also try to add the feature dependencies you suggested, but it
still complains about the missing dependencies.

Any ideas?
Annie

admin@ANNIE
/cygdrive/c/TeamConcert/20080414-provisioningServer/jazz/server
$ ./repotools.bat -import fromFile=backup1.tar
log4j:WARN No appenders could be found for logger
(com.ibm.team.repository.commo
n.transport.internal.registry.AbstractActivationManagerOwner).
log4j:WARN Please initialize the log4j system properly.
Repo Tools, Version 0.6.0.I20080110-1623
Provisioning using ./profile.ini.
Dependency Bundle is not installed

Failed to install profile feature
com.ibm.team.repository.provision.ProvisionException: Error:
Dependency Bundle i
s not installed for feature

at
com.ibm.team.repository.provision.internal.ProvisionService.installFe
ature(ProvisionService.java:232)
at
com.ibm.team.repository.provision.internal.ProvisionService.installFr
omProfile(ProvisionService.java:539)
at
com.ibm.team.repotools.rcp.RepositoryToolsApplication.provision(Repos
itoryToolsApplication.java:528)
at
com.ibm.team.repotools.rcp.RepositoryToolsApplication.run(RepositoryT
oolsApplication.java:566)
at
com.ibm.team.repotools.rcp.RepositoryToolsApplication.start(Repositor
yToolsApplication.java:637)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandl
e.java:169)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runAppli
cation(EclipseAppLauncher.java:106)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(Ec
lipseAppLauncher.java:76)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:363)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.ja
va:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:64)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
Migration failed

permanent link
SATHEESH Gopinathan (41) | answered Dec 23 '09, 5:31 a.m.
Hi,

I have created a Team Concert Server Side plug-in which does Event Handling on WorkItemSave event. I could develop and run the plug-in successfully in Tomcat.

I wanted to deploy the same plug-in in WebSphere Application Server environment. I tried using the repository server service as given below.

1. I have copied the plug-in folder to JazzInstallDir/jazz/server/ folder

2. Copied the provision ini file to JazzInstallDir/server/conf/jazz/provision_profiles and updaetd the url with absolute path.

3. Stopped the server

4. Ran the command 'repoTools -addTables' from the Command Prompt(JazzInstallDir/jazz/server)

and am getting the following error:

2009-12-23 14:46:02.687 - FrameworkManager: (SAT-110.1101) A framework error has occurred.
org.osgi.framework.BundleException: The bundle could not be resolved. Reason: Missing Constraint: Require-Bundle: com.ibm.team.workitem.common; bundle-version="2.1.0" at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(Bundl
eHost.java:305) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(Abstra
ctBundle.java:355) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Frame
work.java:1074) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBund
les(StartLevelManager.java:616) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(St
artLevelManager.java:508) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStart
Level(StartLevelManager.java:299) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEv
ent(StartLevelManager.java:489) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventM
anager.java:211) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(Even
tManager.java:321)
Repo Tools
Rational Team Concert, Version 2.0 (I20090618-1753)
Jazz Foundation Server, Version 1.0 (I20090618-1753)

Provisioning using "F:\IBM\JazzTeamServer\server\conf\jazz\provision_profiles".
CRJAZ1218I The bundle "xxxx.xxxx" with the id 300 is invalid, it is not "R
ESOLVED".
To ignore invalid bundles, re-run repotools with the following property definiti
on enabled in the script:
-Dcom.ibm.team.repotools.rcp.allowInvalidBundles=true
CRJAZ1225I Migration failed.

Do you have have any idea what's wrong with this? Or is this the proper method to deploy a server side component in WAS environment ?.

Thanks,
Satheesh

permanent link
Scott Rich (57136) | answered Dec 30 '09, 9:19 a.m.
JAZZ DEVELOPER
Satheesh, can you post some more detail about exactly what you've copied to the server folder, and what your profile.ini and feature.xml contains? Also, have you tried the steps described below by Simon to debug the bundle activation?

The Jazz team is on a worldwide holiday this week, but we'll get more eyes on this next week when we get back in the office.

Thanks,
Scott Rich
IBM Jazz Team

permanent link
SATHEESH Gopinathan (41) | answered Jan 04 '10, 1:38 a.m.
Hi Scott Rich, Thanks for the reply.

I have copied the Update Site project folder which contains the generated jar files, to the JazzServerInstallDir\server folder.

The profile.ini file has the following entry:
url=file:../advisor-example
featureid=advisor.example.feature

The feature.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="advisor.example.feature"
label="Feature Feature"
version="1.0.0.qualifier">

<description url="http://www.example.com/description">

</description>

<copyright url="http://www.example.com/copyright">

</copyright>

<license url="http://www.example.com/license">

</license>

<requires>
<import plugin="com.ibm.team.process.service"/>
<import plugin="com.ibm.team.workitem.common" version="2.1.0" match="greaterOrEqual"/>
<import plugin="com.ibm.team.workitem.service" version="2.0.1" match="greaterOrEqual"/>
<import plugin="com.ibm.team.process.common" version="1.0.100" match="greaterOrEqual"/>
<import plugin="org.eclipse.equinox.common" version="3.4.0" match="greaterOrEqual"/>
<import plugin="com.ibm.team.repository.common" version="1.0.1" match="greaterOrEqual"/>
<import plugin="com.ibm.team.repository.service" version="1.0.1" match="greaterOrEqual"/>
<import plugin="com.ibm.team.scm.common" version="2.0.1" match="greaterOrEqual"/>
<import plugin="com.ibm.team.scm.service" version="2.0.1" match="greaterOrEqual"/>
</requires>

<plugin
id="advisor.example"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

<plugin
id="com.ibm.team.workitem.common"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>


Thanks,
Satheesh

Your answer


Register or to post your answer.