• Email Notifications

  • 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.
 #2613  by sbs
 
Hey Guys,

I\'m just wondering if there is any difference between configuring email notifcation in 3.0 compared to 2.0?

We have an app to automatically upload files to the repository, which works fine except if someone is subscribed to the folder for email notifcations - we get a null pointer exception on the server, and while the file uploads correctly we get an Object not set to a reference of an Object error back through web services.

Now, If noone is subscribed, everything works fine - which leads me to believe that I\'ve messed up the email config.

My understanding is that there should be:

\\OpenKM-3.0_JBoss-4.2.2.GA\\server\\default\\conf\\props\\openkm-emails.properties
containing the list of usernames and email addresses

\\OpenKM-3.0_JBoss-4.2.2.GA\\server\\default\\deploy\\mail-service.xml
containing the email config

And that the hostname of the OpenKM server should be in the OpenKM.cfg:
application.url=http://winscribe1:8080/OpenKM/es.git.op ... /index.jsp

Is this correct?

I\'ve attached our mail-service.xml file (with the username and password scrubbed), can someone please tell me what I\'ve done wrong?

[file name=mail_service-5ad4481969fff7186f716fad35bf0950.zip size=409]http://www.openkm.com/images/fbfiles/fi ... bf0950.zip[/file]

Cheers.
 #2618  by sbs
 
Thought I might also add the relevant portion of the system log:

2009-05-04 16:25:52,859 DEBUG [es.git.openkm.module.direct.DirectNotificationModule] checkSubscriptionsHelper: /okm:root
2009-05-04 16:25:52,859 DEBUG [es.git.openkm.module.direct.DirectNotificationModule] checkSubscriptionsHelper: /
2009-05-04 16:25:52,859 DEBUG [es.git.openkm.module.direct.DirectAuthModule] getMails(null)
2009-05-04 16:25:52,859 DEBUG [es.git.openkm.principal.DatabasePrincipalAdapter] getMails()
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.MessageContextJAXWS] Begin response processing
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] popMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@431d9d (Thread http-0.0.0.0-8080-2)
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@1616cae (Thread http-0.0.0.0-8080-2)
2009-05-04 16:25:52,859 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
java.lang.NullPointerException
at es.git.openkm.principal.DatabasePrincipalAdapter.getMails(DatabasePrincipalAdapter.java:92)
at es.git.openkm.module.direct.DirectAuthModule.getMails(DirectAuthModule.java:879)
at es.git.openkm.module.direct.DirectNotificationModule.checkSubscriptions(DirectNotificationModule.java:306)
at es.git.openkm.module.direct.DirectDocumentModule.create(DirectDocumentModule.java:273)
at es.git.openkm.ws.endpoint.OKMDocument.create(OKMDocument.java:65)
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:585)
at org.jboss.wsf.container.jboss42.DefaultInvocationHandler.invoke(DefaultInvocationHandler.java:102)
at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:220)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:408)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:272)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:189)
at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:122)
at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
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:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] Cannot obtain fault meta data for: class java.lang.NullPointerException
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callFaultHandlerChain: PRE
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callFaultHandlerChain: ENDPOINT
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callFaultHandlerChain: POST
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] closeHandlerChain
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] close
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] closeHandlerChain
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] close
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] closeHandlerChain
2009-05-04 16:25:52,859 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] close


We are running Jboss as a service using JavaServiceWrapper, if that makes any difference.

Cheers.
 #2621  by jllort
 
There\'s no problem with javaservicewrapper.

Have you implemented your own DatabasePrincipalAdapter ? There\'s some error there.

From OpenKM 2.0 to OpenKM 3.0 has changed the autentication, now is hypersonic embeded by default and users table has mail information, it could be the reason why is not running well on your case.

Which autentication method are you using ?
 #2627  by sbs
 
We haven\'t modified the DatabasePrincipalAdapter, but we have changed the login-config.xml. I\'ve just copied over the same changes we used in 2.0, should this be different?

OpenKM is currently checking a MS Sql 2005 database for login details, which works fine for logging on and off. Should I also be grabbing email addresses from this same database? If so, how do we modify the details below to assign the email address from the database? That is, do we just add a <module-option name=\"emailQuery\"> or something?

I know that the actual log on/off process works fine with the detals below, just not email.

Here is the current OpenKM policy:

<!-- OpenKM -->
<application-policy name = \"OpenKM\">
<authentication>
<login-module code =\"org.jboss.security.auth.spi.DatabaseServerLoginModule\" flag=\"optional\">
<module-option name=\"password-stacking\">useFirstPass</module-option>
<module-option name = \"unauthenticatedIdentity\">Anonymous</module-option>
<module-option name=\"dsJndiName\">java:/MSSQLDS</module-option>
<module-option name=\"principalsQuery\">SELECT A_SECCODE FROM author WHERE A_ID=?</module-option>
<module-option name=\"rolesQuery\">SELECT A_TITLE, \'Roles\' FROM author WHERE A_ID=?</module-option>
</login-module>
<login-module code=\"org.jboss.security.auth.spi.UsersRolesLoginModule\" flag = \"required\">
<module-option name=\"password-stacking\">useFirstPass</module-option>
<module-option name=\"usersProperties\">props/openkm-users.properties</module-option>
<module-option name=\"rolesProperties\">props/openkm-roles.properties</module-option>
</login-module>
</authentication>
</application-policy>

<application-policy name = \"MSSQLDbRealm\">
<authentication>
<login-module code = \"org.jboss.resource.security.ConfiguredIdentityLoginModule\" flag = \"required\">
<module-option name = \"principal\">sa</module-option>
<module-option name = \"userName\">sa</module-option>
<module-option name = \"password\">*****</module-option>
<module-option name = \"managedConnectionFactoryName\">jboss.jca:service=LocalTxCM,name=MSSQLDS</module-option>
</login-module>
</authentication>
</application-policy>

We are using the microsoft SQL driver.

Cheers
 #2644  by sbs
 
Ok, I\'ve done some additional testing and discovered that my email config is OK, but the email addresses are no longer stored where I thought they were. Is there any way of manually adding email addresses?

OpenKM is set up to authenticate against a database for another app we use. I can pull the email addresses out of this database, but I don\'t know how to assign them to the users in OpenKM 3.0.

Is there any way of doing this?

What we used to do was have a batch file that pulled all of the email addresses from the database and wrote them to the openkm-emails.properties file, but I gather this is no longer used.
 #2666  by sbs
 
Ok, So I\'ve figured out the problem. I Specified the UsersRolesPrincipalAdapter in the OpenKM.cfg file, which allowed me to read the email addresses from the openkm-emails.properties file. Everything appeared to be working ok, except for a message that popped up during the logon process.

I kept getting an error in the log - class not found es.git.openkm.principal.UsersRolesPrincipalAdapter and a message popped up along the same lines in OpenKM itself. This did not appear to effect how OpenKM functioned, but I did not do exhaustive testing.

I ended up overwriting the DatabasePrincipalAdapter.class file in the OpenKM.war archive with a copy of the UsersRolesPrincipalAdapter.class. This, combined with having UsersRolesPrincipalAdapter specified in the cfg file seems to be working OK. Can anyone confirm if this is a bug or if it is just something wierd in my configuration?

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.