Unable to acquire Oracle environment handle - eclipse

Environment: Eclipse Indigo or Eclipse Juno 4.2 on Windows 7. Oracle 11g XE (local install)
When running my Django project in pydev, attempted page access results in the message "Unable to acquire Oracle environment handle".
Normally, all I have to do is set TNS_ADMIN to point to the correct tnsnames.ora directory.
If I run manage.py from the command line, all works as expected. I thought at first that it was probably an environment variable difference, but the TNS_ADMIN values are the same. In any case, explicitly setting TNS_ADMIN in the Eclipse run configuration didn't make a difference.
PYTHONPATH was somewhat different between the two, and I went to the trouble of overriding it in the run config to see if it made the difference. Nope.
Looking at the cx_Oracle source, the error seems to come from a failure in a call to OCIEnvNlsCreate, but I didn't see anything obvious in the Oracle documentation.
Can anyone give me a clue why I'm getting this in Pydev?

I figured it out. I didn't look hard enough at the PATH variable.
Basically, there was a virtual environment that needed its scripts directory (containing OCI.DLL) to be first in the path, but my Oracle installation was ahead of it. So, the error message was basically the result of calling the wrong OCI.DLL (the one associated with my Oracle installation, rather than the one cx_Oracle was bound to).
Activating the virtual environment worked because it changed the path. Pydev works differently, so Eclipse was seeing my standard path with the Oracle install first.

Related

Cannot install Qt postgreSQL driver

I'm posting here with the hopes that someone will be kind enough to help me. Just to clarify, I'm sort of a newb, so I'd be really grateful if you give more details to your explanations.
I'm on Windows 10 64 bit, QT 5.9.1, PostgreSQL is 9.6.3 version.
I'm working on a project, where I need to get a postgresql database running and connect it to the code I'm doing right now. Unfortunately, when I try to install the driver, I run into all kinds of problems. I've been reading on threads on sites, but they are outdated and some folders do not match, which my first problem arises. For some reason I cannot get qmake to work, even though I edit the path in the variables.
I tried running the commands from here.
cd %QTDIR%\qtbase\src\plugins\sqldrivers\ps
ql
qmake "INCLUDEPATH+=C:/psql/include" "LIBS+=C:/psql/lib/ms/libpq.lib" psql.pro
nmake
Basically my folders don't aren't 100% as the guide, also I don't have a libpq.lib file
On my final attempt I tried the following:
qmake "INCLUDEPATH+=C:/PostgreSQL/pg96/include" "LIBS+=C:/PostgreSQL/pg96/lib/libpq.lib"
Project ERROR: Cannot run compiler 'cl'. Maybe you forgot to setup the environment?
You'll need to have PostgreSQL installed so you have libpq.lib and libpq.dll. You cannot compile the Qt PostgreSQL driver without these. You'll also need to find the include directory for your PostgreSQL install, the one that contains libpq-fe.h.
Then determine the paths to those. Set the PATH to include the directory with libpq.dll. Set LIBS to include the directory with libpq.lib. And set the INCLUDEPATH to include the directory with libpq-fe.h.
You'll probably need to do this within a "Visual Studio Command Prompt" or run vcvarsall.bat fist, too, so qmake can find Visual Studio.

gtk+ without msys2 mingw

