It's all about the answers!

Ask a question

How can I resolve a "java.lang.ClassNotFoundException" error for a newly created and deployed particpant?


Ryan McBryde (5711130) | asked Dec 07 '16, 2:23 p.m.
I have a newly created participant that updates the parent with the accumulated hours from it's children. The code is from the blog: https://rsjazz.worpress.com/2012/07/31/rtc-update-parent-duration-estimation-and-effort-participant.
I have configured my development environment according to the Extensions Workshop.  I built the update site project in Eclipse, included the feature, and built the site.  I shut down the server, copied the features and plug-ins folder and site.xml over to a newly created update-parent-site folder under server/ccm/conf/sites and created a new update-parent-site.ini file in server/ccm/conf/provisioning-profiles and set it to point to the new site folder and used the feature id of "com.ibm.js.team.workitem.extension.updateparent.feature" as shown below:

url=file:ccm/sites/parent-update-site
featureid=com.ibm.js.team.workitem.extension.updateparent.feature

The server was reset and then restarted.  The servers provisioning status shows the feature being provisioned as shown below:

CRJAZ0303I The profile install from "file:ccm/sites/parent-update-site" was started at "Wed Dec 07 11:16:35 EST 2016".

CRJAZ0300I This feature is being installed: "com.ibm.js.team.workitem.extension.updateparent.feature_1.0.0.201612061622".
CRJAZ0299I Installing bundle from the URL "file:/C%3a/RTC60Dev/installs/JAZZTE~1/server/conf/ccm/sites/parent-update-site/plugins/com.ibm.js.team.workitem.extension.updateparent.common_1.0.0.201612061622.jar".
CRJAZ0299I Installing bundle from the URL "file:/C%3a/RTC60Dev/installs/JAZZTE~1/server/conf/ccm/sites/parent-update-site/plugins/com.ibm.js.team.workitem.extension.updateparent.participant_1.0.0.201612061622.jar".
CRJAZ0299I Installing bundle from the URL "file:/C%3a/RTC60Dev/installs/JAZZTE~1/server/conf/ccm/sites/parent-update-site/plugins/com.ibm.js.team.api.workitem.common.utils_1.0.0.201612061622.jar".

I was able to create a new project area in Eclipse based on the Scrum template and then was able to see and add the participant as a follow-up action.  After I did so and logged into the new project area I received and error stating " Unable to instantiate participant com.ibm.js.team.workitem.extension.updateparent.participant.updateparentduration.  CRJAZ6011E" when I tried to save a story work item.

When I looked in the ccm log file I found this:

2016-12-07 12:24:53,412 [Default Executor-thread-1287 @@ 12:24 myadmin <com.ibm.team.process.editProjectArea/Save@70f1b848-0104-4d7f-8db8-456cac819474> /ccm/service/com.ibm.team.process.internal.service.web.IProcessWebUIService/projectArea] ERROR t.internal.registry.AbstractActivationManagerOwner  - CRJAZ1093E The "com.ibm.js.team.workitem.extension.updateparent.participant.UpdateParentState" feature could not start.
com.ibm.team.repository.common.transport.TeamServiceRegistryException: CRJAZ1107I The implementation class "com.ibm.js.team.workitem.extension.updateparent.participant.UpdateParentState" could not loaded from the bundle "com.ibm.js.team.workitem.extension.updateparent.participant".

as well as this:

Caused by: java.lang.ClassNotFoundException: com.ibm.js.team.workitem.extension.updateparent.participant.UpdateParentState

This is with RTC 6.0.1

Thank you for any assistance provided.



One answer



permanent link
Ralph Schoon (63.1k33645) | answered Dec 08 '16, 4:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 The error message is pretty clear and means that the class com.ibm.js.team.workitem.extension.updateparent.participant.UpdateParentState can not be found. So you were unsuccessful in creating/building the feature or there is a typo somewhere. The problem is somewhere in your .ini file or more likely in the contents of the plugins and features (folders) created when building the content for the site folder.

Comments
Ryan McBryde commented Dec 08 '16, 9:41 a.m.

