[daemon] Java method profiling not working under jsvc
Hi, I want to use method profiling with the JDK Mission Control plugin for Eclipse and connect remotely with a Tomcat. I use a default Tomcat installation from https://tomcat.apache.org/download-90.cgi on Rocky 9 and a self-compiled jsvc. When I start the Tomcat with its own start script, I can attach to the JMX port, do a flight record, and see method profiling results. CATALINA_OPTS="-Dcom.sun.management.jmxremote.port=5000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false" && ./catalina.sh run When I start the Tomcat using jsvc, I see all the other values like Threads, Memory, Socket I/O, Exceptions an so on. But Method Profiling is empty. /usr/local/bin/jsvc -nodetach -debug -pidfile ~/jsvc.pid -java-home /usr/lib/jvm/jre-11 -cp /home/tomcat/apache-tomcat-9.0.71/bin/tomcat-juli.jar:/home/tomcat/apache-tomcat-9.0.71/bin/bootstrap.jar -Dcatalina.home=/home/tomcat/apache-tomcat-9.0.71 -Dcom.sun.management.jmxremote.port=5000 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false org.apache.catalina.startup.Bootstrap I noticed a working method profiling when the jsvc launcher process is running with a Tomcat application, which takes some minutes to start. But when the jsvc launcher process finishes, I have no longer any values under Method Profiling. I have no clue, what I'm doing wrong, nor whether it's a problem of jsvc, Tomcat, or Java. Any idea? Ralf - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Update 2: IMAP and OAuth2
It turns out that the commons net IMAP package can do oauth2 style of authentication just fine. I can do this: String userNamePlusAccessToken = combine( username, accessToken ) according to e.g. https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth or https://developers.google.com/gmail/imap/xoauth2-protocol I got the OAuth2 accessToken via use of msal4j: https://github.com/AzureAD/microsoft-authentication-library-for-java Then AuthenticatingIMAPClient aic = new AuthenticatingIMAPClient(true); aic.connect( server ); aic.auth( AuthenticatingIMAPClient.AUTH_METHOD.XOAUTH2, userNamePlusAccessToken, "passwordNotUsed" ); Just wanted this documented should others need to solve same problem. Stuart - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org
Re: Update 2: IMAP and OAuth2
Thank you for sharing your solution Stuart. Gary On Fri, Feb 3, 2023, 14:47 Stuart Maclean wrote: > It turns out that the commons net IMAP package can do oauth2 style of > authentication just fine. I can do this: > > String userNamePlusAccessToken = combine( username, accessToken ) > > according to e.g. > > > https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth > > or > > https://developers.google.com/gmail/imap/xoauth2-protocol > > I got the OAuth2 accessToken via use of msal4j: > > https://github.com/AzureAD/microsoft-authentication-library-for-java > > Then > > AuthenticatingIMAPClient aic = new AuthenticatingIMAPClient(true); > >aic.connect( server ); > > aic.auth( AuthenticatingIMAPClient.AUTH_METHOD.XOAUTH2, > userNamePlusAccessToken, "passwordNotUsed" ); > > Just wanted this documented should others need to solve same problem. > > Stuart > > > > - > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org > For additional commands, e-mail: user-h...@commons.apache.org > >