OSGI bundle problems when deploying server extension
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
But the new precondition is not getting loaded in the Process Configuration view. Are the advisors included with the sample still working as expected? If not, I'd definitely test the original projects in your WAS environment. If they don't work, we should focus on getting the sample working first. Can you post your plugin.xml and the qualified classname of your new advisor? Hi Mark, Thanks for the quick reply. Yes, its working in Tomcat I could not test in WAS because of the above mentioned issue. Please find the plugin.xml: <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension point="com.ibm.team.process.service.operationAdvisors"> <operationAdvisor class="advisor.example.WorkItemFailAdvisor" id="advisor.example.operationAdvisor" name="Restrict &apos;fail&apos; in summary" operationId="com.ibm.team.workitem.operation.workItemSave"> </operationAdvisor> <operationAdvisor class="advisor.example.RestrictDeliverOfDeletionsAdvisor" id="advisor.example.operationAdvisor2" name="Restrict Delivering Deletions" operationId="com.ibm.team.scm.server.deliver"> <extensionService componentId="com.ibm.team.advisors.examples" implementationClass="advisor.example.RestrictDeliverOfDeletionsAdvisor"> <prerequisites> <requiredService interface="com.ibm.team.repository.service.IRepositoryItemService"/> <requiredService interface="com.ibm.team.scm.common.IScmService"/> </prerequisites> </extensionService> </operationAdvisor> </extension> </plugin> Thanks, Satheesh |
But the new precondition is not getting loaded in the Process Configuration view. Are the advisors included with the sample still working as expected? If not, I'd definitely test the original projects in your WAS environment. If they don't work, we should focus on getting the sample working first. Can you post your plugin.xml and the qualified classname of your new advisor? |
Hi, Satheesh. Caused by:
That doesn't sound right to me. WorkItemFailAdvisor is one of the advisor implementations provided in the example. It's not set as the activator in the original. Maybe it was set inadvertently while you were troubleshooting the other issues. Please check your advisor.example/META-INF/MANIFEST.MF for the following line: Bundle-Activator: advisor.example.WorkItemFailAdvisor I'd remove it and unwind your BundleActivator implementation. -Mark Hi Mark, Thanks for the reply. Yes, I am using the advisor.example and added some custom code to it. I did not try the orginal advisor.example in WAS. I have tried both - with BundleActivator and without specifying BundleActivator - options. I could see that the plug-in shows ACTIVE status and no errors in the logs. But the new precondition is not getting loaded in the Process Configuration view. Thanks, Satheesh |
Hi, Satheesh.
It looks like you started with advisor-example.zip from https://jazz.net/wiki/bin/view/Main/RTCSDK20_ProcessPreConditionExample. Are you able to deploy the original advisor.example on WAS? The walk-through only mentions Tomcat and Jetty. I expect it should work on WAS, but it may not have been tested. Caused by:
That doesn't sound right to me. WorkItemFailAdvisor is one of the advisor implementations provided in the example. It's not set as the activator in the original. Maybe it was set inadvertently while you were troubleshooting the other issues. Please check your advisor.example/META-INF/MANIFEST.MF for the following line: Bundle-Activator: advisor.example.WorkItemFailAdvisor I'd remove it and unwind your BundleActivator implementation. -Mark |
The stack trace is telling you that the class you have specified as the Hi Richard, Thanks a lot for pointing out the issue. I have implemented the org.osgi.framework.BundleActivator in my class and the error got resolved. Now the I can see the plug-in installed and ACTIVE without any error in the log. Still I am not able find the new precondition added in the Project Area->Process Configuration-> Preconditions list. Once the plug-in is deployed it should be available in the list right ?. Because after deploying the plug-in, I could see the new precondition added, in Tomcat environment . However, its not happening in WAS environment. Both the servers are running the same version of RTC (RTC 2.0). Is there any additional configuration required in WAS environment ?. Please guide me if I am missing something. Thanks, Satheesh |
This sounds like
https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/83288 Clear you browser cache and reload the page. Also a restart of the server once it has been provisioned should ensure it works as long as an admin request was not use to trigger the provision Richard On 1/13/2010 6:53 AM, satheeshpg wrote: Hi, |
The stack trace is telling you that the class you have specified as the
BundleActivator, "advisor.example.WorkItemFailAdvisor" is invalid due to a ClassCastException. My guess would be that it does not implement org.osgi.framework.BundleActivator. Richard On 1/12/2010 11:08 AM, satheeshpg wrote: sarcherwrote: |
Hi,
I could resolve the error and install the plug-in without any error. The OSGI console says: id State Bundle 150 ACTIVE example_1.0.0.1532 The plug-in is supposed to add one precondition, which will run some custom code while clicking on the 'save' button from the Web UI. I could achieve the same in RTC 2.0 running on Tomcat. Now I have deployed the same plug-in on RTC 2.0 running on WAS and its in 'ACTIVE' state. However, I am not able to find the new precondition in the 'Process Configurations' tab of Project area, which should be listed in the preconditions list. Is there any thing I am missing here ?. I could see and add the new precondition in Tomcat where as its not showing in RTC running on WAS. Please suggest me a solution for this ? Thanks, Satheesh |
OK, I concede that posting XML to the forum just does not work, even after the preview says it will. Suffice to say, "com.ibm.team.workitem.common" appears twice in your feature.xml file. Hi Simon, Thanks for the reply. I could resolve the issue, it was a version mismatch problem. I was using RTC 2.0.2 in Tomcat environment and the WAS instance was running on RTC 2.0. Now, I am facing another problem. I could install the plug-in and it shows status as "RESOLVED". However, its giving Class Cast exception in the logs. So I am not able to proceed. Please find the error message below: 2010-01-12 20:14:04,968 CRJAZ0291I Failed to start the bundle "example 1.0.0.201001122112". org.osgi.framework.BundleException: The activator advisor.example.WorkItemFailAdvisor for bundle advisor.example is invalid at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:146) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:980) 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 com.ibm.team.repository.provision.internal.ProvisionService.startFeatureBundles(ProvisionService.java:1029) at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfiles(ProvisionService.java:810) at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfile(ProvisionService.java:866) at com.ibm.team.repotools.rcp.internal.Provisioner.provision(Provisioner.java:81) at com.ibm.team.repotools.rcp.internal.Provisioner.installFromProfile(Provisioner.java:72) at com.ibm.team.repotools.rcp.internal.RepositoryToolsApplication.provision(RepositoryToolsApplication.java:605) at com.ibm.team.repotools.rcp.internal.RepositoryToolsApplication.run(RepositoryToolsApplication.java:651) at com.ibm.team.repotools.rcp.internal.RepositoryToolsApplication.start(RepositoryToolsApplication.java:702) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:386) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:618) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504) at org.eclipse.equinox.launcher.Main.run(Main.java:1236) at org.eclipse.equinox.launcher.Main.main(Main.java:1212) Caused by: java.lang.ClassCastException: advisor.example.WorkItemFailAdvisor incompatible with org.osgi.framework.BundleActivator at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:141) ... 25 more Can anybody suggest a solution for this?. Thanks Satheesh |
OK, I concede that posting XML to the forum just does not work, even after the preview says it will. Suffice to say, "com.ibm.team.workitem.common" appears twice in your feature.xml file. Hi Simon, Thanks for the reply. I tried removing the duplicate entry from feature.xml, still am getting the same error. Is there anything else we need to take care ? Thanks, Satheesh |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.