Problem with lsnrctl
hi,
I have installed Oracle10g in one server ...Iam able to connect the database thru sqlplus...If iam checking lsnrctl the database is showing the database has no listener....while starting the listener its showing error as
Starting /glotam/Oracle10g/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
System parameter file is /glotam/Oracle10g/network/admin/listener.ora
Log messages written to /glotam/Oracle10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
TNS-01192: Missing SID_LIST_ value left of equation for SID description in LISTENER.ORA
Listener failed to start. See the error message(s) above...
my listener.ora is listed below .....
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=10.92.5.47)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
#BEQUEATH CONFIG
(GLOBAL_DBNAME=rbtt)
(SID_NAME=rbtt)
(ORACLE_HOME=/glotam/Oracle10g)
#PRESPAWN CONFIG
(PRESPAWN_MAX=20)
(PRESPAWN_LIST=
(PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
can u pls rectify my doubt........
THANKS IN ADVANCE,
R.Ratheesh
hi,
This is my NEW listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.92.5.47)(PORT = 1521))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = rbtt)
(ORACLE_HOME = /glotam/Oracle10g)
the error shown is
LSNRCTL> start
Starting /glotam/Oracle10g/bin/tnslsnr: please wait...
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production
System parameter file is /glotam/Oracle10g/network/admin/listener.ora
Log messages written to /glotam/Oracle10g/network/log/listener.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
TNS-01192: Missing SID_LIST_ value left of equation for SID description in LISTENER.ORA
Listener failed to start. See the error message(s) above...
pls help me out in solving the problem.
Thanks in advance,
R.Ratheesh
Similar Messages
-
Hello,
i have a problem with the LSNRCTL.EXE process.
The process still growing in memory usage.
Do you have an idea?
I have installed Oracle Server Standard Edition
Version 8.1.7.4.17
on Windows 2000 server.
Thanks in advance.
Jean PelletierIs any shared server user run reports.
shared server environment is used fro small transection.
if any user who belong to shared server run heavy transection then it create problems.
I think if you check it and if find such a user the use dedicated connection for such user. -
10g: problem with similar named listeners
Hi,
env:
2 node OEL cluster (not rac, a linux cluster)
11.2.0.3 GI
11.2.0.3 and 10.2.0.5 DB's
The problem seems to be that lsnrctl in 10g is only using the first 12-13 characters of the listener name.
I have a listener configured with the name listener_prodXXX, when I configure another listener named listener_prodYYY and want to start ist:
lsnrctl start listener_prodYYY
TNS-01106: Listener using listener name listener_prodXXX has already been started.
ps -ef |grep -i listener_prod
oracle 2784 1 0 13:03 ? 00:00:00 /oracle/product/10.2.0/XXX/bin/tnslsnr listener_prodXXX -inherit
is there a rule for naming the listeners?
confused greetings
DanielOf course I was searching docs/metalink before but couldn't find anything there, so I was asking here.No sign of searching exists in your posts
If you have only one listener with multiple db's and want to do some maintenance on one of them, how do you avoid user connecting to it?Put the database in restricted session mode
I don't think its forbidden to use multiple listeners, so if I'm having a problem with the configuration the forum should be the place to ask, isn't it?It is not forbidden to use multiple listeners, but in 999 out of 1000 cases it is not required, and people 'think' they need multiple listeners for the wrong reasons.
Your post is no exception.
So, yes, if you want to setup multiple listeners, without apparent and/or sound reasons, I will explain you don't need them/.
There is nothing wrong about that, isn't it? Many people here 'think' they know Oracle, few have experience and know they do.
Sybrand Bakker
Senior Oracle DBA -
Problem with listener whe I create a new instance
Hi
I can not create two instances on my Oracle data base, the listener is not running or the service is not registred. This is my state:
I´ve installed Database Oracle 11gR2 on OEL (Oracle Linux Enterprise) and I need two instance, I created my first instance and I had some problems with my environment variable
but now it is fixed, when I execute: '*lsnrctl status*' it answers me:
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 13-DEC-2010 16:48:03
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=SPHYNX)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 13-DEC-2010 15:09:39
Uptime 0 days 1 hr. 38 min. 23 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
Listener Log File /home/oracle/app/oracle/diag/tnslsnr/SPHYNX/listener/alert/log.xml
Listening Endpoints Summary...
+(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=SPHYNX)(PORT=1521)))+
The listener supports no services
The command completed successfully
where SPHYNX is the computer´s name, when I read the 'forums.oracle' I see that the line where it tells me:
+'The listener supports no services'+
it´s wrong but I don´t undertand the problem
my Oracle´s enviroment variables are: env | grep ORA
ORACLE_BASE=/home/oracle/app/oracle
ORACLE_BIN=/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
and my listener is the created in the Oracle´s intallation, it is:
+# listener.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora+
+# Generated by Oracle configuration tools.+
LISTENER =
+(DESCRIPTION_LIST =+
+(DESCRIPTION =+
+(ADDRESS = (PROTOCOL = TCP)(HOST = SPHYNX)(PORT = 1521))+
+)+
+)+
ADR_BASE_LISTENER = /home/oracle/app/oracle
my tnsmanes is:
+# tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora+
+# Generated by Oracle configuration tools.+
INS1 =
+(DESCRIPTION =+
+(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))+
+(CONNECT_DATA =+
+(SERVER = DEDICATED)+
+(SERVICE_NAME = INS1)+
+)+
+)+
it´s created automatically when I delete my initial Instance orcl, created in the installation, and I create the instance INS1
My user is a special user called 'oracle' and it is not sudoer.
when I try to create the second instance the wizard tell me that the Enterprise Configuration is failed because the listener is not actived or the data base´s service is not registred in
it. I do not write the exact output because it is in spanish and I write a translation.
regards,
PabloI am sorry if there is any inconsistency but I am not the final user, I don´t know if the final user had some conection´s problem but I could access to the Enterprise Manager in the instance and I had to restart the computer many times after the first configuration, but the user never tell me anything about problems. I only access to the instance with the Enterprise Manager and it´s running
I´m sorry but I normally have Oracle on Windows and this is my first contact with Oracle and Linux, on Windows I never had these problems because Oracle did everything automatically on Windows.
The output that I receive with your commands is:
+[oracle@SPHYNX ~]$ uname -a+
Linux SPHYNX 2.6.18-194.el5xen #1 SMP Mon Mar 29 22:22:00 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
+[oracle@SPHYNX ~]$ uptime+
+19:12:22 up 6:16, 1 user, load average: 0.27, 0.18, 0.17+
+[oracle@SPHYNX ~]$ id+
uid=501(oracle) gid=501(oracle) grupos=501(oracle)
+[oracle@SPHYNX ~]$ ps -ef | grep -i pmon+
oracle 25336 25300 0 19:12 pts/1 00:00:00 grep -i pmon
+[oracle@SPHYNX ~]$ env | sort+
_=/bin/env
CVS_RSH=ssh
G_BROKEN_FILENAMES=1
HISTSIZE=1000
HOME=/home/oracle
HOSTNAME= SPHYNX
INPUTRC=/etc/inputrc
JAVA_HOME=/usr/java/jdk1.6.0_22/
LANG=es_ES.UTF-8
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=oracle
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:
MAIL=/var/spool/mail/oracle
ORACLE_BASE=/home/oracle/app/oracle
ORACLE_BIN=/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin
ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
PATH=/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin::/usr/java/jdk1.6.0_22/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
PWD=/home/oracle
SHELL=/bin/bash
SHLVL=1
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_CLIENT=163.117.129.155 54971 22
SSH_CONNECTION=163.117.129.155 54971 163.117.129.170 22
SSH_TTY=/dev/pts/1
TERM=vt100
USER=oracle
+[oracle@SPHYNX ~]$ cat /etc/hosts+
+# Do not remove the following line, or various programs+
+# that require network functionality will fail.+
+127.0.0.1 SPHYNX localhost.localdomain localhost+
+::1 localhost6.localdomain6 localhost6+
+[oracle@SPHYNX ~]$ date+
lun dic 13 19:12:31 CET 2010 -
Oracle 11g problem with creating shared memory segments
Hi, i'm having some problems with the oracle listener, when i'm trying to start it or reload it I get the follow error massages:
TNS-01114: LSNRCTL could not perform local OS authentication with the listener
TNS-01115: OS error 28 creating shared memory segment of 129 bytes with key 2969090421
My system is a: SunOS db1-oracle 5.10 Generic_144489-06 i86pc i386 i86pc (Total 64GB RAM)
Current SGA is set to:
Total System Global Area 5344731136 bytes
Fixed Size 2233536 bytes
Variable Size 2919238464 bytes
Database Buffers 2399141888 bytes
Redo Buffers 24117248 bytes
prctl -n project.max-shm-memory -i process $$
process: 21735: -bash
NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
project.max-shm-memory
privileged 64.0GB - deny
I've seen that a solution might be "Make sure that system resources like shared memory and heap memory are available for LSNRCTL tool to execute properly."
I'm not exactly sure how to check that there is enough resources?
I've also seen a solution stating:
"Try adjusting the system-imposed limits such as the maximum number of allowed shared memory segments, or their maximum and minimum sizes. In other cases, resources need to be freed up first for the operation to succeed."
I've tried to modify the "max-sem-ids" parameter and set it to recommended 256 without any success and i've kind of run out of options what the error can be?
/RegardsI see, I do have the max-shm-ids quite high already so it shouldn't be a problem?
user.oracle:100::oracle::process.max-file-descriptor=(priv,4096,deny);
process.max-stack-size=(priv,33554432,deny);
project.max-shm-memory=(priv,68719476736,deny) -
Hi all,
First, happy new year for everybody.
I'm under Linux and i have a problem with a listener process in Oracle 10g 10.1.0.3.
From time to time, my listener process hang-up and it becomes impossible to obtain a Oracle connection.
With unix 'ps' command, i can see strange process.
# ps auxw | grep lsn
oracle 27728 0.0 0.1 37100 4760 ? S Dec23 0:02 /u01/app/oracle/product/10.1.0/db_1/bin/tnslsnr LISTENER -inherit
oracle 17161 0.0 0.1 37100 4760 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/bin/tnslsnr LISTENER -inherit
oracle 18134 0.0 0.1 18688 5892 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/perl/bin/perl /u01/app/oracle/product/10.1.0/db_1/sysman/admin/scripts/lsnr_log_status.pl
oracle 18145 0.0 0.0 2136 908 ? S Dec25 0:00 sh -c /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl > /tmp/0lHBosCvOe
oracle 18146 0.0 0.0 16144 4064 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl
oracle 31474 0.0 0.1 17332 4588 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/perl/bin/perl /u01/app/oracle/product/10.1.0/db_1/sysman/admin/scripts/lsnrresp.pl
oracle 309 0.0 0.1 18688 5892 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/perl/bin/perl /u01/app/oracle/product/10.1.0/db_1/sysman/admin/scripts/lsnr_log_status.pl
oracle 326 0.0 0.0 2128 904 ? S Dec25 0:00 sh -c /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl > /tmp/zlihqS914Z
oracle 327 0.0 0.0 16148 4072 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl
oracle 752 0.0 0.0 2128 908 ? S Dec25 0:00 sh -c /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl > /tmp/K5geR0wcyN
oracle 753 0.0 0.1 16160 4220 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl
oracle 4270 0.0 0.0 2120 908 ? S Dec25 0:00 sh -c /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl > /tmp/9ov0ZwbS5e
oracle 4271 0.0 0.1 16156 4224 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl
oracle 9227 0.0 0.0 2132 908 ? S Dec25 0:00 sh -c /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl > /tmp/qv5iJttPbm
oracle 9228 0.0 0.1 16168 4216 ? S Dec25 0:00 /u01/app/oracle/product/10.1.0/db_1/bin/lsnrctl
... etc ...
root 9310 0.0 0.0 1612 472 pts/2 S 08:35 0:00 grep lsn
If a stop and restart the listener, i don't have any more problem.
I suspect OEM agent because each time i noted the problem, the agent was running .
What occurs? Thanks for your help.Hi,
we had exactly the same problem this morning with our listener. We don't run OEM, and the listener.log file didn't have any errors in it. The log shows new connections up to the point where the second process starts (we know this from date stamps on the processes) and the next thing that appears is the listener starting again (after I've killed both listener processes and started the listener again)
log extract
09-JUN-2006 09:50:53 * (CONNECT_DATA=(SID=orac10g)(CID=PROGRAM=C:\Program Files\Precedent Version 2\PFW2.exe)(HOST=05BLG297)(USER=pettsc))) * (ADDRESS=(PROTOCOL=tcp)(HOST=172.16.204.76)(PORT=1451)) * establish * orac10g * 0
TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 09-JUN-2006 10:03:42
Copyright (c) 1991, 2005, Oracle. All rights reserved.
System parameter file is /oracle/product/10.2.0/network/admin/listener.ora
Log messages written to /oracle/product/10.2.0/network/log/listener.log
Trace information written to /oracle/product/10.2.0/network/trace/listener.trc
Trace level is currently 0
Started with pid=3178550
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=churchill.blg.co.uk)(PORT=1521)))
According to the actual process - the secondary lsnr process's parent was the initial one. It's almost like the first process spawned the second one.
We thought it might be one of the limits (we're running AIX 5) on the user running the process - but I suspect not as the same user is running the Oracle DB processes and they don't have any issues.
Thoughts?
Dave -
Hello together,
we' re building a ISA-like java-application for a customer. We try to use the same framework as the standard isa-app. Via IPC we are getting the characteristics of a product und configuring it. This works with the 3.1 version of the crm and ipc. But then there was made a upgrade to crm 4.0 and ipc 4.0. At the moment nothing of the configuration-part works. I am trying to use the ipccore.jar, but at this point I can't get any characteristics from my IPCItem. So I want to create another IPCSession and getting this characteristcs via a new IPCDocument and IPCItem, with the same productId.
If I use the constructor of the DefaultIPCDocumentProperties for creating a new IPCDocument, my action can't get instanced and throws a java.lang.IncompatibleClassChangeError. In a standalone java-application this thing works fine. Knows someone any Problems with such a problem? Or maybe another solution for getting my characteristics from the ipc?
Thank you in advance.
Best regards
Thorsten BoerschJan (guest) wrote:
: Hello,
: I3m running 8.0.5 on SuSe 6.0. Everthing works fine but when I
: use lsnrctl and do a start/stop I always get TNS errors
: Permission denied, followed by linux error 13 ?!
: The conenction via TCP/IP works fine ....
Had the same problem on RedHat 5.2. The problem is caused by
protections on files in /tmp/.oracle. Those files are unix-
domain sockets, owned by root. The root ownership is caused by
the set-uid bits of $ORACLE_HOME/bin/tnslsnr and/or
$ORACLE_HOME/bin/lsnrctl, and the fact that this file is owned
by root (which is caused by the root.sh shell script from the
installation procedure).
: Any hints ????
After changing the ownership of lsnrctl and/or (sorry I'm not
sure) tnslsnr everything worked fine. Hope it helps for you too
null -
8i Listener Problem with client
Hi
I'm having problems with our Linux 8i server.
Software has been installed ok and I can get client connections with a
freshly started listener (LSNRCTL start) using the DBA studio client.
Once I disconnect and then attempt to reconnect I get a "Target not found"
error. But, if I restart the listener on the server then try to connect
again all is fine.telnet is ok the port is open and ready.
I have some more information below that I think is causing my problem
When I start the listener I get
TNSLSNR for Linux: Version 8.1.6.0.0 - Production
System parameter file is
/u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
Log messages written to
/u01/ora8/app/oracle/8i_8.1.6/network/log/listener.log
Listening on:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=holly.mv)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=holly.mv)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 8.1.6.0.0 - Production
Start Date 23-AUG-2000 09:23:48
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP ON
Listener Parameter File
/u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
Listener Log File
/u01/ora8/app/oracle/8i_8.1.6/network/log/listener.log
Services Summary...
PLSExtProc has 1 service handler(s)
ora8 has 1 service handler(s)
The command completed successfully
***EOF
For around 50 -65 seconds after this I can connect and reconnect etc
After this time if I do a lsnrctl status I get ( Note the 3 extra
handlers
on ora8 )
LSNRCTL for Linux: Version 8.1.6.0.0 - Production on 23-AUG-2000 09:24:39
(c) Copyright 1998, 1999, Oracle Corporation. All rights reserved.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=holly.mv)(PORT=1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 8.1.6.0.0 - Production
Start Date 23-AUG-2000 09:23:48
Uptime 0 days 0 hr. 0 min. 51 sec
Trace Level off
Security OFF
SNMP ON
Listener Parameter File
/u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
Listener Log File
/u01/ora8/app/oracle/8i_8.1.6/network/log/listener.log
Services Summary...
PLSExtProc has 1 service handler(s)
ora8 has 1 service handler(s)
ora8 has 3 service handler(s)<======== ???????
The command completed successfully
***EOF
Once these extra handlers appear, I can no longer connect to the server.
Here is my listener.ora file
# LISTENER.ORA Configuration
File:/u01/ora8/app/oracle/8i_8.1.6/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = holly.mv)(PORT = 1521))
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/ora8/app/oracle/8i_8.1.6)
(PROGRAM = extproc)
(SID_DESC =
(GLOBAL_DBNAME = ora8)
(ORACLE_HOME = /u01/ora8/app/oracle/8i_8.1.6)
(SID_NAME = ora8)
***EOF
Any ideas on if this is related to my problem
Regards
Andrew
nullThe client debug is a good place to start and here is a document explaining that process.
http://www.cisco.com/en/US/products/hw/wireless/ps430/products_tech_note09186a008091b08b.shtml
You many want to do dot11 debugs as well. But sniff the air first and see what activity you see... Also check your clients for a possible misconfig. -
I have problems with autom. discover of nodes.The services Man.server and agent are started, but i get
the errormsg:Discovery failed:VNI-4009: Cannot contact agent on the node.
Can someone help me.
Thanks.what os are you running?
on my linux box, what i did was to delete *.q and services.ora from $ORACLE_HOME/network/agent then manually put in my instance in tnsnames.ora using the example used in http://www.mike-devlin.com/oracle/tnsnames_ora.htm. i made sure that the instance was up then ran lsnrctl start and agentctl start. OMS was able to discover my database automatically after that.
i do have a feeling that you are using Win2k/XP, but the files i mentioned can be located in the same directory. instead of lsnrctl start and agentctl start, you can go to Administrative Tools>Sevices and start OracleOra92TNSListener and OracleOra92Agent
i would recommend, however, trying to use netca when recreating the tnsnames.ora. it just didn't work with mine so i had to do it manually. -
I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
Thank you in advance,
LeftyThis was one solution from the socket programming forum, have you tried this??
public Thread MyThread extends Thread{
boolean active = true;
public void run(){
ss.setSoTimeout(90);
while (active){
try{
serverSocket = ss.accept();
catch (SocketTimeoutException ste){
// do nothing
// interrupt thread
public void deactivate(){
active = false;
// you gotta sleep for a time longer than the
// accept() timeout to make sure that timeout is finished.
try{
sleep(91);
}catch (InterruptedException ie){
interrupt();
} -
Problem with Threads and a static variable
I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
Code functionality:
A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
The problem as far I understand is:
Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
Thanks,
B.D.
Code:
private static volatile boolean bChanged = false;
private static Thread objMainProcess;
protected static void Init(){
objMainProcess = new Thread() {
public void run() {
while( objMainProcess == Thread.currentThread() ) {
GetState();
objMainProcess.setDaemon( true );
objMainProcess.start();
public static void initStatusTimer(){
if(objTimer == null)
objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
public void actionPerformed( java.awt.event.ActionEvent evt){
SetState();
private static void SetState(){
if( objMainProcess == null ) return;
synchronized( objMainProcess ) {
bChanged = true;
try{
objMainProcess.notify();
}catch( IllegalMonitorStateException e ) {}
private static boolean GetState() {
if( objMainProcess == null ) return false;
synchronized( objMainProcess ) {
if( bChanged) {
SendMessage();
bChanged = false;
return true;
try {
objMainProcess.wait();
}catch( InterruptedException e ) {}
return false;
}Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
Again as you said, There is a reason I can't call sendMessage() inside setState().
The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
Thanks,
B.D. -
Problem with threads running javaw
Hi,
Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
troy.troy,
Try and post a minimum code sample of your app which
does not work.
When using javaw, make sure you redirect the standard
error and standard output streams to file.
Graeme.Hi Graeme,
I dont understand what you mean by redirection to file? some of my code below.
The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
public class Server{
ServerSocket aServerSocket;
Socket dianosticsSocket;
Socket nPortExpress;
ClientListener aClientListener;
LinkedList queue = new LinkedList();
int port = 0;
int clientPort = 0;
String clientName = null;
boolean serverAlive = true;
* Server constructor generates a server
* Socket and then starts a client threads.
* @param aPort socket port of local machine.
public Server(int aPort, String aClientName, int aClientPort){
port = aPort;
clientName = aClientName;
clientPort = aClientPort;
try{
// create a new thread
aServerSocket = new ServerSocket(port) ;
// connect to the nPortExpress
aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
// aClientListener.setDaemon(true);
aClientListener.start();
// start a dianostic port
DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
// System.out.println("Server is running on port " + port + "...");
// System.out.println("Connect to nPort");
catch(Exception e)
// System.out.println("ERROR: Server port " + port + " not available");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
serverAlive = false;
System.exit(1);
while(serverAlive&&aClientListener.hostSocket.isConnected()){
try{
// connect the client
Socket aClient = aServerSocket.accept();
//System.out.println("open client connection");
//System.out.println("client local: "+ aClient.getLocalAddress().toString());
// System.out.println("client localport: "+ aClient.getLocalPort());
// System.out.println("client : "+ aClient.getInetAddress().toString());
// System.out.println("client port: "+ aClient.getLocalPort());
// make a new client thread
ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
// start thread
clientThread.start();
catch(Exception e)
//System.out.println("ERROR: Client connection failure");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
}// end while
} // end constructor Server
void serverExit(){
JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}// end class Server
*** connect to another server
public class ClientListener extends Thread{
InetAddress hostName;
int hostPort;
Socket hostSocket;
BufferedReader in;
PrintWriter out;
boolean loggedIn;
LinkedList queue; // reference to Server queue
Server serverRef; // reference to main server
* ClientListener connects to the host server.
* @param aHostName is the name of the host eg server name or IP address.
* @param aHostPort is a port number of the host.
* @param aLoginName is the users login name.
public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer) // reference to Server queue)
hostName = aHostName;
hostPort = aHostPort;
queue = aQueue;
serverRef = aServer;
// connect to the server
try{
hostSocket = new Socket(hostName, hostPort);
catch(IOException e){
//System.out.println("ERROR: Connection Host Failed");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);
System.exit(0);
} // end constructor ClientListener
** multi client connection server
ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
queue = aQueue;
addToQueue(this);
client = aSocket;
clientRef = aClientListener;
aDiagnostic = diagnostics;
} // end constructor ClientWorker
* run method is the main loop of the server program
* in change of handle new client connection as well
* as handle all messages and errors.
public void run(){
boolean alive = true;
String aSubString = "";
in = null;
out = null;
loginName = "";
loggedIn = false;
while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
try{
in = new BufferedReader(new InputStreamReader(client.getInputStream()));
out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
if(aDiagnostic){
out.println("WELCOME to diagnostics");
broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
out.flush();
else {
out.println("WELCOME to Troy's Server");
broadCastDia("Connect : client "+client.getInetAddress().toString());
out.flush();
String line;
while(((line = in.readLine())!= null)){
StringTokenizer aStringToken = new StringTokenizer(line, " ");
if(!aDiagnostic){
broadCastDia(line);
clientRef.sendMessage(line); // send mesage out to netExpress
out.println(line);
out.flush();
else{
if(line.equals("GETIPS"))
getIPs();
else{
clientRef.sendMessage(line); // send mesage out to netExpress
out.println(line);
out.flush();
} // end while
catch(Exception e){
// System.out.println("ERROR:Client Connection reset");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);
try{
if(aDiagnostic){
broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
out.flush();
else {
broadCastDia("Disconnect : client "+client.getInetAddress().toString());
out.flush();
// close the buffers and connection;
in.close();
out.close();
client.close();
// System.out.println("out");
// remove from list
removeThreadQueue(this);
alive = false;
catch(Exception e){
// System.out.println("ERROR: Client Connection reset failure");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);
}// end while
} // end method run
* method run - Generates io stream for communicating with the server and
* starts the client gui. Run also parses the input commands from the server.
public void run(){
boolean alive = true;
try{
// begin to life the gui
// aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
// aGuiClient.show();
in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
while (alive && hostSocket.isConnected()){
String line;
while(((line = in.readLine())!= null)){
System.out.println(line);
broadCast(line);
} // end while
} // end while
catch(Exception e){
// System.out.println("ERRORa Connection to host reset");
JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
try{
hostSocket.close();
}catch(Exception a){
JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
alive = false;
System.exit(1);
} // end method run -
Problem with threads and camera.
Hi everybody!
I've a problem with taking snapshot.
I would like to display a loading screen after it take snapshot ( sometimes i
have to wait few seconds after i took snapshot. Propably photo is being taken in time where i have to wait).
I was trying to use threads but i didn't succeed.
I made this code:
display.setCurrent(perform);
new Thread(new Runnable(){
public void run() {
while((!performing.isShown()) && (backgroundCamera.isShown())){
Thread.yield();
notifyAll();
}).start();
new Thread(new Runnable(){
public void run() {
try {
this.wait();
} catch(Exception e) {
exceptionHandler(e);
photo = camera.snapshot();
display.setCurrent(displayPhoto);
}).start();This code is sometimes showing performing screen but sometimes no.
I don't know why. In my opinion performing.isShown() method isn't working correctly.
Does anyone have some idea how to use threads here?Hi,
I've finally managed to work this fine.
The code:
Object o = new Object();
display.setCurrent(perform);
new Thread(new Runnable(){
public void run() {
while(!performing.isShown()){
Thread.yield();
synchronized(o) {
o.notify();
}).start();
new Thread(new Runnable(){
public void run() {
try {
synchronized(o) {
o.wait(1);
} catch(Exception e) {
exceptionHandler(e);
photo = camera.snapshot();
display.setCurrent(displayPhoto);
}).start(); -
We have a problem where our application stops responding after a few days of usage. Things will for fine for a day or two, and then pretty quickly threads will start getting hung up, usually in places where they are allocating memory
We are running WebLogic 8.1 SP2 on Sun JDK 1.4.2_04 on Solaris 8 using the alternate threading model and the -server hotspot vm. We are running pretty much the same code that we had no problems with under WebLogic 6.1 SP4 and Sun JDK 1.3.1.
A thread dump usually shows that some or all of our execute threads are in the state "waiting for monitor entry" even though they are not currently waiting on any java locks. Here is a sample thread from the thread dump (we have ~120 threads so I don't want to post the full dump).
=============================================================================================
"ExecuteThread: '8' for queue: 'itgCrmWarExecutionQueue'" daemon prio=5 tid=0x005941d0 nid=0x2c waiting for monitor entry [c807f000..c807fc28]
at java.lang.String.substring(String.java:1446)
at java.lang.String.substring(String.java:1411)
at weblogic.servlet.internal.ServletRequestImpl.getRelativeUri(ServletRequestImpl.java:1872)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3492)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
=============================================================================================
String.java line 1446 for this jdk allocates a new String object, and all the other threads in this state also are creating new objects or arrays, etc.
We've done a pstack on this process when it's in this state, and the threads that are in the "waiting for monitor entry" that look like they're allocating memory are all waiting on the same lwp_mutex_lock with some allocation method that's calling into the native TwoGenerationCollectorPolicy.mem_allocate_work (see pstack output below for the same thread as in the thread dump above)
=============================================================================================
----------------- lwp# 44 / thread# 44 --------------------
ff31f364 lwp_mutex_lock (e3d70)
fee92384 __1cNObjectMonitorGenter26MpnGThread__v_ (5000, 525c, 5000, 50dc, 4800, 4af0) + 2d8
fee324d4 __1cSObjectSynchronizerKfast_enter6FnGHandle_pnJBasicLock_pnGThread__v_ (c807f65c, c807f7d4, 5941d0, 0, 35d654, fee328ec) + 68
fee32954 __1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_ (c807f7d4, ff170000, d4680000, 4491d4, fee1bc2c,
0) + 78
fee3167c __1cPVM_GC_OperationNdoit_prologue6M_i_ (c807f7bc, 4400, ff170000, 2d2b8, 4a6268, c807fa18) + 38
fee2e0b0 __1cIVMThreadHexecute6FpnMVM_Operation__v_ (c807f7bc, 963a8, 0, 0, 1, 0) + 90
fed2c2a4 __1cbCTwoGenerationCollectorPolicyRmem_allocate_work6MIii_pnIHeapWord__ (962c0, ff1c29ec, ff1c297c, ff131a26, 4800, 4998) + 160
fed22940 __1cNinstanceKlassRallocate_instance6MpnGThread__pnPinstanceOopDesc__ (ee009020, 5941d0, 15ca581, 3647f0, 4a6268, c807f8c8) + 180
fed34928 __1cLOptoRuntimeFnew_C6FpnMklassOopDesc_pnKJavaThread__v_ (ee009018, 5941d0, 0, 0, 0, 0) + 28
fa435a58 ???????? (ee009018, e86de, 15ca4de, 50dc, 5941d0, c807f9c8)
fb36f9a4 ???????? (0, d412ccd8, ee046c28, ff170000, 0, 0)
fad8b278 ???????? (ee046c28, d6000c90, ee046530, 8, db8e8450, c807f9e8)
fad62abc ???????? (d412ccd8, ee046530, d6000c90, ee3bfa38, 8, c807fa18)
fa4b3c38 ???????? (c807fb9c, 0, f2134700, fa415e50, 8, c807faa8)
fa40010c ???????? (c807fc28, c807fe90, a, ee9e1e20, 4, c807fb40)
fed5d48c __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_ (c807fe88, c807fcf0, c807fda8, 5941d0, 5941d0, c807fd00) + 27c
fee4b784 __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_ (ff170000, 594778, c807fd9c, c807fd98, c807fda8, 5941d0) + 164
fee5e8dc __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_ (c807fe88, c807fe84, c807fe7c, c807fe74, c807fe6c, 5941d0) + 6c
fee6fc74 __1cMthread_entry6FpnKJavaThread_pnGThread__v_ (5941d0, 5941d0, 838588, 594778, 306d10, fee69254) + 128
fee6927c __1cKJavaThreadDrun6M_v_ (5941d0, 2c, 40, 0, 40, 0) + 284
fee6575c _start (5941d0, fa1a1600, 0, 0, 0, 0) + 134
ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
=============================================================================================
Also when it's having this problem, the "VM Thread" is always using a lot of processor time. We did a couple of pstacks today while it was having this problem, and this thread was stuck in the ONMethodSweeper.sweep for over 15 minutes when we finally killed the server.
From the thread dump:
"VM Thread" prio=5 tid=0x000e2d20 nid=0x2 runnable
From the first pstack:
=============================================================================================
----------------- lwp# 2 / thread# 2 --------------------
fed40c04 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (42a2f4, fa5fa46d, ffffffff, fc4ffcb8, 42a2f4, 42a324) + 124
fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (42a2f0, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (fa5f7f88, fa608940, 1, 0, fa400000, 6) + 1ac
fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
fee6575c _start (e2d20, ff270200, 0, 0, 0, 0) + 134
ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
=============================================================================================
Second pstack
=============================================================================================
----------------- lwp# 2 / thread# 2 --------------------
fed41180 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (0, ff1b9664, ffffffff, fc4ffcb8, a6f2cc, fc4ffbd0) + 6a0
fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (a6f2c8, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (faded4c8, fadf2c80, 1, 0, fa400000, 6) + 1ac
fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
fee6575c _start (e2d20, ff270200, 0, 0, 0, 0) + 134
ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
=============================================================================================
Has anyone ever seen anything like this? I'm trying to figure out if this is caused by something we're doing, or something relating to our environment and jvm options. Any ideas?Thanks for the reply - I'm testing our app with the +UseConcMarkSweepGC now in our test environment to make sure it doesn't cause any problems there. Unfortunately the only place we've had this problem is on the production server, so it's extra difficult debugging this.
We're using the following memory options:
-ms512m -mx512m -XX:NewSize=128m -XX:PermSize=192m -XX:MaxNewSize=128m -XX:MaxPermSize=192m -XX:SurvivorRatio=8and the following debugging options, as we've also been seeing OutOfMemoryErrors ( see http://forum.java.sun.com/thread.jsp?forum=37&thread=522354&tstart=45&trange=15 )
-verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGCBTW, which c++filt version and options are you using? Our Solaris boxes only seem to have the GNU version installed. I was trying to run that on some of the other stack traces and wasn't getting anywhere, and didn't know if because it was GNU version wouldn't work on something compiled with the Sun compiler.
Thanks!
--Andy -
Problem with threads and ProgressMonitor
Dear Friends:
I have a little problem with a thread and a ProgressMonitor. I have a long time process that runs in a thread (the thread is in an separate class). The thread has a ProgressMonitor that works fine and shows the tasks progress.
But I need deactivate the main class(the main class is the user interface) until the thread ends.
I use something like this:
LongTask myTask=new LongTask();
myTask.start();
myTask.join();
Now, the main class waits for the task to end, but the progress monitor don`t works fine: it shows only the dialog but not the progress bar.
What's wrong?Is the dialog a modal dialog? This can block other UI updates.
In general, you should make sure that it isn't modal, and that your workThread has a fairly low priority so that the UI can do its updating
Maybe you are looking for
-
How do I keep a layer constantly selected?
I am creating a animated GIF image, over 70 frames. I need to edit each frame for this GIF image. I select the layer of the GIF, but how do I keep it selected when I go onto the next frame? I always have to click the layer again to edit, it's quite a
-
I want to use my home dvd player to burn dvds/cds onto my MacBook Air. I have an hdmi cord with thunderbolt connector. Where do I go from here?
-
Six kernel panics since installing Lion
So I've had six kernel panics since installing Lion on my sandy bridge MBP. Usually running safari, mail, and excel when they occur. Weird third-party process or something? I actually don't have many applications installed on this computer. Any
-
Cannot import 2000 chars in OWB 9.0.4.
I'm trying to import a flat file in EBCDIC format into OWB 904. It fails with the following message: "API2839 - The field definitions exceed the length of a fixed length record." The record length is 4050, with fixed length fields. When I enter the f
-
I have attempted to update my software update several times and each time I get an error stating that it cannot save. I am not real familiar still with the MAC so I'm not sure what the issue it. Please Help!!