It's all about the answers!

Ask a question

Unable to connect to RTC from Jenkins


K K (2067) | asked Jul 21 '14, 3:43 p.m.
I am unable to connect to RTC  from Jenkins

We have  RTC  which is hosted on a different domain. Our Jenkins is on the a VM ( windows 2008 R2).  I am trying to configure Jenkins to connect to RTC  and I get  an Error.


  1. I am  able to connect from Eclipse (installed on same  box) to RTC.
  2. I am able to connect from   to RTC from same box.
  3. I have set up the proxy configurations in the browser.
  4. I have installed the correct version of RTC Build tool kit.
  5. I am able to download and install plugins from Jenkins update center.


the error I am getting is 

Failed to connect : CRJAZ1371E The following URL cannot be reached:
https://<rtc-server>.company.com:443/ccm/versionCompatibility?clientVersion=4.0.3
						
. The server cannot be reached. The network could not connect to the server. Error details: Connection refused: connect.
com.ibm.team.repository.common.transport.ConnectionException: CRJAZ1371E The following URL cannot be reached: https://<rtc-server>.company.com:443/ccm/versionCompatibility?clientVersion=4.0.3. The server cannot be reached. The network could not connect to the server. Error details: Connection refused: connect. 
	at com.ibm.team.repository.transport.client.ClientHttpUtil.executePrimitiveRequest(ClientHttpUtil.java:1303)
	at com.ibm.team.repository.transport.client.ClientHttpUtil.executeHttpMethod(ClientHttpUtil.java:362)
	at com.ibm.team.repository.transport.client.ClientHttpUtil.executeHttpMethod(ClientHttpUtil.java:321)
	at com.ibm.team.repository.transport.client.ClientHttpUtil.executeHttpMethod(ClientHttpUtil.java:219)
	at com.ibm.team.repository.transport.client.ClientHttpUtil.executeHttpMethod(ClientHttpUtil.java:228)
	at com.ibm.team.repository.transport.client.RestClientConnectionBase.executeMethod(RestClientConnectionBase.java:315)
	at com.ibm.team.repository.transport.client.RestClientConnectionBase.doMethod(RestClientConnectionBase.java:181)
	at com.ibm.team.repository.transport.client.RestClientConnectionBase.doGet(RestClientConnectionBase.java:122)
	at com.ibm.team.repository.transport.client.TeamRawRestServiceClient$RawRestClientConnection.doGet(TeamRawRestServiceClient.java:96)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.invokeServiceCall(ServiceInterfaceProxy.java:164)
	at com.ibm.team.repository.client.internal.ServiceInterfaceProxy.invoke(ServiceInterfaceProxy.java:88)
	at com.ibm.team.repository.client.internal.RawRestServiceClientProxy$RestClientConnectionProxy.invoke(RawRestServiceClientProxy.java:121)
	at com.sun.proxy.$Proxy52.doGet(Unknown Source)
	at com.ibm.team.repository.client.internal.TeamRepository.fetchClientVersionJSONObject(TeamRepository.java:1624)
	at com.ibm.team.repository.client.internal.TeamRepository.access$0(TeamRepository.java:1621)
	at com.ibm.team.repository.client.internal.TeamRepository$5.run(TeamRepository.java:1692)
	at com.ibm.team.repository.client.internal.TeamRepository$5.run(TeamRepository.java:1)
	at com.ibm.team.repository.client.internal.TeamRepository$3.run(TeamRepository.java:1287)
	at com.ibm.team.repository.common.transport.CancelableCaller.call(CancelableCaller.java:79)
	at com.ibm.team.repository.client.internal.TeamRepository.callCancelableService(TeamRepository.java:1280)
	at com.ibm.team.repository.client.internal.TeamRepository.checkServerVersionMatches(TeamRepository.java:1695)
	at com.ibm.team.repository.client.internal.TeamRepository.internalLogin(TeamRepository.java:1471)
	at com.ibm.team.repository.client.internal.TeamRepository.login(TeamRepository.java:641)
	at com.ibm.team.build.internal.hjplugin.rtc.RepositoryConnection.testConnection(RepositoryConnection.java:115)
	at com.ibm.team.build.internal.hjplugin.rtc.RTCFacade.testConnection(RTCFacade.java:73)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.ibm.team.build.internal.hjplugin.RTCFacadeFactory$RTCFacadeWrapper.invoke(RTCFacadeFactory.java:115)
	at com.ibm.team.build.internal.hjplugin.util.RTCFacadeFacade.testConnection(RTCFacadeFacade.java:148)
	at com.ibm.team.build.internal.hjplugin.RTCScm$DescriptorImpl.checkConnect(RTCScm.java:645)
	at com.ibm.team.build.internal.hjplugin.RTCScm$DescriptorImpl.doCheckGlobalConnection(RTCScm.java:471)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:120)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:248)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:728)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:858)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:631)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:225)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:46)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
	at org.eclipse.jetty.server.Server.handle(Server.java:370)
	at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
	at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
	at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
	at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
	at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
	at sun.nio.ch.Net.connect0(Native Method)
	at sun.nio.ch.Net.connect(Unknown Source)
	at sun.nio.ch.Net.connect(Unknown Source)
	at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
	at com.ibm.team.repository.transport.client.InterruptableSocketFactory.doConnect(InterruptableSocketFactory.java:142)
	at com.ibm.team.repository.transport.client.InterruptableSocketFactory.createSocket(InterruptableSocketFactory.java:69)
	at com.ibm.team.repository.transport.client.SecureInterruptableSocketFactory.createSocket(SecureInterruptableSocketFactory.java:300)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at com.ibm.team.repository.transport.client.ClientHttpUtil.executePrimitiveRequest(ClientHttpUtil.java:1275)
	... 92 more
						


