04019: | ContainerManagerPolicy.xml file corrupted by crash during write |
Category: Container Status: ClosedSeverity: HIGH Reported against release: 0.8 Fixed in release: 0.9.1
PROBLEM:An error occured that caused the container manager to go down
abruptly. During this event the container manager policy file was
corrupted. Subsequent runs of ow.bat returned exceptions.
Stack Trace (from container manager with "container" status and error
logs on):
java.lang.NullPointerException
at com.gd.openwings.policy.core.Sax2ParsingPolicy.writeElements
(Sax2ParsingPolicy.java:672)
at
com.gd.openwings.policy.core.Sax2ParsingPolicy.writePolicyFile
(Sax2ParsingPolicy.java:327)
at com.gd.openwings.policy.core.Sax2ParsingPolicy.savePolicy
(Sax2ParsingPolicy.java:240)
at com.gd.openwings.policy.core.Sax2ParsingPolicy.savePolicy
(Sax2ParsingPolicy.java:212)
at com.gd.openwings.policy.core.Sax2ParsingPolicy.savePolicy
(Sax2ParsingPolicy.java:271)
at
com.gd.openwings.container.manager.ContainerManagerConfiguration.savePol
icy(ContainerManagerConfiguration.java:880)
at
com.gd.openwings.container.manager.ContainerManagerConfiguration.compone
ntUpdated(ContainerManagerConfiguration.java:584)
at
net.openwings.install.InstallListenerConnectorProviderProxyImpl.componen
tUpdated(Unknown Source)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown
Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The next time the Container Manager was started, the following was
output:
**** Sax2ParsingPolicy SAX Processing Message Lvl FATAL ERROR ****
URI = file:/C:/openwings/openwings-
0.9/policies/ContainerManagerPolicy.xml
Line = 4323
Col = 3
Message = The element type "ContainerManagerPolicy" must be
terminated by the matching end-tag "".
**** Sax2ParsingPolicy SAX Processing Message ****
container: ContainerManagerConfiguration.constructor: error loading
ContainerManagerPolicy
org.xml.sax.SAXException: Stopping after fatal error: The element
type "ContainerManagerPolicy" must be terminated by the matching end-
tag "".
at org.apache.xerces.framework.XMLParser.reportError
(XMLParser.java:1040)
at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError
(XMLDocumentScanner.java:634)
at org.apache.xerces.framework.XMLDocumentScanner.abortMarkup
(XMLDocumentScanner.java:683)
at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatc
h(XMLDocumentScanner.java:1187)
at org.apache.xerces.framework.XMLDocumentScanner.parseSome
(XMLDocumentScanner.java:380)
at org.apache.xerces.framework.XMLParser.parse
(XMLParser.java:900)
at org.apache.xerces.framework.XMLParser.parse
(XMLParser.java:939)
at com.gd.openwings.policy.core.Sax2ParsingPolicy.loadPolicy
(Sax2ParsingPolicy.java:140)
at com.gd.openwings.policy.core.SimplePolicyLoader.getPolicy
(SimplePolicyLoader.java:260)
at com.gd.openwings.policy.core.SimplePolicyLoader.getPolicy
(SimplePolicyLoader.java:174)
at
com.gd.openwings.container.manager.ContainerManagerConfiguration.
(ContainerManagerConfiguration.java:66)
at
com.gd.openwings.container.manager.ContainerManagerCore.
(ContainerManagerCore.java:71)
at com.gd.openwings.container.manager.ContainerManagerCore.main
(ContainerManagerCore.java:760)
Exception in thread "main" java.lang.NullPointerException
at
com.gd.openwings.container.manager.ContainerManagerConfiguration.getLoad
BalancerImplementation(ContainerManagerConfiguration.java:272)
at
com.gd.openwings.container.manager.ContainerManagerCore.
(ContainerManagerCore.java:79)
at com.gd.openwings.container.manager.ContainerManagerCore.main
(ContainerManagerCore.java:760)ANALYSIS:There must be a failsafe way of saving and recovering the container
manager file. If a corrupted cm policy is found the cm should create a
new one that still works (perhaps just copying the original).
One recommendation to prevent file corruption is to write to a
temporary file and then copy the file over to the official location.
This is a potential problem for policies in general. |