Migrating ANT sqlplus execution from MacOSX to Windows, getting TNS error - oracle

I have a working ANT build.xml that executes sqlplus to compile PL/SQL. I develop on MacOSX. My coworker is going to start contributing to the same application. He develops on WinXP. The sqlplus exec from ANT returns a TNS ORA-12560 error on WinXP. The identical build.xml works on MacOSX. The run string that ANT should be constructing on WinXP works in the DOS shell. We have set up the TNS_ADMIN environment variable in WinXP. What could I be missing?

I'm not sure from your description whether you're using the ANT SQL Task (http://ant.apache.org/manual/Tasks/sql.html) or if your using the exec task to call Sqlplus. Can you please clarify?
If you're calling sqlplus as an external command, you will be at the mercy of two main things:
a) environment variables
b) tnsnames.ora file
Windows and unix are different in how they handle specifying where you want to connect. In OSX you'll have the ORACLE_HOME and ORACLE_SID environment variables set. In Windows this would be in the registry. You may also have TNS_ADMIN set which determines where your tnsnames.ora file will be found.
First thing to check would be if you are both using the same tnsnames.ora file.
If you are, have both of you try to run tnsping to verify that the alias is configured properly.
Get back to us with the results of those tests.

Related

The Server Instance cannot be started because the IntegratedWebLogicServer Domain was not built successfully

