小编use*_*727的帖子

java.lang.NoSuchMethodError:org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparator()Ljava/util/Comparator;"}}

我正在尝试为我的项目添加spring security.我使用的是Spring 4,我想使用spring security 3.2.我有配置问题:这是我的例外:

Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/root-context.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparator()Ljava/util/Comparator;
    Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring/root-context.xml]; nested exception is java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparator()Ljava/util/Comparator;
    Caused by: java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.getDependencyComparator()Ljava/util/Comparator;"}}
Run Code Online (Sandbox Code Playgroud)

这是项目的依赖树:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building engineering-project-web Maven Webapp 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ engineering-project-web ---
[INFO] com.pawel:engineering-project-web:war:0.0.1-SNAPSHOT
[INFO] +- org.aspectj:aspectjweaver:jar:1.8.0:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.2.3:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.2.3:compile …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc

11
推荐指数
1
解决办法
2万
查看次数

微米跟踪中的 Spring Boot 3 TaskExecutor 上下文传播

Spring Boot 3 改变了跟踪中的上下文传播。 https://github.com/micrometer-metrics/tracing/wiki/Spring-Cloud-Sleuth-3.1-Migration-Guide#async-instrumentation

他们现在提供针对此问题的库。我想我不太明白它是如何工作的。我已经按照指南创建了一个任务执行器。

@Bean(name = "taskExecutor")
    ThreadPoolTaskExecutor threadPoolTaskScheduler() {
        ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor() {
            @Override
            protected ExecutorService initializeExecutor(ThreadFactory threadFactory, RejectedExecutionHandler rejectedExecutionHandler) {
                ExecutorService executorService = super.initializeExecutor(threadFactory, rejectedExecutionHandler);
                return ContextExecutorService.wrap(executorService, ContextSnapshot::captureAll);
            }
        };
        threadPoolTaskExecutor.initialize();
        return threadPoolTaskExecutor;
    }
Run Code Online (Sandbox Code Playgroud)

我已经像这样标记了@Async:

 @Async("taskExecutor")
    public void run() {
        // invoke some service
    }
Run Code Online (Sandbox Code Playgroud)

但上下文不会传播到 taskExecutor 线程中的子上下文。

spring spring-boot micrometer-tracing

6
推荐指数
1
解决办法
7921
查看次数

Hibernate一对多,运算符不存在(bytea =整数)

我试图使用一对多的关系但我因为这个错误而卡住了:

20:17:54,621 INFO  [stdout] (default task-2) Hibernate: select user0_.user_id as user_id1_1_, user0_.nick as nick2_1_, user0_.password as password3_1_ from users user0_

20:17:54,655 INFO  [stdout] (default task-2) Hibernate: select userrole0_.users as users3_1_0_, userrole0_.id as id1_0_0_, userrole0_.id as id1_0_1_, userrole0_.role as role2_0_1_, userrole0_.users as users3_0_1_ from user_roles userrole0_ where userrole0_.users=?

20:17:54,657 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-2) SQL Error: 0, SQLState: 42883
20:17:54,658 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (default task-2) B??D: operator ndoesnt exist: bytea = integer
Run Code Online (Sandbox Code Playgroud)

我不知道为什么我会得到这个例外.我不在bytea任何地方使用运营商.下面,我提供了源代码:

User.java

@Entity
@Table(name = "users")
public class User …
Run Code Online (Sandbox Code Playgroud)

java database hibernate jpa hibernate-mapping

2
推荐指数
1
解决办法
700
查看次数