bcisystems
asked on
Socket closed exception
Hi Experts,
I have a web application with 2 war apps. I use the same code in both war application to get the initial context (code below). It works just fine with same credentials in the first app but throws the following exception in the second app.
app is deployed on websphere application server 6.1
[3/30/10 14:31:23:481 EDT] 00000020 SystemErr R javax.naming.ServiceUnavai lableExcep tion: 192.168.1.65:636; socket closed
[3/30/10 14:31:23:481 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.Connecti on.readRep ly(Connect ion.java:4 39)
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapClie nt.ldapBin d(LdapClie nt.java:35 5)
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapClie nt.authent icate(Ldap Client.jav a:207)
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtx. connect(Ld apCtx.java :2652)
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtx. <init>(Lda pCtx.java: 298)
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF actory.get UsingURL(L dapCtxFact ory.java:1 90)
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF actory.get UsingURLs( LdapCtxFac tory.java: 208)
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF actory.get LdapCtxIns tance(Ldap CtxFactory .java:151)
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF actory.get InitialCon text(LdapC txFactory. java:81)
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.spi.NamingMan ager.getIn itialConte xt(NamingM anager.jav a:679)
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.InitialContex t.getDefau ltInitCtx( InitialCon text.java: 259)
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.InitialContex t.init(Ini tialContex t.java:235 )
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.InitialContex t.<init>(I nitialCont ext.java:2 09)
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at javax.naming.directory.Ini tialDirCon text.<init >(InitialD irContext. java:93)
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.ldap.LDAPManager.g etInitialC ontext(LDA PManager.j ava:63)
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.ldap.LDAPManager.< init>(LDAP Manager.ja va:29)
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.ldap.services.LDAP Employee.c hangePassw ord(LDAPEm ployee.jav a:15)
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.servlet.ChangePass word.doPos t(ChangePa ssword.jav a:44)
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.servlet.ChangePass word.doGet (ChangePas sword.java :27)
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 743)
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at javax.servlet.http.HttpSer vlet.servi ce(HttpSer vlet.java: 856)
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.se rvlet.Serv letWrapper .service(S ervletWrap per.java:1 095)
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.se rvlet.Serv letWrapper .handleReq uest(Servl etWrapper. java:569)
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.wswebcontainer. servlet.Se rvletWrapp er.handleR equest(Ser vletWrappe r.java:478 )
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.we bapp.WebAp p.handleRe quest(WebA pp.java:34 40)
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.we bapp.WebGr oup.handle Request(We bGroup.jav a:267)
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.We bContainer .handleReq uest(WebCo ntainer.ja va:815)
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.wswebcontainer. WebContain er.handleR equest(Web Container. java:1461)
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.ch annel.WCCh annelLink. ready(WCCh annelLink. java:118)
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.http.channel.in bound.impl .HttpInbou ndLink.han dleDiscrim ination(Ht tpInboundL ink.java:4 58)
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.http.channel.in bound.impl .HttpInbou ndLink.han dleNewInfo rmation(Ht tpInboundL ink.java:3 87)
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.http.channel.in bound.impl .HttpInbou ndLink.rea dy(HttpInb oundLink.j ava:267)
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.ws.tcp.channel.imp l.NewConne ctionIniti alReadCall back.sendT oDiscrimin ators(NewC onnectionI nitialRead Callback.j ava:214)
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.ws.tcp.channel.imp l.NewConne ctionIniti alReadCall back.compl ete(NewCon nectionIni tialReadCa llback.jav a:113)
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.ws.tcp.channel.imp l.AioReadC ompletionL istener.fu tureComple ted(AioRea dCompletio nListener. java:165)
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.AbstractA syncFuture .invokeCal lback(Abst ractAsyncF uture.java :217)
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.AsyncChan nelFuture. fireComple tionAction s(AsyncCha nnelFuture .java:161)
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.AsyncFutu re.complet ed(AsyncFu ture.java: 136)
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.ResultHan dler.compl ete(Result Handler.ja va:195)
[3/30/10 14:31:23:488 EDT] 00000020 SystemErr R at com.ibm.io.async.ResultHan dler.runEv entProcess ingLoop(Re sultHandle r.java:743 )
[3/30/10 14:31:23:488 EDT] 00000020 SystemErr R at com.ibm.io.async.ResultHan dler$2.run (ResultHan dler.java: 873)
[3/30/10 14:31:23:488 EDT] 00000020 SystemErr R at com.ibm.ws.util.ThreadPool $Worker.ru n(ThreadPo ol.java:14 73)
I have a web application with 2 war apps. I use the same code in both war application to get the initial context (code below). It works just fine with same credentials in the first app but throws the following exception in the second app.
app is deployed on websphere application server 6.1
[3/30/10 14:31:23:481 EDT] 00000020 SystemErr R javax.naming.ServiceUnavai
[3/30/10 14:31:23:481 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.Connecti
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapClie
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapClie
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtx.
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtx.
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF
[3/30/10 14:31:23:482 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at com.sun.jndi.ldap.LdapCtxF
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.spi.NamingMan
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.InitialContex
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.InitialContex
[3/30/10 14:31:23:483 EDT] 00000020 SystemErr R at javax.naming.InitialContex
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at javax.naming.directory.Ini
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.ldap.LDAPManager.g
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.ldap.LDAPManager.<
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.ldap.services.LDAP
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.servlet.ChangePass
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at com.bci.servlet.ChangePass
[3/30/10 14:31:23:484 EDT] 00000020 SystemErr R at javax.servlet.http.HttpSer
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at javax.servlet.http.HttpSer
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.se
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.se
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.wswebcontainer.
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.we
[3/30/10 14:31:23:485 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.we
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.We
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.wswebcontainer.
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.webcontainer.ch
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.http.channel.in
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.http.channel.in
[3/30/10 14:31:23:486 EDT] 00000020 SystemErr R at com.ibm.ws.http.channel.in
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.ws.tcp.channel.imp
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.ws.tcp.channel.imp
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.ws.tcp.channel.imp
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.AbstractA
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.AsyncChan
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.AsyncFutu
[3/30/10 14:31:23:487 EDT] 00000020 SystemErr R at com.ibm.io.async.ResultHan
[3/30/10 14:31:23:488 EDT] 00000020 SystemErr R at com.ibm.io.async.ResultHan
[3/30/10 14:31:23:488 EDT] 00000020 SystemErr R at com.ibm.io.async.ResultHan
[3/30/10 14:31:23:488 EDT] 00000020 SystemErr R at com.ibm.ws.util.ThreadPool
private DirContext getInitialContext(
String protocol,
String hostname,
int port,
String username,
String password,
String keystore)
throws NamingException {
String providerURL =
new StringBuffer("")
.append(protocol)
.append("://")
.append(hostname)
.append(":")
.append(port)
.toString();
System.setProperty("javax.net.ssl.keyStore", keystore);
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
props.put(Context.PROVIDER_URL, providerURL);
if ((username != null) && (!username.equals(""))) {
props.put(Context.SECURITY_AUTHENTICATION, "simple");
props.put(Context.SECURITY_PRINCIPAL, username);
props.put(Context.REFERRAL, "ignore");
if(SSLEnabled.equalsIgnoreCase("1"))
props.put(Context.SECURITY_PROTOCOL, "SSL");
props.put(Context.SECURITY_CREDENTIALS,
((password == null) ? "" : password));
}
return new InitialDirContext(props);
}
Does it happen only when both run at the same time or even if the first one is not doing anything and only the second one is running? Is it always the same the one that is failing? Had you try redeploying the war (thinking here that maybe you are not running the same code exactly?)? Do you call the method with the same parameters?
ASKER
No they are not running the same time. First one runs fine. And second one throws this. After that first one fails as well. Second on always fails.
Thanks
S
Thanks
S
Sounds like a restriction of the number of connections between the servers. Let me think where this might have happened.... It is definitely not a code issue
ASKER
I havent had any new improvements on this. Admin can close the questions and retrun the points.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thank you very much for points. I appreciate it.
Have a good day
AdminRam
Have a good day
AdminRam