When a system is deployed on weblogic12.2.1.3, it reports an error “IllegalStateException zip file closed”. When it is deployed on weblogic12.2.1.2, it does not report an error and can be accessed normally.

Problem phenomenon

When a system is deployed on weblogic12.2.1.3, it reports an error “IllegalStateException zip file closed”. When it is deployed on weblogic12.2.1.2, it does not report an error and can be accessed normally.

Problem analysis

You can find the clear reason on the official website through the error report. The main reason is a bug in Weblogic. Because the application jar file is closed silently due to inactivity, because the jarfile class implements the autoclosable interface, and jarurlhandler does not handle this exception at present, this error is reported. Therefore, it is repaired through patch 27774698. The repair principle is to add a catch block to handle exceptions, And reopen the jar file when there is an IllegalStateException.

In addition, the official suggestion is to apply this patch only when reporting this error. It is not necessary to apply this patch to every system.

Problem continuation

       The above problems are solved by patching 27774698, and the deployment application reports an error error creating bean with name ‘wsrmsafregistrationservice’. After that, you can see that spring is initializing bean and wsrmsafregistrationservice in the log, but its full class name is com.oracle.webservices.impl.wls.wsrmsafregistrationservice, which is used internally, @ inject @ named (“safserverservice”), private SAFServerService safServerService; Therefore, when spring does autowire automatic link, it scans the classes inside Weblogic. This scanning should not occur. Therefore, spring autowire filter should be added to the code to avoid scanning the classes inside Weblogic. For the specific adding method, see the official website link doc ID 2397321.1.

Problem handling

       The problem of “IllegalStateException zip file closed” is solved by patching 27774698. After the application code is changed and the spring autowire filter is added, the application is successfully deployed and can be accessed normally. This problem is solved!

Read More: