aliyun / elasticsearch-repository-oss

74 stars 33 forks source link

unable run in es 6.8.1, openjdk 12 #13

Open wind2008hxy opened 5 years ago

wind2008hxy commented 5 years ago

java.lang.ClassNotFoundException: javax.xml.bind.JAXBException

add dependency jaxb-api,jaxb-core,jaxb-impl still error no osgi

add dependency org.osgi still error java.lang.reflect.invocation target get exception

VanessaLi917 commented 5 years ago

Add following dependency to pom.xml can avoid the error.

        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.3.1</version>
        </dependency>

But after using "mvn clean install " to build the elasticsearch-reposiotry-oss, I couldn't add repository and then create snapshot.

PUT _snapshot/test/
{
  "type" : "oss",
  "settings" : {
    "bucket" : "test-backup",
    "base_path" : "elasticsearch/aliyun/test",
    "chunk_size" : "100mb",
    "endpoint" : "oss-cn-shanghai-internal.aliyuncs.com",
    "region" : "oss-cn-shanghai",
    "compress" : "true",
    "access_key_id": "xxxxxxxxxx",
    "secret_access_key":"xxxxxxxxx"
  }
}
{
  "error": {
    "root_cause": [
      {
        "type": "o_s_s_exception",
        "reason": "o_s_s_exception: Failed to parse the response result.\n[ErrorCode]: InvalidResponse\n[RequestId]: 5DBAA1ETV852D223331B5736B\n[HostId]: null\n[ResponseError]:\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error>\n  <Code>NoSuchKey</Code>\n  <Message>The specified key does not exist.</Message>\n  <RequestId>5DBAA1ETV852D223331B5736B</RequestId>\n  <HostId>test-backup.oss-cn-shanghai-internal.aliyuncs.com</HostId>\n  <Key>elasticsearch/aliyun/test/tests-wcRX5QzZRNqW2nZ2o-npJA/master.dat</Key>\n</Error>\n"
      }
    ],
    "type": "blob_store_exception",
    "reason": "Failed to check if blob [master.dat] exists",
    "caused_by": {
      "type": "o_s_s_exception",
      "reason": "o_s_s_exception: Failed to parse the response result.\n[ErrorCode]: InvalidResponse\n[RequestId]: 5DBAA1ETV852D223331B5736B\n[HostId]: null\n[ResponseError]:\n<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error>\n  <Code>NoSuchKey</Code>\n  <Message>The specified key does not exist.</Message>\n  <RequestId>5DBAA1ETV852D223331B5736B</RequestId>\n  <HostId>test-backup.oss-cn-shanghai-internal.aliyuncs.com</HostId>\n  <Key>elasticsearch/aliyun/test/tests-wcRX5QzZRNqW2nZ2o-npJA/master.dat</Key>\n</Error>\n"
    }
  },
  "status": 500
}

Not sure why it want to find the key "tests-wcRX5QzZRNqW2nZ2o-npJA/master.dat"

wind2008hxy commented 5 years ago

@VanessaLi-oqton I have try to intall the dependency but more error

I try to debug the code, in the end I found this line. https://github.com/aliyun/aliyun-oss-java-sdk/blob/340d006710d51949e3de308e209fb374d9bc3c59/src/main/java/com/aliyun/oss/common/parser/JAXBResponseParser.java#L45

wind2008hxy commented 5 years ago

https://bugs.openjdk.java.net/browse/JDK-8213734

VanessaLi917 commented 5 years ago

I'm using jdk 11 and also following version build successfully.

Maven home: /Users/xxxxxxxxxx/Downloads/apache-maven-3.6.2
Java version: 12.0.1, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
Default locale: en_CN, platform encoding: UTF-8
OS name: "mac os x", version: "10.14.6", arch: "x86_64", family: "mac"
himadrisingh commented 4 years ago

i'm also facing the same issue with jdk11, ES 6.5.1

wind2008hxy commented 4 years ago

i'm also facing the same issue with jdk11, ES 6.5.1

openjdk 11?

himadrisingh commented 4 years ago

yes

i'm also facing the same issue with jdk11, ES 6.5.1

openjdk 11?

himadrisingh commented 4 years ago
[elasticsearch@36307cab3541 ~]$ /opt/jdk-11.0.1/bin/java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
FROM elasticsearch:6.5.1

docker image defaults

himadrisingh commented 4 years ago

tried updating to openjdk-12 but was facing the same issue, so not sure if jdk is the issue. Was able to run com.aliyun.oss.OSSClient.doesObjectExist from within the jdk11 docker with all the same jars etc.

So this is most probably some conflicting classes causing this.