Page 2 of 2

Re: script import mail

Posted: Fri Apr 21, 2017 6:43 pm
by jllort
Do you see some error from catalina.log file ?

Re: script import mail

Posted: Sun Apr 23, 2017 6:54 am
by snowman
I can now confirm that another independent Installation shows the same behavior.

Re: script import mail

Posted: Sun Apr 23, 2017 6:25 pm
by jllort
That not helps much, I'm asking about catalina.log file, is there some error while you are doing it ? if there's some error, please share with us the catalina.log file to see it.

Re: script import mail

Posted: Sun Apr 30, 2017 10:36 pm
by snowman
HI,

I am sorry. I did not see your post. I turned on debug in catalina log and got roughly 130kB of messages. There is no ERROR line in it. I do not know what to look for.
Some interesting parts may be:

Code: Select all

2017-05-01 00:09:32,429 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.tomcat.util.modeler.BaseModelMBean- preRegister org.apache.coyote.RequestInfo@7671c334 Catalina:type=RequestProcessor,worker="http-bio-0.0.0.0-8080",name=HttpRequest1
2017-05-01 00:09:32,450 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.tomcat.util.http.Parameters- Set query string encoding to null
2017-05-01 00:09:32,451 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [uriBC] has value [/OpenKM/services/rest/mail/importEML]
2017-05-01 00:09:32,451 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [semicolon] has value [-1]
2017-05-01 00:09:32,451 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.connector.CoyoteAdapter- The variable [enc] has value [ISO-8859-1]
2017-05-01 00:09:32,452 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase- Security checking request POST /OpenKM/services/rest/mail/importEML
2017-05-01 00:09:32,452 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.realm.RealmBase-   No applicable constraints defined
2017-05-01 00:09:32,452 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.authenticator.AuthenticatorBase-  Not subject to any constraint
2017-05-01 00:09:32,462 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- loadClass(org.springframework.security.web.firewall.FirewalledResponse, false)
2017-05-01 00:09:32,462 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,462 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findClass(org.springframework.security.web.firewall.FirewalledResponse)
2017-05-01 00:09:32,466 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Loading class from local repository
[ ... there are a lot of Searching local Repositories findClass(...) ... ]

Here it starts with "not found, returning null:

Code: Select all

2017-05-01 00:09:32,740 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- getResourceAsStream(org/apache/cxf/transport/https/Messages.properties)
2017-05-01 00:09:32,740 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,740 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findResource(org/apache/cxf/transport/https/Messages.properties)
2017-05-01 00:09:32,741 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     --> Returning 'jar:file:/data/bin/openkm-6.3.3/tomcat/webapps/OpenKM/WEB-INF/lib/cxf-rt-transports-http-2.7.12.jar!/org/apache/cxf/transport/https/Messages.properties'
2017-05-01 00:09:32,741 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   --> Returning stream from local
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- loadClass(org.apache.cxf.transport.https.Messages_de, false)
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findClass(org.apache.cxf.transport.https.Messages_de)
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Delegating to parent classloader at end: org.apache.catalina.loader.StandardClassLoader@bf4b610
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- getResourceAsStream(org/apache/cxf/transport/https/Messages_de.properties)
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,751 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findResource(org/apache/cxf/transport/https/Messages_de.properties)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     --> Resource not found, returning null
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Delegating to parent classloader unconditionally org.apache.catalina.loader.StandardClassLoader@bf4b610
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   --> Resource not found, returning null
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- loadClass(org.apache.cxf.transport.https.Messages_de_DE, false)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findClass(org.apache.cxf.transport.https.Messages_de_DE)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Delegating to parent classloader at end: org.apache.catalina.loader.StandardClassLoader@bf4b610
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader- getResourceAsStream(org/apache/cxf/transport/https/Messages_de_DE.properties)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Searching local repositories
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     findResource(org/apache/cxf/transport/https/Messages_de_DE.properties)
2017-05-01 00:09:32,752 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-     --> Resource not found, returning null
[... lot of Searching local repositories, it appears to end with: ]

Code: Select all

2017-05-01 00:09:32,813 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.catalina.loader.WebappClassLoader-   Loading class from local repository
2017-05-01 00:09:32,815 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.coyote.http11.Http11Protocol- Socket: [org.apache.tomcat.util.net.SocketWrapper@3ebee16e:Socket[addr=/127.0.0.1,port=48376,localport=8080]], Status in: [OPEN_READ], State out: [CLOSED]
2017-05-01 00:09:32,816 [http-bio-0.0.0.0-8080-exec-1] DEBUG org.apache.tomcat.util.threads.LimitLatch- Counting down[http-bio-0.0.0.0-8080-exec-1] latch=1
Does this help?

Re: script import mail

Posted: Mon May 01, 2017 7:52 am
by jllort
Try with xml rather json ( might be there's a bug with json ? ). Use this url as a guide for it http://stackoverflow.com/questions/3007 ... mmand-line

Re: script import mail

Posted: Mon May 01, 2017 9:21 am
by snowman
OK. I tried.
The -d option of curl does not go together with the -F option. With -d I cannot give the target path. So I guess I have to stick with -F.
Man page says there is difference if you transfer a file using -F content=@file and -F content=<file . I tried both. No success.
Then I applied all plausible mime types as -H "Content-type: XXX/YYY". No success.

As I get a 404 in the curl verbose output. I wonder if something is wrong with either my target path: dstId='/okm:root/test/', which should be the (existing) folder test directly under root. I also tried the UUID of this folder.
Or something is wrong with my url:
http://localhost:8080/OpenKM/services/r ... /importEML

I am stuck.

Re: script import mail

Posted: Wed May 03, 2017 8:21 pm
by jllort
I have tested and for me it is going right.

Note:
- I have OpenKM in port 8180, you must change to your port
- Execute the command in the same folder you have the file test.eml
- Ensure you are executing OpenKM version 6.3.3 ( in previous version you do not have import mail support )

Code: Select all

curl -u okmAdmin:admin -H "Accept: application/json" -X POST -F dstId=/okm:root/ -F content=@test.eml http://localhost:8180/OpenKM/services/rest/mail/importEml

Re: script import mail

Posted: Fri May 05, 2017 9:36 pm
by snowman
Ok. It works now. The error was trivial. The url ends with ../importEml not importEML ! Oh my.
Thank you for your patient help.

Re: script import mail

Posted: Sat May 06, 2017 3:51 pm
by jllort
We are working to offering better documentation about REST webservices with some automatic tool for publishing it. Actualy we are working in professional version for it and I hope in nearly future we can release the same for community version. Best documentation of it, sure might helped you.