ACE TAO cannot get NameService object in debug mode - ace

I'm running a multi-program projects using ACE TAO. I set the Environment Variables and compiled ACE_TAO environment. Then I copied the tao_cosnaming.exe to my project run directory and use a .bat to start the naming service.
The programs run well if I start them directly, but they could not get the "NameService" correctly when I invoke obj = orb->resolve_initial_references("NameService") in debug mode. (I could not run obj->_non_existent(), it throws an error).
It seemed because the Naming Service is implemented as a remote one. When I invoke obj = orb->invoke resolve_initial_references("RootPOA"), things are fine, because RootPOA is local object so obj->_non_existent() return immediately.
The .bat file is like:
cd /D %DTAX_RUN_DIR%
tao_cosnaming -ORBEndPoint iiop://%DTAX_NAME_SERVICE_HOST%
The DTAX_RUN_DIR and DTAX_NAME_SERVICE_HOST are Environment Variables. DTAX_RUN_DIR is project run directory and DTAX_NAME_SERVICE_HOST=169.254.51.81:10493
Could anybody share some ideas on what is going wrong? Thanks!

It's hard to give a definite solution with just the information you provided, but in my projects I need to pass "-c" (without the quotes) as a command argument so that I can debug it, maybe you need to do the same.
In Visual Studio in the project properties you can find the Command arguments field in Properties/Debugging.

Related

PyCharm: Unit testing directory setup with remote interpreter

For years I've been running a Docker container on my local machine and using it as a remote Python interpreter via SSH in PyCharm. This works great (though 2022.2.1 brought a lot of new bugs that have been slowly being ironed out) for running my code! I'm now on 2022.2.3.
However, I'm having issues running unit tests. In the past (i.e. before version 2022.2.1), I could simply right click my tests directory (a direct child of my main project directory) and click Run Python tests in test... and it would all work as expected.
Now, though, when I click this, I receive an error message about "No such file or directory."
I've tried everything I can think of- I've setup my path mappings in the Python test run config to exactly match those shown in my Python run config, and have tried every version of directory and subdirectory in the mappings and working directory, but I always receive an error about either having an empty test suite (no tests found), or that the directory "must be in the project."
It seems like no matter what I do, PyCharm is trying to create a temp directory somewhere, or is trying to read from some temp directory that I never specified, because I see errors this like:
AssertionError: /tmp/pycharm_project_405/docker/tests: No such file or directory
Yet I never created, specified, or requested a temp directory of any sort, let alone one named /tmp/pycharm_project_405/; this is a mystery to me.
PyCharm with an SSH interpreter is rapidly becoming unusable for me and my team because we cannot figure out how to set this up. Can anybody please offer some guidance on what we need to do?
Thank you all so very much!
I tried:
Changing run config for Python tests to match the working directory and path mapping of Python run configs (which work)
Directly specifying the path to the tests from the container's perspective
Setting up run config templates
Specifying one directory up/down from the actual tests
Expected:
Unit tests to be found and run as they were in previous versions of PyCharm
Answer
Create a run config for testing
In the testing run config, set Target: to Custom
Set the correct remote interpreter
Set Working directory to the test folder
Set TWO path mappings: 1) Map the code directory (in my case, the parent directory of the tests folder) and 2) Map the test directory itself
Voila!!!

Need Help understanding how PATH works with Windows 7

I am trying to add to the PATH via the Environment Variable settings windows for python.exe.
I have read the instructions using SetX from the March 3, 2012 discussion about this issue and am worried I will make a mess of my machine, so want to stick with the GUI process.
The directory path is C:\Users\Paul\AppData\Local\Programs\Python\Python37\python.exe.
That is a copy from the addition I made in the System Variables section of the Environment Variables window.
I have labelled the Variable Name as "Python", no quotation marks.
I have checked the path, and it looks good to me, and have rebooted the computer. But I still get the
'python.exe' is not recognized as an internal or external command, operable program or batch file.' error in every directory expect if I am specifically in the Python37 directory.
Any idea what I am doing wrong?
The path environment variable contains one or more paths, separated by semicolons. When you try to execute a command in cmd.exe it checks each path listed in the path variable in order of first to last until it finds the executable or runs out of paths to check.
You can experiment without making permanent changes to your system first. Run cmd.exe and type
set path=%path%;C:\Users\Paul\AppData\Local\Programs\Python\Python37
Running python.exe should now work in any directory in this cmd.exe window.
Unlike other environment variables, path is special and is a merged value from the system and user variables. Since you installed python just for yourself you might as well just use a user variable.
In the system properties where you edit environment variables, if there is no path user variable, create one and set it to C:\Users\Paul\AppData\Local\Programs\Python\Python37 or if it already exists, append ;C:\Users\Paul\AppData\Local\Programs\Python\Python37.
In newer versions of Windows 10 the UI is different and you don't have to add the semicolon because it lets you edit them as separate entries.

trying to run an .exe file in lua