Thank you Ralph,
The provisioning profile is located @ C:\RTC60Dev\installs\JazzTeamServer\server\conf\ccm\provision_profiles\ parent-update-site.ini and the site is @C:\RTC60Dev\installs\JazzTeamServer\server\conf\ccm\sites\parent-update-site.  The contents of the parent-update-site.ini file are below:

url=file:ccm/sites/parent-update-site
featureid=com.ibm.js.team.workitem.extension.updateparent.feature

I assumed the featureid is the same as the name of the feature package that I imported.
Also, I only added the UpdateParentDuration participant to the process config not the UpdateParentState. Does it matter?

If I can eliminate the ini file as the problem then I can turn my attention to looking in the features and plug-ins folders.  They contain the following:
features:
com.ibm.js.team.workitem.extension.updateparent.feature_1.0.0.201612061622

plug-ins:
com.ibm.js.team.api.workitem.common.utils_1.0.0.201612061622.jar
com.ibm.js.team.workitem.extension.updateparent.common_1.0.0.201612061622.jar
com.ibm.js.team.workitem.extension.updateparent.participant_1.0.0.201612061622.jar


Ralph Schoon commented Dec 08 '16, 12:12 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I don't kow and can't tell what is wrong. ZThe ini file seems to be OK. The feature is found - otherwise the server would crash.


You can use 7zip to look into the jar files. com.ibm.js.team.workitem.extension.updateparent.participant_1.0.0.201612061622.jar has to contain a bin folder with the classes in there. In the plugin.xml - build section make sure to include the binaries and the plugin.xml.


Ryan McBryde commented Dec 08 '16, 1:45 p.m.

 Ralph,


I think that I have found the source of the problem and it is elementary.  Not sure why but when I unzipped thefolder, 20121127_UpdateParentParticipants, I got 6 folders, including com.ibm.js.team.workitem.extension.updateparent.participant and there are 3 java files under the src folder there; \20121127_UpdateParentParticipants\com.ibm.js.team.workitem.extension.updateparent.participant\src\com\ibm\js\team\workitem\extension\updateparent\participant, including the UpdateParentState.java, UpdateParentDuration.java, and IExtensionsDefinitions.java

After importing though, when I look at the src folder under /com.ibm.js.team.workitem.extension.updateparent.participant I see a small box icon with the same name but has nothing underneath it and if I compare to an environment on my laptop the 3 java files are supposed to be there.  I deleted the project and re-imported it and got the same results.

Any ideas?


Ralph Schoon commented Dec 08 '16, 2:25 p.m. | edited Dec 08 '16, 2:30 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Does the stuff work on Jetty? Ijust downloaded the stuff and it looks OK to me.


Ryan McBryde commented Dec 08 '16, 5:47 p.m.

 Ralph,


I will have to try it again in Jetty in my sandbox environemnt.
Everything works fine on Jetty on my laptop, 
What I am seeing is when I import the participant via File->Import->General->Existing Projects is that there are no Java files (i expect to see 3 of them) under the package 
com.ibm.js.team.workitem.extension.updateparent.participant.

This is what I am seeing in my sandox env but when I do it on my laptop the files show up in the package.  I will check Jetty in the Sanbox and let you know.  As I understand it if those 3 java files are not there then this should not work on the Jetty server in my sandbox, yes?


Ralph Schoon commented Dec 09 '16, 2:40 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 If it works on Jetty, it can't be an issue with the import. It is a packaging and deployment issue then. Delete the generated files and folders in the feature/update site project and rebuild and redeploy.




Ryan McBryde commented Dec 16 '16, 2:25 p.m.

 Ralph,

I have been able to get it to run in the Jetty server and also on the machine hosting my RTC Dev environment.  When the child task is saved, it updates the parent story with its hours added to the hours of all the other child tasks.  However I have also noticed some apparently anomalous behavior which I believe is unintended.  Once I have added the UpdateParent participant to a projects process config, I cannot save a Task that has a different value for Estimate and Time Remaining. I get a message stating that "Exception running followup action. An unhandled exception occurred during "UpdateParentDuration". Time remaining is not valid."
This also occurs if I try to change the value for Time Remaining to something different than the value for Estimate after saving the Task record.

Have you seen this before and if so, what corrective action should I take?

