Failed with exit code 1 Error In cordova - java

C:\phoneGap\firstApp>cordova run android
ANDROID_HOME=C:\Android\sdk\
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_74 Unzipping C:\Users\Somnath Sarkar\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1q\gradle-2.13-all.zip to C:\Users\Somnath Sarkar\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1qException in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) ... 3 more
Error: cmd: Command failed with exit code 1 Error output: Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65) ... 3 more

Delete "gradle-2.13-all.zip" folder and everything in this directory:
C:\Users\Somnath
Sarkar.gradle\wrapper\dists\gradle-2.13all\7hsc6vr6mi3i6i5m7q9hj4ci1q\
Download the gradle zip manually click here
Paste the gradle zip folder in
C:\Users\Somnath
Sarkar.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7q9hj4ci1q\
Run your
Codova build android

Caused by: java.util.zip.ZipException: error in opening zip file which means the concurrent ZIP file was Corrupted.
Solution :
Please Check the Zip file in C:\Users\YourUsername\.gradle\wrapper\dists\gradle-2.13-all\someRandomSting\ size and if it'size not equals to 66.6M then Download and Replace with this

Related

java.io.FileNotFoundException: (Read-only file system) in aws lambda

I have a spring boot application that is being exported as a .zip file and used as a lambda function. I'm generating a file and adding content to it.
file = new File(fileName);// fileName is just a String.txt
context.getLogger().log("File Path1: "+file.getAbsolutePath());
FileUtils.writeLines(file, failedMessages); //failedMessages is a List<String>
context.getLogger().log("File Path2: "+file.getAbsolutePath());
The logs:
File Path1: /var/task/Platform_Status_Failed_2022_09_09.txt
Exception caught java.io.FileNotFoundException: Platform_Status_Failed_2022_09_09.txt (Read-only file system)
Not sure how to fix this. Should I create a temporary folder and save the file and write to that path or is there any other simpler fix?
Update:
Tried using the /tmp path of lambda. As per my logs, it seems that the contents are written to this location but when I'm trying to upload this file to S3 I get an Exception:
Unable to calculate MD5 hash: /tmp/Platform_Status_Failed_2022_09_09.txt (No such file or directory): java.lang.BootstrapMethodError
java.lang.BootstrapMethodError: Unable to calculate MD5 hash: /tmp/Platform_Status_Failed_2022_09_09.txt (No such file or directory)
at com.paytmmoney.bo.equities.lambda.handler.LambdaMethodHandler.uploadToS3(LambdaMethodHandler.java:171)
at com.paytmmoney.bo.equities.lambda.handler.LambdaMethodHandler.uploadFileToS3(LambdaMethodHandler.java:88)
at com.paytmmoney.bo.equities.lambda.handler.LambdaMethodHandler.handleRequest(LambdaMethodHandler.java:58)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
Caused by: com.amazonaws.SdkClientException: Unable to calculate MD5 hash: /tmp/Platform_Status_Failed_2022_09_09.txt (No such file or directory)
at com.amazonaws.services.s3.AmazonS3Client.getInputStream(AmazonS3Client.java:1849)
at com.amazonaws.services.s3.AmazonS3Client.uploadObject(AmazonS3Client.java:1767)
at com.amazonaws.services.s3.AmazonS3Client.putObject(AmazonS3Client.java:1746)
at com.paytmmoney.bo.equities.lambda.handler.LambdaMethodHandler.uploadToS3(LambdaMethodHandler.java:159)
... 6 more
Caused by: java.io.FileNotFoundException: /tmp/Platform_Status_Failed_2022_09_09.txt (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at com.amazonaws.util.Md5Utils.computeMD5Hash(Md5Utils.java:97)
at com.amazonaws.util.Md5Utils.md5AsBase64(Md5Utils.java:104)
at com.amazonaws.services.s3.AmazonS3Client.getInputStream(AmazonS3Client.java:1845)
... 9 more

"Failed to parse poms" Jenkins maven build

I am new to Jenkins and I am trying to integrate it with Cucumber and Maven ( so i can schedule automated scripts) but whenever I try to run my build I receive the following error:
ERROR: Failed to parse POMs
java.io.IOException: Cannot run program "/bin/java" (in directory "C:\Users\rharrigan\Documents\TestingScripts\tcwebsitelinks"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(Unknown Source)
at hudson.Proc$LocalProc.<init>(Proc.java:245)
at hudson.Proc$LocalProc.<init>(Proc.java:214)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:846)
at hudson.Launcher$ProcStarter.start(Launcher.java:384)
at hudson.maven.AbstractMavenProcessFactory.newProcess(AbstractMavenProcessFactory.java:278)
at hudson.maven.ProcessCache.get(ProcessCache.java:236)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:798)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
at hudson.model.Run.execute(Run.java:1728)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 13 more
[CucumberReport] Preparing Cucumber Reports
[CucumberReport] Copied 0 json files from workspace "C:\Program Files (x86)\Jenkins\workspace\CucumberTest" to reports directory "C:\Program Files (x86)\Jenkins\jobs\CucumberTest\builds\9\cucumber-html-reports\.cache"
ERROR: Build step failed with exception
java.lang.IllegalStateException: basedir C:\Program Files (x86)\Jenkins\jobs\CucumberTest\builds\9\cucumber-html-reports\.cache does not exist.
at org.apache.tools.ant.DirectoryScanner.scan(DirectoryScanner.java:879)
at net.masterthought.jenkins.CucumberReportPublisher.findJsonFiles(CucumberReportPublisher.java:148)
at net.masterthought.jenkins.CucumberReportPublisher.generateReport(CucumberReportPublisher.java:101)
at net.masterthought.jenkins.CucumberReportPublisher.perform(CucumberReportPublisher.java:73)
at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:78)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720)
at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1067)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665)
at hudson.model.Run.execute(Run.java:1753)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:544)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:404)
Build step 'Cucumber reports' marked build as failure
Finished: FAILURE
Any ideas or suggestions would be much appreciated.

