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

bugfix: fix loader path in startup scripts #5010

Closed
wants to merge 5 commits into from
Closed

bugfix: fix loader path in startup scripts #5010

wants to merge 5 commits into from

Conversation

neillee95
Copy link
Contributor

@neillee95 neillee95 commented Oct 21, 2022

  • I have registered the PR changes.

Ⅰ. Describe what this PR did

Following this doc to deloy server directly, server startup failed with command

sh ./bin/seata-server.sh

stack trace as following

Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
	at io.seata.server.ServerApplication.main(ServerApplication.java:30)
	... 8 more
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
	at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 9 more

jars in lib are not loaded by spring boot loader.
In bin/seata-server.sh, loader path is relative, it means that server must be startup under bin directory or set LOADER_PATH.
This pr replaces the relative path to absolute path.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

Copy link
Member

@slievrly slievrly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@slievrly
Copy link
Member

@neillee95 does the bat script have the same problem?

@neillee95
Copy link
Contributor Author

@neillee95 does the bat script have the same problem?

i think so, but i have not tried

@neillee95
Copy link
Contributor Author

@neillee95 does the bat script have the same problem?

i think so, but i have not tried

i tried, it is

Copy link
Contributor

@funky-eyes funky-eyes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Please register the pr to develop.md https://github.com/seata/seata/tree/develop/changes

@codecov-commenter
Copy link

Codecov Report

Merging #5010 (f3f1f79) into develop (f56b02c) will increase coverage by 0.36%.
The diff coverage is 85.71%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #5010      +/-   ##
=============================================
+ Coverage      48.81%   49.18%   +0.36%     
- Complexity      4079     4098      +19     
=============================================
  Files            733      733              
  Lines          25951    25958       +7     
  Branches        3199     3202       +3     
=============================================
+ Hits           12669    12767      +98     
+ Misses         11933    11833     -100     
- Partials        1349     1358       +9     
Impacted Files Coverage Δ
.../main/java/io/seata/config/ConfigurationCache.java 74.07% <85.71%> (+0.80%) ⬆️
...ource/sql/struct/cache/AbstractTableMetaCache.java 72.41% <0.00%> (-17.25%) ⬇️
...r/console/impl/file/GlobalLockFileServiceImpl.java 94.87% <0.00%> (-2.57%) ⬇️
.../java/io/seata/spring/util/TCCBeanParserUtils.java 30.64% <0.00%> (-1.62%) ⬇️
...very/registry/zk/ZookeeperRegisterServiceImpl.java 61.02% <0.00%> (-0.74%) ⬇️
...erver/storage/file/session/FileSessionManager.java 49.04% <0.00%> (+0.63%) ⬆️
...rage/redis/store/RedisTransactionStoreManager.java 67.23% <0.00%> (+1.13%) ⬆️
...c/main/java/io/seata/server/store/StoreConfig.java 62.16% <0.00%> (+2.70%) ⬆️
.../java/io/seata/server/coordinator/DefaultCore.java 47.92% <0.00%> (+2.95%) ⬆️
...o/seata/server/coordinator/DefaultCoordinator.java 47.75% <0.00%> (+3.26%) ⬆️
... and 3 more

@neillee95 neillee95 changed the title bugfix: fix loader path in bin/seata-server.sh bugfix: fix loader path in startup scripts Oct 24, 2022
@funky-eyes
Copy link
Contributor

You seem to have other pr's mixed in with your code, please take them out

@neillee95 neillee95 closed this by deleting the head repository Oct 24, 2022
@neillee95 neillee95 reopened this Oct 24, 2022
@slievrly
Copy link
Member

  1. git pull seata/seata develop
  2. git push neillee95/seata develop

@slievrly
Copy link
Member

@neillee95 please update your origin branch.

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

Successfully merging this pull request may close these issues.

None yet

4 participants