Page 2 of 3

Re: NullPointerException with LDAP

PostPosted:Sat Mar 19, 2011 10:27 am
by Catscratch
Yeah, that's right. But e.g. if I login as UserA OpenKM tries to read the email address of UserA out of the AD, right? Now if e.g. UserB has no email address, this shouldn't be a problem. Because only UserA tries to login. Or does OpenKM tries to get the email addresses of all users if only one user logs in?
I don't think so.

So UserA got an email address but OpenKM throws a nullpointer exception anyway. And that's the only thing I don't understand at the moment. :-)

Re: NullPointerException with LDAP

PostPosted:Sun Mar 20, 2011 11:52 am
by jllort
OK :) it's not so simply.

I think login gets all users and all roles not only one user and role. That could be the reason why it happens this problem, I'm not totally sure about it. Althought it you've got other problem on security panels, because there must be shown all users and all roles.

Re: NullPointerException with LDAP

PostPosted:Mon Mar 21, 2011 5:16 pm
by Catscratch
Hello again,

I've tried a new way. I installed a new active directory with only 2
users which are in 1 OU.

There I also get the same error (NullPointerException) at
OKMWorkspaceServlet.java at the point:
workspace.setEmail(user.getEmail());

Both users got email addresses.

So what's wrong here?

Thank you and best regards,
Ronny

Re: NullPointerException with LDAP

PostPosted:Tue Mar 22, 2011 1:12 pm
by jllort
I think must increase log error, add ctegory in jboss-log4j.xml for LdapPrincipal class

Re: NullPointerException with LDAP

PostPosted:Tue Mar 22, 2011 1:16 pm
by pavila
Seems "user" is null. The execution should be traced to wee what happens. Try the log tip proposed by jllort to increase the log messages.

Re: NullPointerException with LDAP

PostPosted:Tue Mar 22, 2011 1:34 pm
by Catscratch
Hm, I added the following in the jboss-log4j.xml:
Code: Select all
<category name="com.openkm.principal.LdapPrincipalAdapter">
  <priority value="WARN" />
</category>
But there is no new error message in the log file (server.log of jboss). Only the stack trace I posted in my first message.

Re: NullPointerException with LDAP

PostPosted:Tue Mar 22, 2011 3:23 pm
by jllort
change to
Code: Select all
<priority value="DEBUG" />

Re: NullPointerException with LDAP

PostPosted:Tue Mar 22, 2011 3:27 pm
by Catscratch
I already tried. But the same. I tried ERROR, WARN and DEBUG. And than I searched the log file (which is very very long) for something like "*ldap*". But no hit.

Re: NullPointerException with LDAP

PostPosted:Wed Mar 23, 2011 4:04 pm
by jllort
In this tedious scenario we might debug the application.

Re: NullPointerException with LDAP

PostPosted:Thu Mar 24, 2011 12:48 pm
by Catscratch
Is there a way, that I may debug the source? I checked it out, but is there some kind of eclipse project? Or what do you use to build it?

Edit: I found the Developer Guide http://wiki.openkm.com/index.php/Developer_Guide and will try it.

Re: NullPointerException with LDAP

PostPosted:Thu Mar 24, 2011 3:12 pm
by jllort
I think in developer guide is well explained, first you must configure your IDE environment ( eclipse galileo or helios, we're using both ). Configure maven, checkout project etc...

Re: NullPointerException with LDAP

PostPosted:Fri Mar 25, 2011 2:08 pm
by Catscratch
I hang on this step http://wiki.openkm.com/index.php/Checko ... Subversion

Everytime I check out the project eclipse downloads the files from the svn. Then the maven plugin starts with "importen maven projects" and there it stucks. And nothings happens for hours.

Edit: If I try to build it manually I get:
Code: Select all
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenKM Web Application 5.0.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.019s
[INFO] Finished at: Fri Mar 25 16:23:56 CET 2011
[INFO] Final Memory: 10M/24M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project openkm: Could not resolve dependencies
 for project com.openkm:openkm:war:5.0.4-SNAPSHOT: Failure to find com.openkm:ex
tensions-full:jar:5.0 in http://repository.jboss.org/maven2 was cached in the lo
cal repository, resolution will not be reattempted until the update interval of
jboss.org has elapsed or updates are forced -> [Help 1]

Re: NullPointerException with LDAP

PostPosted:Fri Mar 25, 2011 7:42 pm
by jllort
into ext-lib there's some library that you must install manually with terminal take a look at install.sh there's the command you must execute to register some library into maven.

Re: NullPointerException with LDAP

PostPosted:Fri Mar 25, 2011 7:53 pm
by Catscratch
I already executed the command in the install.sh. But the error remains.

Re: NullPointerException with LDAP

PostPosted:Sat Mar 26, 2011 10:16 am
by jllort
run from terminal
mvn clean package into your project checkout with eclipse closed.