Error while trying to connect to RM/CLM with OSLC4J
I am working on Jazz CLM deployment. We are using Jazz CLM 6.0.3 with enterprise type topology and Jazz Authorization Server to manage Authentication, Authorization and SSO.
I should also precise that while all the CLM component (RM, JTS, DM) are behind an reverse-proxy to unify the URL, this is not the case of the JAS server.
I would like to be able to connect to this platform (RM module for example) with some java client build on top of OSLC4J but I am facing a connection issue. The error is not present with a CLM 6.0.2 platform and without usage of Jazz authorization Server. As example, I am able to reproduce it from a simple connection class below:
import org.apache.http.HttpStatus;
import org.eclipse.lyo.client.oslc.OSLCConstants;
import org.eclipse.lyo.client.oslc.jazz.JazzFormAuthClient;
import org.eclipse.lyo.client.oslc.jazz.JazzRootServicesHelper;
import java.util.logging.Logger;
public class Connexion {
private static final Logger logger = Logger.getLogger(Connexion.class.getName());
public void connect() {
String webContextUrl = "https://clm.server.org/rm";
String authUrl = "https://clm.server.org/jts";
String user = "userid";
String passwd = "passwd";
String projectArea = "RM PROJ";
try {
JazzRootServicesHelper helper = new JazzRootServicesHelper(webContextUrl, OSLCConstants.OSLC_RM_V2);
JazzFormAuthClient client = helper.initFormClient(user, passwd, authUrl);
if (client.formLogin() == HttpStatus.SC_OK) {
String catalogUrl = helper.getCatalogUrl();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
The exception trace that I get when I try to connect is the following:
java.lang.IllegalStateException: Target host must not be null, or set in parameters.
at org.apache.http.impl.client.DefaultRequestDirector.determineRoute(DefaultRequestDirector.java:706)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:356)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
at org.eclipse.lyo.client.oslc.jazz.JazzFormAuthClient.followRedirects(JazzFormAuthClient.java:204)
at org.eclipse.lyo.client.oslc.jazz.JazzFormAuthClient.formLogin(JazzFormAuthClient.java:149)
at com.mathworks.toolbox.oslc_dng.OslcConnection.login(OslcConnection.java:80)
The dependencies used are:
- oslc4j-core-2.1.0.jar
- oslc4j-json4j-provider-2.1.0.jar
- oslc4j-wink-2.1.0.jar
- oslc-query-2.1.0.jar
- oslc4j-jena-provider-2.1.0.jar
- oslc4j-utils-2.1.0.jar
- oslc-java-client-2.1.0.jar
- oslc-trs-2.1.0.jar
Can anybody help me on this topic?