Xero-Java icon indicating copy to clipboard operation
Xero-Java copied to clipboard

Error when trying to use the Xero java API on Spring Boot / Java 17

Open oss-linux-etc opened this issue 2 years ago • 5 comments

Here is what I'm seeing:

screen

Calling code:

List<Connection> connection = idApi.getConnections(tokenResponse.getAccessToken(), null);

oss-linux-etc avatar Dec 31 '23 05:12 oss-linux-etc

PETOSS-377

github-actions[bot] avatar Dec 31 '23 05:12 github-actions[bot]

Thanks for raising an issue, a ticket has been created to track your request

github-actions[bot] avatar Dec 31 '23 05:12 github-actions[bot]

There's a PR relating to a fix for this to update to Java 17.

oss-linux-etc avatar Jan 03 '24 00:01 oss-linux-etc

@oss-linux-etc I solved this issue by using the following dependency in pom.xml

<dependency>
	<groupId>com.github.xeroapi</groupId>
	<artifactId>xero-java</artifactId>
	<version>4.29.1</version>
	<exclusions>
		<exclusion>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-client</artifactId>
		</exclusion>
		<exclusion>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-multipart</artifactId>
		</exclusion>
		<exclusion>
			<groupId>org.glassfish.jersey.media</groupId>
			<artifactId>jersey-media-json-jackson</artifactId>
		</exclusion>

		<exclusion>
			<groupId>org.glassfish.jersey.core</groupId>
			<artifactId>jersey-common</artifactId>
		</exclusion>
		<exclusion>
			<groupId>org.glassfish.jersey.ext</groupId>
			<artifactId>jersey-entity-filtering</artifactId>
		</exclusion>
	</exclusions>
</dependency>
<dependency>
	<groupId>org.glassfish.jersey.core</groupId>
	<artifactId>jersey-client</artifactId>
	<version>2.27</version>
</dependency>
<dependency>
	<groupId>org.glassfish.jersey.media</groupId>
	<artifactId>jersey-media-multipart</artifactId>
	<version>2.27</version>
</dependency>
<dependency>
	<groupId>org.glassfish.jersey.media</groupId>
	<artifactId>jersey-media-json-jackson</artifactId>
	<version>2.27</version>
</dependency>
<dependency>
	<groupId>org.glassfish.jersey.core</groupId>
	<artifactId>jersey-common</artifactId>
	<version>2.27</version>
</dependency>
<dependency>
	<groupId>org.glassfish.jersey.ext</groupId>
	<artifactId>jersey-entity-filtering</artifactId>
	<version>2.27</version>
</dependency>

dalli98 avatar Feb 08 '24 11:02 dalli98

It looks like xeroapi wants to use jersey 2.27. However, the property is overridden and it uses a newer version which is not compatible

dalli98 avatar Feb 08 '24 11:02 dalli98