Jdk.vm.ci.services.Services ClassNotFoundException при использовании GraalJsExpressionHandler Spring-pug4j ⇐ JAVA

Программисты JAVA общаются здесь
Anonymous
Jdk.vm.ci.services.Services ClassNotFoundException при использовании GraalJsExpressionHandler Spring-pug4j

Сообщение Anonymous »

Я новичок в использовании Spring-pug4j и следовал инструкциям на их странице.
Я создал класс Configuration следующим образом:

Код: Выделить всё

package com.xxxx.xxx.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.ViewResolver;

import de.neuland.pug4j.PugConfiguration;
import de.neuland.pug4j.spring.template.SpringTemplateLoader;
import de.neuland.pug4j.spring.view.PugViewResolver;

@Configuration
public class PugConfig {

@Bean
public SpringTemplateLoader templateLoader() {
SpringTemplateLoader templateLoader = new SpringTemplateLoader();
templateLoader.setTemplateLoaderPath("classpath:/templates");
templateLoader.setEncoding("UTF-8");
templateLoader.setSuffix(".pug");
return templateLoader;
}

@Bean
public PugConfiguration pugConfiguration() {
PugConfiguration configuration = new PugConfiguration();
configuration.setCaching(false);
configuration.setTemplateLoader(templateLoader());
configuration.setExpressionHandler(new GraalJsExpressionHandler());
return configuration;
}

@Bean
public ViewResolver viewResolver() {
PugViewResolver viewResolver = new PugViewResolver();
viewResolver.setConfiguration(pugConfiguration());
return viewResolver;
}
}
Но когда я попытался скомпилировать его, я получил большую ошибку maven, сообщающую мне:

Код: Выделить всё

...
Caused by: java.lang.ClassNotFoundException: jdk.vm.ci.services.Services
...
Я использую следующую зависимость:

Код: Выделить всё

        
de.neuland-bfi
spring-pug4j
3.2.0

Я должен сказать, что этот способ работает нормально (комментируя «configuration.setExpressionHandler(new GraalJsExpressionHandler())»):
@Configuration
публичный класс PugConfig {

Код: Выделить всё

    @Bean
public SpringTemplateLoader templateLoader() {
SpringTemplateLoader templateLoader = new SpringTemplateLoader();
templateLoader.setTemplateLoaderPath("classpath:/templates");
templateLoader.setEncoding("UTF-8");
templateLoader.setSuffix(".pug");
return templateLoader;
}

@Bean
public PugConfiguration pugConfiguration() {
PugConfiguration configuration = new PugConfiguration();
configuration.setCaching(false);
configuration.setTemplateLoader(templateLoader());
//configuration.setExpressionHandler(new GraalJsExpressionHandler());
return configuration;
}

@Bean
public ViewResolver viewResolver() {
PugViewResolver viewResolver = new PugViewResolver();
viewResolver.setConfiguration(pugConfiguration());
return viewResolver;
}
}
Почему это происходит?
Есть ли какое-нибудь решение?
Заранее спасибо.

Подробнее здесь: https://stackoverflow.com/questions/790 ... xpressionh

Вернуться в «JAVA»