Announcement Announcement Module
Collapse
No announcement yet.
spring ldap outofmemory unable to create new native thread Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • spring ldap outofmemory unable to create new native thread

    Code:
    HTTP Status 500 - 
    
    --------------------------------------------------------------------------------
    
    type Exception report
    
    message 
    
    description The server encountered an internal error () that prevented it from fulfilling this request.
    
    exception 
    
    javax.servlet.ServletException: Filter execution threw an exception
    
    
    root cause 
    
    java.lang.OutOfMemoryError: unable to create new native thread
        java.lang.Thread.start0(Native Method)
        java.lang.Thread.start(Thread.java:597)
        com.sun.jndi.ldap.Connection.<init>(Connection.java:215)
        com.sun.jndi.ldap.LdapClient.<init>(LdapClient.java:118)
        com.sun.jndi.ldap.LdapClientFactory.createPooledConnection(LdapClientFactory.java:46)
        com.sun.jndi.ldap.pool.Connections.<init>(Connections.java:97)
        com.sun.jndi.ldap.pool.Pool.getPooledConnection(Pool.java:114)
        com.sun.jndi.ldap.LdapPoolManager.getLdapClient(LdapPoolManager.java:310)
        com.sun.jndi.ldap.LdapClient.getInstance(LdapClient.java:1572)
        com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2625)
        com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:288)
        com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
        com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
        com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:136)
        com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
        javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
        javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
        javax.naming.InitialContext.init(InitialContext.java:223)
        javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:134)
        org.springframework.ldap.core.support.LdapContextSource.getDirContextInstance(LdapContextSource.java:43)
        org.springframework.ldap.core.support.AbstractContextSource.createContext(AbstractContextSource.java:254)
        org.springframework.ldap.core.support.AbstractContextSource.getContext(AbstractContextSource.java:106)
        org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1434)
        org.springframework.ldap.core.LdapTemplate.authenticate(LdapTemplate.java:1386)
        com.company.iss.services.ISSServiceImpl.login(ISSServiceImpl.java:98)
        sun.reflect.GeneratedMethodAccessor358.invoke(Unknown Source)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:597)
        org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
        org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        $Proxy55.login(Unknown Source)
        sun.reflect.GeneratedMethodAccessor358.invoke(Unknown Source)
        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:597)
        org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)
        org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
        org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        $Proxy56.login(Unknown Source)
        com.company.iss.services.UserDetailsAuthenticationProvider.retrieveUser(UserDetailsAuthenticationProvider.java:51)
        org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:121)
        org.springframework.security.providers.ProviderManager.doAuthentication(ProviderManager.java:188)
        org.springframework.security.AbstractAuthenticationManager.authenticate(AbstractAuthenticationManager.java:46)
        org.springframework.security.ui.webapp.AuthenticationProcessingFilter.attemptAuthentication(AuthenticationProcessingFilter.java:82)
        org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:258)
        org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
        org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
        org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
        org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
        org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
        org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
        org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
        org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    
    
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.

    this is my spring ldap setting
    Code:
    <property name="baseEnvironmentProperties">
        <props>
            <prop key="com.sun.jndi.ldap.connect.pool">true</prop>
            <prop key="com.sun.jndi.ldap.connect.pool.initsize">1</prop>
            <prop key="com.sun.jndi.ldap.connect.pool.maxsize">1</prop>
            <prop key="com.sun.jndi.ldap.connect.pool.prefsize">1</prop>
        <prop key="com.sun.jndi.ldap.connect.pool.timeout">300000</prop>
        </props>
    </property>

    any comments why this cause outofmemory? my pool size is only 1?
Working...
X