Page 3 of 3

Re: NullPointerException with LDAP

PostPosted:Sat Mar 26, 2011 5:43 pm
by Catscratch
Code: Select all
C:\Dokumente und Einstellungen\Administrator\Desktop\eclipse\workspace\openkm>mvn clean package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building OpenKM Web Application 5.0.4-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.417s
[INFO] Finished at: Sat Mar 26 18:41:47 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:extensions-full:jar:5.0 in http://repository.jboss.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of jboss.org has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
Der Befehl "cmd" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.

Re: NullPointerException with LDAP

PostPosted:Mon Mar 28, 2011 7:25 am
by jllort
into ext-lib there's the jar that you must register. That must be done manually, take a look at install.sh

Re: NullPointerException with LDAP

PostPosted:Mon Mar 28, 2011 7:30 am
by Catscratch
I got it. The install.sh don't do it.

I manually copied the "extensions-5.0-full.jar" into the maven repository.
In windows its: ...Documents and Settings\USERNAME\.m2\repository\com\openkm\extensions-full\5.0

But the JAR is named wrong. After copying I have to rename it to "extensions-full-5.0.jar".
Now maven find the dependencies.

Re: NullPointerException with LDAP

PostPosted:Mon Mar 28, 2011 7:39 am
by jllort
you must not copy directly into maven , no no no

You've executed it ( that's into install.sh ) in the terminal
mvn install:install-file -DgroupId=com.openkm -DartifactId=extensions-full -Dversion=5.0 -Dpackaging=jar -Dfile=extensions-5.0-full.jar

Re: NullPointerException with LDAP

PostPosted:Mon Mar 28, 2011 7:54 am
by Catscratch
Yeah, I executed it several times. But it won't work. Now I copied it directly into the maven repository and it worked!

Maybe the install.sh works in unix, but in Windows XP SP3 it don't. (And yes, I copy pasted the content of the file to the console)

Re: NullPointerException with LDAP

PostPosted:Mon Mar 28, 2011 3:13 pm
by jllort
Yes, on windows you must copy and execute the command that's into install.sh obviously on windows the .sh will not propertly executed, but the interest of the script is the command that's into. Better if you install with command than make it manually.

Re: NullPointerException with LDAP

PostPosted:Tue Mar 29, 2011 8:42 am
by Catscratch
Hi,

I debugged the application and need you help please.

The error is thrown by the com.openkm.frontend.server.OKMWorkspaceServlet.java:284

In Line 283 there is:
user = AuthDAO.findUserByPk(getThreadLocalRequest().getRemoteUser());

This return null so the line 284:
workspace.setEmail(user.getEmail());

Tries to access a null-object.

The request getThreadLocalRequest().getRemoteUser() returns an object regarding to the ldap user.
But the methode findUserByPk(with this object) returns null.

From my point of view, findUserByPk tries to get the userId from the database. But how do I get the userId into the database? It's read out of the active directory so the user isn't present in the database. How should he get there?

Do you have any idea, whats going wrong here?

Re: NullPointerException with LDAP

PostPosted:Tue Mar 29, 2011 4:20 pm
by jllort
The complete code is :
Code: Select all
if (Config.PRINCIPAL_ADAPTER.equals(com.openkm.principal.DatabasePrincipalAdapter.class.getName())) {
				user = AuthDAO.findUserByPk(getThreadLocalRequest().getRemoteUser());
				workspace.setEmail(user.getEmail());
			}
These condition never must be true on ldap Config.PRINCIPAL_ADAPTER.equals(com.openkm.principal.DatabasePrincipalAdapter.class.getName())

You've got some problem on OpenKM.cfg which is your principal.adapter there.

Re: NullPointerException with LDAP

PostPosted:Tue Mar 29, 2011 7:42 pm
by Catscratch
Code: Select all
principa.adapter=com.openkm.principal.LdapPrincipalAdapter
That's the error. :cry:
I posted it in my first post and noone noticed it. I could scream!

No I corrected it and it runs! Thank you very much.
But there is one good thing left. Until now I got a good understanding on how openKM works. :mrgreen:

Re: NullPointerException with LDAP

PostPosted:Fri Apr 01, 2011 10:20 pm
by jllort
ok, you missed the "l" character principa.adapter must be principal.adapter

It's yet solved no ?

Re: NullPointerException with LDAP

PostPosted:Sat Apr 02, 2011 8:41 am
by Catscratch
It's solved.