• NullPointerException with LDAP

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #9855  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.
 #9871  by jllort
 
into ext-lib there's the jar that you must register. That must be done manually, take a look at install.sh
 #9874  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.
 #9878  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
 #9879  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)
 #9882  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.
 #9906  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?
 #9927  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.
 #9940  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:
 #10017  by jllort
 
ok, you missed the "l" character principa.adapter must be principal.adapter

It's yet solved no ?

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.