[Solved]TeamRespositoryException in login() Servlet&WAS7
I've got TeamRepositoryException during login in my servlet although my project includes all RTC client java libraries under WEB-INF/lib.
I tried to set class loading policy as reverse order, but didn't work.
I do like to know how I can make this plugin get information from his plugin.xml.
Any solution?
SystemOut.log - TeamPlatform.startup()
SystemErr.log - ITeamRepository.login()
IProgressMonitor monitor = new NullProgressMonitor();
TeamPlatform.startup();
//RepositoryPackage.eINSTANCE.eContents();
ITeamRepository repo = TeamPlatform.getTeamRepositoryService().getTeamRepository(repositoryURI);
//ClassLoader loader = Thread.currentThread().getContextClassLoader();
//Thread.currentThread().setContextClassLoader(TeamRepository.class.getClassLoader());
repo.registerLoginHandler(new ITeamRepository.ILoginHandler() {
public ILoginInfo challenge(ITeamRepository repository) {
return new ILoginInfo() {
public String getUserId() {
return "userid";
}
public String getPassword() {
return "password";
}
};
}
});
repo.login(monitor);
//Thread.currentThread().setContextClassLoader(loader);
https://jazz.net/forums/viewtopic.php?t=16564&highlight=missing+foundation+component+tag
The issue is because of missing plugin configurations in eclipse classes, caused by classloading issues.
WebSphere 7 is implemented using OSGI technology like eclipse, so the eclipse platform classes by default are loaded from WebSphere, and the ones not by RTC client libraries included in the web application.
A possible solution is to include the lib classes into the webapp and reverse the class loading policy. Be careful to remove javax.servlet jar (included into RTC clint libraries), in order to be able to use the websphere classes for this specific library.
I tried to set class loading policy as reverse order, but didn't work.
https://jazz.net/forums/viewtopic.php?t=5458
For the version check issue, you need to ensure that your client includes the com.ibm.team.rtc.common plugin, which includes the extension:
"<extension
" point="com.ibm.team.repository.common.componentConfigurations">
" <componentConfiguration
" clientCompatibilityVersion="3.0"
" id="com.ibm.team.rtc"
" version="3.0">
" </componentConfiguration>
" </extension>
There's a similar extension for Foundation in com.ibm.team.repository.common, which you probably already have or nothing would work.
To see how these get processed, the relevant code is in
com.ibm.team.repository.client.internal.TeamRepository.checkServerVersionMatches()
I do like to know how I can make this plugin get information from his plugin.xml.
Any solution?
SystemOut.log - TeamPlatform.startup()
StandaloneFil W com.ibm.team.repository.common.internal.util.StandaloneExtensionRegistry getBundleLocalization Could not open META-INF/MANIFEST.MF for bundle: jar:file:/C:/IBM/WebSphere/AppServer/lib/pc-appext.jar!/plugin.xml
StandaloneFil W com.ibm.team.repository.common.internal.util.StandaloneExtensionRegistry getBundleLocalization Could not open META-INF/MANIFEST.MF for bundle: jar:file:/C:/IBM/WebSphere/AppServer/lib/rrd-appext.jar!/plugin.xml
SystemErr.log - ITeamRepository.login()
com.ibm.team.repository.common.TeamRepositoryException: Badly configured client. Missing a foundation component tag.
at com.ibm.team.repository.client.internal.TeamRepository.checkServerVersionMatches(TeamRepository.java:1657)
at com.ibm.team.repository.client.internal.TeamRepository.internalLogin(TeamRepository.java:1445)
at com.ibm.team.repository.client.internal.TeamRepository.login(TeamRepository.java:618)
at ccm.servlets.TryLogin.doGet(TryLogin.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
3 answers
here is the jars my web application based workitem client has listed in its web_inf/lib directory .
org.eclipse.osgi
org.eclipse.equinox.registry
org.eclipse.equinox.common
org.eclipse.emf.ecore
org.eclipse.emf.ecore.xmi
org.eclipse.emf.ecore.change
org.eclipse.emf.common
org.eclipse.core.runtime
org.eclipse.core.jobs
com.ibm.team.repository.rcp.common
com.ibm.team.repository.common
com.ibm.team.repository.common.transport
com.ibm.team.repository.common.serialize
com.ibm.team.repository.common.remoteaccess
com.ibm.team.repository.common.remoteaccess.auth
com.ibm.team.repository.common.json
com.ibm.team.repository.client
com.ibm.team.process.common
com.ibm.team.interop.common
com.ibm.team.interop.client
org.eclipse.osgi
org.eclipse.equinox.registry
org.eclipse.equinox.common
org.eclipse.emf.ecore
org.eclipse.emf.ecore.xmi
org.eclipse.emf.ecore.change
org.eclipse.emf.common
org.eclipse.core.runtime
org.eclipse.core.jobs
com.ibm.team.repository.rcp.common
com.ibm.team.repository.common
com.ibm.team.repository.common.transport
com.ibm.team.repository.common.serialize
com.ibm.team.repository.common.remoteaccess
com.ibm.team.repository.common.remoteaccess.auth
com.ibm.team.repository.common.json
com.ibm.team.repository.client
com.ibm.team.process.common
com.ibm.team.interop.common
com.ibm.team.interop.client
Tentative solution on WEB-INF/lib is SETTING CLASS LOADER of application as follows.
- Classloader mode : PARENT_LAST
AND
- WAR classloader policy : APPLICATION
With this, I succeeded in login().
But with classloader change, other framework based codes did not work.
Another solution is MAKING RTC Plain Client jars as EAR/Utility Jars. In this case, classloader mode : PARENT_LAST was sufficient and framework code worked.
- Classloader mode : PARENT_LAST
AND
- WAR classloader policy : APPLICATION
With this, I succeeded in login().
But with classloader change, other framework based codes did not work.
Another solution is MAKING RTC Plain Client jars as EAR/Utility Jars. In this case, classloader mode : PARENT_LAST was sufficient and framework code worked.