recently i have been trying to run a script in lua that through os.execute() will execute a script in C# compiled into an executablethat is in the same directory as my script.
In my first attempt adding the entire directory until the executable worked:
os.execute("C:\\ServerTest\\test\\tex\\testcode.exe")
however I need this script to work on other computers, which means I can't add the entirely path to the file.I tried countless methods to execute the .exe file inside the same directory without using the entire path and none of the methods worked
os.execute("./testcode")
os.execute [[".\testcode.exe"]]
os.execute(".\\testcode.exe")
os.execute "testcode.exe"
I even tried to create an environment variable and run the entire directory from it xD
os.execute("set wTest=%cd%")
os.execute("%wTest%\\testcode.exe")
but nothing worked. I also tried to use io.popen() but didn't get results either (because the executable will close a computer process, it does not give any output :V)
does anyone know how I can do this?????

.env file Flaged as not being an object when deploying trough DevOps CD pipeline

I have just created a .env file to separate my environment variables from my main docker-compose file. I can run this document on my local machine fine with no errors or issues but when I try run it through my CD pipeline I get the following error.
[error]Top level object in 'C:\BuildAgent_work\r38\a\"Myproject Name"\drop\ .env' needs to be an object not 'class 'str'.
I first thought this was because I had set up my build/CI process wrong but I have played around with it and have had no luck.
I have also done some research online to find others with the same problem but none relate to DevOps in anyway so it has been unhelpful
I am not sure how to reproduce this problem but if anyone knows I can try provide some of my code if needed
Edit:
Here is a snippet of my .env file. Check comment below for my thoughts
ContainerInfrastructure_Version=6.7.93-beta.1
ContainerInfrastructureCore_Version=6.7.41-beta.1
AuthenticationWebService_Version=6.7.52-beta.1
CRM_Version=6.7.52-beta.1
Expected result:
Deploys successfully
What I'm getting during the docker-compose task:
[error]Top level object in 'C:\BuildAgent_work\r38\a\Goldpine.ReleaseManagement\drop.env' needs to be an object not 'class 'str'.
Ok so I figured it out. I'm not sure how to explain this briefly but I'll do my best.
So the problem was within DevOps itself not my code. It turns out a .env file only works/gets picked up if you run the docker-compose command from within the working directory that the docker-compose.yml file exists.
When it went into DevOps it was not running the command from within the downloaded artefact directory but by creating a path to it using the -f command.
So long story short, If you use a .env file you need to set the working directory within the CD pipeline to your artefact folder for it to be able to see the .env file correctlly.
I hope this is clear enough if not just let me know and I'll try change it accordingly :)

Windows x64 RabbitMQ install error with Erlang environment var (ERLANG_HOME)

