-
1. Re: Unable to setup more EJB receivers: "Too many open files"
leonardo.devai Jul 30, 2012 8:35 AM (in response to windy)This looks like an OS limitation rather than a JBoss issue.
Are you using linux / unix?
If yes, check your /etc/security/limits.conf and rise the limits up according to your needs...
http://linux-quirks.blogspot.com/2011/02/too-many-open-files.html
Leo
-
2. Re: Unable to setup more EJB receivers: "Too many open files"
windy Jul 30, 2012 8:38 AM (in response to leonardo.devai)Thanks for the suggestion, but is an increase of limits really the right way to deal with this? Sooner or later I will hit the next boundary, so would prefer a way to correctly close remote connections which are no longer used.
-
3. Re: Unable to setup more EJB receivers: "Too many open files"
leonardo.devai Jul 30, 2012 9:13 AM (in response to windy)Some OS' are shipped with a low "max open files" threshold for security reasons and it is safe to increase it to a certain point.
If this is something that will keep increasing forever, then perhaps you may need to rethink your logic.
-
4. Re: Unable to setup more EJB receivers: "Too many open files"
windy Jul 30, 2012 9:16 AM (in response to leonardo.devai)Since there will be more and more logins, the amount of open connections will constantly increase until the OS prohibits the creation of new ones. But even if I can increase the limits so it will work for now, this is hardly an acceptable solution.
What I am searching for is a way to close unused connections without shutting down the whole JVM.
-
5. Re: Unable to setup more EJB receivers: "Too many open files"
jaikiran Aug 6, 2012 3:42 AM (in response to windy)So you have a properties file which has over 1000 remote connections configured?
-
6. Re: Unable to setup more EJB receivers: "Too many open files"
windy Aug 6, 2012 4:11 AM (in response to jaikiran)What do you mean? A configuration value allowing more than 1,000 conections or a list of 1,000 accounts?
Either way, none of those are configured.
-
7. Re: Unable to setup more EJB receivers: "Too many open files"
jaikiran Aug 6, 2012 4:18 AM (in response to windy)The exception stacktrace seemed to suggest that you are using the jboss-ejb-client.properties to configure those connections. But reading your post again, it looks like you are using programatic way to register them. Can you post the exact code where you are registering these connections?
-
8. Re: Unable to setup more EJB receivers: "Too many open files"
windy Aug 6, 2012 4:58 AM (in response to jaikiran)jaikiran pai wrote:
The exception stacktrace seemed to suggest that you are using the jboss-ejb-client.properties to configure those connections. But reading your post again, it looks like you are using programatic way to register them. Can you post the exact code where you are registering these connections?
You are correct, I am using Java code without any property files. Here it is:
final Properties properties = new Properties();
properties.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false");
properties.put("remote.connections", username);
properties.put("remote.connection." + username + ".host", "localhost");
properties.put("remote.connection." + username + ".port", "4447");
properties.put("remote.connection." + username + ".username", mailaddress);
properties.put("remote.connection." + username + ".password", password);
properties.put("remote.connection." + username + ".connect.options.org.xnio.Options.SASL_POLICY_NOANONYMOUS", "true");
properties.put("remote.connection." + username + ".connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS","JBOSS-LOCAL-USER");
properties.put("remote.connection." + username + ".connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
final EJBClientConfiguration clientConfiguration = new PropertiesBasedEJBClientConfiguration(properties);
final ContextSelector<EJBClientContext> contextSelector = new ConfigBasedEJBClientContextSelector(clientConfiguration);
EJBClientContext.setSelector(contextSelector);
Context ctx = getInitialContext();
try {
myController = (MyControllerRemote) ctx.lookup(lookupString);
} finally {
ctx.close();
}