Win a copy of Functional Design and Architecture this week in the Functional programming forum!

Kumara Swamy

Ranch Hand
+ Follow
since Nov 17, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kumara Swamy

Hi,
I have a JMS queue and configured with a MDB listener in Weblogic 10.3 to get the asynchronous behaviour.
We defined pool of 5 objects to MDB and the 5 objects are getting created successfully.

The issue is ::
From the pool of objects only one object is processing all the messages one by one so it is becoming synchronous.

The messages should distribute to all the objects available in the pool. How can we acheive this?
9 years ago
Hi all,

I have the following snippet of code.

Process p = Runtime.getRuntime().exec(strCommand);
BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));
BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));
String s = null;
while ( (s = stdInput.readLine()) !=null ){

}
while ((s = stdError.readLine()) != null){
}


Is there any need to close the streams or will they automatically close?
12 years ago
My question is why its working fine with some servers only?


session.setAttribute("number", 3);

accessing the above value as follows:
(String)session.getAttribute("number");

its throwing the Class Cast exception on some systems only all the servers on those systems are same.
12 years ago
JSP

String is not an Integer .



But it was worked fine earlier its throwing the exception from today only. Its still working fine with some other servers.

12 years ago
JSP

Vivek Kr Singh wrote:If using 1.5 then

EDIT : done for missing brackets



Hi thanks for the reply,

My question is something different the problem with the following statement:
(String)session.getAttribute("number")

here we are getting the Class Cast exception
12 years ago
JSP

Hi,

I am reading the int value from a session object in a jsp as follows.

session.setAttribute("number", 3);

accessing the above value as follows:
int n = Integer.parseInt((String)session.getAttribute("number"));

in the above case i am getting a Class Cast Exception.

if i read the same value by using the following code it's fine.
int n = Integer.parseInt(session.getAttribute("number").toString());



I have written this code long back it was working fine but from today only its getting the exception. I didnt update the system/tomcat server configurations.

Please help me out to resolve the issue.
12 years ago
JSP

That's likely the issue. You should be using a connection pool.



Hi,
I would look into the possibility of implementing the connection pool.
Thanks for the help.

Regards,
Kumara Swamy.
12 years ago

That suggests the bottleneck has to do with database connections. Are you using a connectin pool?



Hi,
We are not using the connection pool at all but still we are getting the error.

12 years ago

Bear Bibeault wrote:Increase the maxThreads setting and make sure you have the hardware to support it.



Hi,
We can the thread size but the problem is i dont know how to balance the configuration settings with hardware availability.
Please help me out to find how to configure the server efficiently?


Do you really have 500 users accessing the system concurrently? Or is there something that prevents threads from terminating correctly?



No there might be below 50 users at that time, but still we are getting the error.
Here is the some part of thread dump which was taken at the time of error.


Full thread dump Java HotSpot(TM) Server VM (1.5.0_02-b09 mixed mode):

"http-80-Processor887" daemon prio=1 tid=0x08b65c98 nid=0x7350 in Object.wait() [0x68d6f000..0x68d70130]
at java.lang.Object.wait(Native Method)
- waiting on <0x7da5dfa0> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:474)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:656)
- locked <0x7da5dfa0> (a org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:595)

"http-80-Processor862" daemon prio=1 tid=0x580bc2f0 nid=0x7337 waiting for monitor entry [0x56b71000..0x56b71db0]
at java.sql.DriverManager.getConnection(DriverManager.java:158)
- waiting to lock <0x6f02b2a0> (a java.lang.Class)
at com.panterranetworks.james.db.JamesMysqlConnection.getConnection(Unknown Source)
at com.panterranetworks.james.JamesMailClient.getInbox(Unknown Source)
at org.apache.jsp.messenger.smspull_jsp._jspService(smspull_jsp.java:73)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

"http-80-Processor861" daemon prio=1 tid=0x580bb688 nid=0x7336 runnable [0x67dd0000..0x67dd0e30]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:737)
at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:398)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:827)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
"http-80-Processor1" daemon prio=1 tid=0x6b1f37e0 nid=0x5b6a runnable [0x6a6fe000..0x6a6ff030]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.coyote.http11.InternalInputBuffer.fill(InternalInputBuffer.java:737)
at org.apache.coyote.http11.InternalInputBuffer.parseRequestLine(InternalInputBuffer.java:398)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:827)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

"ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon prio=1 tid=0x6a1f9a90 nid=0x5b69 waiting on condition [0x6b2fe000..0x6b2ff0b0]
at java.lang.Thread.sleep(Native Method)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1547)
at java.lang.Thread.run(Thread.java:595)

"Low Memory Detector" daemon prio=1 tid=0x6da028a0 nid=0x5a4e runnable [0x00000000..0x00000000]

"CompilerThread1" daemon prio=1 tid=0x6da01480 nid=0x5a4c waiting on condition [0x00000000..0x6d97d058]

"CompilerThread0" daemon prio=1 tid=0x6da004c0 nid=0x5a4b waiting on condition [0x00000000..0x6d9fe0d8]

"AdapterThread" daemon prio=1 tid=0x0886aff0 nid=0x5a48 waiting on condition [0x00000000..0x00000000]

"Signal Dispatcher" daemon prio=1 tid=0x0886a088 nid=0x5a46 runnable [0x00000000..0x00000000]

"Finalizer" daemon prio=1 tid=0x088605d0 nid=0x5a42 in Object.wait() [0x6decf000..0x6ded0030]
at java.lang.Object.wait(Native Method)
- waiting on <0x727b8130> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
- locked <0x727b8130> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=1 tid=0x0885e778 nid=0x5a40 in Object.wait() [0x6df50000..0x6df510b0]
at java.lang.Object.wait(Native Method)
- waiting on <0x72675380> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:474)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <0x72675380> (a java.lang.ref.Reference$Lock)

"main" prio=1 tid=0x087aa8e8 nid=0x5a34 runnable [0xbff26000..0xbff27028]
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
- locked <0x769a9fa8> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:388)
at org.apache.catalina.startup.Catalina.await(Catalina.java:615)
at org.apache.catalina.startup.Catalina.start(Catalina.java:575)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

"VM Thread" prio=1 tid=0x0885bb10 nid=0x5a3e runnable

"GC task thread#0 (ParallelGC)" prio=1 tid=0x08830be8 nid=0x5a38 runnable

"GC task thread#1 (ParallelGC)" prio=1 tid=0x08831448 nid=0x5a3a runnable

"GC task thread#2 (ParallelGC)" prio=1 tid=0x08831878 nid=0x5a3b runnable

"GC task thread#3 (ParallelGC)" prio=1 tid=0x08832080 nid=0x5a3c runnable

"VM Periodic Task Thread" prio=1 tid=0x6da03e40 nid=0x5a4f waiting on condition



Regards,
Kumara Swamy.
12 years ago
Hi,
Thanks for the reply i will go through the link and if i find any difficulty i will let you know.

Regards,
Kumara Swamy.
12 years ago
Please help me out to build the culster.


Regards,
Kumara Swamy.
12 years ago
Please help me out to fix the issue.

Regards,
Kumara Swamy.
12 years ago
In my tomcat server(5.5.17) i used to get the following error message:
All threads (500) are currently busy, waiting. Increase maxThreads (500) or check the servlet status

How to resolve this issue?


Regards,
Kumara Swamy.
12 years ago
Hi I am planning to setup the tomcat cluster.
It should be ssl enabled with a load balancer. Please provide me the necessary steps to setup the Tomcat cluster.
Provide me the some good tutorial links to do this.



Regards,
Kumara Swamy.
12 years ago