TeamPlatform.shutdown(): cannot shutdown
![]()
Hi,
I got a problem with TeamPlatform.shutdown(). I have a widget with a button "Show Available Project Areas". The button has a listener that calls the following method public List<String> getProjectAreas(){ List<String> projectAreas = null; TeamPlatform.startup(); try { // code for login and retrieving active project areas } catch (Exception x) { x.printStackTrace(); } finally { if (TeamPlatform.isStarted()) { TeamPlatform.shutdown(); } } return projectAreas; } The button event listener that calls the method is: availableProjectAreas.addListener(SWT.Selection, new Listener() { public void handleEvent(Event event){ List<String> projectAreas = getProjectAreas(); } }); The problem is: I click the button for the first time, everything is ok. Then I click it for a second time, I got exceptions as: Exception in thread "main" java.lang.IllegalStateException: Already stopped at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.shutdown(InternalTeamPlatform.java:112) at com.ibm.team.repository.client.TeamPlatform.shutdown(TeamPlatform.java:60) at com.ibm.team.workitem.ide.ui.example.widgets.GroupRTC.getProjectAreas(GroupRTC.java:144) GroupRTC.java:144 is the line TeamPlatform.shutdown() in the finally block. Can I ask here that if TeamPlatform.isStarted() returns true, why TeamPlatform.shutdown() throws an exception as "Already stopped"? thank you very much Lin |
8 answers
![]()
I'm also seeing the same problem. I don't think the previous response answers the question / issue. |
![]() I'm also seeing the same problem. I don't think the previous response It doesn't make sense to start and stop the platform within a method. The TeamPlatform lifecycle should correspond to the application's lifecycle in most cases. If this is not possible in your case, please create a defect for this issue on jazz.net. -- Regards, Patrick Jazz Work Item Team |
![]() Hi, |
![]()
I have the same problem. Maybe a defect (e.g. some field isn't correctly setted when are called startup() and/or shutdown() methods)?
|
![]() public List<String> getProjectAreas(){ You should start the TeamPlatform when your application starts and shut it down when your application ends. -- Regards, Patrick Jazz Work Item Team |
![]()
I am using RTC 3.0.1 server and client,and we we first call TeamPlatform.startup() method before we process our xml artfacts in a method in our JAVA business logic.When we are done processing artifacts we call TeamPlatform.shutdown() method after checking if TeamPlatform.isStarted() or not ,(but in the same method)
processArtifact{ TeamPlatform.startup(); try{ //logic to process artfacts in a for loop } catch(){} finally { if (TeamPlatform.isStarted()) TeamPlatform.shutdown(); } } Its fine for the first artifact,but for others it throws this error Throwable occurred: java.lang.IllegalStateException: Already stopped at com.ibm.team.repository.common.internal.util.InternalTeamPlatform.shutdown(InternalTeamPlatform.java:113) at com.ibm.team.repository.client.TeamPlatform.shutdown(TeamPlatform.java:61) Can this TeamPlatform.shutdown(); method in the finally clause be commented out totally or do we still need this at the end of the application but maybe in a different method? |
![]()
We are also encountering this problem. I searched for an existing RTC Defect, but didn't find one. So I created RTC Defect 173878.
|