debugging a jsp webapp through intellij: static resources not found

Answered

I'm running airsonic-advanced in IntelliJ: it's a spring boot app with a jsp frontend running in an embedded tomcat server. although the application starts up fine, none of the static content (images, css etc.) is being served.

The directory structure is:

webapp

  • icons
  • script
  • style
  • WEB-INF/jsp

the application.properties file has:

spring.mvc.view.prefix=/WEB-INF/jsp/

Looking at stack overflow, i tried adding

spring.web.resources.static-locations=webapp (tried both relative and absolute path)

That didn't help. any ideas on how to get this working?

Thanks!

0
6 comments

Does it work correctly if you start it via Maven outside of IntelliJ IDEA?

What run/debug configuration do you use in the IDE to start it?

0
Avatar
Permanently deleted user

Good point. I tried 'mvn package' and then running with the airsonic.war, and it has the same issue. So it's nothing to do with running it through IntelliJ. 

Then i downloaded the airsonic.war from github and tried running with that, and still the same issue.

their war worked fine on my raspberry pi, but is having issues on my macbook. perhaps because my pi already has apache running, and my mac doesn't? i think this stems from a fundamental gap in my understanding of web servers.

any ideas on where i should take this question? 

0

How do you run it on the app server? What app server version do you use?

0
Avatar
Permanently deleted user

I chose the standalone option that has an embedded tomcat server. the logs say the version is

Apache Tomcat/9.0.48

0

No idea, please ask at https://stackoverflow.com/ or contact the project maintainers for help.

1
Avatar
Permanently deleted user

Quick update: i don't know what happened, but after restarting my laptop last night, today everything works perfectly - on the command line, or through IntelliJ. note to myself: restart laptop as first attempt to fix anything.

0

Please sign in to leave a comment.