• DocumentImpl (create) : com.openkm.sdk4csharp.exception.UnknowException: One or more errors occurred.

  • We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
We tried to make OpenKM as intuitive as possible, but an advice is always welcome.
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.
 #49368  by dharm826
 
Hi

I am using .NET SDK 1.2.3. While uploading/creating document I am getting error. The error logged in log file is mentioned below.
Code: Select all
com.openkm.core.ParseException: Premature end of file.
	at com.openkm.util.FormUtils.parsePropertyGroupsForms(FormUtils.java:226)
	at com.openkm.module.db.DbPropertyGroupModule.getAllGroups(DbPropertyGroupModule.java:209)
	at com.openkm.api.OKMPropertyGroup.getAllGroups(OKMPropertyGroup.java:103)
	at com.openkm.servlet.admin.PropertyGroupsServlet.list(PropertyGroupsServlet.java:181)
	at com.openkm.servlet.admin.PropertyGroupsServlet.doGet(PropertyGroupsServlet.java:112)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)
	at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
 #49433  by dharm826
 
Thank you for responding. After setting up the metadata, now I am getting this error:
Code: Select all
DocumentImpl (create) Unable to cast object of type 'com.openkm.sdk4csharp.bean.Folder' to type 'com.openkm.sdk4csharp.bean.Document'. com.openkm.sdk4csharp.exception.UnknowException: Unable to cast object of type 'com.openkm.sdk4csharp.bean.Folder' to type 'com.openkm.sdk4csharp.bean.Document'. at com.openkm.sdk4csharp.impl.DocumentImpl.createDocumentSimple(String docPath, FileStream fileStream)
This kind of error I am getting from few other apis as well. e.g renameDocument,getDocumentProperties,getDocumentChildren.
 #49445  by jllort
 
Please share the section of the code what is raising the error. If possible an small sample in combination with OpenKM screenshot will be great ( basically to be sure the paths or the uuid used in your test really are pointing to documents )
 #49448  by dharm826
 
Code: Select all
String host = "http://localhost:8080/DochronicleDev/ ";
String username = "admin";
String password = "Abhi@2017";

OKMWebservice ws = OKMWebservicesFactory.newInstance(host, username, password);

try {
    FileStream fileStream = new FileStream(@"E:\store2\downloads 2211\dharmendra_jackys.docx", FileMode.Open);
    var doc = ws.createDocumentSimple("/dms:root/Dharm/dharmendra_jackys6.docx", fileStream);
    fileStream.Dispose();              
} catch (Exception e) {
    System.Console.WriteLine(e.ToString());
}
Attachments
OpenKM
OpenKM
Screenshot (211).png (70.2 KiB) Viewed 8747 times
 #49656  by jllort
 
You have a problem with metadata definition in the OpenKM, check it.

The error is clear:
Code: Select all
com.openkm.core.ParseException: Premature end of file.
	at com.openkm.util.FormUtils.parsePropertyGroupsForms(FormUtils.java:226)
	at com.openkm.module.db.DbPropertyGroupModule.getAllGroups(DbPropertyGroupModule.java:209)
	at com.openkm.api.OKMPropertyGroup.getAllGroups(OKMPropertyGroup.java:103)

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.