I tried to use Google Speach Api
and I have big problem with authentication.
I followed this tutorial, and I export GOOGLE_APPLICATION_CREDENTIALS, and I checked it using echo, and all ok.
But when I start code from first link I get error:
Exception in thread "main" java.io.IOException: The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.
at com.google.auth.oauth2.DefaultCredentialsProvider.getDefaultCredentials(DefaultCredentialsProvider.java:119)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:127)
at com.google.auth.oauth2.GoogleCredentials.getApplicationDefault(GoogleCredentials.java:100)
at com.google.api.gax.core.GoogleCredentialsProvider.getCredentials(GoogleCredentialsProvider.java:53)
at com.google.api.gax.rpc.ClientContext.create(ClientContext.java:110)
at com.google.cloud.speech.v1.stub.GrpcSpeechStub.create(GrpcSpeechStub.java:93)
at com.google.cloud.speech.v1.SpeechSettings.createStub(SpeechSettings.java:128)
at com.google.cloud.speech.v1.SpeechClient.<init>(SpeechClient.java:143)
at com.google.cloud.speech.v1.SpeechClient.create(SpeechClient.java:125)
at com.google.cloud.speech.v1.SpeechClient.create(SpeechClient.java:117)
at com.example.speech.QuickstartSample.main(QuickstartSample.java:58)
Of course I checked path in environment variable, even I get this file chmod 777, and nothing help.
anyone have similar problem?
My output for stat $GOOGLE_APPLICATION_CREDENTIALS:
File: /home/kruczek/Pulpit/mirthconnection-59cb32bcd531.json
Size: 2329 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode: 2360629 Links: 1
Access: (0777/-rwxrwxrwx) Uid: ( 1000/ kruczek) Gid: ( 1000/ kruczek)
Access: 2017-12-01 14:20:33.111439885 +0100
Modify: 2017-12-01 14:20:33.111439885 +0100
Change: 2017-12-01 15:24:26.476545027 +0100
Birth: -
but when i restart computer and i call stat, i have stat: missing operand
my export commend export GOOGLE_APPLICATION_CREDENTIALS=/home/kruczek/Pulpit/mirthconnection-59cb32bcd531.json
and I run project by IDE Intellij, next to privat static void main we have green arrow to run method.
In eclipse,
Run -> Run Configurations.. -> Environment tab
Enter GOOGLE_APPLICATION_CREDENTIALS under Name:
Enter json path in Value:
Make sure you have not entered with quotes when enter path in Value.
Related
pid - 808 just quit unexpectedly, please check logs under /opt/logs/100003171 and /tmp for more information![enter image description here][1]
lsLinHaiZhao ~/Desktop/apollo/apollo-configservice/target/apollo-configservice-2.0.0-SNAPSHOT-github/scripts (master)
$ sh startup.sh
mkdir: cannot create directory ‘/opt’: Permission denied
Windows new JAVA_HOME is: /c/PROGRA~1/Java/JDK18~1.0_4
2022年02月22日 16:18:17 ==== Starting ====
LOG_FOLDER /opt/logs/100003171/ does not exist. Falling back to /tmp
Started [808]
Waiting for server startup.
pid - 808 just quit unexpectedly, please check logs under /opt/logs/100003171 and /tmp for more information!
lsLinHaiZhao ~/Desktop/apollo/apollo-configservice/target/apollo-configservice-2.0.0-SNAPSHOT-github/scripts (master)
$
1.Database password cannot be used: special characters can be used to modify the database password!
2.If the database is not started, the same error will be reported. Restart the database!
3.Not here Configure the contents of relevant databases in the properties file or YML file, and comment out the unnecessary or redundant configuration information, and restart it!
There are three possible mistakes, each of which can lead to the above mistakes. Carefully examine your own problems. Using these three solutions can solve your problems!!!
I keep obtaining the same identical error as here.
I'm running eclipse under linux mint 17.3.
I've tried to add to MPJ_HOME to system variables writing this command on the terminal: export MPJ_HOME=/path/to/mpj/ (giving the real path to the folder of mpj) but the when I compile eclipse keep telling me:
[MPJRun.java]:[MPJRun.java]:MPJ_HOME environment found..
java.lang.Exception: [MPJRun.java]:MPJ_HOME environment found..
at runtime.starter.MPJRun.<init>(MPJRun.java:155)
at runtime.starter.MPJRun.main(MPJRun.java:1238)
How can I solve? I've already defined MPJ_HOME in Eclipse.
Finally I find out where the problem was!
I already have inserted in RunConfiguration>Tab "Arguments">Button "Variables...">Edit Variable>New Variable the correct values:
Name: MPJ_HOME
Value: /path/to/mpj
Description: [What you want]
and in RunConfiguration>Tab "Arguments">TextField "VM Arguments" this value: -jar ${MPJ_HOME}/lib/starter.jar -np 4
After that I missed to do so:
RunConfiguration>Tab "Environment">New... and insert the following values:
Name: MPJ_HOME
Value: ${MPJ_HOME}
With this configuration everything is working.
I know that this is a real stupid problem but I hope that this answer could help someone.
I am writing a Java application to interact with files in Google Cloud Storage. I found gcloud-java which I'm trying to get working.
Looking at their examples it seems I should be able to simply run them after having logged-in with gcloud, but it doesn't seem to be working. I'm trying to run StorageExample, which says "logged-in project will be used if not supplied", but despite logging in I cannot access my project whether I specify it or not.
$ gcloud auth login
Your browser has been opened to visit:
https://accounts.google.com/o/oauth2/auth?....
Saved Application Default Credentials.
You are now logged in as [...].
Your current project is [...]. You can change this setting by running:
$ gcloud config set project PROJECT_ID
$ java -cp GCloudDemo.jar com.google.gcloud.examples.storage.StorageExample list
Exception in thread "main" java.lang.IllegalArgumentException: A project ID is required for this service but could not be determined from the builder or the environment. Please set a project ID using the builder.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.google.gcloud.ServiceOptions.<init>(ServiceOptions.java:317)
...
at com.google.gcloud.examples.storage.StorageExample.main(StorageExample.java:566)
$ java -cp GCloudDemo.jar com.google.gcloud.examples.storage.StorageExample ... list
Exception in thread "main" com.google.gcloud.storage.StorageException: Login Required
at com.google.gcloud.spi.DefaultStorageRpc.translate(DefaultStorageRpc.java:94)
at com.google.gcloud.spi.DefaultStorageRpc.list(DefaultStorageRpc.java:148)
...
at com.google.gcloud.examples.storage.StorageExample$ListAction.run(StorageExample.java:1)
at com.google.gcloud.examples.storage.StorageExample.main(StorageExample.java:579)
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized
{
"code" : 401,
"errors" : [ {
"domain" : "global",
"location" : "Authorization",
"locationType" : "header",
"message" : "Login Required",
"reason" : "required"
} ],
"message" : "Login Required"
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
...
at com.google.gcloud.spi.DefaultStorageRpc.list(DefaultStorageRpc.java:138)
... 10 more
Clearly something is wrong with my environment, but what do I have to do to fix it? I'd like to correct my environment rather than make changes to the example.
Notes:
I'm running in Cygwin 2.0.4 on Windows 10
I'm not building via Maven, but I assume that isn't the source of the problem
The reason gcloud auth login isn't working is because Java doesn't play well with Cygwin, specifically with regards to absolute paths.
gcloud stores your settings and credentials in your Cygwin home directory, ~/.config/gcloud, but Java is going to look for them in your Windows home directory via System.getProperty("user.home"). You can specify where the application should look for this directory via the CLOUDSDK_CONFIG environment variable, like so (be sure to only specify it when calling java; setting it for your shell will in turn break gcloud):
$ CLOUDSDK_CONFIG=$(cygpath -w ~/.config/gcloud) \
java -cp GCloudDemo.jar com.google.gcloud.examples.storage.StorageExample list
Exception in thread "main" com.google.gcloud.storage.StorageException: Login Required
at ....
Notice that that we didn't have to specify a project, but we're still not logged in for some reason. It turns out the demo app doesn't do a great job of reporting authentication errors. Adding an explicit call to AuthCredentials.createApplicationDefaults() at the start of the main() method reports a much more helpful error message:
Exception in thread "main" java.io.IOException: The Application Default Credentials are
not available. They are available if running in Google Compute Engine. Otherwise, the
environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a
file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials
for more information.
So now we at least have the GOOGLE_APPLICATION_CREDENTIALS environment variable to go on. But why isn't gcloud configuring things for us? It looks like that's actually a bug in the library; it should now be able to find our login token.
In the meantime, we can workaround it by explicitly specifying the credentials path as well:
$ CLOUDSDK_CONFIG=$(cygpath -w ~/.config/gcloud) \
GOOGLE_APPLICATION_CREDENTIALS=$(cygpath -w ~/.config/gcloud)/application_default_credentials.json \
java -cp GCloudDemo.jar com.google.gcloud.examples.storage.StorageExample list
Bucket{name=...}
Success!
i am trying run the websphere liberty profile server from the command line. I am following the steps told here : https://developer.ibm.com/wasdev/downloads/liberty-profile-using-non-eclipse-environments/
I have created the server with the name server1.
But when the extraction completes and I try to start the server using the command : server start server1
the server throws an error : CWWKE0054E: Unable to open file C:\wlp\wlp\usr\servers\server1\logs\C:\Users\Furquan\AppData\Local\Temp\\ihp_custom_batches.log.. Now I know this cant be a valid path, but I dont know where and how to change it. Please help !!
This error is related to the LOG_FILE environment variable that you have defined in your environment by some other program. To solve that, you have the following opions:
Remove LOG_FILE env variable, if it is no longer needed by your system
If you cant do that, override it via server.env file, that you can create in the wlp\usr\servers\serverName directory with the following content:
LOG_FILE=console.log
As last resort (this is not recommended, will make your installation NOT SUPPORTED and in certain installations might get overwritten by updates) - modify the server.bat command line script - in the script find the following section:
if not defined LOG_FILE (
set X_LOG_FILE=console.log
) else (
set X_LOG_FILE=!LOG_FILE!
)
And after the line set X_LOG_FILE=!LOG_FILE! just add another line that will override it with the default like this set X_LOG_FILE=console.log
In general, I'd recommend second solution (with the server.env file), as it is the most portable and will work in any environment.
I have the similar problem for IBM Support Assistant V5. After I deleted %LOG_FILE% from Environment Variables, it worked.
I have a pentaho job which runs successfully in pentaho but if i try to run the same through command line i get the error
Kitchen can't continue because the job could not be loaded.
D:\data-integration>kitchen.bat /file:D:\PENTAHO\pentahojobsNtrans_1\jobs\vws_sync_job_2.kjb /level:Basic
DEBUG: Using JAVA_HOME
DEBUG: _PENTAHO_JAVA_HOME=C:\Program Files\Java\jre7
DEBUG: _PENTAHO_JAVA=C:\Program Files\Java\jre7\bin\java.exe
2014/08/25 12:44:33 - Kitchen - Logging is at level : Basic logging
2014/08/25 12:44:33 - Kitchen - Start of run.
ERROR: Kitchen can't continue because the job couldn't be loaded.
What is that i am doing wrong?
please help
The most common mistake that the begginers do (I am included) is to use "\" to give the path of the transformation or the job. Replace it by "/".
I get the same error on Windows (maybe de same solution works on Linux) because I have spaces on file names. If it is your case, protect the entire path of file directory with quotation marks.
For example:
"C:\Program Files\Pentaho Data Integration - Kettle 6.1.0.1\kitchen.bat" /file:"C:/Users/Username/Documents/Pentaho Projects/Job - System Integration.kjb" /level:Basic
Another important thing is to follow the instruction given by a_horse_with_no_name (funny username by the way) using slash.
Avoid the backslash instruction as given in the kitchen documentation (http://wiki.pentaho.com/display/EAI/Kitchen+User+Documentation) on its example: kitchen.bat /file:D:\Jobs\updateWarehouse.kjb /level:Basic