marklogic.client.FailedRequestException: Local message: write failed: Unauthorized. Server Message: Unauthoriz]ed> but was:<com.[sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8012 refus]ed>" type="org.junit.ComparisonFailure">org.junit.ComparisonFailure: expected:<com.[marklogic.client.FailedRequestException: Local message: write failed: Unauthorized. Server Message: Unauthoriz]ed> but was:<com.[sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8012 refus]ed>

GitHub | georgeajit | 6 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Fix InvalidUserTest when run on a SSL enabled MarkLogic Server

    GitHub | 6 months ago | georgeajit
    marklogic.client.FailedRequestException: Local message: write failed: Unauthorized. Server Message: Unauthoriz]ed> but was:<com.[sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8012 refus]ed>" type="org.junit.ComparisonFailure">org.junit.ComparisonFailure: expected:<com.[marklogic.client.FailedRequestException: Local message: write failed: Unauthorized. Server Message: Unauthoriz]ed> but was:<com.[sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8012 refus]ed>

    Root Cause Analysis

    1. marklogic.client.FailedRequestException

      Local message: write failed: Unauthorized. Server Message: Unauthoriz]ed> but was:<com.[sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8012 refus]ed>" type="org.junit.ComparisonFailure">org.junit.ComparisonFailure: expected:<com.[marklogic.client.FailedRequestException: Local message: write failed: Unauthorized. Server Message: Unauthoriz]ed> but was:<com.[sun.jersey.api.client.ClientHandlerException: org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8012 refus]ed>

      at org.junit.Assert.assertEquals()
    2. JUnit
      Assert.assertEquals
      1. org.junit.Assert.assertEquals(Assert.java:115)
      2. org.junit.Assert.assertEquals(Assert.java:144)
      2 frames
    3. com.marklogic.client
      InvalidUserTest.testInvalidUserAuth
      1. com.marklogic.client.test.InvalidUserTest.testInvalidUserAuth(InvalidUserTest.java:56)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    5. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      4. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      5. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      6. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      8. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      9. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      10. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      11. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      12. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      13. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      13 frames
    6. JUnit4 Provider
      JUnit4Provider.invoke
      1. org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      2. org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      3. org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      3 frames
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:606)
      4 frames
    8. SureFire
      ForkedBooter.main
      1. org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      2. org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      3. org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      4. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      5. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
      5 frames