Thank you


Ryan McBryde commented Jan 11 '17, 4:14 p.m.

 Hi Ralph,


I have run this participant thru the Jetty debug server, stepping through the code line by line. I have found that if I comment out the majority of the getDuration method in UpdateParentDuration.java, then the error goes away and the plug-in seems to function correctly.  When I say the "majority" I mean that I only leave the setting of duration to 0 and the returning of duration.  Any ideas why this would be the case? Digging further it appears that the error is not coming from any of the child work items but instead when the code attempts to update the parent and specifically where it is checking to make sure that it doesn't update recursively, As best that I can determine with my limited Java knowledge, it seems to be happening here,
"IStatus saveStatus = fWorkItemServer.saveWorkItem3(parent, null, null, additionalParams);"

Any help would be appreciated.  If I can't get this work, they are going to scrap it.

Thank you


Ralph Schoon commented Jan 12 '17, 5:40 a.m. | edited Jan 12 '17, 5:43 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I just ran the UpdateParentDurantion from http://dl.dropbox.com/u/12668004/UpdateParentParticipants/20121127_UpdateParentParticipants.zip on 6.0.1 under Jetty.

It works. I can debug all the steps under Jetty. There is an issue if you run on time remaining mode that needs inspection. The error message in the server console is pretty clear it complains about inconsistent data in time remaining and estimate. This needs to be looked at. But this is an example and not a production ready tool.

If you run on Jetty and are still unable to debug this after running the extensions workshop, and rely on commenting and poking in the mud and are unable to provide more useful information, I am afraid, this is beyond your capabilities and I don't think you will be able to get this running.

Consulting might be a solution.


Ryan McBryde commented Jan 12 '17, 10:58 a.m.

 Thank you Ralph,


And this may indeed be beyond my capabilities.  I have 4 questions related to your last comment and then will leave you alone.  
1. Based on the name, is the zip file you mention, 20121127_UpdateParentParticipants.zip the same as the one I downloaded named 20121127_UpdateParentParticipants?
2. "not a production ready tool" - does this mean that this code is not ready to be used in a production environment?
3. "There is an issue if you run in time remaining mode that needs inspection."  How can I determine if I am in that mode or time spent mode? Are you saying that if I am in remaining mode then the code won't work?
4. Can the UpdateParentDuration participant be deployed and used WITHOUT the UpdateParentState participant also being deployed and used?

Thank you for your help thus far!


Ralph Schoon commented Jan 12 '17, 11:44 a.m. | edited Jan 12 '17, 11:48 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  1. http://dl.dropbox.com/u/12668004/UpdateParentParticipants/20121127_UpdateParentParticipants.zip is the download file from the post it is from November 27 2012 and it is the only one since then.

  2. See the disclaimer and the last remark <cite on> Now we have the most important code for the plugin. You should be able to get it working. Please remember that there is few error handling at this point. You might want to enhance this.<cite off>
    the examples are as simple as possible, bare minimum so that inexperienced users are not lost in all the decoration.

  3. The team advisor shows an unhanded exception and the Jetty Console shows the exceptions one can read the text you can't miss it during debugging

  4. Yes they are totally unrelated, they are just shipped together for my and potentially others convenience

Ryan McBryde commented Jan 12 '17, 1:09 p.m.

Thank you for the information.


2. I plan to add error handling and other logic, (To make it specific to a work item type of Story, for example), once I can get it to work, so I do understand that it not production ready as is.  Thank you for the reminder.

3. Not sure that I understand this as it relates to the time remaining/spent question. From what I can see in the project configuration of my testing project area, under Process Config->Project Config->Configuration Data->Planning->General there is a "Time Estimates" setting and mine is currently set to "Time Remaining".  
Is that what you were referring to when you said "There is an issue if you run on time remaining mode that needs inspection."  Would switching that to "Time Spent" remove the "issue" that you are referring to?


Ralph Schoon commented Jan 12 '17, 1:35 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  1. Yes. Estimate and Time remaining attribute depend on each other. The calculation assumes time spent mode and does not calculate right. Work  Item save fails because there is a check in the background. See related exceptions in the server console/log.
showing 5 of 13 show 8 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.