Amit,

On 11/3/24 22:48, Amit Pande wrote:
Thank you, Chris, for quick response.

I am trying to play with the scan/skip values.

https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/event/EventListener.html
Does this @EventListener Spring annotation get affected by this 
pluggabilitySkip setting?

I believe if you disable jar scanning, then Tomcat will ignore all annotations for things like Listeners that should be running on startup.

-chris

-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Sunday, November 3, 2024 3:39 PM
To: Tomcat Users List <users@tomcat.apache.org>
Subject: Re: pluggabilitySkip JarScanFilter and JMX calls


CAUTION: This email originated from outside the organization. Do not click 
links or open attachments unless you recognize the sender and know the content 
is safe. If you believe this is a phishing email, use the Report to 
Cybersecurity icon in Outlook.



Amit,

On 11/3/24 11:56 AM, Amit Pande wrote:
Hello,

I have been experimenting with the JarScanFilter setting to boost the 
application deployment time.

     <JarScanner scanClassPath="true" scanBootstrapClassPath="true">
          <JarScanFilter pluggabilitySkip="*.jar" tldSkip="*.jar" 
defaultTldScan="false" />
      </JarScanner>

When I add this:
JarScanFilter pluggabilitySkip="*.jar"

The JMX calls stopped working. E.g. I am seeing:

javax.management.InstanceNotFoundException: 
Catalina_Web_Services:j2eeType=WebModule,name=//localhost/mywebapp,J2EEApplication=none,J2EEServer=none
          at 
java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(Unknown
 Source) ~[?:?]
          at 
java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(Unknown
 Source) ~[?:?]
          at 
java.management/com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(Unknown 
Source) ~[?:?]
          at com.myapp.findMBeanState(MyTest.java:124) ~[myapp.jar:?]

Am I missing some additional configuration?

Appreciate the help.

The JarScanner does more than it looks like it does. I'm guessing that you have 
a component that uses something like annotation-based 
SomethingSomethingListener and that component is not being found and 
initialized when the application starts.

That component probably registers your MBean with the local JMX server.

Try being more restrictive with your pluggability-skipping. You might want to search all 
your JAR files for "*Listener.class" and let those JARs continue to be 
processed.

-chris


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to