Tomcat configuration file catalina.policy related

There is a bug in the old system that has been maintained recently.

The normal file upload cannot be performed. The file upload and download protocol is the smb protocol.

The uploading method of this system is relatively old. The applet upload is referenced on the JSP page, that is, the class class in a jar is called.

 

The main code is as follows:

<object code="AB.class" width="100" height="100">

<param name="java_archive" value="CCC.jar">

<param name="files" value="">

<param name="files" value="">

<param name="files" value="">

</obeject>

 

This jar package is placed in the same folder as the Jsp page

Due to the migration of an application service before, the corresponding document server information address needs to be modified in the AB class

Since there is no source code, the jar package needs to be decompiled to modify the class file, and then recompiled and packaged to replace the original jar

 

Many class files in this jar are low-version jdk, and the class file to be modified has reached jdk1.6 (I have been entangled before whether it is due to the compilation problem of jdk version after modifying the AB file, and there are many follow-up problems)

Since it is difficult to modify the CLASS file in the jar, the method used is for reference:

 

First, decompile the corresponding class to be modified through the decompilation tool JAD or jd-gui, (a lot of errors are found when the entire jar is decompiled, and it is very troublesome to modify) error source code information

Then delete the AB.class file from the CCC.jar through winrar software

Then create a new project in myeclipse, create an AB class with the same name, copy the decompiled information into it, and reference CCC.jar in the project

Modify the corresponding source code AB.java

Then jar the project as CCC.jar with the same name through FAT jar (plug-in for jar package)

 

 

After the jar package is successfully typed, it is found that various errors will occur during runtime,

Such as

java.security.AccessControlException : access denied (java.util.PropertyPermission *.* read)错误

java applet  java.lang.System.property (Unknown Source)

mistake

I have been checking all the time, and have been guided by modifying the configuration file in jre and adding digital signatures on the server side. After checking for a long time, there is no result.

 

It suddenly occurred to me that I had done application server migration before, so I compared the configuration of tomcat on the old server and the new server to see if they were consistent.

(Although the version is the same, the tomcat of the new service is installed by itself, and the tomcat on the old server is made by many people before)

It is found that there are differences in the tomcat/conf/catalina.policy file. There is a configuration on the old server.

在grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar"{

 

}

新增 permission java.security.AllPermission;  

After adding this piece of information, the problem is solved.

Visually, it should be released to the highest authority.

The specific reason may need to study the information of the tomcat configuration file again, ask the experts to answer and inform, and hope to help other small partners.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326853070&siteId=291194637
Recommended