aws-samples / aws-java-sample

Sample project to demonstrate usage of the AWS SDK for Java
Apache License 2.0
231 stars 339 forks source link

Build Error #26

Open nura72019 opened 4 years ago

nura72019 commented 4 years ago

Very new to programming and AWS SDK Java... Just getting started..

After following all the instructions am getting still the Build Failure still.

[INFO] Scanning for projects... [INFO] [INFO] ---------------< com.amazonaws.samples:aws-java-sample >---------------- [INFO] Building aws-java-sample 1.0 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aws-java-sample --- [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ aws-java-sample --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master\${env.HOME}.aws [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ aws-java-sample --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master\target\classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later. [INFO] 2 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.761 s [INFO] Finished at: 2019-11-24T17:04:57-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project aws-java-sample: Compilation failure: Compilation failure: [ERROR] Source option 5 is no longer supported. Use 7 or later. [ERROR] Target option 5 is no longer supported. Use 7 or later. [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master>pom.xml

C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master>pom.xml

C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master>mvn clean compile exec:java [INFO] Scanning for projects... [INFO] [INFO] ---------------< com.amazonaws.samples:aws-java-sample >---------------- [INFO] Building aws-java-sample 1.0 [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ aws-java-sample --- [INFO] Deleting C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master\target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ aws-java-sample --- [INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] skip non existing resourceDirectory C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master\${env.HOME}.aws [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ aws-java-sample --- [INFO] Changes detected - recompiling the module! [INFO] Compiling 1 source file to C:\Users\userm\Documents\AWS_IOT\aws-java-sample-master\target\classes [INFO] [INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) > validate @ aws-java-sample >>> [INFO] [INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) < validate @ aws-java-sample <<< [INFO] [INFO] [INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ aws-java-sample ---

Getting Started with Amazon S3

Creating bucket my-first-s3-bucket-e53f604f-8bb8-43c2-941d-cec1e20fc1c9

[WARNING] java.lang.reflect.InvocationTargetException at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:297) at java.lang.Thread.run (Thread.java:830) Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter at com.amazonaws.util.Base64.encodeAsString (Base64.java:36) at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode (AbstractAWSSigner.java:70) at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode (AbstractAWSSigner.java:58) at com.amazonaws.services.s3.internal.S3Signer.sign (S3Signer.java:127) at com.amazonaws.http.AmazonHttpClient.executeOneRequest (AmazonHttpClient.java:652) at com.amazonaws.http.AmazonHttpClient.executeHelper (AmazonHttpClient.java:460) at com.amazonaws.http.AmazonHttpClient.execute (AmazonHttpClient.java:295) at com.amazonaws.services.s3.AmazonS3Client.invoke (AmazonS3Client.java:3697) at com.amazonaws.services.s3.AmazonS3Client.createBucket (AmazonS3Client.java:788) at com.amazonaws.services.s3.AmazonS3Client.createBucket (AmazonS3Client.java:713) at com.amazonaws.samples.S3Sample.main (S3Sample.java:86) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:297) at java.lang.Thread.run (Thread.java:830) Caused by: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter at java.net.URLClassLoader.findClass (URLClassLoader.java:436) at java.lang.ClassLoader.loadClass (ClassLoader.java:588) at java.lang.ClassLoader.loadClass (ClassLoader.java:521) at com.amazonaws.util.Base64.encodeAsString (Base64.java:36) at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode (AbstractAWSSigner.java:70) at com.amazonaws.auth.AbstractAWSSigner.signAndBase64Encode (AbstractAWSSigner.java:58) at com.amazonaws.services.s3.internal.S3Signer.sign (S3Signer.java:127) at com.amazonaws.http.AmazonHttpClient.executeOneRequest (AmazonHttpClient.java:652) at com.amazonaws.http.AmazonHttpClient.executeHelper (AmazonHttpClient.java:460) at com.amazonaws.http.AmazonHttpClient.execute (AmazonHttpClient.java:295) at com.amazonaws.services.s3.AmazonS3Client.invoke (AmazonS3Client.java:3697) at com.amazonaws.services.s3.AmazonS3Client.createBucket (AmazonS3Client.java:788) at com.amazonaws.services.s3.AmazonS3Client.createBucket (AmazonS3Client.java:713) at com.amazonaws.samples.S3Sample.main (S3Sample.java:86) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:567) at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:297) at java.lang.Thread.run (Thread.java:830) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 3.522 s [INFO] Finished at: 2019-11-24T17:07:57-05:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project aws-java-sample: An exception occured while executing the Java class. null: InvocationTargetException: javax/xml/bind/DatatypeConverter: javax.xml.bind.DatatypeConverter -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Please help !!! Thanks in advance