Page 1 of 1

OpenKM.xml login with User-Email-Adress

PostPosted:Sun Dec 07, 2014 4:10 pm
by khaupt
Hallo and a happy 2. Advent Sonday,

I am new in this forum and... sorry for my bad english.

I will develop a program in C# for an existing community-okm 6.3.0 server with MySQL-Database.

The user login successfully with their email address.
For this purpose the OpenKM.xml was modified as follows:
The sql-statement "users-by-username-query" had change the usr_id to usr_email.
This works very well.

But the C# WebServices API-Login breaks at "webserviceserver.webservice.login ();".
A part of the error message is: "/okm:trash\n\System.Web.Services.Protocols.SoapException: ..."
The same C#-login() with the original OpenKM.xml works very well.

How can I solve this problem?
Is it possible to modify the sql-statement "users-by-username-query" to login with usr_id AND/OR usr_email?
Or exists a solution for the trash-problem?

For helpful ways or tips I would be very grateful.
... I am working for several days with this problem.


With best regards

Karl Haupt

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Mon Dec 08, 2014 11:22 am
by jllort
What openkm version are you using ( in older version was a problem with users what still has not been logged by UI because the trash/userId node was still not created ). Could you try login with UI and then operate across WS to be sure this is not the case ?

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Mon Dec 08, 2014 4:45 pm
by khaupt
Hallo

and thanks for the answer.
The server is version 6.3.1 (6.3.0 (build: 8156)) and the users are existing/creating before i will login with WS.

With best regards

Karl Haupt

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Wed Dec 10, 2014 5:42 pm
by jllort
What webservices version are you using ? you should use webservice 1.0 as is indicated in table http://wiki.openkm.com/index.php/Csharp_webservice_dll

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Fri Dec 12, 2014 10:53 pm
by khaupt
Hallo Admin,

i downloaded the file OKMWebservice 2.0.zip.
I can't find a OKMWebservice 1.0.zip.
Where can i get/download the file?

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Sat Dec 13, 2014 9:56 am
by jllort
Here there's some confusion, webservices 2.0 is the version 2.0 of all ws packages what are into same zip. Donwload the webservices 2.0 but when you use it must create like
Code: Select all
webservice= OKMWebServiceFactory.getInstance(host, user, password, OKMWebServiceFactory.WEBSERVICE_1_0);
Or something very similar, I do not remember if the constant is exactly as I wrote.

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Sat Dec 13, 2014 7:11 pm
by khaupt
Hallo,

thanks for the answer.
I test it, but it's the same error like before:
okm_login_error.JPG
okm_login_error.JPG (99.61 KiB) Viewed 11530 times

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Sun Dec 14, 2014 7:16 pm
by jllort
Now you're using WS correctly.

Same user logged from UI goes right or not ?
Also I would like to see complete catalina.log error stack trace.

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Mon Dec 15, 2014 7:16 am
by khaupt
Hallo,

and first thanks for the help to this point.
Yes, the user login with emailadress in UI is korrekt, only the login with WS fails.

Here is the last part of the catalina.log:
(First i login with ws with error than the korrekt login with UI)
--------------------------------------------------------------------------
Code: Select all
2014-12-15 07:53:03,566 [localhost-startStop-1] WARN  com.openkm.servlet.RepositoryStartupServlet- officeHome must exist and be a directory
java.lang.IllegalArgumentException: officeHome must exist and be a directory
	at org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration.checkArgument(DefaultOfficeManagerConfiguration.java:221)
	at org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration.setOfficeHome(DefaultOfficeManagerConfiguration.java:54)
	at org.artofsolving.jodconverter.office.DefaultOfficeManagerConfiguration.setOfficeHome(DefaultOfficeManagerConfiguration.java:49)
	at com.openkm.util.DocConverter.getInstance(DocConverter.java:167)
	at com.openkm.servlet.RepositoryStartupServlet.start(RepositoryStartupServlet.java:279)
	at com.openkm.servlet.RepositoryStartupServlet.init(RepositoryStartupServlet.java:127)
	at javax.servlet.GenericServlet.init(GenericServlet.java:158)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1073)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1857)
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
	at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
	at java.util.concurrent.FutureTask.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
