Ionut Barau

+ Follow
since Feb 18, 2008
Merit badge: grant badges
For More
Bucharest, Romania
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ionut Barau

I know this is an old topic but it still applies today. I am reading the book OCM JavaEE 6 Enterprise Architect Exam Guide and the same distinction is made for layers and tiers.
Layers are more physical than logical (from Application to physical hardware) while tiers are the logical components (Business, Presentation etc). How are these concepts treated in the exam?
Should I ignore the definitions?
Thanks for the cow !

I am posting some updates after further testing with JMeter.

It seems that whatever value you put in acceptCount, it is ignored. I found some threads where other users complained about this. If you run netstat -anp | grep 8080 on a linux machine you will see a lot of waiting tcp connections.
It comes down to the OS how many connections it can keep on hold.

Further more, I found out that once a connection is in acceptCount queue, the connectionTimeout value will not affect the lifetime. What will happen is the connection will be put on idle state until a thread is ready to process it's request. If the time taken to respond to the request is higher than the browser's requestTimeout setting, the user will get an error.

Hope it helps somebody else trying to understand this.

7 years ago
OK, so i found out that i didn't fully understand how Tomcat is handling the request <> response mechanism.
I connected with JConsole, and saw that the parameters have the values that I have provided in xml, so I assume they are taken into account.

I'm posting now my understanding of how Tomcat handles requests in regards with the configuration parameters. Please correct me if I am wrong

What I understood :

connectionTimeot = how long does the server wait, after accepting a connection, for the request to be presented
keepAliveTimeout = how long is the connection kept open, waiting for subsequent requests from the same client. (Do not confuse with session timeout)
acceptCount = represents a queue where new connections are stored, when the "maxConnections" value is reached
maxConnections = the maximum number of simultaneous opened connections
maxThreads = the maximum number of simultaneous threads . (in case of BIO, each thread is tied to one connection, and processes requests from that single connection)

In BIO connector, there is thread per connection paradigm, not thread per request like in NIO or APR.
If the time taken until the request is presented to the server exceeds connectionTimeout value, the user receives an error.
A connection is kept open for the duration of keepAliveTimeout value

What happens during the request <> response mechanism with BIO connector?

The user initiates a request by clicking a button/link or typing and address in browser
The server checks if this client has an already opened connection.
If it has an opened connection (meaning that this is not the first request), then the connection will have access to a thread and will present it's request > the request will be processed > the user receives in turn a response
If it does not have a connection opened, the server will try to create a new connection.

The creation of a new connection is successful if
1)the maxConnections value is not reached - the connection has access to a thread and will present it's request > the request will be processed > the user receives in turn a response
2)there is still room in the acceptCount queue - the connection will be created, but it's request won't be processed until the server has a free thread, or it reaches the connectionTimeout value (user receives an error)

The creation of a new connection will not be successful if both maxConnections value has been reached and acceptCount value has been reached. The user will receive a "Connection refused" error.

Hopefully my explanation is clear...


7 years ago
I realize that there might some problems on how I use JMeter.
I will use JConsole and post a reply afterwards.

Thanks a lot !
7 years ago
I've read the post. Probably this is the one : However it does not answer my question. My current problem is that the connectionTimeout parameter is not taken into account. I have set it at 1 millisecond, so no request should be processed from my understanding. I have played a lot with those other parameters that I mentioned but still the behavior is strange. I had maxThreads set to 100 and acceptCount to 100. I tested with 250 users simultaneous, and I expected that at least 50 users get a connection refused. But they all passed.

The problems mentioned in the existing post that I read, are happening to me also. But I am trying to figure it out one at a time. acceptCount did not work for me either., but i am expecting at least connectionTimeout to work. The Tomcat documentation seems to be wrong. I also had a problem for creating a datasource in Tomcat. In documentation they wrote that we should add the "username" attribute, but it is actually just "user" ... (PS. I tried chaning the attribute names for connector in lowercase but did not work...)

7 years ago

I am trying to make some performance test on our application deployed on Tomcat 7. I have played around with connector configurations but I am under the impression that some of them are ignored. The connector is HTTP BIO.

I am using JMeter for performance testing, and my scenario is to test with simultaneous users. After reading Tomcat documentation I started playing with maxThreads, maxConnections, acceptCount and connectionTimeout.

