It's all about the answers!

Ask a question

Error instantiating plugin class : is not a kind of "com.ibm.team.repository.service.AbstractService"


Dan Sevcenco (5021923) | asked Apr 23 '13, 6:04 a.m.
So, I managed to successfully deploy a plugin to RTC v4.0.0 and I added the pre-condition and post-condition handlers to the WorkItem save operation.

When I create a workitem and try to save it, I get the following message when RTC tries to instantiate the advisor and later on the participant:

2013-04-23 12:38:04,213 [         http-bio-9443-exec-39] ERROR t.internal.registry.AbstractActivationManagerOwner  - CRJAZ1093I The following service class was not activated: "itsm2.rtcext.workitem.extensions.service.advisors.AddSubscribersOnWorkitemSaveAdvi
sor" com.ibm.team.repository.common.transport.TeamServiceRegistryException: CRJAZ1108I The implementation class "itsm2.rtcext.workitem.extensions.service.advisors.AddSubscribersOnWorkitemSaveAdvisor", in the bundle "itsm2.rtcext.workitem.extensions.service.advisors", is not a kind of "com.ibm.team.repository.service.AbstractService".

Please mind that the plugins' code was created using the tools provided by the Eclipse platform in which I have added the RTC SDK. I have not created the classed manually, nor have I written code other than the content of the run method.

Question 1 : If RTC expects the class to be of the AbstractService type, why is Eclipse not extending it by default when creating the class code?

Question 2 : How do I fix this so I can move forward? Is it enough to go inside the code and modify the class declaration to extend the missing class?


Comments
Dan Sevcenco commented Apr 23 '13, 7:13 a.m.

Funny thing happened when I modified the plugin code to extend the AbstractService class.

After I copied over the update files, reset the server and restarted it, I was faced with a server critical situation. Basically, the server is no longer starting properly. Instead it just throws different kinds of internal errors and is shot in pieces.

Once the plugin code is removed from the update site and the server is restarted, everything returns to normal.

Well, this begs the question : What the hell is going on?

On one hand, the service cannot be instantiated because it is not of AbstractService type; on the other, the server dies during startup.

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Apr 24 '13, 8:44 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I test-deployed against an arbitrary test tomcat.
https://localhost:9443/jazz/admin?internal=true#action=com.ibm.team.repository.admin.componentStatus did not show the components.

I imported the components and ran them with Jetty. They worked.
I went through the plugin-xml's ans unchecked the Activate this Plugin..... since there is no activator.


I made the component names (not ID's) distinguishable.

I deleted all files in the update site, except .project and site.xml and rebuilt the update site.
I copied Site.xml and the Features, Plugins folder from the update site into the update site and it deploys now and shows up in the component status.

Please be aware this was 4.0.1 and my workspace settings are UTF-8


As described in the Extensions Workshop. I am not sure why that should matter, but it did for me in the past.
Would be interesting if that was the case here, but  iguess it rather was an issue with rebuilding the update site.




Dan Sevcenco selected this answer as the correct answer

Comments
Ralph Schoon commented Apr 24 '13, 10:49 a.m. | edited Apr 24 '13, 10:57 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Going through your extensions, and looking at the Advisor, I thought I'd mention that it is not a good idea to try to modify the work item in the Advisor - actually the extension point documents that this is not supported. It works, but you could get youself into serieous trouble in the future. See: http://rsjazz.wordpress.com/2012/12/14/do-not-modify-the-triggering-element-in-an-operationadvisor/

You should only modify work items in a follow-up action/participant.


Dan Sevcenco commented Apr 24 '13, 11:57 a.m. | edited Apr 24 '13, 11:58 a.m.

Ralph,

Indeed the deployment works with your suggestions and I thank you for your help.
There was no problem with UTF-8 settings, as this is the default on Linux.

I think the explanation for the error is related to the component distinguished name.

Now I have another problem when the participant is invoked on workitem save. RTC throws this exception:

2013-04-24 23:53:05,163 [              WebContainer : 3] ERROR t.internal.registry.AbstractActivationManagerOwner  - The class "com.ibm.team.workitem.service.IWorkItemCommon" f
ailed to load. The bundle "itsm2.rtcext.workitem.extensions.service.participants" could not find the class.
java.lang.ClassNotFoundException: com.ibm.team.workitem.service.IWorkItemCommon
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:506)