2014-12-15 07:53:03,566 [localhost-startStop-1] INFO  com.openkm.extension.core.ExtensionManager- Initialize and load plugins...
2014-12-15 07:53:03,629 [localhost-startStop-1] WARN  net.xeoh.plugins.base.impl.classpath.loader.FileLoader- Supplied path does not exist. Unable to add plugins from there.
2014-12-15 07:53:03,629 [localhost-startStop-1] INFO  com.openkm.servlet.RepositoryStartupServlet- *** Execute start script ***
2014-12-15 07:53:03,644 [localhost-startStop-1] WARN  com.openkm.util.ExecutionUtils- Unable to read script: C:\openkm\start.bsh
2014-12-15 07:53:03,644 [localhost-startStop-1] WARN  com.openkm.util.ExecutionUtils- Unable to read jar: C:\openkm\start.jar
2014-12-15 07:53:03,644 [localhost-startStop-1] INFO  com.openkm.servlet.RepositoryStartupServlet- *** Execute start SQL ***
2014-12-15 07:53:03,644 [localhost-startStop-1] WARN  com.openkm.servlet.RepositoryStartupServlet- Unable to read sql: C:\openkm\start.sql
2014-12-15 07:53:03,707 [localhost-startStop-1] WARN  org.apache.chemistry.opencmis.server.impl.atompub.CmisAtomPubServlet- CMIS version is not defined! Setting it to CMIS 1.0.
2014-12-15 07:53:03,753 [localhost-startStop-1] INFO  org.apache.catalina.startup.HostConfig- Deploying web application directory C:\openkm\webapps\ROOT
2014-12-15 07:53:04,533 [main] INFO  org.apache.coyote.http11.Http11Protocol- Starting ProtocolHandler ["http-bio-0.0.0.0-8080"]
2014-12-15 07:53:04,533 [main] INFO  org.apache.coyote.ajp.AjpProtocol- Starting ProtocolHandler ["ajp-bio-127.0.0.1-8009"]
2014-12-15 07:53:04,533 [main] INFO  org.apache.catalina.startup.Catalina- Server startup in 27785 ms
2014-12-15 07:54:31,695 [http-bio-0.0.0.0-8080-exec-1] INFO  com.openkm.module.db.DbAuthModule- Create okm:trash/noreply@openkm.com
2014-12-15 07:54:31,711 [http-bio-0.0.0.0-8080-exec-1] INFO  org.apache.cxf.phase.PhaseInterceptorChain- Application {http://ws.openkm.com}OKMAuth#{http://ws.openkm.com}login has thrown exception, unwinding now: com.openkm.core.RepositoryException: 7ae9aabb-f966-40b3-9757-739f4c0a8057 : /okm:trash
2014-12-15 07:55:00,259 [Thread-13] INFO  com.openkm.extractor.TextExtractorWorker- processSerial.Working on {docUuid=090bcd5a-b926-4dac-ac20-078aff965afb, docPath=/okm:root/FilePath.pdf, docVerUuid=4537d6bd-7a86-4aaa-a332-37c2000ddf42, date=Mon Jul 14 18:17:07 CEST 2014}
2014-12-15 07:55:00,477 [Thread-13] WARN  com.openkm.extractor.PdfTextExtractor- PDF does not contains text layer
2014-12-15 07:55:03,285 [Thread-13] ERROR org.apache.pdfbox.filter.FlateFilter- Stop reading corrupt stream
2014-12-15 07:55:04,424 [Thread-13] WARN  com.openkm.core.Cron- Error executing crontab task 'Text Extractor Worker': Sourced file: inline evaluation of: ``new com.openkm.extractor.TextExtractorWorker().run();'' : Method Invocation run : at Line: 1 : in file: inline evaluation of: ``new com.openkm.extractor.TextExtractorWorker().run();'' : .run ( ) 

Target exception: java.lang.OutOfMemoryError: Java heap space

2014-12-15 07:55:05,532 [Thread-13] WARN  com.openkm.core.Cron- Error sending mail: Sourced file: inline evaluation of: ``new com.openkm.extractor.TextExtractorWorker().run();'' : Method Invocation run
2014-12-15 07:58:36,663 [http-bio-0.0.0.0-8080-exec-9] INFO  com.openkm.spring.LoggerListener- Authentication ERROR: noreply@DomainName.net
2014-12-15 07:59:11,248 [http-bio-0.0.0.0-8080-exec-5] INFO  com.openkm.module.common.CommonAuthModule- PrincipalAdapter: com.openkm.principal.DatabasePrincipalAdapter
2014-12-15 07:59:11,482 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.config.GlobalSettings- Trying to find Dozer configuration file: dozer.properties
2014-12-15 07:59:11,513 [http-bio-0.0.0.0-8080-exec-1] WARN  org.dozer.config.GlobalSettings- Dozer configuration file not found: dozer.properties.  Using defaults for all Dozer global properties.
2014-12-15 07:59:11,529 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.DozerInitializer- Initializing Dozer. Version: 5.3.2, Thread Name: http-bio-0.0.0.0-8080-exec-1
2014-12-15 07:59:11,529 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.jmx.JMXPlatformImpl- Dozer JMX MBean [org.dozer.jmx:type=DozerStatisticsController] auto registered with the Platform MBean Server
2014-12-15 07:59:11,544 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.jmx.JMXPlatformImpl- Dozer JMX MBean [org.dozer.jmx:type=DozerAdminController] auto registered with the Platform MBean Server
2014-12-15 07:59:11,544 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.DozerBeanMapper- Initializing a new instance of dozer bean mapper.
2014-12-15 07:59:11,575 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.loader.CustomMappingsLoader- Using the following xml files to load custom mappings for the bean mapper instance: [dozerBeanMapping.xml]
2014-12-15 07:59:11,575 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.loader.CustomMappingsLoader- Trying to find xml mapping file: dozerBeanMapping.xml
2014-12-15 07:59:11,575 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.loader.CustomMappingsLoader- Using URL [file:/C:/openkm/webapps/OpenKM/WEB-INF/classes/dozerBeanMapping.xml] to load custom xml mappings
2014-12-15 07:59:11,591 [http-bio-0.0.0.0-8080-exec-1] INFO  org.dozer.loader.CustomMappingsLoader- Successfully loaded custom xml mappings from URL: [file:/C:/openkm/webapps/OpenKM/WEB-INF/classes/dozerBeanMapping.xml]
2014-12-15 07:59:11,700 [http-bio-0.0.0.0-8080-exec-7] INFO  com.openkm.vernum.VersionNumerationFactory- VersionNumerationAdapter: com.openkm.vernum.MajorMinorVersionNumerationAdapter

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Tue Dec 16, 2014 6:40 pm
by jllort
I think it's a problem with SOA webservices. I encourage using rest ones ! ( Our actual sdk for c# is based on SOA, it's still the only what uses SOA the others use rest inside ). Meanshile we are releasing ones with c# I suggest try rest api.