I'm ask/answering this question because it hung me up & it's likely someone else will have the same problem.
Install of RabbitMQ x64 v2.8.6 on Windows Server 2008 x64.
After Erlang install using default install location to C:\Program Files\erl5.9.2, I'm attempting to start the server via running the rabbitmq-service.bat. Fail:
Please either set ERLANG_HOME to point to your Erlang installation
or place the RabbitMQ server distribution in the Erlang lib folder.
Problem is the .bat file does not have the correct subpath. with 5.9.2 (R15B02) version of erlang. My ERLANG_HOME directory is set correctly, but the script does not use it correctly for this version of Erlang, which, it appears to this Erlang noob to have a new subdirectory called "erts-5.9.2" which is causing the problems. Maybe someone intimate with these scripts can describe how to make this work correctly without the hack workaround I'm about to describe?
1- Set environment variable:
Variable name : ERLANG_HOME
Variable value: C:\Program Files (x86)\erl6.4
note: don't include bin on above step.
2- Add %ERLANG_HOME%\bin to the PATH environmental variable:
Variable name : PATH
Variable value: %ERLANG_HOME%\bin
This works well.
There are several RabbitMQ control .bat files on windows. Every one you use needs to get changed to reflect the Erlang path correctly. In this example, I'm editing the rabbitmq-server.bat because it's one of the easier ones... any of the .bat files you want to run will need this hack to get them to work, with the rabbitmq_service.bat file being the most involved to adjust.
editing that rabbitmq_server.bat file, you can see on about line 48 or so there's a check to see if the erl.exe is found, but the path isn't correct:
if not exist "!ERLANG_HOME!\bin\erl.exe" (
that path does not match the file structure for the 5.9.2 version of Erlang. I fixed this by simply removing this path check from about line 48 to 58, then, where the .bat actually makes a call to the erl.exe on about line 129 which reads:
"!ERLANG_HOME!\bin\erl.exe"
I simply hardcoded the path to my erl.exe:
"C:\Program Files\erl5.9.2\erts-5.9.2\bin\erl.exe"
With the pathing correct, the rabbitmq .bat files will run.
I had the similar issue, modifying ERLANG_HOME in .bat files did not work. Then I tried echo %ERLANG_HOME% in command prompt, that did not print the environment variable value(I could see that ERLANG_HOME environment variable has been created under advance system settings), that lead me to believe that I need to restart server for 64 bit installation of Erlang. After rebooting server, It worked like a charm. I hope this helps someone.
Just to share an up-to-date answer as of 2019: On Windows Server 2019, after setting up the environment variable, a restart is required to solve the problem.
I got into same kind of problem.
I solved it by doing three changes as given below.
Update Path variable "ERLANG_HOME" : "C:\Program Files\erl8.0" in Environment Variables.
Upadte "Path" variable "Path" : ";%ERLANG_HOME%\bin;"
Give urself FULL CONTROL permissions over "Program Files" in C drive.
It worked for me in this way.
This problem still occurs in Erlang 18.3 (erl7.3) and RabbitMQ 3.6.9 on Windows when upgrading from any older version of RabbitMQ to version 3.6.9. The solution as already stated here is to manually set ERLANG_HOME with 'setx -m ERLANG_HOME "C:\Program Files\erl7.3"' before starting the service.
What happens is that the RabbitMQ 3.6.9 installer removes the environment variable ERLANG_HOME from the system while removing the older version of RabbitMQ. Then, when it proceeds to the installation step, it does not put back the ERLANG_HOME variable. Then, the batch files that start up RabbitMQ cannot find Erlang. They try to find Erlang's home directory using "where.exe" but it always fails after an upgrade.
RabbitMQ's installer also does not kill all of the Erlang background processes, causing many of its files to be undeletable due to the Windows "file in use" problem. This leaves behind "files in use" in %APPDATA%\RabbitMQ and "C:\Program Files\RabbitMQ." These processes are "erl.exe," "erlsrv.exe," and "epmd.exe." The RabbitMQ installer should taskkill these processes after shutting down the RabbitMQ Windows service.
RabbitMQ is rather clunky on Windows.
Download Erlang or OTP - Only one Version of OTP should be installed
Download RabbitMQ installer
Install both exe file as Administrator
Set class path for Erlang. (Setting classpath is a bit troublesome, so follow these steps)
Set a new path with name ERLANG_HOME and value C:\Program Files\erl-23.1 (do not copy bin folder here)
Edit System "path" and add %ERLANG_HOME%\bin
Go to Start - Open rabbitmq command promt and run
rabbitmq-plugins enable rabbitmq_management
Navigate to localhost:15672
Use guest/guest to login
Interesting that this worked for you. There is record of a two bugs in Erl5.9.2 that cause an incomplete installation where %ERLANG_HOME%\bin is not installed.
Either of
* Installed 64bit erlang on 32bit machine
* "The program can't start because MSVCR100.dll is missing from your computer."
https://groups.google.com/d/topic/erlang-programming/wGtFLzapiQ0/discussion
Try 5.9.1 or any other version. They also mention making the future versions of the installer alert you if it fails.
I just had the same problem mentioned here. I installed otp_win64_R15B02 on a Windows 7 machine and everything worked perfectly, but I used the same installer on a Windows 2008 server and the bin directory was not created. I then uninstalled otp_win64_R15B02 and downloaded the otp_win64_R15B02_with_MSVCR100_installer_fix and the bin directory was created.
I suspect the reason it worked on my Windows 7 system is that I have Visual Studio installed and the required libraries were already available which allowed the otp_win64_R15B02 installer to work correctly.
Oh, and if you're installing Erlang to run RabbitMQ the RabbitMQ install will succeed with the broken installer but installing otp_win64_R15B02_with_MSVCR100_installer_fix after RabbitMQ will not work, just un-install and re-install RabbitMQ to resolve this.
Just give C:\Program Files\erl10.6\ not C:\Program Files\erl10.6\bin\erl.exe in the environment variable. If you open the server.bat file I came to know the issueenter image description here
I think this is encoding issue on windows.I see a correct value but I write echo %ERLANG_HOME% on console the value come with question mark. These steps fix it.
1.go environment variable window
2.edit ERLANG_HOME item
3.copy the value, open notepad and paste there
4.copy again on notepad and paste to edit window
5.apply and exit window
6.close command line tools and reopen
7.run rabbitmq bat file.
I solved it in a quick and dirty way,without naming path variables
I've opened the bat file and replaced every occurrence of
!ERLANG_HOME!\bin\erl.exe
with hard coded path for example might be diffrent path for you because of diffrent version
C:\Program Files\erl10.3\erts-10.3\bin\erl.exe
and replaced
%RABBITMQ_HOME%\escript\rabbitmq-plugins
with
C:\Program Files\RabbitMQ Server\rabbitmq_server-3.7.14\escript\rabbitmq-plugins
Even I was this problem. The issue was the environment variable ERLANG_HOME=c:\Program Files\erl9.0 which was never existed.
I cross checked the path. The correct path was c:\Program Files\erl9.3.
After correcting the
ERLANG_HOME=c:\Program Files\erl9.3
the problem solved. So, definitely it is a path issue.
In my case, it should be installed erlang using admin role running
If above solutions doesn't work for you then you can try following
Find another compatible version of erlang for your rabbit mq e.g. for rabbit 3.7.x erlang version 20.3.x to 22.0.x all are compatible .
Right click newly downloaded erlang version and from properties select the option to unblock the file .
Run the erlang with admin persssion .
Re run rabbit mq exe

Resources