Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

java.net.UnknownHostException #60

Open
pautaran opened this issue Feb 7, 2017 · 4 comments
Open

java.net.UnknownHostException #60

pautaran opened this issue Feb 7, 2017 · 4 comments

Comments

@pautaran
Copy link

pautaran commented Feb 7, 2017

Hi!
I'm facing UnknownHostException. As you can see test runs fine with the same Host. Do you have any ideas why it is failing for the coverage calculation?

Thank you

[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ ApexUnit-core ---
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.ApexUnitRunner - ####################################   Processing the Apex test classes specified by the user  #################################### 
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.connection.PartnerConnectionConnectorConfig - Default connection time out value is: 0
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.connection.PartnerConnectionConnectorConfig - Updated connection time out value(from config.properties file): 1200000
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.fileReader.ApexManifestFileReader - Reading from Manifest files: ManifestFile_For_Unit_Test_Classes.txt
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.fileReader.ApexManifestFileReader - Reading Manifest file from location : ManifestFile_For_Unit_Test_Classes.txt
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.connection.ConnectionHandler - Bulk connection established.
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.AsyncBulkApiHandler - Creating batch for the test classes to execute using bulk connection....
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.AsyncBulkApiHandler - Async test parent job Id : 7075600000LCC2cAAH
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.AsyncBulkApiHandler - ############################# List of Apex test classes successfully submitted to the Force.com test execution engine #############################
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestExecutor - Parent job ID for the submission of the test classes to the Force.com platform is: 7075600000LCC2cAAH
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestExecutor - ############################# Now executing - Apex tests.. #############################
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestStatusPollerAndResultHandler - Total test classes to execute: 1
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestStatusPollerAndResultHandler - Now executing the test class: MyTestClass (https://cs42.salesforce.com/01p560000005VxjAAE ) Status : Completed
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestStatusPollerAndResultHandler - Test status for MyTestClass:(0/1)
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestStatusPollerAndResultHandler - Completed executing the test class: MyTestClass. Time taken by the test: 0 minutes,0 seconds
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestStatusPollerAndResultHandler - Total tests executed 1 , Remaining tests 0
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.testEngine.TestStatusPollerAndResultHandler - All tests have now completed executing!!
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.ApexUnitRunner - ####################################    Computing code coverage for the team based on the Apex Class names(source class names) provided   #################################### 
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.fileReader.ApexManifestFileReader - Reading from Manifest files: ClassManifestFile.txt
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.fileReader.ApexManifestFileReader - Reading Manifest file from location : ClassManifestFile.txt
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.client.codeCoverage.WebServiceInvoker - authorizationServerURL obj = https://cs42.salesforce.com/services/oauth2/token
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] ERROR com.sforce.cd.apexUnit.ApexUnitUtils - Exception during post method: java.net.UnknownHostException: cs42.salesforce.com
[com.sforce.cd.apexUnit.ApexUnitRunner.main()] INFO com.sforce.cd.apexUnit.ApexUnitUtils - Shutting down ApexUnit
java.lang.Exception: Stack trace
	at java.lang.Thread.dumpStack(Thread.java:1333)
	at com.sforce.cd.apexUnit.ApexUnitUtils.shutDownWithErrMsg(ApexUnitUtils.java:48)
	at com.sforce.cd.apexUnit.ApexUnitUtils.shutDownWithDebugLog(ApexUnitUtils.java:33)
	at com.sforce.cd.apexUnit.client.codeCoverage.WebServiceInvoker.doPost(WebServiceInvoker.java:90)
	at com.sforce.cd.apexUnit.client.codeCoverage.OAuthTokenGenerator.doPostAndGetOrgToken(OAuthTokenGenerator.java:49)
	at com.sforce.cd.apexUnit.client.codeCoverage.OAuthTokenGenerator.getOrgToken(OAuthTokenGenerator.java:36)
	at com.sforce.cd.apexUnit.client.codeCoverage.CodeCoverageComputer.calculateAggregatedCodeCoverageUsingToolingAPI(CodeCoverageComputer.java:104)
	at com.sforce.cd.apexUnit.ApexUnitRunner.main(ApexUnitRunner.java:88)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
	at java.lang.Thread.run(Thread.java:745)
@awillia2
Copy link
Contributor

awillia2 commented Feb 7, 2017

@pautaran would you post the output of running mvn in verbose mode which might help to show more info on why the host on cs42 was having this exception.

@vamshi-sfdc
Copy link
Contributor

vamshi-sfdc commented Feb 7, 2017 via email

@pautaran
Copy link
Author

pautaran commented Feb 9, 2017

@vamshi-sfdc
Yes, I'm not able to ping the endpoint, it gives Unknown host as well. Host command is working fine. I guess this happens because of our internal DNS settings.

@awillia2
This is what I got in debug mode:

java.net.UnknownHostException: cs42.salesforce.com
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:668)
	at sun.security.ssl.SSLSocketImpl.<init>(SSLSocketImpl.java:472)
	at sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:153)
	at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:82)
	at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:127)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	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 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
	at com.sforce.cd.apexUnit.client.codeCoverage.WebServiceInvoker.doPost(WebServiceInvoker.java:81)
	at com.sforce.cd.apexUnit.client.codeCoverage.OAuthTokenGenerator.doPostAndGetOrgToken(OAuthTokenGenerator.java:49)
	at com.sforce.cd.apexUnit.client.codeCoverage.OAuthTokenGenerator.getOrgToken(OAuthTokenGenerator.java:36)
	at com.sforce.cd.apexUnit.client.codeCoverage.CodeCoverageComputer.calculateAggregatedCodeCoverageUsingToolingAPI(CodeCoverageComputer.java:104)
	at com.sforce.cd.apexUnit.ApexUnitRunner.main(ApexUnitRunner.java:88)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
	at java.lang.Thread.run(Thread.java:745)

@vamshi-sfdc
Copy link
Contributor

@pautaran Did you override the proxy host and port shared as optional parameters in https://github.com/forcedotcom/ApexUnit/blob/master/README.md ? Unless I am missing some details, this does not seem to be an issue with the tool.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants