On 28/07/2019 07:26, Jmeter Tea wrote:
> We are using Tomcat 8.5 *without any hot deploy*,
> I assume that classes are loaded to memory and for example if class change
> in jar it will ignore (not hot deploy)

Correct. But, classes are only loaded as needed. Tomcat does not load
every class in a JAR when the web application starts. And only classes
are loaded into memory. Other resources may be read from the JAR as
required and NOT cached.

> But if we override a jar when application is running it overrides classes
> (or removing it)

Yes, for classes that haven't yet been loaded.

> For example when I copy empty jar it throws ZipException for classes that
> were in the jar:

No, that is not what is happening here. Your code is using the
ServiceLoader which means each JAR's META-INF directory will be searched
for service definitions. The empty JAR file is triggering the error.

> java.lang.IllegalStateException: java.util.zip.ZipException: zip file is empty
>         at 
> org.apache.catalina.webresources.AbstractSingleArchiveResourceSet.getArchiveEntry(AbstractSingleArchiveResourceSet.java:97)
>         at 
> org.apache.catalina.webresources.AbstractArchiveResourceSet.getResource(AbstractArchiveResourceSet.java:260)
>         at 
> org.apache.catalina.webresources.StandardRoot.getResourcesInternal(StandardRoot.java:327)
>         at 
> org.apache.catalina.webresources.CachedResource.validateResources(CachedResource.java:127)
>         at org.apache.catalina.webresources.Cache.getResources(Cache.java:147)
>         at 
> org.apache.catalina.webresources.StandardRoot.getResources(StandardRoot.java:315)
>         at 
> org.apache.catalina.webresources.StandardRoot.getClassLoaderResources(StandardRoot.java:231)
>         at 
> org.apache.catalina.loader.WebappClassLoaderBase.findResources(WebappClassLoaderBase.java:939)
>         at java.lang.ClassLoader.getResources(ClassLoader.java:1142)
>         at 
> java.util.ServiceLoader$LazyIterator.hasNextService(ServiceLoader.java:348)
>         at 
> java.util.ServiceLoader$LazyIterator.hasNext(ServiceLoader.java:393)
>         at java.util.ServiceLoader$1.hasNext(ServiceLoader.java:474)
>         at javax.xml.parsers.FactoryFinder$1.run(FactoryFinder.java:293)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at 
> javax.xml.parsers.FactoryFinder.findServiceProvider(FactoryFinder.java:289)
>         at javax.xml.parsers.FactoryFinder.find(FactoryFinder.java:267)
>         at 
> javax.xml.parsers.DocumentBuilderFactory.newInstance(DocumentBuilderFactory.java:120)
>         at com.MyHelper.createDoc(MyHelper.java:64)
> Can tomcat ignore overridden jar and pull classes from memory only ?


> Is there some sort of built-in hot deploy I'm not aware of?


> Or is it related to issue specific for tomcat with empty jar opening



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

Reply via email to