#

Comments
sam detweiler commented Jul 21 '14, 4:03 p.m. | edited Jul 21 '14, 4:08 p.m.

if u go to the console of your jenkins machine (and maybe agents) can u use a web browser to bring up the RTC logon screen?  If not, then the RTC plugin can't work either.

the build toolkit uses a different instance of eclipse.. so if u need proxy, you will have to configure it there too..

I have this model working here in my test system..

rtc
jenkins master (virtual machine)
separate machine
   virtual machines for build (with jenkins agents)


K K commented Jul 21 '14, 5:48 p.m. | edited Jul 22 '14, 11:28 a.m.

@Sam Detweiler,

yes ,I can use a browser on jenkins machine to bring up RTC log on screen. I have configured proxy on my browser.

In Build Tool kit  I tried configuring jbe.ini in <buildtoolinstalldir>\buildsystem\buildengine\eclipse with following.Did not work either. Is this what you meant?

-vm
C:\Program Files\Java\jdk1.6.0_45\bin
--launcher.suppressErrors
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Dorg.eclipse.ecf.provider.filetransfer.excludeContributors=org.eclipse.ecf.provider.filetransfer.httpclient
-Dhttps.proxyHost=https://proxyhostname
-Dhttps.proxyPort=proxyportnumber


sam detweiler commented Jul 21 '14, 6:00 p.m.

that is correct.  just to confirm, the protocol from the jbe machine to the proxy is https. right?


K K commented Jul 21 '14, 6:49 p.m. | edited Jul 22 '14, 11:28 a.m.

it is actually http


sam detweiler commented Jul 21 '14, 6:57 p.m.

the the two proxy lines would be (notice the http. instead of https.)

-Dhttp.proxyHost=https://proxyhostname
-Dhttp.proxyPort=proxyportnumber


K K commented Jul 21 '14, 9:31 p.m. | edited Jul 22 '14, 11:28 a.m.

@Sam
I tried all combinations it did not work. I do think this is due to proxy , but I am unable to figure out the configuration in build tool kit


K K commented Jul 22 '14, 12:58 a.m. | edited Jul 22 '14, 11:29 a.m.

Update :

I was able to connect from command line
jbe -vm"<path to JDK" -repositoryID "<repositoryurl>" -userID<userid> -pass "<password>......

Jbe is picking up the proxy , but for some reason Team Concert plugin is not abel to do that


Tim Mok commented Jul 22 '14, 11:30 a.m.
JAZZ DEVELOPER

I've fixed the posts but be careful when adding answers to a question that are actually comments. Others may think the question has an answer when it does not contain any information at that point that leads to a solution.

showing 5 of 8 show 3 more comments

Accepted answer


permanent link
Heather Fraser-Dube (4512) | answered Jul 22 '14, 1:01 p.m.
JAZZ DEVELOPER
I think what you need to do is make sure Jenkins has the 2 http properties defined in its running environment. For example:

java -Dhttp.proxyHost=https://proxyhostname -Dhttp.proxyPort=proxyportnumber -jar jenkins-1.509.1.war

The reason changing the jbe.ini file doesn't help is the Jenkins Team Concert plugin doesn't run/launch the JBE so the file doesn't get read. The code that handles establishing the connection with RTC is in the toolkit jars which are added to the class loader during run time. That code will look for the system env. vbles above. If you decide to run slaves, they too will need to be started with those env. variables (assuming that this works).
K K selected this answer as the correct answer

Comments
sam detweiler commented Jul 22 '14, 1:29 p.m. | edited Jul 22 '14, 1:40 p.m.

isn't that what the  plugin advanced page is setting up? my jenkins runs under tomcat so I don't have a commandline

on edit: never mind, read the help, this is for jenkins to download plugins, not do actual work..
"If your Jenkins server sits behind a firewall and does not have the direct access to the internet, and if your server JVM is not configured appropriately (See JDK networking properties for more details) to enable internet connection, you can specify the HTTP proxy server name in this field to allow Jenkins to install plugins on behalf of you. Note that Jenkins uses HTTPS to communicate with the update center to download plugins."

Heather has the right answer..   don't know how to do that for tomcat for this application only however..


K K commented Jul 22 '14, 4:28 p.m.

Indeed, Heather's solution worked!. thanks!


K K commented Jul 22 '14, 8:17 p.m.

@Sam
I put the  properties in jenkins.xml file. and restarted the windows service and Jenkins picked up the properties. you will be able to verify this in manage jenkins > system information

<executable>%BASE%\jre\bin\java</executable>
  <arguments> -Dhttp.proxyHost=https://proxyhostname -Dhttp.proxyPort=proxyportnumber -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080</arguments>

2 other answers



permanent link
sam detweiler (12.5k6195201) | answered Jul 22 '14, 11:12 a.m.
sorry, I had you work on the wrong problem.. you will have to configure the proxy in jenkins..

Manage jenkins-> Manage Plugins- >Advanced tab

the RTC Jenkins plugin uses the jenkins proxy. (jenkins is the app)
JBE is the app on the build toolkit side.

-1
permanent link
K K (2067) | answered Jul 22 '14, 12:14 p.m.
Configuring proxy in Jenkins was  one of the first things I tried before trying other things,, it did not work.

However,  When I switched from  localhost:8080 to " http://myhost.mydomain".. I see a message in Jenkins " your reverse proxy is broken".

I wonder if that has something to do with  the issue. thoughts?

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.