• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

successful LDAP authentication results in InvocationTargetException

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have configured LDAP with Jforum 2.1.8 and I am getting hit @ my LDAP server

But in JForum, I am getting invocationTargetException.. This is the log
:07,396 INFO [ConfigLoader ] Loading clickstream config from /home/sguruvar/Desktop/shiv/apache_tomcat_6_0_18/webapps/ETForum/WEB-INF/config/clickstream-jforum.xml

04:56:25,359 ERROR [ExceptionWriter ] net.jforum.exceptions.ForumException: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at net.jforum.Command.process(Command.java:114)
at net.jforum.JForum.processCommand(JForum.java:217)
at net.jforum.JForum.service(JForum.java:200)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at net.jforum.util.legacy.clickstream.ClickstreamFilter.doFilter(ClickstreamFilter.java:59)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
... 23 more
Caused by: java.lang.NullPointerException
at javax.naming.directory.BasicAttributes.get(BasicAttributes.java:144)
at net.jforum.sso.LDAPAuthenticator.validateLogin(LDAPAuthenticator.java:124)
at net.jforum.dao.generic.GenericUserDAO.validateLogin(GenericUserDAO.java:738)
at net.jforum.view.forum.UserAction.validateLogin(UserAction.java:578)
at net.jforum.view.forum.UserAction.validateLogin(UserAction.java:427)
... 23 more

URL is: /ETForum/jforum.page?null




Any help is much appreciated....



[originally posted on jforum.net by sivagurunath]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
IMHO, the LDAPAuthenticator is more along the lines of upscaled demo code than a full fledged production code.

Anyway, it looks like the error is because the getAttributes call (LDAPAuthenticatior line: 124) is returning null instead of the expected NamingException.

You will probably have to split this into two lines with a check to see if getAttributes returned null or not.
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Should I need to tweak the source code (LDAPAuthenticator.java)???
Can you elaborate on what I need to do as I am very new to JForum??


[originally posted on jforum.net by sivagurunath]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The source for the LDAPAuthenticator is the place to start in understanding how jForum will validate against LDAP. Here you can see how the configuration properties get converted into LDAP lookup info (e.g. LDAP DN strings).

Note: anything that looks like:

SystemGlobals.getValue(ConfigKeys.X_Y_Z))

is getting the configuration setting for x.y.z. E.g. the ldap.login.prefix setting.

If I'm reading the code and error correctly, the code assumes that if the generated lookupPrincipal does not exist, a NamingException will be thrown by Java's Directory code. But this does not seem to be happening on your set up.

This could be due to a configuration issue or it could be due to a version difference in your version of the directory code.

The only way to really track this down is to play around with the code to find out. E.g. replace line 124 which reads:



with something like:


[originally posted on jforum.net by monroe]
 
reply
    Bookmark Topic Watch Topic
  • New Topic