Error when adding security-oauth2-starter dependency in Jmix 1.7.0 with JDK 11

I created a new project using Jmix version 1.7.0 with JDK 11. However, when I add the following dependency:
implementation ‘io.jmix.security:jmix-security-oauth2-starter’

I get the following exception:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration’: Unsatisfied dependency expressed through method ‘setFilterChains’ parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘sec_AuthorizationServerSecurityFilterChain’ defined in class path resource [io/jmix/securityoauth2/config/AuthorizationServerSecurityConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method ‘securityFilterChain’ threw exception; nested exception is java.lang.RuntimeException: javax.xml.bind.JAXBException: Implementation of JAXB-API has not been found on module path or classpath.

Question:
How can I resolve this JAXBException? Is there an additional dependency required for JDK 11 compatibility?

Hi,

Please use Jmix 1.7.1.

Regards,
Ivan

Hi ,
Thank you for suggesting an upgrade to Jmix 1.7.1. However, I have other projects running on 1.7.0, and upgrading might introduce inconsistencies.

  1. Is there a workaround to use jmix-security-oauth2-starter in 1.7.0 without encountering the JAXBException?
  • For example, would manually adding JAXB dependencies (e.g., javax.xml.bind:jaxb-api) resolve this?
  1. If not, are there alternative approaches to implement OAuth2 security in 1.7.0?
  • Could a different dependency or configuration be used temporarily?

I’d prefer to avoid upgrading just one project while others remain on 1.7.0. Any guidance would be appreciated!

The only change that comes with 1.7.1 is the fix for that issue.
That’s the purpose of that patch.

Regards,
Ivan