Google Drive Java Quick Start Guide Warning - java

The following was the error.
WARNING: Application name is not set. Call Builder#setApplicationName.
Exception in thread "main" java.io.FileNotFoundException: document.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at com.google.api.client.http.FileContent.getInputStream(FileContent.java:71)
at com.google.api.client.googleapis.media.MediaHttpUploader.upload(MediaHttpUploader.java:361)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:418)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at DriveCommandLine.main(DriveCommandLine.java:56)

Quickstart application uploads document.txt file from your local filesystem to Drive. Please place any file named document.txt on working directory of your application before executing the code.

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

Getting a Keytool Error while creating for flutter app?

I m trying release my flutter app.. but when I try to generate keytool I am getting this following error:
enter code here:[Storing c:\Users\USER_NAME\upload-keystore.jks]
keytool error: java.io.FileNotFoundException: c:\Users\USER_NAME\upload-keystore.jks
(The system cannot find the path specified)
java.io.FileNotFoundException: c:\Users\USER_NAME\upload-keystore.jks (The system cannot
find the path specified)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:235)
at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:123)
at java.base/sun.security.tools.keytool.Main.doCommands(Main.java:1360)
at java.base/sun.security.tools.keytool.Main.run(Main.java:415)
at java.base/sun.security.tools.keytool.Main.main(Main.java:408)
Can anyone know how to solve this..?

Unable to run Sabre Red App in Sandbox mode

I went through 'Getting Started with Red App Development'. Looks like the Red App cab be run in Sandbox mode when neither CERT nor PROD environment is accessible. We are in the process to get the login credential for CERT and PROD environment. Meanwhile, I wanted to run the RedApp product in the Sandbox mode.
Per the ‘Getting Started with Red App Development’ document, added the following VM argument to the run environment:
Dredapp.fake.session=true
Ran the RedApp product, but could not get through the VPN login page.
I found following exceptions in the log :
SEVERE: Exception occured during copying 'hssp-mapping_SVPNMapping_HSSP_sabre.com.properties' file to the workspace
java.io.FileNotFoundException: C:\Users\jjha\.jsapi\hssp-mapping_SVPNMapping_HSSP_sabre.com.properties (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
SEVERE: Exception occured during copying 'hssp-mapping_SVPNMapping_HSSP_sabre.com.properties' file to the workspace
java.io.FileNotFoundException: C:\Jay\runtime-RedAppRun\emulator_files\hostinfo_svpn.txt (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
What is the fix for the above issues/exceptions?
Have you tried clicking on the Validate Plugins option, from the Plugins Tab?
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.pde.doc.user%2Fguide%2Ftools%2Flaunchers%2Fplugins.htm
Below is the fix for the issue:
Launch the Red App
click tools->Options->Sabre System>Connection, and select 'Private network' instead of 'SSL VPN'

EMMA failed to dump coverage data: java.io.FileNotFoundException: coverage.ec (Permission denied)

I have done the following steps.
Copied emma.jar into classpath
Instrumented the code and got coverage.em
Restarted server and checked the tomcat log(No suggestion of Emma collecting coverage data)
Started doing some tests on the application
Stopped tomcat, I get the below when I stopped tomcat.
java.io.FileNotFoundException: coverage.ec (Permission denied)
at java.io.RandomAccessFile.open(Native Method)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:236)
at com.vladium.emma.data.DataFactory.persist(DataFactory.java:656)
at com.vladium.emma.data.DataFactory.persist(DataFactory.java:86)
at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:54)
at com.vladium.emma.rt.RTExitHook.run(RTExitHook.java:32)
at java.lang.Thread.run(Thread.java:701)
Exception in thread "EMMA shutdown handler thread" java.lang.RuntimeException: EMMA failed to dump coverage data: java.io.FileNotFoundException: coverage.ec (Permission de
at com.vladium.emma.rt.RTCoverageDataPersister.dumpCoverageData(RTCoverageDataPersister.java:71)
at com.vladium.emma.rt.RTExitHook.run(RTExitHook
at java.lang.Thread.run(Thread.java:701)
Does Anyone know what step I am missing. I would greatly appreciate if anyone could help out.
Thanks,
This error:
java.io.FileNotFoundException: coverage.ec (Permission denied)
Generally means that you don't have permission to read the file. Verify that the user that is running the application has permissions to read coverage.ec, and that the file exists.
If you are using Win7, you may want to check whether your workspace is under "C:\". This caused a permissions issue for me. I changed my workspace into "C:\Users\[MyAccount]" and the permission issue was gone.

Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Invalid WSDL?

I get the following error while trying to generate a web-services client stub...
When I log into Apache Admin page and I can see the web service and the service end point of 'http://localhost:8080/axis2/services/HelloWorldService?wsdl' - why cant WSDL2Java.bat find the wsdl file..?
C:\AAA\HelloWorld\client\client>WSDL2Java.bat -uri http://localhost:8080/axis2/services/HelloWorldService?wsdl -o client
Using AXIS2_HOME: C:\Axis2\axis2-1.5.6
Using JAVA_HOME: C:\Program Files (x86)\Java\jdk1.6.0_23
Exception in thread "main" org.apache.axis2.wsdl.codegen.CodeGenerationException: Invalid WSDL Location
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:58)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:28)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:22)
Caused by: java.io.FileNotFoundException: http:\localhost:8080\axis2\services\HelloWorldService?wsdl (The filename, directory name, or volume label syntax is incorrect)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.getWOM(CodeGenerationEngine.java:110)
at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGenerationEngine.java:52)
... 2 more
C:\AAA\HelloWorld\client\client>
Clearly exception says, it can not find the file
http:\localhost:8080\axis2\services\HelloWorldService?wsdl.
Please check if there is any file and run it.

Categories