A class of Class modifications in WebLogic Classes, hot deployment

xiaoxiao2021-03-06  117

A measures ensure this, it is recommended to use it during the development process:

STARTWEBLOGIC.CMD:

SET StartMode = FALSE

2. Web.xml:

Logina

/ servlet / loginchecka

0

3. WebLogic.xml:

Pagecheckseconds

0

4.Make Sure That Your Servlet Classes Are Not in Your ClassPath Which Can Cause This Problem.

5. In WLS Console, in the Files page of the web app, set to 1

----------------------------

Oh, let me say the principle. WebLogic allows new versions of components to be deployed at WLS runtime. This process is called hot deployment. Because Java ClassLoader does not have any mechanism to remove a series of existing classes, you can't use the new version of the class to replace the old version. In order to update the associated class in a running virtual machine, ClassLoad must be replaced. When it is replaced, all of which it is loaded, and derived son ClassLoader should be reloaded. All instances of these classes must also be reloaded. In WLS, each application component has a hierarchical ClassLoaders, which are subclasses of System ClassLoader, which helps part of each application or application can be reloaded separately without other Component. So we just understand this principle, similar confusion is also solved. :-)

-------------------------------------

Thanks to the answer.

Since you said the principle, I want to ask some questions, you said, "In order to update the associated class in a running virtual machine, ClassLoader must be replaced." You only said that the result is not said. ClassLoader is replaced by each running Class, or it is decided to replace it after being modified?

For example, JSP will compile into servlet, I have modified JSP, and WebLogic will compare the current JSP and it is consistent with the servlet it compile. If it is inconsistent, recompile (I guess, please correct). But Class is different. For example, I have changed it directly, I copied it directly to cover the original coverage, what is it compared? It is time or whether there is anyone modified it, I know that we will modify the redeploy file, WebLogic will automatically deploy.

There is also a problem, such as the servlet we have made to parse an XML, if my XML adds some new things, I think if I don't start, WebLogic will not resolve this XML.

A little bit of drill angular tip, please guide the bamboo.

----------------------------------------

To: zhouhg

You said 4th:

4. Make Sure That Your Servlet Classes Are Not in Your ClassPath Which Can Cause This Problem. (Translate) If your servlet class is not in your ClassPath path, it may also cause this problem) I don't know if the translation is. Didn't understand, what you said is that, it is WebLogic startup

Classpath? If so, why do you need to put it there, not in web.xml, WebLogic boot will load this servlet,

Can you specifically explain it.

Thank you!

-----------------------------------

The first question: Is the reason not?

"Because Java ClassLoader does not have any mechanism to remove a series of existing classes, you can't use new versions of the class to replace the old version."

This is determined by the JVM itself.

Second question: The dynamic loading principle of the servlet is as follows

When a servlet responds to HTTP requests, WLS first checks the timestamp of this Servlet class, compares the timestamp of the servlet class in the memory. Once it is found to be a new version, WLS will automatically reload all Servlet classes that currently this webApp, we can set the interval timestamp of the WLS checking the timestamp through the servlet reload property. If set to -1, you never check (for product mode), set to 0, check it in each request.

The third question: Of course not. XML data source changes naturally do not affect ClassLoader

----------------------------------

Explain again:

What I said the first and fourth point is premise, the second point is for servlet, the third point is for JSP,

The fifth point is incorporated, second, three points, is for JSP and servlet.

----------------------------------

Because the location of the Class of JSP / Servlet is dynamically added to the ClassPath after the WLS startup, if the JSP / Servlet's Class's directory has been added to the classpath, then you lose the dynamic update ability, because WLS has found this class in static classpath, and it certainly doesn't go to LOAD once again.

Regarding the issue of updating, it is basically that you understand it. As yanglf911 said, JVM ClassLoader has determined this limiter. However, there are two possibilities, one is all HOT Deploys that depend on WLS, which is the hot deploy of Web Application and EJB. You only do JSP / servlet javabean's implementation, or use EJB's Client-Jar to package all of your EJBs needed together. One is based on collaborative development, like you use JDK, or use log4j, these things are relatively stable, and the version changes will not be much, and it will not cause your system frequently. When you design your own system, you should also manage the system's modules and levels. Don't update your interface, you should pre-design well, use some own analysis design capabilities, change must be tested in your own test environment, formation The stable version is released to other systems, the module is used. This can also solve some problems. What we use is the second.

---------------------------

转载请注明原文地址:https://www.9cbs.com/read-102526.html

New Post(0)