From my understanding, in case of BIO connector, maxThreads value = maxConnections value (if you don't set them both specifically), so essentially there is a 1 to 1 relationship between thread and connection. AcceptCount is the queue length of incoming requests (the requests are stacked up until the number of connections is lower than maxConnections ). ConnectionTimeout represents the number of milliseconds taken until the request is presented to the server.

Take for example the following configuration :

I have tested with 20 simultaneous users in JMeter (ramp-up period of 0 seconds so they can be simultaneous). I expect based on my understanding that all 20 users will get "Connection Refused error", but they all succeed.
I have be playing for 2 weeks now and I am confused... Is connectionTimeout ignored in this case, or is my understanding poor ?

7 years ago
I've been trying to understand j2ee security/jass for a week now and still i can't keep the terms straight. I will share my opinion on your question, hoping someone will bring some light.

As far as i understood, declarative security (or container managed security) is handled by the container(DOH!). How it is handled it depends on container implementation.Websphere for example, uses jaas for authentication.The special servlet j_security_check verifies credentials with the help of jaas login modules.So even though you use declarative security, in websphere you are using jass indirectly.Websphere authentication

Programmatic security can be of 2 flavors:

1.Using the request object methods:isUserInRole, getRemoteUser

2.Using jaas login modules

If someone has a different opinion please share some light.

10 years ago

Have you found a solution to the problem? My problem is slightly different but the error is the same...I have posted on many forums but no one responded.

11 years ago
Hy guys

I am still struggling with this problem...

I've tested the application on JBoss 6 and everything works fine...After searching deeper i have found that the core problem is actually that JSF is not able to save the state on server. if I configure the application to save the state of the page on client everything works just fine. So the problem in my opinion is due to some WAS configuration issue, not the code as I have expected...If i save the state on server, click a h:commandLink will throw View could not be restored error.

Bellow is my web.xml file:

My faces-config file contains only the dtd schema for 2.0 version

my page is bellow:

i am stuck on this one for a while so I appreciate any help


11 years ago
Hi guys,

I am using WAS and JSF 2.0+ Richfaces 4. I keep getting this error :The response is already committed to the client.
I have a single page that is rendered, but when i click the button mapped to the managed bean method nothing happens. Last night the app was working without any problem. This morning it stopped, and the only modification i did was configuring WAS to stop publishing automatically. I really don't have a clue what might be the problem. I guess the session expires right after the page is rendered..Tried with no expiring session but still nothing


WASSessionCor W SessionAffinityManager setCookie SESN0066E: The response is already committed to the client. The session cookie cannot be set.
srt W addSessionCookie WARNING: Cannot set session cookie. Response already committed

I addition when i first run the app it throws:

context W JSF1091: No mime type could be found for file combo_list_shadow.png. To resolve this, add a mime-type mapping to the applications web.xml.

really don't know what is up with this one ...i don't have any png file..maybe from richfaces calendar i think

If you need code just let me know.

11 years ago
As far as i know and also tried, the signature works only for 1 jar Note that the jars are third party and as far as i know you cannot sign them if it is not permitted by the license....but I will try again an post back.
11 years ago
Hi guys! I have an unsigned applet located in imageScanApplet.jar, that uses multiple third party jars. I want to sign the applet so i can use it without modifying java policy file. I have tried packing all the jars in one but obviously it doesn't work due to the manifest files in each jar. How can I achieve this??
11 years ago
Hi.I wasn't sure where to ask this question. I have a Spring MultiActionController that uses Hibernate to insert into db. I have a jsp page that simply redirects to this controller with <c:redirect>.The thing is when redirecting, it just returns the ModelAndView without doing business logic. If I refresh the page everything works fine. Am I having trouble understanding c:redirect ?
12 years ago
The subject of the topic was not good. It don't understand collection mapping, it doesn't matter the type. I want to be able when i load an Artist to get his Songs with his getSongs() method. But i get a org.hibernate.HibernateException: null index column for collection error.
Hi! I have difficulty understanding one to many mapping with lists. I use Oracle 10g and Hibernate 3. I have class Artist and class Song. Artist has a List of Song objects as field and Song has a Artist field. As far as I know I have to make a many-to-one association in Song.hbm.xml and a one-to-many association in Artist.hmb.xml. Now Song table has a foreign key to Artist table but Artist table doesn't have a foreing key to Song. I want to be able to load the Artist previously persited(I've also persisted Song objects) and iterate thru the Artist's list of Song objects. When i try this I get org.hibernate.HibernateException: null index column for collection which is obviously because I don't have a column Songs. My question is it is possible to do this (and if it is what have I done wrong in the mapping files) or do I have a problem understanding db design?If it isn't possible I think mapping collections isn't worth.

Here is the one-to many association of Artist.hmb.xml

And here is the many to one association of Song.hmb.xml: