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

Tomcat Probe issues - Tomcat 9.0.85 with JDK 17 #3153

Open
khravi1979 opened this issue Mar 4, 2024 · 10 comments
Open

Tomcat Probe issues - Tomcat 9.0.85 with JDK 17 #3153

khravi1979 opened this issue Mar 4, 2024 · 10 comments
Assignees

Comments

@khravi1979
Copy link

Hi All,

We are using Tomcat 9.0.85 version with JDK 17 (17.0.10). Tomcat is running fine while launching Probe, we are getting this error,

"Application encountered an unexpected error. Please check the Tomcat logs. We will greatly appreciate it if you share the information with us. Sharing this information through our issue tracker or our discussion board will help us find and correct this problem as soon as possible!"

In the logs, we see this error,

04-Mar-2024 14:20:37.721 SEVERE [main] org.apache.catalina.core.ApplicationContext.log Servlet.init() for servlet [probe] threw exception
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'handlerMapping' defined in ServletContext resource [/WEB-INF/spring-probe-servlet.xml]: Initi
alization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/appruntimeinfo.ajax' defined in ServletContext resourc
e [/WEB-INF/spring-probe-controllers.xml]: Cannot resolve reference to bean 'statsCollection' while setting bean property 'statsCollection'; nested exception is org.springframework.beans.fa
ctory.BeanCreationException: Error creating bean with name 'statsCollection' defined in ServletContext resource [/WEB-INF/spring-probe-stats.xml]: Invocation of init method failed; nested e
xception is java.lang.ExceptionInInitializerError

Kindly help us in fixing this issue.

@hazendaz
Copy link
Member

hazendaz commented Mar 4, 2024 via email

@khravi1979
Copy link
Author

khravi1979 commented Mar 4, 2024 via email

@khravi1979
Copy link
Author

we are seeing a strange issue with probe on Tomcat 9.0.85. after restart of tomcat, probe URL gives this below attached error (image attached)
probe

But if we remove probe folder in webbapps and refresh probe URL, the URL is coming OK.

Kindly let us know how to fix this issue.

@hazendaz
Copy link
Member

hazendaz commented Mar 26, 2024 via email

@khravi1979
Copy link
Author

04-Mar-2024 14:20:37.721 SEVERE [main] org.apache.catalina.core.ApplicationContext.log Servlet.init() for servlet [probe] threw exception
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'handlerMapping' defined in ServletContext resource [/WEB-INF/spring-probe-servlet.xml]: Initi
alization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/appruntimeinfo.ajax' defined in ServletContext resourc
e [/WEB-INF/spring-probe-controllers.xml]: Cannot resolve reference to bean 'statsCollection' while setting bean property 'statsCollection'; nested exception is org.springframework.beans.fa
ctory.BeanCreationException: Error creating bean with name 'statsCollection' defined in ServletContext resource [/WEB-INF/spring-probe-stats.xml]: Invocation of init method failed; nested e
xception is java.lang.ExceptionInInitializerError

@hazendaz
Copy link
Member

hazendaz commented Apr 6, 2024

Can you confirm your tomcat configuration files are up to date? I think this is related to the following: NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Tomcat exports all that in their configs. Its needed for the stats stuff to work.

Now I am using a older 9.0.52 but I don't think that ever changed in what they export. So I think that should be looked at. I'll try upgrading this weekend to 9.0.87 for my testing and see if I see any such issues. I've also got a few fixes but not related to that which will get released this weekend for 4.1.5.

@hazendaz hazendaz self-assigned this Apr 6, 2024
@khravi1979
Copy link
Author

We added this in startup script of Tomcat and restarted Tomcat,, the result is the same
we need to remove probe folder inside webapps and then the URL loads fine

@hazendaz
Copy link
Member

If you were missing that from tomcat configs, that tells me you are not up to date with tomcat generally as that isn't our requirement but their own. Could you please take a fresh untouched tomcat and use same jvm and see what you get. I suspect it will simply work. Then you could start checking all your setups to see.

I haven't gotten to test more recent version but last I check the recent versions all have the same settings as I release bundles at my job for secured tomcats and none have lost that setting from core tomcat.

Note that I have released 4.1.5 now. I'd be happy to fix something here if there is an issue but I'm not seeing any issue. I'll try bumping up to newer version to double check as soon as I can but may be a couple weeks. Since this doesn't seem widespread or upvoted, my guess is its some configuration issue with the tomcat instance you have. That is just a guess though based on missing configs tomcat has long had in place.

@khravi1979
Copy link
Author

We have built many instances on Tomcat9 after that, but the issue is still the same.
So, why the PROBE URL works after removing probe directory in webapps?

@hazendaz
Copy link
Member

I cannot answer your specific question. I can only point back to what I noted previously that you were missing setup and if missing that you are likely missing far more. Its important when upgrading that tomcat is in sync with tomcat releases. That isn't something psi probe can help with. I've since upgraded to latest and no issues but note I also updated all the config changes they have had over the years too. There are changes from time to time in tomcat configs, those need adhered to on any upgrades. I haven't run into the issue you are facing otherwise.

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