Error running Cordova android platform

I'm trying to create my first cordova hybrid app. I run it with the "cordova browser" pratform and the app run fine. Now, when i try to build the app for android the console show me the next error :
$ cordova build android
ANDROID_HOME=C:\Users\MyUser\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_121
Unzipping C:\Users\MyUser\.gradle\wrapper\dists\gradle-2.13-all\7hsc6vr6mi3i6i5m7 q9hj4ci1q\gradle-2.13-all.zip to C:\Users\MyUser\.gradle\wrapper\dists\gradle-2.1 3-all\7hsc6vr6mi3i6i5m7q9hj4ci1q
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipExceptio n: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:65)
... 3 more
Error: cmd: Command failed with exit code 1 Error output:
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipExceptio n: error in opening zip file
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:78)
at org.gradle.wrapper.Install.createDist(Install.java:47)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:219)
at java.util.zip.ZipFile.<init>(ZipFile.java:149)
at java.util.zip.ZipFile.<init>(ZipFile.java:163)
at org.gradle.wrapper.Install.unzip(Install.java:160)
at org.gradle.wrapper.Install.access$400(Install.java:29)
at org.gradle.wrapper.Install$1.call(Install.java:70)
at org.gradle.wrapper.Install$1.call(Install.java:47)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAcc essManager.java:65)
... 3 more
Before, i was fixin others errors but with this, i don't know what i need to do. If a run the command "cordova requirements android" the console show that I have installed everything that I need.
The output for that command is the next:
$ cordova requirements android
Error loading cordova-browser
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed
Android target: installed android-14,android-16,android-18,android-22,android-23,android-24,android-25,Google Inc.:Google APIs:22,Google Inc.:Google APIs:23,Google Inc.:Google APIs:24
Gradle: installed
My project is on "React JS" and his libraries.
In your case, find this:
C:\Users\MyUser.gradle\wrapper\dists\gradle-2.13-
all\7hsc6vr6mi3i6i5m7
now when you find it,delete the gradle-2.2.1-all.zip because this file is corrupted and then we'll replace for this http://services.gradle.org/distributions/gradle-2.2.1-all.zip
when you finish all try again
cordova build android

apktool decode error on 32-bit Ubuntu

When I run apktool on Ubuntu 12.04 LTE(32), something is wrong. But when I run it on Ubuntu 12.04 LTE(64), everything is ok.
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.util.zip.ZipException: archive is not a ZIP archive
at brut.androlib.ApkDecoder.hasResources(ApkDecoder.java:247)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:91)
at brut.apktool.Main.cmdDecode(Main.java:169)
at brut.apktool.Main.main(Main.java:85)
Caused by: brut.directory.DirectoryException: java.util.zip.ZipException: archive is not a ZIP archive
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:54)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:37)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.ApkDecoder.hasResources(ApkDecoder.java:245)
... 3 more
Caused by: java.util.zip.ZipException: archive is not a ZIP archive
at org.apache.commons.compress.archivers.zip.ZipFile.positionAtCentralDirectory32(ZipFile.java:717)
at org.apache.commons.compress.archivers.zip.ZipFile.positionAtCentralDirectory(ZipFile.java:672)
at org.apache.commons.compress.archivers.zip.ZipFile.populateFromCentralDirectory(ZipFile.java:406)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:206)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:182)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:143)
at brut.directory.ZipExtFile.<init>(ZipExtFile.java:28)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:52)
... 6 more

Error while install hadoop on mac

I was trying to install hadoob on mac. I got the following error. What could be the issue?
hadoop-0.20.203.0 administrator$ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
Exception in thread "main" java.io.IOException: Error opening job jar: hadoop-*-examples.jar
at org.apache.hadoop.util.RunJar.main(RunJar.java:90)
Caused by: java.util.zip.ZipException: error in opening zip file
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(ZipFile.java:127)
at java.util.jar.JarFile.<init>(JarFile.java:135)
at java.util.jar.JarFile.<init>(JarFile.java:72)
at org.apache.hadoop.util.RunJar.main(RunJar.java:88)
-Anish-
I had a similar issue with an example from the book Hadoop In Action. It turns out either the book had it wrong or the example jars now have a different naming scheme. In any case, your command should now begin with:
bin/hadoop jar hadoop-examples-*.jar

Categories