I am new to ADF.In JDeveloper, I tried to run my first project , It asked for a password for the first time, after entering this, it should run my project but it gave the below error-
The Server Instance cannot be started because the IntegratedWebLogicServer Domain was not built successfully.
For more information,
There was a log file too.
Adding environment variable to WLST script USER_MEM_ARGS = -Xms32m -Xmx1024m -XX:MaxPermSize=384m
Log File: C:\Users\absasahu\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain.log
Label: JDEVADF_PT.12.2.1.4.0_GENERIC_190911.2248.S
Product Home: C:\Oracle\Middleware\jdeveloper\jdeveloper\jdev\
Domain: C:\Users\absasahu\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\DefaultDomain
BuildDefaultDomain1.py 2022-05-18 07:55:17
cmd.exe /c ""C:\Oracle\Middleware\jdeveloper\oracle_common\common\bin\wlst.cmd" "C:\Users\absasahu\AppData\Roaming\JDeveloper\system12.2.1.4.42.190911.2248\o.j2ee.adrs\BuildDefaultDomain1.py""
Process started
wlst > \Java\jdk1.8.0_331 was unexpected at this time.
Elapsed time: 395 ms
Please help me out.
What I tried-
Set java_home system variable without any whitespaces.(Not worked).
Yeah , Solved my problem.
Go through this link [http://dstas.blogspot.com/2012/09/integrated-weblogic-domain-creation.html][1]
Solution 1- Set environment variables JAVA_HOME , and value as path to your jdk. But keep in mind to shorten(remove whitespaces) like use PROGRA~2 for program files(*86).
Solution 2- If you have more than One java path set on environment variables, remove them.
It will work now. It worked for me too.

Getting Sqldeveloper working with instantclient on Windows without admin privileges?

I've installed Sqldeveloper Version 19.1 64-bit Version on an enterprise PC with Win10-64bit.
It works fine with embedded jdbc-client, but I need to get it working using the Oracle OCI-client. One reason is the much better support to cancel long running queries.
Using an OCI-client (thick-driver) requires for sure a client like instantclient_12_2.
I have no admin privileges on my workstation and so copied the full instantclient_12_2 to the enterprise PC.
Since I'm not allowed to change the %PATH% myself, I created a start.bat file with required settings, because without, it also won't work (already tried).
PATH="C:\Users\myuser\OneDrive\Oracle\instantclient_12_2";%JAVA_HOME%;%PATH%
C:\Users\myuser\OneDrive\Oracle\sqldeveloper64\sqldeveloper.exe
When I try to configure another Oracle-Client without this change, I get another error, that PATH to instantclient needs to be defined before any others.
Now, starting sqldeveloper with this bat-file works fine. Connections can be established using the internal jdbc client.
Then, I've configured the Oracle Client in SQLdeveloper (Preferences/Database/Advanced) and selected the instantclient directory.
Pressing the "Test" button opens the Messages log "Oracle Client Test Results - Log" and shows an error.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occured, Program will exit.
Unrecognized option: -
Now, I'm lost, because I'm not a Java-Expert. I'm wondering, why sqldeveloper as Java-tool is running, but the instant-client says it can't create the JVM.
The reason for me to use OCI-client is, that it has e.g. better support of User-breaks.
Without admin privileges and no permission to change your %PATH% env permanently, you only need to install the whole directory somewhere and add a .BAT file, that changes environment temporarily before calling SQL-Developer.
Install complete SQL-Developer e.g. in C:\myprogs\sqldeveloper
Install instant-client somewhere, e.g. in C:\myprogs\instantclient_12_2
Create .BAT file, e.g. C:\myprogs\sqldeveloper\startsqldev.bat with following content:
set PATH=C:\myprogs\instantclient_12_2;%PATH%
REM start sqldeveloper
"C:\myprogs\sqldeveloper\sqldeveloper.exe"
It works for versions > 20 as well ;-)
Meanwhile, I've solved it.
Result of testing:
Testing the Instant Client located at C:\Users\myuser\Oracle\instantclient_12_2
Testing client directory ... OK
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
Driver version: 12.2.0.1.0
Testing testing native OCI library load ... OK
Success!
Reason were following mistakes:
Forgot "set" in front of Variable assignment (because I'm usually using Unix)
Used quotation marks during Variable assignment, which are taken as part of the value (also different to UNIX).
Added JAVA_HOME and JRE_PATH
See below my complete bat-file (adapted, because of some secret information within pathnames):
REM Optional: setting of USE_OS_DATETIME_FORMAT changes DATE-Format
set USE_OS_DATETIME_FORMAT=1
set PATH=%USERPROFILE%\OneDrive - myCompany\Oracle\instantclient_12_2;%JAVA_HOME%;%PATH%
REM start your preferred sqldeveloper
"%USERPROFILE%\OneDrive - myCompany\Oracle\sqldeveloperx64.20.2\sqldeveloper.exe"C:\Users\myuser\OneDrive - myCompany\Oracle\sqldeveloperx64.19.1\sqldeveloper.exe"
Additionally, I've added a shortcut to the bat-file and now I can start it simply with CRTL-SHIFT-S ;-)
BTW: Same solution works fine on Win10 as well

install weblogic on console mode without xming

I'm trying to install weblogic server on Centos 7 with following instruction of oracle about console mode. Everything will be fine till weblogic file 's extracting on my computer. I get this message about
display enviroment variable failed
I google it and found xming as solution. But is there any solution to install weblogic without xming.
You need to do a silent install as mentioned. You can find the documentation here.
Basically, you need two files:
A response file
Here, you will set some parameters like ORACLE_HOME, proxy information if needed and installation type, etc.
An oraInst.loc file
In this file, you need to do the following(from documentation):
Replace oui_inventory_directory with the full path to the directory where you want the installer to create the inventory directory. Then, replace oui_install_group with the name of the group whose members have write permissions to this directory.
After doing all of this, you can run the command as follows;
java -jar distribution_name.jar -silent -responseFile file [-options] [()*]
I uploaded my own oraInst.loc and response files here for demonstration. I strongly suggest you to read the documentation though. Good luck.

Run batch scripts on a remote server (windows) from jenkins

I've got a continuous integration server (Jenkins ) which builds my code (checks for compilation errors) and runs tests and then deploys the files to a remote server (not a war file, but the actual file structure) I do this with a Jenkins plugin which allows me to transfer files via samba, it does this nightly.
Now, what I need to do is run an ant command on the remote server. And after that I need to start the application server on the remote server, the application server is started by running a .bat file from the command line.
I'm pretty clueless how to accomplish this, I know Jenkins is capable of running batch commands, but how do I make them run in the context of the server and not the context of the build server?
If Jenkins on Windows, remote on *nix, use plink.exe (which is essentially command line PuTTy)
If Jenkins on Windows, remote on Window, use psexec.exe
If Jenkins on *nix, remote on *nix, use ssh
If Jenkins on *nix, remote on Windows, (update 2015-01) Ansible http://docs.ansible.com/intro_windows.html has support for calling Windows commands, eg powershell, from a unix/linux machine, https://github.com/ansible/ansible-examples/blob/master/windows/run-powershell.yml
Tell me what OSes are involved (both on Jenkins and remote), and I will flash this out further.
Edit:
The download page for psexec.exe lists all command line options. You will want something along the lines of:
psexec \\remotecomputername -u remoteusername -p remotepassword cmd /c <your commands here>
Replace <your commands here> with actual commands as you would execute them from command prompt.
Note that psexec first needs to install a service, and required elevated command prompt/admin remote credentials to do so.
Also, you need to run psexec -accepteula once to accept the EULA prompt.
Following Slav's answer above, here is a simpler solution for Jenkins (*nix) to remote (windows):
Install an SSH server on your remote windows (MobaSSH home edition worked well for me)
Make sure your Jenkins user, on your Jenkins machine, has the required certification to open an SSH connection with your remote (you can simply open a terminal and ssh to your remote once, then accept the certification. Make sure it is saved for the Jenkins user).
You can now add an execute shell build phase in your Jenkins job which can SSH to your remote windows machine.
Notes :
The established connection might require some additional work - you might have to set windows environment variables or map network drivers in order for your executed commands or batch files to work properly on your windows machines.
If you wish to run GUI related operations this solution might not be relevant (Following my work on running automation tests which require GUI manipulation).
Using Jenkins SSH plugin is an issue, as seen here.
1、i install (MobaSSH home ) on my remote windows server .
2、and install jenkins ssh plugin
3、edit shell eg: go build project
4、it seems something wrong ,
" go: creating work dir: CreateFile C:\WINDOWS\system32\bsh\tmp: The system cannot find the path specified."
I ended up going with a different approach after trying out psexec.exe for a while.
Psexec.exe and copying files over the network was a bit slow and unstable, especially since the domain I work on has a policy of changing password every months (which broke the build).
In the end I went with the master/slave approach, which is faster and more stable. Since I don't have to use psexec.exe and don't have to copy files over the network.

JDeveloper IntegratedWebLogicServer not able to build default domain

I am trying to run the JDeveloper Integrated Weblogic server (11.1.1.5) on Windows 7 x64 and keep running into this error from within JDeveloper:
[Starting Server Instance IntegratedWebLogicServer]
#### Server Instance IntegratedWebLogicServer could not be started: Error starting Server Instance.
I found this in the createDefaultDomain.log file:
Log File: C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\o.j2ee.adrs\CreateDefaultDomain.log
Label: JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013
Product Home: C:\Oracle\Middleware\jdeveloper\jdev\
Domain: C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\DefaultDomain
"C:\Oracle\Middleware\oracle_common\common\bin\wlst.cmd" "C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\o.j2ee.adrs\CreateDefaultDomain.py"
Process started
Elapsed time: 94 ms
When I try to run this command from the command line I get the following:
C:\Users\mologan>"C:\Oracle\Middleware\oracle_common\common\bin\wlst.cmd" "C:\Users\mologan\AppData\Roaming\JDeveloper\system11.1.1.5.37.60.13\o.j2ee.adrs\CreateDefaultDomain.py"
CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK160~1\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;;C:\Oracle\MIDDLE~1\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar
PATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\native;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\native;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\bin;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1\bin;C:\Oracle\MIDDLE~1\JDK160~1\jre\bin;C:\Oracle\MIDDLE~1\JDK160~1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Oracle\Middleware\jdk160_24\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files\ThinkPad\Bluetooth Software\;C:\Program Files\ThinkPad\Bluetooth Software\syswow64;C:\Program Files\Broadcom\WHL\;C:\Program Files\Broadcom\WHL\syswow64;C:\Program Files\Broadcom\WHL\SysWow64\;C:\Program Files\Broadcom\WHL\SysWow64\syswow64;C:\Program Files\TortoiseSVN\bin;C:\ant\\bin;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\native\win\32\oci920_8 Your environment has been set.
CLASSPATH=C:\Oracle\MIDDLE~1\patch_wls1035\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\patch_jdev1111\profiles\default\sys_manifest_classpath\weblogic_patch.jar;C:\Oracle\MIDDLE~1\JDK160~1\lib\tools.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic_sp.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\weblogic.jar;C:\Oracle\MIDDLE~1\modules\features\weblogic.server.modules_10.3.5.0.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\server\lib\webservices.jar;C:\Oracle\MIDDLE~1\modules\ORGAPA~1.1/lib/ant-all.jar;C:\Oracle\MIDDLE~1\modules\NETSFA~1.0_1/lib/ant-contrib.jar;;C:\Oracle\MIDDLE~1\ORACLE~1/modules/oracle.jrf_11.1.1/jrf-wlstman.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADF-SH~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\ADFSCR~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\lib\mdswlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\AUDITW~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\IGFWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jps-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\jrf-wlst.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAP_~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OAMAUT~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\ossoiap.jar;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OSSOIA~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\OVDWLS~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\SSLCON~1.JAR;C:\Oracle\MIDDLE~1\ORACLE~1\common\wlst\RESOUR~1\wsm-wlst.jar;C:\Oracle\MIDDLE~1\utils\config\10.3\config-launch.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbynet.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbyclient.jar;C:\Oracle\MIDDLE~1\WLSERV~1.3\common\derby\lib\derbytools.jar;;
Initializing WebLogic Scripting Tool (WLST) ...
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
Error: ADRS_DOMAIN_PASSWORD environment variable not set.
Exiting WebLogic Scripting Tool.
C:\Users\mologan>
Has anyone seen this type of error before? I have no idea how to fix it and its getting really frustrating. All help is much appreciated!
Cheers,
Morris
Open CreateDefaultDomain.py file and set ADRS_DOMAIN_PASSWORD.
import os
os.putenv('ADRS_DOMAIN_PASSWORD', 'welcome1')
if not 'ADRS_DOMAIN_PASSWORD' in os.environ:
print("Error: ADRS_DOMAIN_PASSWORD environment variable not set.")
exit()
I found this answer:
Domain creation fails after installing on new Windows version (7338577, 7339920, 8654914)
When JDeveloper is installed on a newly released Windows version, it is possible that Jython, which is used by Oracle WebLogic Server's script tool, does not recognize the Windows version and instead assumes that it is running in a Linux environment.
This causes domain creation to fail with the following error in CreateDefaultDomain.log:
wlst > Failed to get environment, environ will be empty: (0, 'Failed to /
execute command ([\'sh\', \'-c\', \'env\']): java.io.IOException: Cannot run /
program "sh": CreateProcess error=2, The system cannot find the file /
specified')/
# wlst > Error: ADRS_DOMAIN_PASSWORD environment variable not set.
The workaround is to obtain a patch for jython-modules.jar, or to run on a supported version of Windows.
Original source:
http://www.oracle.com/technetwork/developer-tools/jdev/knownissues-097654.html#dep1
I'm using JDeveloper 12.2.1.3.0.
Have the same problem, and all I had to to is exit the JDeploper, kill the Java process in the Task Manager, and restarting JDev again.

Resources