bash command from Grails application - shell

I am working in grails application which needs to execute an external bash command like so:
def cmd= "example".execute()
cmd.waitFor()
the problem is that this command is well executed when i run it from development environment but when i deploy it into tomcat this command is not executed any more.
Can someone help me please to solve this problem?

UPDATE
It looks like you're invoking an Ant Task from your TaskService.
Without your code, or you adding more debugging, it will be difficult to help.
"On ne sait pas ce que fait TaskService, ajoute du debug dans le code, ca va etre dur d'aider sans détails"
Try to debug it, by putting this line right after your execute call.
cmd.text.eachLine { log.info it }

Related

Configuration Python environment with Behave

I have a problem with the configuration of the run/debug configuration in PyCharm. When i run my behave script with the standard configurations my script wont work.
configuration behave
and i will get the message:
"D:\pythontestscripts\venv\Scripts\python.exe "C:/Program Files/JetBrains/PyCharm 2022.3.2/plugins/python/helpers/pycharm/behave_runner.py"
Testing started at 05:57 ...
Gevonden omgeving: O
Extern: FALSE
restArcgisUri voor omgeving 'O': https://xxxxxxxxxx.xxx
restErdasUri voor omgeving 'O': https://xxxxxxxxxxx.xxx
Undefined
Undefined step. Rest part of scenario is skipped
Process finished with exit code 0"
When we configure it as a shell script its possible to run the code correctly:
configuration shellscript
My question is as followed: How do change the parameters/configuration so the script will work for the standard behave configurations instead of a shell script?
I have tried filling in parameters/scenarios to make the script work but i have no idea what im doing.

Special characters in a srping boot application error when launched from cmd and from STS

I am developing a Vaadin Spring Boot application.
When I start the app from the Spring Tool Suite everything is ok.
But when I start it from cmd, I get errors on special characters like german umlauts.
Started from cmd: Jürgen Höller
Started from STS: Jürgen Höller
Any ideas? It must run as a service, so I need to run it from a bat in cmd.
I am working with a german edition of windows 10 in Germany
It is a mojibake!
The problematic code was:
try (Reader reader = new FileReader(file)) {
The solution for it is:
try (Reader reader = new FileReader(file, StandardCharsets.UTF_8)) {
Thanks JosefZ for pointing this out in your comment.

Error deploying JHipster with aws-containers on Windows 10

I'm trying to deploy a monolith JHipster demo on AWS using AWS-containers
c:\jhipster\demo>jhipster aws-containers
..
🔧🛠️ AWS configuring
√ ECR Auth token has been retrieved.
Run-async async() called outside a valid run-async context, callback will be ignored.
AWS default
Warning demo is using a cache provider, scaling will not be available. Refer to an AWS native scaling service.
force ..\..\Users\demo\.yo-rc-global.json
identical pom.xml
identical src\main\java\com\demo\bootstrap\AwsSSMConfiguration.java
identical src\main\resources\META-INF\spring.factories
force .yo-rc.json
identical src\main\resources\config\bootstrap-aws.yml
identical base.template.yml
identical demo.template.yml
Run-async wrapped function (sync) returned a promise but async() callback must be executed to resolve.
× ".." no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
× The Docker image build failed. Error: Command failed: ../demo/./mvnw -ntp -Pprod verify jib:dockerBuild
".." no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
I'm using JHipster 6.10.5 on windows 10.
The output is partially on spanish, the translation is:
'..' is not recognized as an internal or external command
it's a environment issue caused by windows 10.
I see the same error at
https://github.com/jhipster/generator-jhipster/issues/8366#issuecomment-489498566
Also looks like a windows machine.
Is trying to execute
../demo/./mvnw -ntp -Pprod verify jib:dockerBuild
that not is a valid command on windows system.
Any idea about how fix it?

Bluemix CLI Joomla 3.8 installation final steps

I am installing Joomla 3.8 for a demo purpose on Bluemix, through Cloud Foundy - cf push,
And the URL is : https://joomlacloud.eu-gb.mybluemix.net/installation/index.php#
as i use ClearDb as external database, the new security tool since joomla 3.7.4 requests a file created in the /install folder to be removed.
Message : "Afin de confirmer que vous êtes le propriétaire de ce site Web, supprimez le fichier "_JoomlaUQEvA8900RHAnVyBbf1Zs.txt" que nous venons de créer dans le dossier "installation" de votre site Joomla."
Does someone explain me how i can do access to this file for removing ?
Thank you in advance
Yves
Run cf ssh <your-app-name>. Then cd app/. You'll now be in the root of your application. From there locate the file and rm it. The change will be instant.
Things will be more confusing if you have multiple instances of your application. In that case, you might need to cf ssh into all of them to find where the file was written, or just scale down to one while you're installing.
Just keep in mind that any files you cf push'd with your application will return when your application is restarted, intentionally or otherwise. If you need to remove a file that you cf push'd then you should do so locally and cf push a second time without that file or files.
Hope that helps!

Unable to start program in debug mode. Debug Dll installation issue?

I've just get a new machine and try to checkout, build and launch my program.
When hitting "launch in debug" button, I have this error message poping up from MS VS:
Unable to start program 'xx'. This
application has failed to start
because the application configuration
is incorrect. Reviex the manifest file
for possible errors. Reinstalling the
application may fix this problem. For
more details , please see the
application event log.
Have a look into the application event log:
Type de l'événement : Erreur Source de
l'événement : SideBySide Catégorie de
l'événement : Aucun ID de l'événement
: 59 Date : 24/08/2009 Heure
: 16:10:03 Utilisateur : N/A
Ordinateur : XXXXXXXX Description :
Resolve Partial Assembly a échoué pour
Microsoft.VC80.DebugCRT. Message
d'erreur de référence : L'assemblage
référencé n'est pas installé sur votre
système. .
Pour plus d'informations, consultez le
centre Aide et support à l'adresse
http://go.microsoft.com/fwlink/events.asp.
Ok , the text is in french, but it roughly tells that that resolving the "partial assembly" didn't work for "Microsoft.VC80.DebugCRT". It conludes so that this assemlby is not installed on my machine.
Having a look into the C:\windows\system32 folders, I see no mscvrt80d.dll file. (Huu .. Is it this one I should expect?). MS visual studio 8.0 is freshly installed by admin system though.
Did you ever have that issue before ? And how did you fix that ?
It is not the neatest solution, but in addition to shared SxS installs of the C-runtime - which incidentally are installed to a folder: c:\windows\winsxs - its completely legitimate to perform what is called a "private side-by-side" install - which for debug builds will be most convenient.
Simply go to your folder: C:\Program Files\Microsoft Visual Studio 8\VC\redist\Debug_NonRedist\x86, and copy the appropriate folder into the deployment folder of your debug build:
So, if your app is installed in C:\Test\MyApp, you would now have a folder called C:\Test\MyApp\Microsoft.VC80.DebugCRT
(You can also copy the foles from the assembly straight into your app folder, but I find that messy).
Actually CRT was not the issue here. What caused the problem was that another lib I used was compiled by a co-worker on his machine and sent to me through shared directory. Therefore the recipient folder for the DLL was not the same as it was on the original machine from my coleague. I guess the issue is because the manifest files expect it to be the same(?), or does it expect to find the source code at a specified path (?).
Anyway, re-compiling the lib in question from scratch on my machine resolved the issue..

Resources