You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Does Jython 2.7.4 Use Package Scanning In Log4j2? #377
I use jython in a Tomcat servlet webapp. I upgraded from Jython 2.7.2 to 2.7.4 to make sure that the webapp still works, which it does. But I now get a warning message in Tomcat's log file that says that package scanning is deprecated:
main WARN The use of package scanning to locate plugins is deprecated and will be removed in a future release
My own code does not use scanning. Jython does use log4j2 for "internal" logging. Does jython 2.7.4 configure log4j2 to use package scanning? If so, can it be changed not to use it?
I was unable to find, in the jython.jar file, how logging is configured. I assume that happens during the ant build task.
[Later] I see that the log4j2 classes are all in the netty jar. Does Jython actually use netty's logging? If so, what gets logged?
It doesn't consciously use log4j, only j.u.l. Netty logs things extensively, so I'm not surprised there may be references in there.
However, it does scan packages to build a database that makes Java packages look like Python packages. This is so that java.util.List, for example, can be found by attribute access. I think it scans all the JARs it can find.
I don't understand the connection between the two questions.
I had only found a reference to Log4j2 potentially scanning packages. The deprecation message I got in a Tomcat log warned that scanning packages to "locate plugins" would be removed in some future version. My concern is that my Jython servlet webapp might stop working in that future version.
OTOH, the deprecation message sounds closely related to Tomcat operations, not the Jython-based servlet webapp. So I will have to learn more.
BTW, my application uses java servlets that instantiate Jython classes as POJOs that do most of the work. This approach works really well and is much easier to write and develop than using all java would be.
Activity
jeff5 commentedon Apr 22, 2025
It doesn't consciously use log4j, only j.u.l. Netty logs things extensively, so I'm not surprised there may be references in there.
However, it does scan packages to build a database that makes Java packages look like Python packages. This is so that
java.util.List, for example, can be found by attribute access. I think it scans all the JARs it can find.I don't understand the connection between the two questions.
tbpassin commentedon Apr 22, 2025
I had only found a reference to Log4j2 potentially scanning packages. The deprecation message I got in a Tomcat log warned that scanning packages to "locate plugins" would be removed in some future version. My concern is that my Jython servlet webapp might stop working in that future version.
OTOH, the deprecation message sounds closely related to Tomcat operations, not the Jython-based servlet webapp. So I will have to learn more.
BTW, my application uses java servlets that instantiate Jython classes as POJOs that do most of the work. This approach works really well and is much easier to write and develop than using all java would be.