[Beginners Corner] - Getting "Too many open files" error with JBoss 4.2.2GA
by eightmd
I am running into a problem with JBoss 4.2.2GA, front-ended with Apache 2.2.6 were JBoss or the webserver seems to be hanging on to connections and leaving them in the CLOSE_WAIT state. Then my application gets "Too many open files".
There was a post about this in the EJB/JBoss forum but there wasn't a resolution. I thought I'd post my issue here to see if anyone has run into this. I can reproduce this with a straight-forward hit to JBoss/tomcat. If I go directly to JBoss on port 8080 I don't see the problem but going through Apache (KeepAlive is turned off) I do see this problem. The test uses a single thread and just sends many requests over and over. We can watch the number of open sockets climb until it gets close to the max 1024 and starts spewing "Too many open files".
The open sockets are to port 8009 which is the port that JBoss listens to the Apache AJP connector.
We are running on Linux FC6
I've seen various issues listing this same error but I haven't seen any solutions. Our max file handles per user is 1024 which would see sufficient and the total max is over 200,000.
I did try this on the same machine with the same version of Apache and FC6 but using JBoss 4.0.4GA and JBoss 4.0.3SP1 and neither had the problem. It appears to be the version of JBoss or some difference in the configuration. I have tried to make the configuration the same.
Is anyone else running into this? Anyone figure a way out of this? Just bumping up the number of max connections will just put the problem off till later. Any insight or help will be appreciated. Thanks
The exceptions look like this:
10:34:50,698 ERROR [JIoEndpoint] Socket accept failed
java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:309)
at java.lang.Thread.run(Thread.java:595)
10:34:50,698 ERROR [JIoEndpoint] Socket accept failed
java.net.SocketException: Too many open files
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
at java.net.ServerSocket.implAccept(ServerSocket.java:450)
at java.net.ServerSocket.accept(ServerSocket.java:421)
at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:309)
at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136071#4136071
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136071
18 years, 1 month
[JBossCache] - Re: FetchInMemoryState && InitialStateRetrievalTimeout
by jorgemoralespou_2
We need to assure that the data that is not evicted is accesible from both nodes of the cluster.
We have a big ammount of data in cache, so start up time is very high, if we do an initial state trasfer. We were trying to test if disabling initialStateTransfer and allowing the cache to get state as time passes by, getting it from the other node was a performance point to take into account, wheter it was for better or for worse. We supposed that startup time should have been much better, but instead of this, it gets stuck, while loading, and loads lots of info from the other cache, but not all.
We don`t know if this is the correct configuration to use for what we are trying to achieve. Right til`now, it was fine, but we faced an unexpected startup problem in production when we had lot of data, that we had to evict in order to start it up again, until we changed our app to take initial State transfer right. It was safer than changing this we didn't fully understand right at the momment.
Thanks, Manik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136066#4136066
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136066
18 years, 1 month
Re: Securing JBoss jmx-console and web-console for JBoss 4.0
by samk@twinix.com
See Thread at: http://www.techienuggets.com/Detail?tx=9 Posted on behalf of a User
How to encrypt the password for jmx-console and web-console?
I use the follow command to encrypt the password. But where should I put the encrypted password? What changes do I need to make?
java -cp lib\jboss-common.jar;server\default\lib\jbosssx.jar;server\default\lib\jboss-jca.jar org.jboss.resource.security.SecureIdentityLoginModule production
Thanks!
In Response To:
Out of the box jmx-console and the web console are accessable to anyone who can access your server via
the following url: http://yourserver:8080/jmx-console. The good news is that both jmx-console and web-console
are standard servlet so they can be protected easily by enabling the security-constraint. Our example
uses the default server model.
1. edit \server\default\deploy\jmx-console.war\WEB-INF\web.xml and uncomment the security-constraint
<!-- A security constraint that restricts access to the HTML JMX console
to users with the role JBossAdmin. Edit the roles to what you want and
uncomment the WEB-INF/jboss-web.xml/security-domain element to enable
secured access to the HTML JMX console. -->
<security-constraint>
<web-resource-collection>
<web-resource-name>HtmlAdaptor</web-resource-name>
<description>An example security config that only allows users with the
role JBossAdmin to access the HTML JMX console web application
</description>
<url-pattern>/*</url-pattern>
<http-method>GET</http-method>
<http-method>POST</http-method>
</web-resource-collection>
<auth-constraint>
<role-name>JBossAdmin</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>JBoss JMX Console</realm-name>
</login-config>
<security-role>
<role-name>JBossAdmin</role-name>
</security-role>
2. Edit \server\default\deploy\jmx-console.war\WEB-INF\jboss-web.xml. Uncomment the following block:
<jboss-web>
<!-- Uncomment the security-domain to enable security. You will
need to edit the htmladaptor login configuration to setup the
login modules used to authentication users.-->
<security-domain>java:/jaas/jmx-console</security-domain>
</jboss-web>
3. Edit \server\default\conf\props\jmx-console-roles.properties
4. Edit \server\default\conf\props\jmx-console-users.properties
The only change above should be to jmx-console-users.properties, i.e, set a password.
5. While you are in directory make copies of the two jmx-console properties files and call them web-console-roles.properties
and web-console-users.prperties respectively.
6. The property files for web-console currently exist under \server\default\deploy\management\console-mgr.sar\web-console.war\WEB-INF\classes.
I would rename these files.
7. edit \server\default\conf\login-config.xml
<application-policy name = "web-console">
<authentication>
<login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
flag = "required">
<module-option name="usersProperties">props/web-console-users.properties</module-option>
<module-option name="rolesProperties">props/web-console-roles.properties</module-option>
</login-module>
</authentication>
</application-policy
In the above you need to add the props/ because this is missing in the original file. If you do not do
this the login procedure will look for the properties file under
web-console.war\WEB-INF\classes and if you have not renamed the properties file there it will try and
use those.
Remember to bounce JBoss after you are done.
18 years, 1 month
[EJB 3.0] - EJB3 Lazy Load problem
by zilbi
Hi,
i am new to this, so i apologize if this question is stupid...
have 2 entities with 1 to many relations:
@Entity
| @Table(name = "contents")
| public class Content implements Serializable
| {
| private Long id;
| private Integer version;
| ... some more simple fields
|
| private Collection lastTaggingCollection;
|
| @ManyToOne
| @JoinColumn(name = "last_tagging_collection", nullable = true)
| public Collection getLastTaggingCollection()
| {
| return lastTaggingCollection;
| }
|
| public void setLastTaggingCollection(Collection lastTaggingCollection)
| {
| this.lastTaggingCollection = lastTaggingCollection;
| }
|
| ... more methods
| }
|
| @Entity
| @Table(name = "cm_collections")
| public class Collection implements Serializable
| {
| private Long id;
| private Integer version;
| ... some more simple fields
|
| private List<Content> contents;
|
| @OneToMany(fetch = FetchType.LAZY, mappedBy = "lastTaggingCollection")
| @JoinColumn(name = "last_tagging_collection")
| public List<Content> getContents()
| {
| return contents;
| }
|
| public void setContents(List<Content> contents)
| {
| this.contents = contents;
| }
|
| ... more methods
| }
now, when i am inside a stateless session bean method with a transaction type = required i try the following:
Collection collection = dao.findById( 1L );
| log.debug("fetchContacts() - caller: " + collection.getContents().size());
(the dao is injected using @EJB)
i get:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.jinni.content.mgmt.model.Collection.contents, no session or session was closed
but when i change the fetch type to eager all works...
???
any clue why?
what am i missing?
thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136044#4136044
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136044
18 years, 1 month