File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes jboss jndi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "jboss jndi" Watch "jboss jndi" New topic
Author

jboss jndi

divs sharma
Greenhorn

Joined: Jan 19, 2010
Posts: 1
Hi Experts,


I am facing the problem with JNDI.I have made the connection with LDAP Server using JNDI.It's working fine.[b]But after some period of time ,the connection with LDAP get lost .[/b]

AND THIS IS THE ERROR LOG:



[color=red]javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; remaining name 'uid=SuperAdmin,ou=admin,ou=SouthZone,dc=bsnl,dc=co,dc=in'
2010-01-13 10:28:03,953 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1961)
2010-01-13 10:28:03,953 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1806)
2010-01-13 10:28:03,953 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1731)
2010-01-13 10:28:03,953 ERROR [STDERR] at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)
2010-01-13 10:28:03,953 ERROR [STDERR] at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:338)
2010-01-13 10:28:03,953 ERROR [STDERR] at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:321)
2010-01-13 10:28:03,953 ERROR [STDERR] at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248)
2010-01-13 10:28:03,953 ERROR [STDERR] at sun.reflect.GeneratedMethodAccessor188.invoke(Unknown Source)
2010-01-13 10:28:03,953 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2010-01-13 10:28:03,953 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.jboss.naming.ExternalContext$CachedContext.invoke(ExternalContext.java:558)
2010-01-13 10:28:03,953 ERROR [STDERR] at $Proxy261.search(Unknown Source)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.jsp.BSNLApp.jsp.AppList_jsp._jspService(AppList_jsp.java:205)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
2010-01-13 10:28:03,953 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
2010-01-13 10:28:03,953 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2010-01-13 10:28:03,953 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2010-01-13 10:28:03,968 ERROR [STDERR] at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2010-01-13 10:28:03,968 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2010-01-13 10:28:03,968 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
2010-01-13 10:28:03,968 ERROR [STDERR] at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:437)
2010-01-13 10:28:03,968 ERROR [STDERR] at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:366)
2010-01-13 10:28:03,968 ERROR [STDERR] at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
2010-01-13 10:28:03,968 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
2010-01-13 10:28:03,968 ERROR [STDERR] Caused by: java.io.IOException: connection closed
2010-01-13 10:28:03,968 ERROR [STDERR] at com.sun.jndi.ldap.LdapClient.ensureOpen(LdapClient.java:1558)
2010-01-13 10:28:03,968 ERROR [STDERR] at com.sun.jndi.ldap.LdapClient.search(LdapClient.java:504)
2010-01-13 10:28:03,968 ERROR [STDERR] at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1944)[/color]

[b]I have attached jboss-service.xml file in wich i have added a section for LDAP Bind.like[/b]

<!-- Bind a remote LDAP server -->
<mbean code="org.jboss.naming.ExternalContext" name=":service=ExternalContext,jndiName=external/ldap/jboss">


<attribute name="JndiName">external/ldap/jboss

</attribute>
<attribute name="PropertiesURL">myldap.properties</attribute>

<attribute name="InitialContext"> javax.naming.directory.InitialDirContext </attribute>
<attribute name="RemoteAccess">true</attribute>
</mbean>

[b]and myldap.properties file contains[/b]

# DO NOT EDIT THIS FILE UNLESS YOU KNOW WHAT YOU ARE DOING
#

java.naming.factory.initial=com.sun.jndi.ldap.LdapCtxFactory
java.naming.provider.url=ldap://172.21.7.230:2389
java.naming.security.principal=cn=admin,ou=admin,dc=bsnl,dc=co,dc=in
java.naming.security.authentication=simple
java.naming.security.credentials=tcs@1234

*****************************************************************************************************

I have to resolve this issue as earliest.


Please Help me.


Thanks & Regards,


Divya.
 
GeeCON Prague 2014
 
subject: jboss jndi