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

Specif CLASSPATH setting instructions would be beneficial #84

Closed
hisashiyamaguchi opened this issue Feb 14, 2021 · 3 comments
Closed

Specif CLASSPATH setting instructions would be beneficial #84

hisashiyamaguchi opened this issue Feb 14, 2021 · 3 comments

Comments

@hisashiyamaguchi
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I'm trying to play the tutorial, and getting an error here. The error tells me that "identity.jks" is not found, and I believe I should set CLASSPATH environmental valuable before executing mvn command. If specific instructions are noted on RM, that would be appreciated.

$ mvn spring-boot:run
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-02-14 23:31:39.633 ERROR 26546 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:identity.jks'
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:582) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1311) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1300) ~[spring-boot-2.4.2.jar:2.4.2]
	at nl.altindag.server.App.main(App.java:10) ~[classes/:na]
Caused by: org.springframework.boot.web.server.WebServerException: Could not load key store 'classpath:identity.jks'
	at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSslKeyStore(SslConnectorCustomizer.java:132) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSsl(SslConnectorCustomizer.java:92) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.customize(SslConnectorCustomizer.java:57) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.customizeSsl(TomcatServletWebServerFactory.java:349) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.customizeConnector(TomcatServletWebServerFactory.java:327) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory.getWebServer(TomcatServletWebServerFactory.java:192) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:181) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:159) ~[spring-boot-2.4.2.jar:2.4.2]
	... 9 common frames omitted
Caused by: java.io.FileNotFoundException: class path resource [identity.jks] cannot be resolved to URL because it does not exist
	at org.springframework.util.ResourceUtils.getURL(ResourceUtils.java:137) ~[spring-core-5.3.3.jar:5.3.3]
	at org.springframework.boot.web.embedded.tomcat.SslConnectorCustomizer.configureSslKeyStore(SslConnectorCustomizer.java:129) ~[spring-boot-2.4.2.jar:2.4.2]
	... 16 common frames omitted

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.334 s
[INFO] Finished at: 2021-02-14T23:31:39Z
[INFO] Final Memory: 13M/32M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.4.2:run (default-cli) on project server-with-spring-boot: Application finished with exit code: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I'm guessing the following .jars should be on my CLASSPATH, but if you gave me which ones should be, that would be great.

$ find . -name '*.jar' -print
./.mvn/wrapper/maven-wrapper.jar
./common-server-utils/target/common-server-utils-1.0-SNAPSHOT.jar
./server-with-jersey-grizzly/target/server-with-jersey-grizzly-1.0-SNAPSHOT.jar
./server-with-jersey-grizzly/target/server.jar
./server-with-spring-boot/target/server-with-spring-boot-1.0-SNAPSHOT.jar
./server-with-spring-boot/target/server.jar
./server-with-sun-httpserver/target/server-with-sun-httpserver-1.0-SNAPSHOT.jar
./server-with-sun-httpserver/target/server.jar
./shared-server-resources/target/shared-server-resources-1.0-SNAPSHOT.jar
@Hakky54
Copy link
Owner

Hakky54 commented Feb 15, 2021

The spring boot server has a dependency on the shared-server-resources module within the project.

That maven module is also used by the other servers to prevent code duplication.

If you create your server keystores (the identity.jks and truststore.jks) within that module and rebuild only that module than the spring server should work. Can you retry and share the results?

You can rebuild the shared-server-resources module with the following command from the root directory:

mvn -pl shared-server-resources clean install

@Hakky54
Copy link
Owner

Hakky54 commented Feb 23, 2021

@hisashiyamaguchi any updates from your side regarding this topic, is the issue still present?

@hisashiyamaguchi
Copy link
Author

Thanks for the follow-up. After doing mvn -pl shared-server-resources clean install, it's working fine now!

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

No branches or pull requests

2 participants