Some url what could have some interest to you:
http://wiki.openkm.com/index.php/RESTful_Guide
http://wiki.openkm.com/index.php/SDK

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Sat Dec 20, 2014 1:10 pm
by khaupt
Hello and thanks for the reply.

Another good solution for my problem is to insert the user login-ID from my database directly into the input field of the okm login window.
With php, c#, c++, java, ...
Is it possible to solve this?

Thank you
and a beautiful christmas party at the okm - team.

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Sun Dec 21, 2014 12:20 pm
by jllort
sdk for java is the most complete, my suggestion if it's possible is use it. About setting automatically the user id, well, I do not understand your exact scenario, but if you want to show some login fields in a browser and automatically get the user id, then could solve it with some cookie etc... As I said I do not understand exactly what you got in your mind. Detailed description can help us on understanding and then offers you better ideas.

Our best wishes for this Christmas.

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Mon Dec 22, 2014 10:43 am
by khaupt
Hallo,

it is difficult to understand my login-problem..., for me too! :-[
The user give me a email-adress, and i search the user-id and call the okm-server with the inserted user-id in the user-editbox.
But, i solved this problem with a little change in the login_desktop.jsp:

In the <head> Section add:
Code: Select all
String userID = request.getParameter("ID");
In the form-Section add:
Code: Select all
        <% } else if (userID != null){ %>
          <label for="j_username">adapted-UserID</label><br/>
          <input name="j_username" id="j_username" type="text" value="${param['ID']}" </input><br/><br/>
And then you can call the OKM-Server with: http://localhost:8080/OpenKM/login.jsp?ID=TestUserID

It works very well and i hope this helps, if there is anyone who has the same problem.

Thank you
and my best wishes for this Christmas.

Re: OpenKM.xml login with User-Email-Adress

PostPosted:Wed Dec 24, 2014 4:15 pm
by jllort
then you're not login with mail, you're translating the mail to userid and then use userId as login