Too man open sockets?
After running tests on weblogic server 5.1.0, sp6 for a few days, we noticed
that the number of open sockets for the Java VM slowly creeped up to 472.
This test was run with 75 simulated users with
weblogic.system.executeThreadCount=15
The question is: why are there so many open sockets? We did have a JDBC
connection pool of size 100, but that does not account for the 472 open
sockets.
Any ideas?
Ravi Sharma.
acs10004# ps -ef | grep java
acs 824 823 0 Dec 22 ? 2374:42
/acs/util/SunOS/jdk1.2.2/bin/../bin/sparc/native_threads/java -ms512m -mx512
m -
acs10004# cd /proc/824/fd
acs10004# find . -print | wc -l
585
acs10004# find . -type s | wc -l
472
acs10004# find . -type f | wc -l
102
acs10004# find . \! \( -type f -o -type s \) -ls
4054 10 dr-x------ 2 acs dev 9632 Dec 22 18:54 .
1409362 0 c--------- 1 root tty 24, 4 Dec 24 14:27 ./0
237955 0 p--------- 0 root other 0 Dec 26 22:47 ./1
1409237 0 c--------- 1 root sys 13, 12 May 23 2000 ./3
4035 1 lr-x--x--x 1 acs dev 0 Dec 22 18:54 ./4 ->
1409236 0 c--------- 1 root sys 13, 2 Dec 27 11:35 ./5
1409236 0 c--------- 1 root sys 13, 2 Dec 27 11:35 ./6
1625248272 0 D--------- 1 root root 0 May 23 2000 ./7
2992 0 c--------- 0 root root 41,93187 Dec 22 18:54 ./32
237960 0 p--------- 0 root other 0 Dec 26 22:47 ./36
237960 0 p--------- 0 root other 0 Dec 26 22:47 ./37
If you don't kill WL properly it will leave all of those extra java processes running. try using this to shutdown your server:
$JAVA_HOME/java -cp ./classes/boot:./classes:./lib/weblogicaux.jar weblogic.Admin t3://localhost:(WL PORT) SHUTDOWN system password
this won't kill the ones that have been stopped incorrectly already but it will kill the ones on the current WL instance.
To make sure this is the problem just stop the server the way you have been and if the java proceses are still there then it was the way you were shutting down.
Hope this helps
-Jeff Ward
"Cameron Purdy" <[email protected]> wrote:
Are you using that native io option?
Cameron Purdy
Tangosol, Inc.
http://www.tangosol.com
+1.617.623.5782
WebLogic Consulting Available
"Ravi Sharma" <[email protected]> wrote in message
news:[email protected]...
After running tests on weblogic server 5.1.0, sp6 for a few days, wenoticed
that the number of open sockets for the Java VM slowly creeped up to 472.
This test was run with 75 simulated users with
weblogic.system.executeThreadCount=15
The question is: why are there so many open sockets? We did have a JDBC
connection pool of size 100, but that does not account for the 472 open
sockets.
Any ideas?
Ravi Sharma.
acs10004# ps -ef | grep java
acs 824 823 0 Dec 22 ? 2374:42
/acs/util/SunOS/jdk1.2.2/bin/../bin/sparc/native_threads/java -ms512m -mx512
m -
acs10004# cd /proc/824/fd
acs10004# find . -print | wc -l
585
acs10004# find . -type s | wc -l
472
acs10004# find . -type f | wc -l
102
acs10004# find . \! \( -type f -o -type s \) -ls
4054 10 dr-x------ 2 acs dev 9632 Dec 22 18:54 .
1409362 0 c--------- 1 root tty 24, 4 Dec 24 14:27 ./0
237955 0 p--------- 0 root other 0 Dec 26 22:47 ./1
1409237 0 c--------- 1 root sys 13, 12 May 23 2000 ./3
4035 1 lr-x--x--x 1 acs dev 0 Dec 22 18:54 ./4 ->
1409236 0 c--------- 1 root sys 13, 2 Dec 27 11:35 ./5
1409236 0 c--------- 1 root sys 13, 2 Dec 27 11:35 ./6
1625248272 0 D--------- 1 root root 0 May 23 2000 ./7
2992 0 c--------- 0 root root 41,93187 Dec 22 18:54 ./32
237960 0 p--------- 0 root other 0 Dec 26 22:47 ./36
237960 0 p--------- 0 root other 0 Dec 26 22:47 ./37
Similar Messages
-
Too many open socket connections causing ColdFusion to crash?
I’m currently working on an e-commerce site which sends and receives information to/from the client’s order management system via XML over a TCP/IP socket. It uses a very old java-based custom tag called CFX_JSOCKET (which appears to have been written in 2002) to open the socket, send the data, and get the response. The code that calls the custom tag and sends/receives data from the OMS pre-dates my working on the site, but its always worked, so I haven’t paid it much attention.
Back in the summer of 2009 we started experiencing issues with ColdFusion (v.7 on Window 2003 at the time) locking up on a more and more frequent basis, until it ultimately became a daily issue. After extensive research we narrowed the issue down to the communication between the web server and our client’s order management server. It seemed the issue with ColdFusion hanging was either related to there being too many connections open, or to these connections hanging and resulting in dead threads. This an educated guess based on a blog post I’d seen online, not actual monitoring of either CF or the TCP/IP connections. As soon as we dialed back the timeout on the CFX_JSOCKET tag from 20 seconds to 10, the issue disappeared, so we left it at that and moved on.
Fast forward to this January. The site is hosted at a new location, on a 64-bit Windows 2008 box running ColdFusion 9. Over the years traffic on the site has continued to grow. The nature of the clients business means that August and January are their business times of the year (back to school for college kids) and in January ColdFusion once again started locking up on an almost-daily basis.
One significant difference is that the address cleansing software that previously ran on the box and was used to verify shipping addresses is not available for 64-bit, so when we moved to the new server last summer, that task was moved to the client’s order management software and handled via XML like all other interaction with that system. However, while most XML calls to that server (order input, inventory check, etc) take under a second to complete, the address cleansing call regularly takes over 5 seconds to return data, and frequently times out.
Once we eliminated the address cleansing call from the checkout process, ColdFusion once again stopped locking up regularly. So it appears that once again it’s the communication between the web server and the order management server that’s causing problems. We currently have that address cleansing call disabled on the web site in order to keep ColdFusion from crashing, but that’s not a long term solution.
We don’t have, nor can I find online, the source code for the CFX_JSOCKET custom tag, so I decided I’d write some CF code utilizing the java methods to open the socket, send the data, get the response, and close the connection. My test code is working fine (under no load). However, in trying to troubleshoot an issue I had with it, I started monitoring the TCP/IP connections using TCPView. And I noticed that all the connections to the order management server, whether opened via the custom tag or my new code, remain open in either a TIME_WAIT or FIN_WAIT2 status for well over 2 minutes, even though I know for a fact that my new code is definitely closing the connection from the web server side.
They do all close eventually, but I’m wondering 1. Why they’re remaining open that long; 2. Is that normal; and 3. If all these connections remaining open could be what’s causing ColdFusion to choke.
Does this sound plausible? If so, does anyone have any suggestions/recommendations about how to fix it? My research seems to indicate this might be a matter of the order management system not closing the connection on its end, but I’m in way over my head, and before I go to client and tell them it’s their OMS causing the issue, I need to feel a little more confident that I’m on the right track.
Any help or advice would be very greatly appreciated. And thanks for taking the time to read through my long-winded explanation of the problem.
Set-up details:
ColdFusion Version: 9,0,0,251028 Standard
Operating System: Windows Server 2008
Java Version: 1.6.0_14
Java VM Name: Java HotSpot(TM) 64-Bit Server VM
Java VM Version: 14.0-b16
Thanks,
LaurieHi Laurie,
Not aware of custom tag called CFX_JSOCKET. I guess the process you described very well is consuming a resource then you are getting a problem. Trick is what parameter to adjust. Perhaps you are running out of one the threads in CFadmin > Server Settings > Request Tuning.
I expect if you enable CF Metrics logging where you can log the threads and other resources then you can find out which parameter needs adjusting. Let me know if you want some details on enabling CF Metrics. Perhaps others will have much better idea than me and help without the overhead of logging.
The other interesting thing is you are using CF9.0.0. Do you have some reasons for not being on updater1 CF9.0.1?
HTH, Carl.
PS I posted before however seems to have gone, just hope does not come back and then I have posted twice. -
10/29/11 10:29:17.285 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:209 (fe09000a) CTunTapMgr::openDevice
10/29/11 10:29:17.285 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:1257 (18) socket Too many open files
10/29/11 10:29:17.285 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:340 (fe09000b) CTunTapMgr::disableHostMgr
10/29/11 10:29:22.286 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:259 (18) open Too many open files
10/29/11 10:29:22.286 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:209 (fe09000a) CTunTapMgr::openDevice
10/29/11 10:29:22.286 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:1257 (18) socket Too many open files
10/29/11 10:29:22.286 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:340 (fe09000b) CTunTapMgr::disableHostMgr
10/29/11 10:29:27.287 PM vpnagentd: [p:133 pp:1]: error - TunTapMgr.cpp:259 (18) open Too many open files
What could this mean? It keeps appearing on my console. I"m trying to install a Fitbit Tracker and can't get it to recognize the device. wondering if this has something to do with it. Thanks!It means you've installed some kind of third-party VPN software that isn't working.
-
Hello!
On MacOSX 10.4.10 which is an OD master, my log are filed with this:
DirectoryService[67]: socket(PF_ROUTE) failed: Too many open files
It happens at exactly every hours 44 minutes 18 seconds 161 times. At the same time, it makes a lot dns request for "kerberos-master.udp.XXXXXXXXX.COM IN SRV +"
The server works fine, but there's probably a cronjob that go crazy and i would like to know why it's happening.
Thanks a lot!
FredHi,
Cause might The server got an exception while trying to accept client connections. It will try to backoff to aid recovery.
The OS limit for the number of open file descriptor (FD limit) needs to be increased. Tune OS parameters that might help the server to accept more client connections (e.g. TCP accept back log).
http://e-docs.bea.com/wls/docs90/messages/Server.html#BEA-002616
Regards,
Prasanna Yalam -
Operation Could Not Be Completed: Too Many Open...
I've had this error showing up a lot in the Safari 3.2 and 4.0 beta activity window when loading multiple tabs of pages with many images (usually gallery type pages or blogs with lots of thumbnails). The result is that some images or other elements like style sheets don't load, leading to the blue question mark, or messed up formatting. Unfortunately, the activity window can't be stretched wide enough to see the whole error, but in fact it's "Operation Could Not Be Completed: Too Many Open Files". The error "socket(PF_ROUTE) failed: Too many open files" shows up in the Console as well, at least with Safari 4. I had also experienced similar problems with "Operation Timed Out" errors as well.
I've been pulling my hair out on this one, because it's rather inconsistent, not to mention annoying. You can usually get an individual page to load completely by refreshing it, but that kind of defeats the purpose of loading multiple tabs all at once. It's also less of a problem if more of those pages are already cached, but you never know for sure. Running your connection through a proxy also helps a bit, but not always.
I found a fix, but it's actually not Safari's "fault" per se. The issue lies in the allowable number of open files per user process, which is set by the system's launchd process at boot time. Note that Safari is not entirely innocent, as FireFox doesn't have this problem. It Seems that Safari just tries to load everything all at once, whereas FireFox does a better job of managing its load requests. Anyway if you run the following command in Terminal:
sudo launchctl limit
the following list should show up (with perhaps slightly different values)
cpu unlimited unlimited
filesize unlimited unlimited
data 6291456 unlimited
stack 8388608 67104768
core 0 unlimited
rss unlimited unlimited
memlock unlimited unlimited
maxproc 200 532
maxfiles 256 unlimited
The second column is a "soft limit" and the third column is a "hard limit", though to be honest I'm not exactly sure what the difference entails. The image loading problem is caused by hitting the maxfiles limit of just 256 files. The solution is to change maxfiles to 4096/unlimited, and also change maxproc to 1000/2000 since it's pretty low as well. That sounds like a pretty big change, but OS X server is supposed to change them to numbers like this when services like Apache are enabled, and Apple even mentions how to change maxproc at http://support.apple.com/kb/TS1659
To make these changes, run the following two commands in Terminal and restart the computer:
echo "limit maxproc 1000 2000" | sudo tee -a /etc/launchd.conf
echo "limit maxfiles 4096 unlimited" | sudo tee -a /etc/launchd.conf
The commands add the two lines in quotes to the launchd.conf file in /etc/ (if no file exists yet, it creates it). That should clear up the loading issues. I haven't noticed any other problems with these increased numbers, but I'll report back if anything seems to go amiss. Hopefully this will be helpful to someone.I faced the same problem with an image gallery using css for image resizing. Thanks for the explanation.
-
WLS 10.3.5 on RHEL 5.4, SocketException: Too many open files
Hi
I'm running Weblogic server 10.3.5 on Red Hat Enterprise Linux Server release 5.4 (Tikanga), with Java jdk1.6.0_27.
My order handling application, when receiving client orders, needs to make outbound SOAP calls to fulfill the order. During a performance test, we got following errors:
####<Feb 10, 2012 2:28:41 PM ICT> <Critical> <Server> <KKMOMAPP2> <KKMOMPE2> <DynamicListenThread[Default]> <<WLS Kernel>> <> <> <1328858921806> <BEA-002616> <Failed to listen on channel "Default" on 172.24.106.81:4095, failure count: 1, failing for 0 seconds, java.net.SocketException: Too many open files>
I monitored the java process of this application, when the "Too many open files" error happened, it had 1388 open file descriptors, among which 655 were sockets.
I also monitored the total open file descriptors of the weblogic user account, the count was around 6300 during this error.
These numbers are far smaller than the file limits configured on OS:
- Under weblogic account, ulimit -n shows 65536
- /proc/sys/fs/file-max shows 772591
- Following lines are already in /etc/security/limits.conf
weblogic soft nofile 65536
weblogic hard nofile 65536
weblogic soft nproc 16384
weblogic hard nproc 16384
I did another test using a simple java program to open large number of sockets under weblogic account. It has no problem to open 15,000 sockets. It seems the file descriptor limit is indeed quite high, but for some reasons, the Weblogic process fails even when it has merely 1388 open files. Are there other Linux or Weblogic parameters I should tune? Or anything else I missed?
Thank you very much
NingHi All,
Any help on this issue ?
Thank you,
Ram -
Running Out Of FIle Descriptors "Too many open files"
We have a 32 application(running on Solaris 8) that opens socket connections and also some files in read/write mode. The application works fine in normal(under low load) case.
But it is failing under stress environment. At some point under stress environment, when it tries opening a file, it(fopen) gives me error code 24 that means that "too many files opened".
From this it seems that the application is running out of file descriptors. I used the truss, pfiles and lsof utilities to see how many descriptors are currently opened by my application and the number it gives is around 900(and this is the expected figure to be opened by my application).
I also set the ulimit(both hard and soft) to a larger number but it also didn't work. Also when i set the soft limit to 70000, the truss output shows like:
25412/1: 5.3264 sysconfig(_CONFIG_OPEN_FILES) = 70000
23123/1: 7.2926 close(69999) Err#9 EBADF
23123/1: 7.2927 close(69998) Err#9 EBADF
23123/1: 7.2928 close(69997) Err#9 EBADF
23123/1: 7.2928 close(69996) Err#9 EBADF
23123/1: 7.2929 close(69995) Err#9 EBADF
23123/1: 7.2929 close(69994) Err#9 EBADF
23123/1: 7.2930 close(69993) Err#9 EBADF
This goes to close(3).. loops almost 70K times.
Don't know why such output is.
Note: under moderate stress environment where only 400 file descriptors are opened, the application works fine.
can you please help me in this? Is this the file descriptor problem or can be other potential source of problem.
Is this any other way to increase the file descriptor limit.
I aldo trying using LD_PRELOAD_32=/usr/lib/extendedFILE.so.1 but it gave me following error while starting application:
"ld.so.1: ls: fatal: /usr/lib/extendedFILE.so.1: open failed: No such file or direcroty"
Also i cant use purify(because of some reasons) to find file descriptors leakage(if any) and is not possible to upgrade the system to Solaris 10.
Thanks in advance.http://developers.sun.com/solaris/articles/stdio_256.html
-
What have "Too many open Files" to do with FIFOs?
Hi folks.
I've just finished a middleware service for my company, that receives files via a TCP/IP connection and stores them into some cache-directory. An external program gets called, consumes the files from the cache directory and puts a result-file there, which itself gets sent back to the client over TCP/IP.
After that's done, the cache file (and everything leftover) gets deleted.
The middleware-server is multithreaded and creates a new thread for each request connection.
These threads are supposed to die when the request is done.
All works fine, cache files get deleted, threads die when they should, the files get consumed by the external program as expected and so on.
BUT (there's always a butt;) to migrate from an older solution, the old data gets fed into the new system, creating about 5 to 8 requests a second.
After a time of about 20-30 minutes, the service drops out with "IOException: Too many open files" on the very line where the external program gets called.
I sweeped through my code, seeking to close even the most unlikely stream, that gets opened (even the outputstreams of the external process ;) but the problem stays.
Things I thought about:
- It's the external program: unlikely since the lsof-command (shows the "list of open files" on Linux) says that the open files belong to java processes. Having a closer look at the list, I see a large amount of "FIFO" entries that gets bigger, plus an (almost) constant amount of "normal" open file handles.
So perhaps the handles get opened (and not closed) somehwere else and the external program is just the drop that makes the cask flood over.
- Must be a file handle that's not closed: I find only the "FIFO" entries to grow. Yet I don't really know what that means. I just think it's something different than a "normal" file handle, but maybe I'm wrong.
- Must be a socket connection that's not closed: at least the client that sends requests to the middleware service closes the connection properly, and I am, well, quite sure that my code does it as well, but who knows? How can I be sure?
That was a long description, most of which will be skipped by you. To boil it down to some questions:
1.) What do the "FIFO" entries of the lsof-command under Linux really mean ?
2.) How can I make damn sure that every socket, stream, filehandle etc. pp. is closed when the worker thread dies?
Answers will be thanked a lot.
TomThanks for the quick replies.
@BIJ001:
ls -l /proc/<PID>/fdGives the same information as lsof does, namely a slowly but steadily growing amount of pipes
fuserDoesn't output anything at all
Do you make exec calls? Are you really sure stdout and stderr are consumed/closed?Well, the external program is called by
Process p = Runtime.getRuntime().exec(commandLine);and the stdout and stderr are consumed by two classes that subclass Thread (named showOutput) that do nothing but prepending the corresponding outputs with "OUT:" and "ERR" and putting them into a log.
Are they closed? I hope so: I call the showOutput's halt method, that should eventually close the handles.
@sjasja:
Sounds like a pipe.Thought so, too ;)
Do you have the waitFor() in there?Mentioning the waitFor():
my code looks more like:
try {
p = Runtime.getRuntime.exec(...);
outshow = new showOutput(p.getInputStream(), "OUT").start;
errshow = new showOutput(p.getErrorStream(), "ERR").start;
p.waitFor();
} catch (InterruptedException e) {
//can't wait for process?
//better go to sleep some.
log.info("Can't wait for process! Going to sleep 10sec.");
try{ Thread.sleep(10000); } catch (InterruptedException ignoreMe) {}
} finally {
if (outShow!=null) outShow.halt();
if (errShow!=null) errShow.halt();
/**within the class showOutput:*/
/**This method gets called by showOutput's halt:*/
public void notifyOfHalt() {
log.debug("Registered a notification to halt");
try {
myReader.close(); //is initialized to read from the given InputStream
} catch (IOException ignoreMe) {}
}Seems as if the both of you are quite sure that the pipes are actually created by the exec command and not closed afterwards.
Would you deem it unlikely that most of the handles are opened somewhere else and the exec command is just the final one that crashes the prog?
That's what I thought.
Thanks for your time
Tom -
Suddenly getting "Too Many Open File" error
Dear All,
I have listener program which have been working well for the past few months. Suddenly I start to get "Too Many Open File" error. What can be solution? Is it I need to increase the file descriptors or any other solution? Thank you.Dear Ejp,
Attached below is my codes. I have remove some of the fields for db just to make the code a bit more easier to read. Where do you think is leaking?
public class commServer {
public static void main(String[] args) {
try {
final ServerSocket serverSocketConn = new ServerSocket(8888);
while (true)
try
Socket socketConn1 = serverSocketConn.accept();
new Thread(new ConnectionHandler(socketConn1)).start();
catch(Exception e)
System.out.println(e.toString());
catch (Exception e)
System.out.println(e.toString());
//System.exit(0);
class ConnectionHandler implements Runnable {
private Socket receivedSocketConn1;
DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
DateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy");
DateFormat inDf=new SimpleDateFormat("ddMMyyHHmmss");
DateFormat outDf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ConnectionHandler(Socket receivedSocketConn1) {
this.receivedSocketConn1=receivedSocketConn1;
//@Override
public void run() {
Connection dbconn = null;
BufferedWriter w = null;
BufferedReader r = null;
try {
PrintStream out = System.out;
BufferedWriter fout = null;
w = new BufferedWriter(new OutputStreamWriter(receivedSocketConn1.getOutputStream()));
r = new BufferedReader(new InputStreamReader(receivedSocketConn1.getInputStream()));
int m = 0, count=0;
String line="";
String n="";
w.write("$PA\n");
w.flush();
while ((m=r.read()) != -1)
Date dateIn = new Date();
n = n + (char) m;
int i = n.indexOf("GET");
if(i != -1) {
break;
if (m==35)
String ori = n;
String noCheckSum = n.substring(0,(n.length()-4));
int addExist = n.indexOf("@");
String[] slave = null;
if(addExist!=-1)
slave = noCheckSum.split("@");
n = slave[0];
//System.out.println(" slave : "+slave.length);
else
n = noCheckSum;
String[] result = n.split(",");
Statement stmt = null;
w.write("$PA\n");
w.flush();
int count1 = 0;
Date date = Calendar.getInstance().getTime();
String today = formatter.format(date);
String filename= "MyDataFile"+today+".txt";
boolean append = true;
FileWriter fw = null;
try
fw = new FileWriter(filename,append);
fw.write(ori+" "+dateFormat.format(dateIn)+"\n");//appends the string to the file
Date dateOut = new Date();
fw.write("$PA"+" "+dateFormat.format(dateOut)+"\n");//appends the string to the file
catch (IOException ex)
//ex.printStackTrace(new PrintWriter(sWriter));
System.out.println("MyError:IOException has been caught in in the file operation");
ex.printStackTrace();
finally
try
if ( fw != null )
fw.close();
else
System.out.println("MyError:fw is null in finally close");
catch(IOException ex){
System.out.println("MyError:IOException has been caught in fw is null in finally close");
ex.printStackTrace();
try
String deviceID=result[3].trim();
String dateTime=result[4].trim();
String[] result2 = result[10].split("'");
String gpsDate = result2[1].trim().substring(0,6);
String gpsTime = result2[1].trim().substring(6,12);
String gpsLat = result2[1].trim().substring(13,20);
String latitude = result2[1].trim().substring(13,20).substring(0,2)+"."+result2[1].trim().substring(13,20).substring(2,7);
String gpsLong = result2[1].trim().substring(21,29);
String longitude = result2[1].trim().substring(21,29).substring(0,3)+"."+result2[1].trim().substring(21,29).substring(3,8);
String speed = result2[1].trim().substring(30,33);
String course = result2[1].trim().substring(33,36);
String dateTimer = null;
try
Date inDate=null;
inDf.setTimeZone(TimeZone.getTimeZone("UTC"));
inDate=inDf.parse(dateTime);
outDf.setTimeZone(TimeZone.getTimeZone("Asia/Kuala_Lumpur"));
dateTimer=outDf.format(inDate);
catch(ParseException ex)
System.out.println("MyError:Parse Error has been caught for date parse close");
ex.printStackTrace();
dbconn = DriverManager.getConnection("jdbc:mysql://192.168.1.155:3306/db1?"+"user=db1&password=test1");
stmt = dbconn.createStatement();
String selectQuery2 = "Select * from tripData Where deviceID='"+ deviceID +"' and dateTimer>'"+dateTimer+"' Order By dateTimer Desc Limit 1";
ResultSet rs2 = stmt.executeQuery(selectQuery2);
String updateQuery = "";
if(rs2.next())
String previousLatitude="";
String previousLongitude="";
String previousSpeed="";
previousLatitude = rs2.getString("latitude");
previousLongitude = rs2.getString("longitude");
previousSpeed = rs2.getString("speed");
updateQuery = "UPDATE device SET " +
"latitude='" + previousLatitude +
"',longitude='" + previousLongitude +
"',speed='" + previousSpeed +
"' WHERE serialNumber='" + deviceID + "'";
else
updateQuery = "UPDATE device SET " +
"latitude='" + latitude +
"',longitude='" + longitude +
"',speed='" + speed +
"',course='" + course +
"',dateTimer='" + dateTimer +
"' WHERE serialNumber='" + deviceID + "'";
count = stmt.executeUpdate(updateQuery);
String insertQuery = "INSERT INTO tripData" +
"(latitude,longitude,speed,course,dateTimer,deviceID)" + " VALUES ('" +
latitude + "','" + longitude + "','" + speed + "','" + course + "','" + dateTimer + "','" + deviceID + "' )";
count = stmt.executeUpdate(insertQuery);
if(addExist!=-1)
for(int iSlave=1; iSlave<slave.length ; iSlave++)
String[] slaveDetails = slave[iSlave].split(",",-1);
String slaveEventType = slaveDetails[0];
String slaveGroup = slaveDetails[1];
String slaveUnitID = slaveDetails[2];
String slaveBattLevel = slaveDetails[3];
String slaveSwitchStat = slaveDetails[4];
String slaveTempHumid = slaveDetails[5];
String slaveTemp="",slaveHumid="";
if(slaveTempHumid.length()>0)
slaveHumid = slaveTempHumid.substring(5,7);
if(slaveTempHumid.charAt(0)=='P')
slaveTemp = "+"+slaveTempHumid.substring(1,3)+"."+slaveTempHumid.substring(3,5);
else if(slaveTempHumid.charAt(0)=='M')
slaveTemp = "-"+slaveTempHumid.substring(1,3)+"."+slaveTempHumid.substring(3,5);
slaveBattLevel = slaveBattLevel.trim().substring(0,2)+"."+slaveBattLevel.trim().substring(2,3);
String insertQuery2 = "INSERT INTO tripDataSlave" +
"(dateTimer,deviceID,slaveUnitID,slaveEventType,slaveGroup,slaveBattLevel,slaveSwitchStat,slaveTemp,slaveHumidity)" + " VALUES ('" +
dateTimer + "','" + deviceID + "','" + slaveUnitID + "','" + slaveEventType + "','" + slaveGroup + "','" + slaveBattLevel + "','" + slaveSwitchStat + "','" + slaveTemp + "','" + slaveHumid + "')";
count = stmt.executeUpdate(insertQuery2);
catch (SQLException ex)
System.out.println("MyError:Error : "+ex);
finally
try
if ( stmt != null )
stmt.close();
else
System.out.println("MyError:stmt is null in finally close");
catch(SQLException ex){
System.out.println("MyError:SQLException has been caught for stmt close");
ex.printStackTrace();
try
if ( dbconn != null )
dbconn.close();
else
System.out.println("MyError:dbconn is null in finally close");
catch(SQLException ex){
System.out.println("MyError:SQLException has been caught for dbconn close");
ex.printStackTrace();
n="";
catch (IOException ex)
System.out.println("MyError:IOException has been caught in in the main first try");
ex.printStackTrace();
finally
try
if ( w != null )
w.close();
else
System.out.println("MyError:w is null in finally close");
catch(IOException ex){
System.out.println("MyError:IOException has been caught in w in finally close");
ex.printStackTrace();
} -
hi
I am getting the following error while calling the procedure in the batch process
ORA-06512: at "SYS.UTL_HTTP", line 1022
ORA-29270: too many open HTTP requests
Could you please help me on this? As this is getting affected in the live databases.
ORA-06512: at "SYS.UTL_HTTP", line 1022
ORA-29270: too many open HTTP requests
CREATE OR REPLACE PROCEDURE Send_To_Spg(
PTRANSACTION_ID IN VARCHAR2,
PCHANNEL_TYPE IN VARCHAR2 DEFAULT NULL,
PCSS_ORDER_NUMBER IN VARCHAR2 DEFAULT NULL,
PTELEPHONE_NUMBER IN VARCHAR2 DEFAULT NULL,
PSCENARIO_TYPE IN VARCHAR2 DEFAULT NULL,
PCUSTOMER_REQUIRED_DATE IN VARCHAR2 DEFAULT NULL,
PCUSTOMER_REQUIRED_TIME IN VARCHAR2 DEFAULT NULL,
PCANCELLATION_REASON IN VARCHAR2 DEFAULT NULL,
PCANCELLATION_NOTES IN VARCHAR2 DEFAULT NULL,
PSMPF_RETENTION IN VARCHAR2 DEFAULT NULL,
PEMERGENCY_WINBACK IN VARCHAR2 DEFAULT NULL,
PCSS_PROJECT_ID IN VARCHAR2 DEFAULT NULL,
PCSS_ORDER_NOTES IN VARCHAR2 DEFAULT NULL,
PREASON_FOR_CESSATION IN VARCHAR2 DEFAULT NULL,
P_RESPONSE OUT VARCHAR2,
PSMART_USER_ID IN VARCHAR2 DEFAULT NULL,
PORACLE_ERROR OUT VARCHAR2,
PORACLE_ERROR_MESSAGE OUT VARCHAR2,
PRESPONSE_TIME OUT NUMBER,
PDATA_TRANSFER_STATUS OUT VARCHAR2)
IS
v_scenario_type VARCHAR2(20); -- Varialble to Hold Time Out of every request to SPG
v_transaction_time NUMBER; -- Total time in which Request to SPG was processed
v_record_inserted_at DATE; -- Date/Time about the record insertion to the Error Handler
v_start_time NUMBER; -- Variable to hold Start Time for calculationg Transaction Time
v_url VARCHAR2(32767);-- URL to use when sending data to SPG
vtransaction_id VARCHAR2(18); -- Variable to hold Transaction ID for the request
v_buffer VARCHAR2(32760);-- Variable to read response from the SPG interface
v_timeout PLS_INTEGER; -- Time Out for each Transaction
v_oracle_err_msg VARCHAR2(600); -- Variable to hold Oracle Error Message
v_resp UTL_HTTP.RESP; -- Response Object
v_req UTL_HTTP.REQ; -- Request Object
v_userid_pwd SMT_ORACLE_PARAMETERS%ROWTYPE; --Variable declared to contain User ID & Password
vl_RetCode VARCHAR2(5000);
vl_std_returnCode VARCHAR2(3000);
--PDATA_TRANSFER_STATUS Holds the Data Transfer Status which can have possible values as
-- N => Data Has not been sent to SPG
-- Y => Received Successful response from SPG
-- F => On the First try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
-- S => On the Second try to Send data to SPG Oracle Error Occured or response from SPG was a faulure
-- T => Data Has been transferred to the Error Log Table
-- X => Data need not be transfered to Error Log Table.
--Location of the timeout, URL & User Id & Password in Standing Data.
c_url_stopwlr SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_WLR';-- Stop WLR URL
c_url_cancelown SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OWN';-- Cancel own URL
c_url_cancelother SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_OTH';-- Cancel other URL
c_url_amendcrd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPG_CRD';--Amend CRD URL
c_spg_useridpwd SMT_ORACLE_PARAMETERS.PARAMETER_CODE%TYPE:='SPGIDPWD'; --Contains user id and pwd
ctimeout smt_parameters.parameter_code%TYPE:='SPGTO'; --This holds the timeout parameter
BEGIN
--In case the calling batch process can pass this value this SQL read will not be required & can be deleted
--Read data transfer status for the transaction Id
SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS FROM SPG_INTERFACE_TABLE
WHERE transaction_id = PTRANSACTION_ID;
--Record the start time
v_start_time:=DBMS_UTILITY.GET_TIME;
--If Data transfer status is S then send the record to error handler
IF PDATA_TRANSFER_STATUS = 'S' THEN
Error_Handler(PTRANSACTION_ID,PSMART_USER_ID,PORACLE_ERROR,PORACLE_ERROR_MESSAGE,v_record_inserted_at,PDATA_TRANSFER_STATUS);
ELSE
--In case Data Tranfer Status is something other than S then send the request to SPG
--Initialise other variables which will be populated during the journey
P_RESPONSE := '';
PORACLE_ERROR := NULL;
PORACLE_ERROR_MESSAGE := NULL;
PRESPONSE_TIME := 0;
--Read timeout parameter from standing data.
BEGIN
SELECT VALUE INTO v_timeout FROM smt_parameters WHERE parameter_code=ctimeout;
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_timeout:=30;
WHEN OTHERS THEN
v_timeout:=30;
END;
-- Construct the URL for Stop WLR Scenario
IF PSCENARIO_TYPE = 'STOP_WLR' THEN
BEGIN
-- Read the Initial URL from Standing Data
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_stopwlr
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
WHEN OTHERS THEN
v_url:='Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_winback_details'; --After testing the same, URL will be fetched from the Query
END;
--construct the URL depending on the parameters to be passed to the url
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' || Smart_Urlencode('xmloverhttp') || '&';
v_url := v_url || 'p_channel_type=' || Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_start_order_no=' || Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' || Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_crd=' || Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
v_url := v_url || 'p_take_over_time=' || Smart_Urlencode(PCUSTOMER_REQUIRED_TIME)|| '&';
v_url := v_url || 'p_retainsmpf=' || Smart_Urlencode(PSMPF_RETENTION)|| '&';
--v_url := v_url || 'p_emergency_winback=' || Smart_Urlencode(PEMERGENCY_WINBACK)|| '&';
v_url := v_url || 'p_projectno=' || Smart_Urlencode(PCSS_PROJECT_ID)|| '&';
v_url := v_url || 'p_ordernotes=' || Smart_Urlencode(PCSS_ORDER_NOTES)|| '&';
v_url := v_url || 'p_reason_cessation=' || Smart_Urlencode(PREASON_FOR_CESSATION);
ELSIF PSCENARIO_TYPE='CANCEL_OWN' THEN
--Fetch the URL for cancel own from standing data.
BEGIN
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_cancelown
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
WHEN OTHERS THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelown_details'; --After testing the same, URL will be fetched from the Query
END;
--construct the URL
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON)|| '&';
v_url:= v_url || 'p_cancel_notes=' ||Smart_Urlencode(PCANCELLATION_NOTES);
ELSIF PSCENARIO_TYPE='CANCEL_OTHER' THEN
--Fetch the URL for cancel own from standing data.
BEGIN
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_cancelother
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
WHEN OTHERS THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_cancelother_details'; --After testing the same, URL will be fetched from the Query
END;
--construct the URL
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_stop_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_cancel_reason=' ||Smart_Urlencode(PCANCELLATION_REASON);
ELSIF Pscenario_type='AMEND_CRD' THEN
--Fetch the URL for cancel own from standing data.
BEGIN
SELECT VALUE
INTO v_url
FROM SMT_ORACLE_PARAMETERS
WHERE parameter_code = c_url_amendcrd
AND host_id = ( SELECT host_id
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS b
WHERE A.hostname = b.hostname
AND A.database_id = b.database_id));
--handle unforseen exception
EXCEPTION
WHEN NO_DATA_FOUND THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
WHEN OTHERS THEN
v_url := 'Http://wls.brassi1c.devenv1.bt.co.uk:64738/pls/spgenv/spg_btrc.add_btrc_amendcrd_details'; -- After testing the same , URL will be fetched from the Query
END;
--construct the URL
v_url := v_url || '?';
v_url := v_url || 'p_data_entered=' ||Smart_Urlencode('xmloverhttp')|| '&';
v_url := v_url || 'p_channel_type=' ||Smart_Urlencode(PCHANNEL_TYPE)|| '&';
v_url := v_url || 'p_css_start_order_no=' ||Smart_Urlencode(PCSS_ORDER_NUMBER)|| '&';
v_url := v_url || 'p_tel_no=' ||Smart_Urlencode(PTELEPHONE_NUMBER)|| '&';
v_url := v_url || 'p_crd=' ||Smart_Urlencode(PCUSTOMER_REQUIRED_DATE)|| '&';
v_url := v_url || 'p_css_change_order_numbers='||Smart_Urlencode(PCANCELLATION_REASON);
END IF;
--this is start of setting parameters for utl http object. the show begins...
utl_http.set_transfer_timeout(v_timeout);
--Set the wallet
--XXXXX e.g.UTL_HTTP.SET_WALLET(?file:DirectoryPath?,'put password here?);
--Set proxy
--YYYYY e.g. utl_http.set_proxy(p_proxy_in, p_no_proxy_domains_in);
v_url := REPLACE(v_url,'%27%27','%27'); -- Fix to ensure Double Quotes are converted to Single Quotes
--set the required URL to utl http.
v_req := utl_http.begin_request(v_url);
--Authentication setting
--Fetch the user id and password from stnding data.
BEGIN
SELECT *
INTO v_userid_pwd
FROM SMT_ORACLE_PARAMETERS
WHERE PARAMETER_CODE=c_spg_useridpwd
AND HOST_ID = ( SELECT HOST_ID
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS B
WHERE A.HOSTNAME = B.HOSTNAME
AND A.DATABASE_ID = B.DATABASE_ID));
EXCEPTION
WHEN NO_DATA_FOUND THEN
P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
WHEN OTHERS THEN
P_RESPONSE := 'ORACLE_ERROR: USER id AND Password NOT configured IN SMT_ORACLE_PARAMETERS:SPGIDPWD';
END;
--utl_http.set_authentication(v_req, p_username_in, p_password_in);
utl_http.set_authentication(v_req, v_userid_pwd.description, v_userid_pwd.VALUE);
v_resp := utl_http.get_response(v_req);
--Fill in the the response time
PRESPONSE_TIME := (DBMS_UTILITY.GET_TIME - v_start_time)/100;
IF v_resp.reason_phrase = 'OK' THEN
-- Fetch the response
BEGIN
LOOP
utl_http.read_line(v_resp, v_buffer);
P_RESPONSE := P_RESPONSE || v_buffer;
END LOOP;
utl_http.end_response(v_resp);
EXCEPTION
WHEN utl_http.end_of_body THEN
utl_http.end_response(v_resp);
P_RESPONSE := P_RESPONSE || v_buffer;
END;
ELSIF v_resp.reason_phrase <> 'OK' OR P_RESPONSE = '' THEN
--error handling starts
--If the HTTP Status is not OK then store the error information
PORACLE_ERROR_MESSAGE := 'Status Code: '|| v_resp.STATUS_CODE||'. Reason Phrase ' ||v_resp.reason_phrase;
P_RESPONSE := 'ORACLE_ERROR: '|| ' Reason Phrase ' || v_resp.reason_phrase;
PORACLE_ERROR := v_resp.STATUS_CODE;
END IF;
--In case we got successful response from SPG
IF P_RESPONSE LIKE '%<RetCde>0</RetCde>%' THEN
PDATA_TRANSFER_STATUS := 'Y';
ELSE
BEGIN
SELECT message
INTO vl_std_returnCode
FROM SMT_MESSAGES
WHERE MESSAGE_CODE='SPGANTIDTS';
EXCEPTION
WHEN NO_DATA_FOUND THEN
vl_std_returnCode := '-12545,-29273,-1,401,';
WHEN OTHERS THEN
vl_std_returnCode := '-12545,-29273,-1,401,';
END;
--In case there was an error do not update Data Transfer Status
IF PORACLE_ERROR <> NULL AND INSTR(vl_std_returnCode, PORACLE_ERROR || ',', 1, 1) <> 0 THEN
PDATA_TRANSFER_STATUS:=PDATA_TRANSFER_STATUS;
ELSE
vl_RetCode := SUBSTR(P_RESPONSE, INSTR(P_RESPONSE,'<RetCde>', 1, 1),
INSTR(P_RESPONSE,'</RetCde>',1,1)+9 - INSTR(P_RESPONSE,'<RetCde>', 1, 1));
BEGIN
SELECT VALUE
INTO vl_std_returnCode
FROM SMT_ORACLE_PARAMETERS
WHERE PARAMETER_CODE='SPGRCS'
AND HOST_ID = ( SELECT HOST_ID
FROM SMART_HOSTS A
WHERE EXISTS ( SELECT 1
FROM DB_PARAMETERS B
WHERE A.HOSTNAME = B.HOSTNAME
AND A.DATABASE_ID = B.DATABASE_ID));
EXCEPTION
WHEN NO_DATA_FOUND THEN
vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
WHEN OTHERS THEN
vl_std_returnCode := '<RetCde>4244</RetCde><RetCde>4245</RetCde><RetCde>4246</RetCde>';
END;
IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
--needs not to re attempted.
PDATA_TRANSFER_STATUS:='X';
ELSE
--In case we did'nt got SUCCESSFUL response FROM SPG THEN UPDATE the Data Transfer Status so that the failed requests can be picked up BY the NEXT batch job RUN
IF PDATA_TRANSFER_STATUS='N' THEN
--initially if data transfer status was N then update it now to F
PDATA_TRANSFER_STATUS := 'F';
ELSIF PDATA_TRANSFER_STATUS='F' THEN
--initially if data transfer status was N then update it now to S
PDATA_TRANSFER_STATUS := 'S';
END IF;
END IF;
END IF;
END IF;
--Now Update all the modified Values
UPDATE SPG_INTERFACE_TABLE
SET response = P_RESPONSE,
data_transfer_status = PDATA_TRANSFER_STATUS,
oracle_error = PORACLE_ERROR,
oracle_error_message = PORACLE_ERROR_MESSAGE,
response_time = PRESPONSE_TIME
WHERE transaction_id = PTRANSACTION_ID;
COMMIT;
END IF;
EXCEPTION
WHEN OTHERS THEN
--Handling the unhandled exception
PORACLE_ERROR := SQLCODE;
PORACLE_ERROR_MESSAGE := SQLERRM;
P_RESPONSE := 'ORACLE_ERROR: '|| PORACLE_ERROR_MESSAGE;
PRESPONSE_TIME := (DBMS_UTILITY.GET_TIME - v_start_time)/100;
SELECT data_transfer_status INTO PDATA_TRANSFER_STATUS
FROM SPG_INTERFACE_TABLE
WHERE transaction_id=PTRANSACTION_ID;
--New functionality to update the oracle error and oracle error message and not the Data Transfer Status
BEGIN
SELECT message
INTO vl_std_returnCode
FROM SMT_MESSAGES
WHERE MESSAGE_CODE='SPGANTIDTS';
EXCEPTION
WHEN NO_DATA_FOUND THEN
vl_std_returnCode := '-12545,-29273,-1,';
WHEN OTHERS THEN
vl_std_returnCode := '-12545,-29273,-1,';
END;
vl_RetCode := PORACLE_ERROR || ',';
IF INSTR(vl_std_returnCode, vl_RetCode, 1, 1) <> 0 THEN
--If the error is found in above maintained standing data do not change the Data Transfer Status
pdata_transfer_status:=pdata_transfer_status;
ELSE
IF pdata_transfer_status='N' THEN
PDATA_TRANSFER_STATUS := 'F';
DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
ELSIF pdata_transfer_status='F' THEN
PDATA_TRANSFER_STATUS := 'S';
DBMS_OUTPUT.PUT_LINE('DUE TO ERROR DATA COULDN''T GET TRANSFERED TO SPG FOR TRANSACTION'||' '||PTRANSACTION_ID);
DBMS_OUTPUT.PUT_LINE(SQLERRM);
ELSE
DBMS_OUTPUT.PUT_LINE('Failure WHEN sending data TO Error LOG. Data Transfer Status IS ' || PDATA_TRANSFER_STATUS || '. TRANSACTION ID '|| PTRANSACTION_ID);
END IF;
END IF;
--Now update all the information gathered above to the table
UPDATE SPG_INTERFACE_TABLE
SET response = P_RESPONSE,
data_transfer_status = PDATA_TRANSFER_STATUS,
oracle_error = PORACLE_ERROR,
oracle_error_message = PORACLE_ERROR_MESSAGE,
response_time = PRESPONSE_TIME
WHERE transaction_id = PTRANSACTION_ID;
COMMIT;
END;
/I have fixed the problem by own.
Seems there are some while space in the endpoint url.
Fix
http_req:= utl_http.begin_request
trim(l_endpoint_url)
,'POST'
,'HTTP/1.1'
It works...
Regards
BS -
Sometime I can write to the local shared variable through data socket. But sometime cannot. Even though, I still can read/write through shared variable monitor.
The error is in the open socket, said connect to peer timeout. I set timeout to 10s or left blank both not work.
I am using 8.2.1 on vista. The computer has 2 lan ports.
I met almost same case long time ago. I solved it by diable NETBIOS and one of the lan port.
This time, I disabled netbios already. But in vista, seems not able to disable the other lan port.
Any suggestion?hi turbot,
I had same problem of timeout error.just check if system Firewall is on or off if it is on then make it off and then run the program.i don't know how much this will help you,it helped me.
GAK
Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved. -
Java.io.IOException: Too many open files while deploying in soa 11g
hi all,
I am getting a strange error while deploying any composite .. it's a hello world kinda composite but while i am trying to deploy it i am getting "java.io.IOException: Too many open files" while deployment.. i have tried to deploy it in 2-3 ways but all of them resulted in the same error..bouncing the soa server might be an option but can someone give an insight as why it is happening and can it be resolved without restarting the server..
Thanksyes..so this problem is with unix only ..coz i previously worked in Windows ..never got this problem..
-
STARTING DATABASE : PROBLEM OF Linux Error: 23: Too many open files in syst
Hi everybody,
I am running an RMAN script and get this error,
9> @/u01/app/oracle/admin/devpose/backup/configuration.rcv
RMAN> ###################################################################
2> # Configuration file used to set Rman policies.
3> #
4> ###################################################################
5>
6> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 1;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
RMAN> #CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
2> CONFIGURE DEVICE TYPE DISK PARALLELISM 2;
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
RMAN>
RMAN> CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/backup/db/ora_df%t_s%s_s%p';
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of configure command at 08/26/2009 20:03:30
RMAN-06403: could not obtain a fully authorized session
ORA-01034: ORACLE not available
But this problem is understandable, as the database is not running. The main problem why database is not running, I have found the reason but do not understand how to solve the problem.
Since, the database was not running, I tried to startup the database, I then came across the following which is my problem (Why so many files are open? Linux OS error says too many files open. See below,
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 419430400 bytes
Fixed Size 779516 bytes
Variable Size 258743044 bytes
Database Buffers 159383552 bytes
Redo Buffers 524288 bytes
Database mounted.
ORA-00313: open failed for members of log group 2 of thread 1
ORA-00312: online log 2 thread 1: '/u01/app/oracle/oradata/devpose/redo02.log'
ORA-27041: unable to open file
Linux Error: 23: Too many open files in system
Can anybody has run into such problem and guide me to a solution, please?
ThanksHi,
yes, this DB was functioning o.k. this configuration script was part of RMAN daily backup.
Last night the backup failed. So, when I opened "Failed job" in the EM, I saw this type of messages.
That was the starting point. Gradually, I tried to narrow down on to the actual problem and found the findings as I have posted.
One way of sovling problem, I thought that, all these processes I would kill and then try to open the database, it might startup. However, that wouldnot lead me in ensuring this won't occur again.
That's why I am trying to understand why it should open, so many processes (why spawn so many .flb files?) Any thoughts you have around this?
I will try to restart the OS as the last resort.
Thanks for your help and suggestions.
Regards, -
"java.io.IOException: Too many open files" in LinuX
Hi Developers,
* I am continiously running and processing more than 2000 XML files by using SAX and DOM.....
* My process is as follows,
- Converting the XML file as Document object by DOM....
- And that DOM will be used while creating log file report, that log file will be created after executing all XML files..
* After processing approx 1000 files, it throws *"java.io.IOException: Too many open files" in LinuX system* ....
* I have googled more and more in all sites including sun forum also, but they are telling only to increase the system config by ULIMIT in linux....If i increase that its executing well without exception........
* My question is, Is it possible to do it by JAVA code itself or any other VM arguments like -Xms512m and -Xmx512m.....
* Please let me know , if you have any idea.....
Thanks And Regards,
JavaImranDoh! I forgot to post my little code sample...
package forums.crap;
import java.io.*;
import java.util.*;
public class TooManyFileHandles
private static final int HOW_MANY = 8*1024;
public static void main(String[] args) {
List<PrintWriter> writers = new ArrayList<PrintWriter>(HOW_MANY);
try {
try {
for (int i=1; i<=HOW_MANY; i++ ) {
writers.add(new PrintWriter("file"+i+".txt"));
} finally {
for (PrintWriter w : writers) {
if(w!=null)w.close();
} catch (Exception e) {
e.printStackTrace();
}... and the problem still isn't OOME ;-)
Cheers. Keith. -
Java.util.zip.ZipException: Too many open files on Linux
Hi,
We have web application running on Caucho's resin server on jdk 1.5.0_11 and Red hat Linux. We are noticing that java process is running out of file handles within 24-30 hours. We have file limit of 5000 which it consumes in 24 hours throwing 'java.util.zip.ZipException: Too many open files'.
I have made sure all sorts of file handles are closed from application point of view. Here is the snapshot of lsof (list of file handles) from java process. The following list keeps growing until it runs out of limit. Do you have tips/suggestions on how to mitigate this problem (considering we dont want to increase ulimit for this process)? Also, can you make out any thing more from the description of file handles like, are they unclosed POP3 connections or URL connection to external sites?
java 7156 resin 120u IPv4 34930051 UDP localhost.localdomain:59693
java 7156 resin 121u IPv4 34927823 UDP localhost.localdomain:59663
java 7156 resin 122u IPv4 34931861 UDP localhost.localdomain:59739
java 7156 resin 123u IPv4 34932023 UDP localhost.localdomain:59745
java 7156 resin 124u IPv4 34930054 UDP localhost.localdomain:59700
java 7156 resin 125u IPv4 34927826 UDP localhost.localdomain:59665
java 7156 resin 126u IPv4 34927829 UDP localhost.localdomain:59666
java 7156 resin 127u IPv4 34930057 UDP localhost.localdomain:59703
java 7156 resin 128u IPv4 34930713 UDP localhost.localdomain:59727
java 7156 resin 129u IPv4 34930716 UDP localhost.localdomain:59730
java 7156 resin 130u IPv4 34932238 UDP localhost.localdomain:59789
java 7156 resin 131u IPv4 34932026 UDP localhost.localdomain:59749
java 7156 resin 132u IPv4 34932221 UDP localhost.localdomain:59770
java 7156 resin 133u IPv4 34932224 UDP localhost.localdomain:59775
java 7156 resin 134u IPv4 34932029 UDP localhost.localdomain:59753
java 7156 resin 135u IPv4 34932032 UDP localhost.localdomain:59754
java 7156 resin 138u IPv4 34932035 UDP localhost.localdomain:59760
java 7156 resin 139u IPv4 34932038 UDP localhost.localdomain:59763
java 7156 resin 140u IPv4 34932227 UDP localhost.localdomain:59780
java 7156 resin 141u IPv4 34932230 UDP localhost.localdomain:59781
java 7156 resin 144u IPv4 34932234 UDP localhost.localdomain:59786
java 7156 resin 146u IPv4 34932241 UDP localhost.localdomain:59792
java 7156 resin 147u IPv4 34932247 UDP localhost.localdomain:59802Finally we resolved this issue. It was oracle driver which had some compatibility issue, we upgraded our Oracle client driver to newer version, and this fixed the problem. Base line, there was nothing wrong with application code, code was doing good resource clean up, but oracle driver was leaking handles per every connection.
Maybe you are looking for
-
Can any one help me read this panic report
Ok first let me tell you the story how i got this mac. The ex owner decided to put it on his driveway for some reason and totally forgot he put it there when he came out of his driveway with his pick up truck and boom this mac actually looks like it
-
CD DVD Burning P6250 T 64 windows 7 4600 printer, 4050 scanner no program changes no error message Voice narration of movies from old scan slide will not play on DVD Player. used DVD plus R discs.
-
DVD Player linked straight to FCP!?!
Got some actor friends who want a showreel done from their work. All of which is on DVD. I'm thinking of getting the Philips DVDR 3380 which has a DV in/out. Do you think, from this, that I could capture footage/scenes from their DVD's straight into
-
Extract Category, Attributes data in Multilingual
Hi experts, I'm using the MDMGX to extract the Categories data using the F/M "MDM_COMM_CATEGORIES_EXTR". data is populated (in debug mode) in all languages but, when the XML file created its showing only English language data. did I left any configur
-
_SMSTSCurrentActionName place the TS step name into another variable when fails
Hello, Testing a Task Sequence that detects step error and generates a VB script which echos failure or success. Want to capture the _SMSTSCurrentActionName when it fails and places into a user defined variable that can be called an displayed in the