Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

不使用sofa boot,使用spring boot parent,依赖tracer-sofa-boot-starter时启动报错 #448

Open
dkwdjq opened this issue Aug 20, 2021 · 6 comments
Labels
waiting for feedback waiting for feedback

Comments

@dkwdjq
Copy link

dkwdjq commented Aug 20, 2021

公司内部项目无法替换依赖的parent为sofa boot,只能使用spring boot parent,在这种情况下想要使用tracer-sofa-boot-starter,怎么解决

@nobodyiam
Copy link
Member

I think you could import sofaboot-dependencies in dependencyManagement, e.g.

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>com.alipay.sofa</groupId>
        <artifactId>sofaboot-dependencies</artifactId>
        <version>${sofa.boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

@glmapper
Copy link
Contributor

@dkwdjq can you provide more info for this issue, such as exception stack.

@glmapper glmapper added the waiting for feedback waiting for feedback label Nov 12, 2021
@vacuityv
Copy link

vacuityv commented Jun 5, 2023

有办法解决吗

@khotyn
Copy link
Member

khotyn commented Jun 5, 2023

@vacuityv 参考前面 @nobodyiam 反馈的方式试一下,如果有问题的话,可以把错误信息贴到这里。

@vacuityv
Copy link

vacuityv commented Jun 8, 2023

错误信息如下:
[2023-06-08 14:59:37.252] [TID: N/A] [,] [ERROR] - org.springframework.boot.SpringApplication.reportFailure(SpringApplication.java:821) - Application run failed
java.lang.NoSuchMethodError: org.springframework.boot.context.event.ApplicationEnvironmentPreparedEvent.(Lorg/springframework/boot/SpringApplication;[Ljava/lang/String;Lorg/springframework/core/env/ConfigurableEnvironment;)V
at com.alipay.sofa.boot.listener.SofaBootstrapRunListener.onApplicationEvent(SofaBootstrapRunListener.java:130) ~[sofa-boot-3.10.0.jar:3.10.0]
at com.alipay.sofa.boot.listener.SofaBootstrapRunListener.onApplicationEvent(SofaBootstrapRunListener.java:51) ~[sofa-boot-3.10.0.jar:3.10.0]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-5.3.15.jar:5.3.15]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-5.3.15.jar:5.3.15]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-5.3.15.jar:5.3.15]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) ~[spring-context-5.3.15.jar:5.3.15]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) ~[spring-boot-2.6.3.jar:2.6.3]
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) ~[spring-boot-2.6.3.jar:2.6.3]
at java.util.ArrayList.forEach(ArrayList.java:1259) ~[?:1.8.0_312]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) ~[spring-boot-2.6.3.jar:2.6.3]
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) ~[spring-boot-2.6.3.jar:2.6.3]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) ~[spring-boot-2.6.3.jar:2.6.3]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:338) [spring-boot-2.6.3.jar:2.6.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) [spring-boot-2.6.3.jar:2.6.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1303) [spring-boot-2.6.3.jar:2.6.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1292) [spring-boot-2.6.3.jar:2.6.3]

各位大佬有空帮忙看下 @khotyn

@nobodyiam
Copy link
Member

@vacuityv this was solved via sofastack/sofa-boot#944, you may use more recent versions, e.g. 3.18.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback waiting for feedback
Projects
None yet
Development

No branches or pull requests

5 participants