[jira] Commented: (DIRSERVER-391) Loop in client results in NPE +
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Directory Project > [jira] Commented: (DIRSERVER-391) Loop in client results in NPE +




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    [jira] Commented: (DIRSERVER-391) Loop in client results in NPE +  
Nikolay Ugarov (JIRA)


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-27-06 06:11 PM

[ http://issues.apache.org/jira/brows...237
6724 ]

Nikolay Ugarov commented on DIRSERVER-391:
------------------------------------------

Alex,

I have the stacktrace in my project (not related to ApacheDS in any way) exa
ctly similar to the one you have on server -   actually found this bug searc
hing the net for the stacktrace.

It looks like this is sun's bug. http://bugs.sun.com/bugdatabase/vie...r />
d=4729342

Could you please comment, did you upgrade your JDK when when you where testi
ng the resolution?

> Loop in client results in NPE + CommunicationException Request: 1 cancelle
d
> --------------------------------------------------------------------------
-
>
>          Key: DIRSERVER-391
>          URL: http://issues.apache.org/jira/browse/DIRSERVER-391
>      Project: Directory ApacheDS
>         Type: Bug

>  Environment: Windows XP SP2, JDK1.4.2_05, Running the program in Eclipse 
3.0.1
>     Reporter: David Geleyn
>     Assignee: Alex Karasulu
>  Attachments: Test.java
>
> The source code that fails is too complicated to add here, so I've made a 
test program that results in the same behaviour.
> This program doesn't do anything useful. It checks twice whether Alex Karasulu is 
an administrator and repeats this for a thousand times. It results in an Communicati
onException at client side and a NPE at server  side. I added both stacktraces at th
e e
nd. I also added the code that starts up the LDAP server.
> I googled to find some explanation for the "Request 1: Cancelled", but I d
idn't find an useful explanation. There was some topic on a forum that menti
onned that the number of connections was reached. Can this be the problem?
> After the NPE (which is never a good thing), new server requests will be p
rocessed. It's only the thread that handles the request that fails (i guess)
.
> ============= SAMPLE CLIENT CODE
> public static void main(String[] args) throws Exception
> {
>         final Properties env = new Properties();
>         env.put(Context.INITIAL_CONTEXT_FACTORY,
> "com.sun.jndi.ldap.LdapCtxFactory");
>         env.put(Context.PROVIDER_URL, "ldap://david:389");
>         env.put(Context.SECURITY_AUTHENTICATION, "simple");
>         env.put("java.naming.ldap.version", "3");
>         env.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
>         env.put(Context.SECURITY_CREDENTIALS, "secret");
>         int positive = 0;
>
>         for (int i = 0; i < 1000; i++)
>         {
>                 // Try to authenticate user.
>                 DirContext userContext = new InitialDirContext(env);
>
>                 final SearchControls constraints = new SearchControls();
>                 constraints.setDerefLinkFlag(true);
>                 constraints.setSearchScope(SearchControls.SUBTREE_SCOPE);
>                 String filter =
> "(& (cn=administrators)(uniqueMember=uid=aka
rasulu,ou=users,ou=system))";
>                 NamingEnumeration enum =
> userContext.search("ou=groups,ou=system", filter, constraints);
>                 enum = userContext.search("ou=groups,ou=system", filter,
> constraints);
>
>                 if (enum.hasMoreElements()) positive++;
>                 userContext.close();
>         }
>         System.out.println(positive);
>
> }
> ============= SERVER STARTUP CODE
> // Start the LDAP server
> Properties env = new Properties();
> env.setProperty(Context.PROVIDER_URL, "ou=system");
> env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.apache.ldap.server.jndi.ServerContextFactory");
> try
> {
>         new InitialDirContext(env);
> }
> catch (NamingException e)
> {
>         e.printStackTrace();
> }
> ============= CLIENT STACK TRACE
> javax.naming.CommunicationException: Request: 1 cancelled
>         at com.sun.jndi.ldap.LdapRequest.getReplyBer(LdapRequest.java:60)
>         at com.sun.jndi.ldap.Connection.readReply(Connection.java:405)
>         at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:340)
>         at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:193)
>         at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2640)
>         at com.sun.jndi.ldap.LdapCtx.<init>(LdapCtx.java:290)
>         at
> com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(LdapCtxFactory.java:175)
>         at
> com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(LdapCtxFactory.java:193)
>         at
> com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(LdapCtxFactory.java:13
6)
>         at
> com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(LdapCtxFactory.java:66)
>         at
> javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
>         at
> javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
>         at javax.naming.InitialContext.init(InitialContext.java:219)
>         at javax.naming.InitialContext.<init>(InitialContext.java:195)
>         at
> javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:80)
>         at id.security.authentication.service.ldap.Test.main(Test.java:34)
> ============= SERVER STACK TRACE
> java.lang.NullPointerException
>         at
> sun.nio.ch.WindowsSelectorImpl$SubSelector.processFDSet(WindowsSelectorImp
l.java:321)
>         at
> sun.nio.ch.WindowsSelectorImpl$SubSelector.processSelectedKeys(WindowsSele
ctorImpl.java:290)
>         at
> sun.nio.ch.WindowsSelectorImpl$SubSelector.access$2800(WindowsSelectorImpl
.java:253)
>         at
> sun.nio.ch.WindowsSelectorImpl.updateSelectedKeys(WindowsSelectorImpl.java
:439)
>         at
> sun.nio.ch.WindowsSelectorImpl.doSelect(WindowsSelectorImpl.java:145)
>         at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:59)
>         at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:70)
>         at sun.nio.ch.SelectorImpl.select(SelectorImpl.java:74)
>         at
> org.apache.apseda.input.TCPInputManager.run(TCPInputManager.java:158)
>         at java.lang.Thread.run(Thread.java:534)

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secur...nistrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:45 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register