This happens both on Tomcat and on Websphere Application Server.


sam detweiler commented Apr 24 '13, 12:11 p.m.

concerning
com.ibm.team.workitem.service.IWorkItemCommon
not found

IWorkItemCommon class is in

com.ibm.team.workitem.common plugin
not
com.ibm.team.workitem.service plugin

5 other answers



permanent link
Dan Sevcenco (5021923) | answered Apr 24 '13, 2:52 a.m.
Hello Ralph,

I did remove the activator from the plugin and tried again. No luck :( Here is the server log generated by Tomcat:

INFO: Deploying web application archive /opt/IBM/JazzTeamServer/server/tomcat/webapps/ccm.war
Attempting to delete [/opt/IBM/JazzTeamServer/server/tomcat/work/Catalina/localhost/ccm/eclipse]
java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:139)
        at java.util.jar.JarFile.<init>(JarFile.java:138)
        at java.util.jar.JarFile.<init>(JarFile.java:75)
        at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:72)
        at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:48)
        at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:83)
        at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:107)
        at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:135)
        at java.net.URL.openStream(URL.java:1011)
        at com.ibm.team.repository.provision.internal.xml.AbstractXMLParser.invokeParser(AbstractXMLParser.java:40)
        at com.ibm.team.repository.provision.internal.xml.FeatureXMLParser.parse(FeatureXMLParser.java:46)
        at com.ibm.team.repository.provision.model.Feature.parseFeature(Feature.java:105)
        at com.ibm.team.repository.provision.model.Feature.getPluginDependencies(Feature.java:81)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFeature(ProvisionService.java:387)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileProperties(ProvisionService.java:948)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfiles(ProvisionService.java:1005)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileNoWait(ProvisionService.java:1139)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfile(ProvisionService.java:1077)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromContextConfigurationUrl(ProvisionService.java:1156)
        at com.ibm.team.jfs.app.install.Activator$1.run(Activator.java:172)
        at java.lang.Thread.run(Thread.java:736)
Exception in thread "Launch callback handler" Apr 24, 2013 9:36:03 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/IBM/JazzTeamServer/server/tomcat/webapps/ROOT
java.lang.NullPointerException
        at com.ibm.team.repository.provision.internal.ProvisionService.installFeature(ProvisionService.java:388)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileProperties(ProvisionService.java:948)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfiles(ProvisionService.java:1005)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileNoWait(ProvisionService.java:1139)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfile(ProvisionService.java:1077)
        at com.ibm.team.repository.provision.internal.ProvisionService.installFromContextConfigurationUrl(ProvisionService.java:1156)
        at com.ibm.team.jfs.app.install.Activator$1.run(Activator.java:172)
        at java.lang.Thread.run(Thread.java:736)

The CCM application log is empty.

Invoking "https://localhost:9443/ccm/admin#action=com.ibm.team.repository.admin.componentStatus" give the following result:

HTTP Status 404 - ProxyServlet: /ccm/admin


type Status report

message ProxyServlet: /ccm/admin

description The requested resource (ProxyServlet: /ccm/admin) is not available.


Apache Tomcat/7.0.25


What now?


Comments
Ralph Schoon commented Apr 24 '13, 3:23 a.m. | edited Apr 24 '13, 3:29 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

The Zip exception is disturbing. Can you unzip the Jar files on your target platform? I think this is the core problem. You could test if it deploys on the platform you used for development.

As mentioned before I managed to kill a ccm server by providing a broken extension as well to the point where it would not start.

Without your plugin source I am out of options.


Dan Sevcenco commented Apr 24 '13, 3:28 a.m.

The last test, for which I provided the Tomcat server log was performed on the same platform on which the update-site was generated. And the jar files can be unzipped (I have checked that).

