About the JavaAPI - why do not recognize PreBuiltTransportClient


(염경훈) #1

ES 5.1.1, use JavaAPI

As describe at manual, write pom.xml

but have a problem. that don't recognize PreBuiltTransportClient


(David Pilato) #2

May be your workspace is not refreshed?

Check in the list of the jars that has been imported if you can see the transport jar.


(염경훈) #4

yes. refresh~ i checked the jar file.
but when i click the PreBuilTransportClient method, it did not point jar file


(David Pilato) #5

What gives mvn dependency:tree ?


(염경훈) #6

it my pom.xml file.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  
  <groupId>elasticsearch-test</groupId>
  <artifactId>elasticsearch-test</artifactId>
  <version>1.0.0</version>
    <packaging>jar</packaging>
    
  <build>
    <sourceDirectory>src</sourceDirectory>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.5.1</version>
        <configuration>
          <source>1.3</source>
          <target>1.1</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>

  <dependency>
  	<groupId>org.elasticsearch.client</groupId>
  	<artifactId>transport</artifactId>
  	<version>5.1.1</version>
  </dependency>

  <dependency>
  	<groupId>org.apache.logging.log4j</groupId>
  	<artifactId>log4j-api</artifactId>
  	<version>2.6.2</version>
  </dependency>
  
  <dependency>
  	<groupId>org.apache.logging.log4j</groupId>
  	<artifactId>log4j-core</artifactId>
  	<version>2.6.2</version>
  </dependency>
  
  </dependencies>
</project>

(David Pilato) #7

Can you run please:

mvn dependency:tree

(David Pilato) #8

BTW this:

          <source>1.3</source>
          <target>1.1</target>

won't work.

You need Java 8 here.


(염경훈) #9

thank you very much.

i try update pom.xml

    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.6.0</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>

then operate well
:slight_smile:


(system) #10

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.