• Error checkin new Version

  • 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.
 #50713  by DanielK
 
Hi, I am developing a java application and when i checkin a new version i get an Exception.
The upload is working but when reading the Version the Exception is thrown.

JDK 11.0.8
OpenKM 6.3.9

java code (from the example + checkout):
Code: Select all
package com.openkm;

import java.io.FileInputStream;
import java.io.InputStream;

import org.apache.commons.io.IOUtils;

import com.openkm.sdk4j.OKMWebservices;
import com.openkm.sdk4j.OKMWebservicesFactory;

public class Test {
	public static void main(String[] args) {
		String host = "http://10.23.16.115:8080/OpenKM";
		String username = "okmAdmin";
		String password = "admin";
		OKMWebservices ws = OKMWebservicesFactory.newInstance(host, username, password);

		try {
			InputStream is = new FileInputStream("c:\\tmp\\test.txt");
			ws.checkout("/okm:root/test.txt");
			ws.checkin("/okm:root/test.txt", is, "optional some comment");
			IOUtils.closeQuietly(is);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
maven dependencies:
Code: Select all
<dependencies>
		<dependency>
			<groupId>com.openkm</groupId>
			<artifactId>sdk4j</artifactId>
			<version>1.2</version>
		</dependency>
		<dependency>
			<groupId>commons-io</groupId>
			<artifactId>commons-io</artifactId>
			<version>2.8.0</version>
		</dependency>
	</dependencies>
Exception:
Code: Select all
com.sun.jersey.api.client.ClientHandlerException: A message body reader for Java class com.openkm.sdk4j.bean.Version, and Java type class com.openkm.sdk4j.bean.Version, and MIME media type application/xml was not found
 #50725  by jllort
 
You must use JDK 1.8.
What kind of project you have in mind ( here you have some samples https://docs.openkm.com/kcenter/view/sd ... lient.html ):
* standalone jar with everything into? ( I suggest use something like this project https://github.com/openkm/sdk4j-with-dependences )
* package into war file? ( I think is not your case )

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.