I am working on automation script to install a WAR in the Websphere using WSADMIN console. It leaves random string at the end of the application name.
If the application name is 'test.war', name appears as 'test.war1525e76b1cb'. Has anyone come across this issue before? Any solutions worked. I need the application name to match the artifact to use isAppReady and start the application.
I believe not providing specific app name appends random string to the artifact name and sets as application display name. This line of code with -appname option did the trick.
AdminApp.install(appPath,['-appname '+app_name+'','-MapWebModToVH', [['.*', '.*', 'default_host']]])
Related
The goal is to customize the login of an embedded keycloak application. It worked seamlessly for the standalone version, but the embedded version makes some small troubles
Setup
<keycloak.version>17.0.1</keycloak.version>
<spring.version>2.6.7</spring.version>
I followed the tutorials on https://www.baeldung.com/spring-keycloak-custom-themes and https://www.keycloak.org/docs/latest/server_development/. The files are under "themes/<myTheme>/..." and the reference to this path is set accordingly e.g. over System.property(...,...) . However, when the application runs and the theme is invoked a FreeMarkerException is thrown with the hint that it's not existing.
The exception is thrown by FreeMarkerUtil.
The mainpoint is, that the reference was not taken by embedded keycloak. I don't know exactly why. Researching the path by the DefaultThemeManager indicates that it's searching for the path theme/<myTheme>/... As you might (not) noticed, the "s" is missing. So it can't find the file.
In case you get a similar error, you can check the file reference.
I'm trying to use Google.Cloud.Translation service of Google Cloud platform (GCP) for the translation of text in Xamarin forms. I want to translate my application from English to Arabic. I enabled the API. Created a json file from the Service account. Followed the step in the following url
https://cloud.google.com/translate/docs/setup
But still when I try to set the GOOGLE_APPLICATION_CREDENTIALS I get exception-
Error reading credential file from location
C:/Users/xxx/Downloads/xxxx-280817-bedb566bfd11.json: Could not find a part of the path "/C:/Users/xxxx/Downloads/xxxx-280817-bedb566bfd11.json". Please check the value of the Environment Variable GOOGLE_APPLICATION_CREDENTIALS
I have tried numerous ways to fix this. This is my code:
System.Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS","C:/Users/xxx/Downloads/xx-280817-bedb566bfd11.json");
TranslationClient client = TranslationClient.Create();
How can I fix this, so I can have translation of English to Arabic language in my Xamarin form?
Put your GOOGLE_APPLICATION_CREDENTIALS json file as EmbeddedResource and you can get yout path by this way
<ItemGroup>
<EmbeddedResource Include="_fonts/OpenSans.ttf" />
</ItemGroup>
to get the file path
var assembly = typeof(MyLibrary.MyClass).GetTypeInfo().Assembly;
Stream resource = assembly.GetManifestResourceStream("MyLibrary._fonts.OpenSans.ttf");
The key point is to use the right name on GetManifestResourceStream call. You have to use [assembly name].[directory].[file name].
Ref link: https://stackoverflow.com/a/41106851/4778712
The issue you are having is that 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 on your local machine, pointing to a file defining the credentials as shown here.
So how to you define it?
If you are using a Mac and you place the json file in the Downloads folder, you would open your Terminal app and run this command in it:
export GOOGLE_APPLICATION_CREDENTIALS="/home/user/Downloads/xx-280817-bedb566bfd11.json"
It seems like you are using a Windows computer and you placed the file in your Downloads folder, so you would open your "Windows Command Prompt" (type CMD in Run, or search for Command Prompt) and run this command:
set GOOGLE_APPLICATION_CREDENTIALS="C:\Users\xxx\Downloads\xx-280817-bedb566bfd11.json"
Make sure that the xx-280817-bedb566bfd11.json is the correct file name of the JSON file that contains your service account key.
You could get the service account key in the Google Cloud Platform Console as shown here.
Just tried this thing for a day or two, able to do the installation using AdminApp command, but still got some problem about application name and installation path.
Reference I look from IBM said AppName is defined by display name, I think that mean it use the display name field from web.xml? But the result that I see is the application name will look like "Test_AP.war16dfd74ab1a", not exactly the same.
The installation path parameter part is also ambiguous, I don't think I see a thing looks like it.
https://www.ibm.com/support/knowledgecenter/SSEQTP_8.5.5/com.ibm.websphere.base.iseries.doc/ae/rxml_taskoptions.html?view=embed#rxml_taskoptions__cmd10
import time
AdminApp.install('C:/Users/Development/Desktop/Test_AP.war', '-cell WIN-9DAB2SINode01Cell')
AdminConfig.save()
result = AdminApp.isAppReady('Test_AP')
while (result == "false"):
### Wait 5 seconds before checking again
time.sleep(5)
result = AdminApp.isAppReady('Test_AP')
print("Starting application...")
What I try to achieve is to use this script to install my service onto WAS with exact application name(same as my WAR name or display name in web.xml) and designated installation path, then start the service. But now I'm stuck at com.ibm.ws.scripting.ScriptingException: WASX7280E: An application with name "Test_AP_WAR" does not exist. Can anyone tell me how to do this?
Simple Solution
You need to include an -appname argument such as:
AdminApp.install('C:/Users/Development/Desktop/Test_AP.war', ['-cell WIN-9DAB2SINode01Cell' -appname SimpleTestConnection5_war])
Otherwise WAS will generate an application name for you.
Ideal Solution
Create an AdminApp.install command using the Admin Console. Install an enterprise application using the WAS Admin Console. On the last page, you will see a help box in the upper right corner. Click on view administrative scripting and you will be provided with an AdminApp.install command. This command can be edited with a custom location and appname.
My App is named 'This & That'. Well, that's not my App's real name. 'This' and 'That' stand in for the two actual words I'm using.
In Xcode > Targets > General > Identity > Bundle Identifier shows:
com.domain.This---That
So, it looks like Xcode replaced the two spaces and the ampersand in my App name with hyphens in order to generate a bundle ID it liked.
Over in iTunes Connect under App Information > Identifiers, the Bundle ID shows:
'This---That'
I think that's wrong. This was due to a misunderstanding on my part when I entered the data. I believe I should have entered 'com.domain.This---That'
I discovered this issue when I made an Archive of my App in the Organizer and submitted it for Validation.
The Validation failed with one fault and I got the following back:
"The bundle identifier cannot be changed from the current value, 'This---That'. If you want to change your bundle identifier, you will need to create a new application in iTunes Connect."
Maybe I'm being too literal here but when it says,
"...you will need to create a new application in iTunes Connect."
it seems to me that before I can do that, I will need to delete the application I have in iTunes Connect now (the one with the wrong bundle ID).
I read about how to delete an App in iTunes Connect and says that if I do that, I cannot reuse the SKU or the App name in the same organization.
That could be a real problem for me because I really like the App name I have now. The two words I've chosen work really well for what I'm doing. So if I can avoid it, I do not want to do anything here to fix my problem that will preclude me from using the App name I've chosen.
Any suggestions on how I might sort this problem out?
I need a help on getting Special folder in windows service program. I used this code in my Windows Form application:
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
and got the path, ""C:\Users\\AppData\Roaming"*
But if I run the same code in my Winows Service project I got the path: "C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\"
But I need the earlier path (got in Windows Form). How do I get the same path in Service projet also.
I have user setting file, log, config file in the "C:\Users\\AppData\Roaming" folder. So I have to refer the same path both in my Windows Form application and Windows Service project.
Can somebody tell me, what is the difference here and how do i get the same path in both type of project?
Thanks,
sharath
Your Windows Service should use 'User' Account, instead of 'LocalService' or 'LocalSystem'.
ServiceProcessInstaller process = new ServiceProcessInstaller();
process.Account = ServiceAccount.User;
And during installation of the service, you need to specify the username and password of currently logged in user. Username should be in this format: "MachineName\UserName". Example: ".\John"