If you want, I can send you my source projects as well as the generated update site for you to take a look at.


Ralph Schoon commented Apr 24 '13, 3:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Do that, no promises.


Dan Sevcenco commented Apr 24 '13, 4:49 a.m.

Understood. Thanks for your assistance. I have sent you the projects.


permanent link
Dan Sevcenco (5021923) | answered Apr 23 '13, 1:33 p.m.
Here is the stack trace of the error for the deployment on WAS:

[4/24/13 1:18:45:461 CEST] 00000011 SystemErr     R java.util.zip.ZipException: error in opening zip file
[4/24/13 1:18:45:462 CEST] 00000011 SystemErr     R     at java.util.zip.ZipFile.open(Native Method)
[4/24/13 1:18:45:462 CEST] 00000011 SystemErr     R     at java.util.zip.ZipFile.<init>(ZipFile.java:150)
[4/24/13 1:18:45:462 CEST] 00000011 SystemErr     R     at java.util.jar.JarFile.<init>(JarFile.java:149)
[4/24/13 1:18:45:463 CEST] 00000011 SystemErr     R     at java.util.jar.JarFile.<init>(JarFile.java:86)
[4/24/13 1:18:45:463 CEST] 00000011 SystemErr     R     at sun.net.www.protocol.jar.URLJarFile.<init>(URLJarFile.java:84)
[4/24/13 1:18:45:463 CEST] 00000011 SystemErr     R     at sun.net.www.protocol.jar.URLJarFile.getJarFile(URLJarFile.java:60)
[4/24/13 1:18:45:463 CEST] 00000011 SystemErr     R     at sun.net.www.protocol.jar.JarFileFactory.get(JarFileFactory.java:80)
[4/24/13 1:18:45:463 CEST] 00000011 SystemErr     R     at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:119)
[4/24/13 1:18:45:464 CEST] 00000011 SystemErr     R     at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:147)
[4/24/13 1:18:45:464 CEST] 00000011 SystemErr     R     at java.net.URL.openStream(URL.java:1022)
[4/24/13 1:18:45:464 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.xml.AbstractXMLParser.invokeParser(AbstractXMLParser.java:40)
[4/24/13 1:18:45:464 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.xml.FeatureXMLParser.parse(FeatureXMLParser.java:46)
[4/24/13 1:18:45:464 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.model.Feature.parseFeature(Feature.java:105)
[4/24/13 1:18:45:465 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.model.Feature.getPluginDependencies(Feature.java:81)
[4/24/13 1:18:45:465 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFeature(ProvisionService.java:387)
[4/24/13 1:18:45:465 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileProperties(ProvisionService.java:948)
[4/24/13 1:18:45:465 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfiles(ProvisionService.java:1005)
[4/24/13 1:18:45:466 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileNoWait(ProvisionService.java:1139)
[4/24/13 1:18:45:466 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfile(ProvisionService.java:1077)
[4/24/13 1:18:45:466 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromContextConfigurationUrl(ProvisionService.java:1156)
[4/24/13 1:18:45:466 CEST] 00000011 SystemErr     R     at com.ibm.team.jfs.app.install.Activator$1.run(Activator.java:172)
[4/24/13 1:18:45:467 CEST] 00000011 SystemErr     R     at java.lang.Thread.run(Thread.java:738)
[4/24/13 1:18:45:467 CEST] 00000011 SystemErr     R Exception in thread "Launch callback handler" java.lang.NullPointerException
[4/24/13 1:18:45:468 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFeature(ProvisionService.java:388)
[4/24/13 1:18:45:468 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileProperties(ProvisionService.java:948)
[4/24/13 1:18:45:468 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfiles(ProvisionService.java:1005)
[4/24/13 1:18:45:469 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfileNoWait(ProvisionService.java:1139)
[4/24/13 1:18:45:469 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromProfile(ProvisionService.java:1077)
[4/24/13 1:18:45:469 CEST] 00000011 SystemErr     R     at com.ibm.team.repository.provision.internal.ProvisionService.installFromContextConfigurationUrl(ProvisionService.java:1156)
[4/24/13 1:18:45:469 CEST] 00000011 SystemErr     R     at com.ibm.team.jfs.app.install.Activator$1.run(Activator.java:172)
[4/24/13 1:18:45:470 CEST] 00000011 SystemErr     R     at java.lang.Thread.run(Thread.java:738)


permanent link
Ralph Schoon (63.1k33646) | answered Apr 23 '13, 9:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I can't remember I ever created a constructor. My code typically only overwrites the run operation. like this


also see the many examples beginning with this one: http://rsjazz.wordpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant/

When I deploy, I typically have only issues with typos. Once a typo led to my Tomcat dying during startup - because I had missed to copy the site.xml over.....

Comments
Ralph Schoon commented Apr 23 '13, 9:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Make sure to organize imports and that you pick up the right AbstractService.


Dan Sevcenco commented Apr 23 '13, 10:09 a.m.

I have the right import, exactly as in your code.

Also, my code looks exactly like yours as far as class and method declarations are concerned.

There must be something else that I am missing.

One thing I noticed is that when the server dies, it typically throws an exception related to the loading of some com.ibm.team.repository.<something> class which is kind of strange because I think that classes from this package are loaded before plugins are loaded.


Ralph Schoon commented Apr 23 '13, 11:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

If it runs on Jetty, please be aware that in the test environment you have client as well as server plugins. So you can end up mixing client code into your server plugin. Once going to Tomcat, you won't have that and you'd fail to deploy. If you could provide information for the <something> one could tell.

See http://rsjazz.wordpress.com/2013/02/28/setting-up-rational-team-concert-for-api-development/
and
http://rsjazz.wordpress.com/2013/03/14/what-apis-are-available-for-rtc-and-what-can-you-extend/ especially Don’t Mix Client and Server API



Dan Sevcenco commented Apr 23 '13, 1:36 p.m. | edited Apr 23 '13, 1:40 p.m.

I think you raised a very important issue of not mixing the APIs. How do I verify if I am doing the mixing or not?

By the way, I am not deploying on Jetty. Instead I deploy directly in Tomcat and use remote debugging for development testing.

My plugin code imports the following packages:

import com.ibm.team.process.common.IProcessArea;
import com.ibm.team.process.common.IProcessConfigurationElement;
import com.ibm.team.process.common.advice.AdvisableOperation;
import com.ibm.team.process.common.advice.IReportInfo;
import com.ibm.team.process.common.advice.runtime.IOperationParticipant;
import com.ibm.team.process.common.advice.runtime.IParticipantInfoCollector;
import com.ibm.team.repository.common.IAuditable;
import com.ibm.team.repository.common.IContributorHandle;
import com.ibm.team.repository.common.TeamRepositoryException;
import com.ibm.team.workitem.common.ISaveParameter;
import com.ibm.team.workitem.common.model.ISubscriptions;
import com.ibm.team.workitem.common.model.IWorkItem;
import com.ibm.team.repository.service.AbstractService;


Dan Sevcenco commented Apr 23 '13, 1:40 p.m.

and the plugin XML makes reference to:

com.ibm.team.process.common;bundle-version="1.2.1000"
com.ibm.team.repository.common;bundle-version="1.3.1000",
com.ibm.team.repository.service;bundle-version="1.2.1000",
com.ibm.team.workitem.common;bundle-version="3.1.0"

while the feature XML makes reference to :

<import feature="com.ibm.team.process.server.jfs.feature" version="1.1.1000.v20120518_2049"/>
<import feature="com.ibm.team.repository.server.jfs.feature" version="1.0.1000.v20120518_2049"/>
<import feature="com.ibm.team.workitem.server.rtc.feature" version="3.1.0.v20120601_0115"/>


Ralph Schoon commented Apr 23 '13, 2:06 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Don't see anything disturbing.

showing 5 of 6 show 1 more comments

permanent link
Ralph Schoon (63.1k33646) | answered Apr 23 '13, 7:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
There are many examples out there that you could have stated with. Just my blog for example and the Extension Workshop also mentions the fact.

That an extension point expects a specific type extending it, is quite normal and described in many Eclipse extension books. Since writing Eclipse extensions is complex it is a good idea to buy one of the many books available or look at tutorials on Eclipse.org. The extension point actually also mentions that.


And you can browse the extension point schema to learn more. What Eclipse does if you hit the shortcut above, I am not sure. However there are so many ways to create the class, that it would probably be pointless to have one path that automates everything. You can file a request on eclipse.org however.

If your extension works with Jetty, but dies with tomcat, that hints to deployment issues. Wrong .ini pointing to somewhere with no site (typo), wrong dependencies e.g. to client API, missing files in the created Jar files. I'd suggest looking into the ccm.log.


Comments
Dan Sevcenco commented Apr 23 '13, 9:41 a.m.

I have tried with a default public constructor. I have tried with no constructor in my code to let the java compiler generate one for me.

All my attempts were met with a server shot in pieces as long as I declare my class to extend AbstractService.

By the way, in your lab exercise, the code does not declare a constructor, although the class declaration does contain the extends statement. So I can only assume that the java compiler is used to generate a default constructor. How does it work for you? (I must admit I have not tried to deploy the plugins that result from your code samples. I do believe that the best lessons can be learned when doing not when observing something that was prepared by an expert.)

So, what else can I try?


permanent link
Ralph Schoon (63.1k33646) | answered Apr 23 '13, 1:42 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Did you create the plugin on a different architecture? It appears that the unzip operation already fails - line 1 inthe errors.

Comments
Dan Sevcenco commented Apr 23 '13, 1:48 p.m.

The plugin is created on linux (Ubuntu) and I have JazzTeamServer deployed on Tomcat on the same linux while the WAS server is on an AIX machine.

However, as soon as I eliminate the "extends AbstractService" from the class definition, the plugin is loaded OK and I can see the component listed in the CCM's Admin ComponentStatus page. I can also see the advisor and the participant registered because I can associate them with the work item save operation.

In this scenario, as soon as I create a new workitem, fill data in and press the save button, I get the error about not being able to instantiate the advisor / participant for not being of the AbstractService type.


Dan Sevcenco commented Apr 23 '13, 1:53 p.m.

Oh, and I do not think the zip error is related to the plugin because in the web interface, the "Provision Status" page shows some content but stops short of my plugin:

CRJAZ0299I Installing bundle from the URL "file:////rational/IBM/JazzTeamServer/server/conf/ccm/sites/update-site/plugins/com.ibm.rational.rrdi.etl.rif2irifconverter_1.1.1.v20120416_2135.jar".
CRJAZ0299I Installing bundle from the URL "file:////rational/IBM/JazzTeamServer/server/conf/ccm/sites/update-site/plugins/com.ibm.rational.rpe.core.doors_1.1.2.v20111212_1225.jar".
CRJAZ0299I Installing bundle from the URL "file:////rational/IBM/JazzTeamServer/server/conf/ccm/sites/update-site/plugins/com.ibm.rational.rpe.core_1.1.2.v20120531_2156.jar".
CRJAZ0299I Installing bundle from the URL "file:////rational/IBM/JazzTeamServer/server/conf/ccm/sites/update-site/plugins/com.ibm

These are the last 4 entries in the log. And I know my plugin is yet to be processed because it is located in a different folder than "update-site" which is not listed in the log.


Ralph Schoon commented Apr 23 '13, 2:03 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Do you define an activator? Can you please remove the definition if so?


Ralph Schoon commented Apr 23 '13, 2:08 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Otherwise there is maybe something smelly with the update site. Hard to tell. I am not convinced I can debug this just in the forum.


Dan Sevcenco commented Apr 23 '13, 2:13 p.m.

Indeed I have an activator. I will proceed to remove it and will let you know of the results tomorrow morning.


Dan Sevcenco commented Apr 24 '13, 3:20 a.m.

I compared my plugin configuration with that of your PoT code samples and except for the schema parameter there is absolutely no difference.

showing 5 of 6 show 1 more comments

Your answer


Register or to post 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.