Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

JAVA API Client : Null output when using findProcessArea(uri,nulll,null)

 IProjectArea projectArea= (IProjectArea) processClient.findProcessArea(uri, null, null);
I am getting error Project are not found.
Value of Project Area Is NULL.
Please let me know why this error ?

0 votes


Accepted answer

Permanent link
Hello Ralph Schoon,

I was giving the uri  as https://xxxxx:9443/jts rather /ccm
I got it now .. Thanks ..
Thanks Again
Ralph Schoon selected this answer as the correct answer

0 votes


One other answer

Permanent link
Because it could not find a process area given the URI you specified in which case it returns null as specified in the interface:


1 vote

Comments

Hello Ralph Schoon,

Thanks for reply

I have used the example code available in RSjazz.

I have created the project Ares (Process Area) I have checked  for all project area available.(Also with the alais name)

Here is the code :
    ITeamRepository teamRepository= TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryURI);
        teamRepository.registerLoginHandler(new LoginHandler(userId, password));
        teamRepository.login(null);
   
        IProcessClientService processClient= (IProcessClientService) teamRepository.getClientLibrary(IProcessClientService.class);
        IAuditableClient auditableClient= (IAuditableClient) teamRepository.getClientLibrary(IAuditableClient.class);
        IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);
       
       
        System.out.println(processClient);
      
        URI uri= URI.create(projectAreaName.replaceAll(" ", "%20"));
        System.out.println(projectAreaName);
        System.out.println(uri);
        IProjectArea projectArea= (IProjectArea) processClient.findProcessArea(uri, null, null);
        System.out.println(projectArea);
        if (projectArea == null) {
            System.out.println("Project area not found.");
            return false;
        }


This is all not useful information, because what really would matter is the String that is passed to create the URI and the URI as string to check if there might be any funny pre or postfix values.

A valid program is not able to work if the input is invalid. I know, my code above works, because I have used it like 30 times already and it works for me. So the only possible data producing issues is the input.

And i believe you created the project areas and the like, but I also believe that you pass the wrong information to the code above, which results in a not found, because what you search for is not there and what is there you don't search for.

Hello Ralph Schoon,

I apologise , I  Actually know that code is good as I have tried lot of  the code in your blog and its really good and makes us to learn lot and interesting .But this input I am really trying but do not know  what is the wrong I am doing ...

Thanks again .. I will try it ..

Yes, the project areas are managed by the application and not JTS.
Trouble is you don't notice, because the JTS shares some common API with apps like CCM and you can actually log in.

Don't worry, stuff like that happened to probably all of us. Your learning here should be to provide the information for debugging next time. You can obfuscate it a bit, if needed.

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Mar 14 '16, 8:53 a.m.

Question was seen: 2,067 times

Last updated: Mar 14 '16, 4:13 p.m.

Confirmation Cancel Confirm