On Windows, trying something with gtk+. I have downloaded Msys2, along with gtk+3.0.
Successfully compiled all the gtk+3.0 examples in the msys2 mingw-w64 terminal.
Now I want to move a bit further to try work without the msys environment.
I opened up cmd and navigated to where the example executables are compiled. Then I fired them up by typing "example.exe".
libgio-2.0-0.dll missing, not surprised. I go back to check the PATH environment of the msys environment, PATH=/mingw64/bin/:/usr/local/bin:/usr/bin/:/bin:/c/Windows/System32:..blablabla
So in the cmd environment I did set PATH=%PATH%;pathto/mingw64/bin; and run example.exe again.
This time it gave a very strange error cannot find entrypoint inflateValidate (in dll libpng16-16.dll)
So I checked, indeed there was no inflateValidate function in the dll. it seemed to me that something thought the function is in the dll and tried to call it but because it doesn't exist so it failed. What I don't understand is that why did it not fail in the msys environment but failed in the windows environment. And does that bring any impact to me if I am going to ship any gtk application? I thought simply distributing the relevant dll would be enough.
I have tried instead of adding the mingw64/bin path to the PATH variable, but copying the required dll the the execute location 1 by 1, but at the end it still gave the same error.
I have also tried to search for other libpng*.dll in my computer, none of them contained the inflateValidate function.
If anyone know whats going on please shed some light to the question.
I might be very late to the party but I ran into the same issue yesterday (missing the inflateValidate symbol) and after checking the contents of the zlib1.dll file could ascertain that the function is just not there.
I downloaded another version (specifically this one https://sourceforge.net/projects/uqm-mods/files/latest/download, though I am in no way affiliated to this project) and saw that the inflateValidate symbol was indeed declared, so I suppose that the zlib bundled with your files is not up to date with the libpng requirements.
This solved my problem. I hope it solves yours too.

TieredCompilation is disabled in this release - running Leiningen in Counterclockwise

I'm running Leiningen in Counterclockwise in Eclipse (Windows, if it's relevant).
The thing is, when I run Leiningen from the command prompt, it runs just fine. However when I run it inside Eclipse, although it runs fine it haunts me with the following warning:
Java HotSpot(TM) Client VM warning: TieredCompilation is disabled in this release.
The only relevant thing I found on the Internet is this. However the solution doesn't work for me as I don't have this line in lein.bat file. I've tried fiddling with Java options in lein.bat to enable TieredCompilation explicitly with no avail. I'm trying to understand - what's different when Eclipse runs lein, compared to when I run it from the prompt, how does it run it? How do I hide this message?
EDIT: this warning seems to appear only in 32-bit JVM; for anyone having the same problem, using 64-bit JVM solves it. For anyone that as to use 32-bit JVM for whatever reason, I'm still looking for a good solution.
(converted from comment as I have to add additional info)
CCW uses its own version of Leiningen - for example, when I execute lein version from inside CCW I get 2.5.1, but if I drop to the command line and execute the same command I get 2.7.1. In my install (Neon + CCW - couldn't make the standalone CCW install work) there's a leiningen-standalone.jar in C:\eclipse\plugins\ccw.core_0.35.1.STABLE001. There may be a way to get Counterclockwise to use a separate version of Leiningen - perhaps more knowledgeable users will chime in with how to do this.
Also note that in the Windows install of Leiningen the LEIN_JVM_OPTS environment variable isn't defined at all in lein.bat, although it is used when invoking Java. Thus it seems you have two options:
Less-preferred option: edit lein.bat and add the definition of LEIN_JVM_OPTS, probably somewhere near the beginning of the file. This has the disadvantage that when you upgrade Leiningen you'll lose your definition of LEIN_JVM_OPTS and have to find this message again.
More-preferred option: since this is Windows you can go into Control Panel, type "environ" in the search box, then click on on the "Edit environment variables for your account" link which comes up under System (or click on "Edit the system environment variables" if you like). Create a new entry for LEIN_JVM_OPTS, specifying something like
-XX:-TieredCompilation
and you should be good to go. While I don't know for certain if this environment variable is used by the standalone .jar version of Leiningen I'd certainly hope and expect it would be.
Best of luck.

A Java Development Kit must be available in order to run Eclipse

I was able to run Eclipse until I tried to install another compiler, suggested by a online tutorial for C++. Now I'm getting the 'No virtual machine was found error'. I know I'm suppose to match the versions of the programs but I can't seem to figure it out. I thought I had downloaded 64 bit version of each program in Eclipse and JDK but I don't know how to verify it. I go to each file and try to get the info but I must be looking in the wrong places. I have copied the file location of JDK and pasted it in the Advanced System Settings in Environment Variables. In the Systems Variables for User on the variable line I typed "path", on the value line I pasted the location: C:\Program Files\Java\jdk1.8.0_05\bin. I have even uninstalled both programs several times and reinstalled them. I've been at it for several hours now with no success. Any suggestions, anybody. Thank you.

error while loading shared libraries

My problem is very weird. I am developing in eclipse using QT lib and gtest on ubuntu 11.04.
I am getting error while loading shared libraries: libRtdb.so.1 only while i wish to Debug. Run works without a problem. I have my LD_LIBRARY_PATH set, without it Run doesn't work.
Are there any separated settings in eclipse for Run and Debug? It's weird since it doesn't work randomly. I have set whole environment on virtual machine, same steps and it worked. Did the same on another virtual machine and it didn't work.
Any ideas?
Was investigating the problem some more since the previous solution didn't work so well.
Seems like my LD_LIBRARY_PATH environment variable is being reset somewhere.
Unfortunately i didn't find where, so atm my temporary solution will have to be the following:
Setting LD_LIBRARY_PATH environment variable in terminal and running eclipse from there.
See:
http://www.eclipse.org/forums/index.php?t=msg&goto=204818&#msg_204818
http://code.google.com/p/xuggle/issues/detail?id=81