It's all about the answers!

Ask a question

java.lang.NoClassDefFoundError: com/ibm/team/repository/client/ITeamRepository


Álvaro Alonso (35127) | asked Nov 20 '19, 4:00 a.m.

 Hello


Im trying to develop a follow-up for deliver action.

I need to get the component name of a changeset.

Im trying this
private ITeamRepository fRepository;

public  followUpClassName(ITeamRepository repository) {
this.fRepository = repository;
}

 
Object data = operation.getOperationData(); ;
DeliverOperationData data1 = (DeliverOperationData) data;
List<IChangeSetHandle> changeSetHandles = data1.getChangeSetHandles();
List<IChangeSet> changeSets = fRepository.itemManager().fetchCompleteItems(changeSetHandles, IItemManager.DEFAULT, monitor1.newChild(25));

But when i run the deliver operation i get this error message: java.lang.NoClassDefFoundError: com/ibm/team/repository/client/ITeamRepository

Do you think i need any dependencie or external jar for get the change set??

Accepted answer


permanent link
Ralph Schoon (63.1k33646) | answered Nov 20 '19, 4:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 com/ibm/team/repository/client/ITeamRepository is part of the client API and not available in extensions run on the server. You must extend abstract service to get access to the service APIs.


See https://rsjazz.wordpress.com/2015/09/30/learning-to-fly-getting-started-with-the-rtc-java-apis/ for how to do this kind of stuff. Do the extensions workshop.

Álvaro Alonso selected this answer as the correct answer

Comments
Álvaro Alonso commented Nov 20 '19, 7:21 a.m.

 Thanks!!!

One other answer



permanent link
mark toddy (11) | answered Jun 22 '21, 1:14 a.m.
edited Jun 22 '21, 2:09 a.m. by Ralph Schoon (63.1k33646)

 As the name suggests this exception in Java occurs when JVM  tries to load a particular class and doesn't found the requested class in the classpath you specified. This means that, your classpath is broken.  Java ClassNotFoundException thrown when an application tries to load in a class through its string name using:


  •     The forName method in class Class.
  •     The findSystemClass method in class ClassLoader .
  •     The loadClass method in class ClassLoader.

When you get a ClassNotFoundException , it means that the Java Virtual Machine has traversed the entire classpath you specified and not found the class you've attempted to reference. The one and only solution is to check your classpath carefully.

Verify the name of the requested class is correct and the specified .jar file exists in your classpath. If not, you must explicitly add it to your application’s classpath.

If it's present in your classpath then there is high chance that your classpath is getting overridden or application is using classpath specified in jar file or start-up script and to fix that you need to find the exact classpath used by your application.



Comments
Ralph Schoon commented Jun 22 '21, 2:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

It blows the mind, why one would answer an already answered and accepted question. 

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.