0

I amnew to AWS. I need to keep my files inside s3 using eclipse. For this

  1. Created AWS account
  2. Installed AWS plugin with my eclipse mars
  3. Create a new AWS java project for s3Sample.
  4. It creates as3sample.java it contains methods to do the same.

While i am trying to run the project i am getting errors like below. I am confused about the pom.xml file. I have added aws-java-sdk and all. But when iam trying to run the project as maven install i am getting error like below

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project demo: Compilation failure: Compilation failure:

[ERROR] error: error reading C:\Users\rameeha.c.m2\repository\org\apache\httpcomponents\httpclient\4.5.2\httpclient-4.5.2.jar; invalid LOC header (bad signature) [ERROR] error: error reading C:\Users\rameeha.c.m2\repository\org\apache\httpcomponents\httpcore\4.4.4\httpcore-4.4.4.jar; invalid LOC header (bad signature) [ERROR] error: error reading C:\Users\rameeha.c.m2\repository\commons-codec\commons-codec\1.9\commons-codec-1.9.jar; invalid LOC header (bad signature) [ERROR] error: error reading C:\Users\rameeha.c.m2\repository\software\amazon\ion\ion-java\1.0.2\ion-java-1.0.2.jar; invalid LOC header (bad signature) [ERROR] error: error reading C:\Users\rameeha.c.m2\repository\joda-time\joda-time\2.8.1\joda-time-2.8.1.jar; invalid LOC header (bad signature) [ERROR] error: error reading C:\Users\rameeha.c.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.6.7.1\jackson-databind-2.6.7.1.jar; invalid LOC header (bad signature)

Please help me to solve this issue with my project

My pom.xml is given below

<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>com.amazonaws.lambda</groupId>   <artifactId>demo</artifactId>   <version>1.0.0</version>   <packaging>jar</packaging>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.6.0</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <encoding>UTF-8</encoding>
          <forceJavacCompilerUse>true</forceJavacCompilerUse>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.0.0</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>   </build>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-bom</artifactId>
        <version>1.11.244</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>   </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>2.7.22</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-java-sdk-s3</artifactId>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-lambda-java-events</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>aws-lambda-java-core</artifactId>
      <version>1.1.0</version>
    </dependency>
    <dependency>
    <groupId>joda-time</groupId>
    <artifactId>joda-time</artifactId>
    <version>2.8.1</version> </dependency>    <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.6.7.1</version>  </dependency>   </dependencies> </project>
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
ShaiNe Ram
  • 395
  • 2
  • 6
  • 19
  • post your pom.xml.. – Vishnu T S Dec 08 '17 at 05:25
  • POM is added with the code.After creating project i added jacksn-databind artifact in the project to solve the error – ShaiNe Ram Dec 08 '17 at 06:24
  • I am using aws-java-sdk-1.11.243. Is there any problem regarding this version. Now I tried a pom like below only adding aws-sdk-dependancy. com.amazonaws aws-java-sdk 1.11.243 compile error like Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonMappingException – ShaiNe Ram Dec 08 '17 at 06:36
  • so you'r getting this error when you do mvn install – Vishnu T S Dec 08 '17 at 06:41
  • Yes...if i am creating a simple aws java project for s3. to upload one file to s3 bucket from my local folder. It is created and i added my code and there is no error. but while i m running the project it shows like Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/databind/JsonMappingException – ShaiNe Ram Dec 08 '17 at 06:47

0 Answers0