[ http://issues.apache.org/jira/browse/GERONIMO-1996?page=all ]
John Sisson updated GERONIMO-1996:
----------------------------------
Summary: Error during deployment may result in files not being cleaned up
properly (was: Serialization failure during deployment leaves a config.ser in
the repository but doesn't write a config.info causing problems later.)
> Error during deployment may result in files not being cleaned up properly
> -------------------------------------------------------------------------
>
> Key: GERONIMO-1996
> URL: http://issues.apache.org/jira/browse/GERONIMO-1996
> Project: Geronimo
> Issue Type: Bug
> Security Level: public(Regular issues)
> Components: deployment
> Affects Versions: 1.1
> Reporter: John Sisson
> Assigned To: John Sisson
> Fix For: 1.2, 1.1.1
>
> Attachments: jira-g-1996.zip
>
>
> h1. Problem
> If an Error (java.lang.Error and its subclasses) occurs during deployment and
> the deployment operation fails it may not be possible to redeploy.
> h1. Symptom
> Example of exception during serialization phase of deployment:
> {code}
> java.lang.ClassCastException
> at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
> at org.apache.xerces.parsers.DOMParser.<init>(Unknown Source)
> at com.foo.common.xml.XMLNode.loadXML(XMLNode.java:534)
> at com.foo.common.xml.XMLNode.loadXML(XMLNode.java:520)
> <SNIP>
> at com.foo.server.ejb.Bar.<clinit>(FooBean.java:104)
> at java.io.ObjectStreamClass.hasStaticInitializer(Native Method)
> at
> java.io.ObjectStreamClass.computeDefaultSUID(ObjectStreamClass.java:1557)
> at java.io.ObjectStreamClass.access$100(ObjectStreamClass.java:47)
> <SNIP>
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
> at
> org.apache.geronimo.gbean.GBeanData.writeExternal(GBeanData.java:186)
> at
> org.apache.geronimo.kernel.config.SerializedGBeanState.storeGBeans(SerializedGBeanState.java:139)
> at
> org.apache.geronimo.kernel.config.SerializedGBeanState.writeObject(SerializedGBeanState.java:92)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:324)
> at
> java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
> at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
> at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
> at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
> at
> java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
> at
> java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
> at
> java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
> at
> java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
> at
> org.apache.geronimo.kernel.config.SerializedConfigurationMarshaler.writeConfigurationData(SerializedConfigurationMarshale
> r.java:66)
> at
> org.apache.geronimo.kernel.config.ConfigurationUtil.writeConfigurationData(ConfigurationUtil.java:163)
> at
> org.apache.geronimo.system.configuration.ExecutableConfigurationUtil.writeConfiguration(ExecutableConfigurationUtil.java:
> 149)
> at
> org.apache.geronimo.system.configuration.RepositoryConfigurationStore.install(RepositoryConfigurationStore.java:318)
> at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:308)
> at org.apache.geronimo.deployment.Deployer.deploy(Deployer.java:119)
> {code}
> When restarting Geronimo after a deployment that failed during serialization
> you may see the following exception:
> {code}
> ERROR [RepositoryConfigurationStore] Unable to load ConfigurationInfo for
> com.acme.foo/foo-server-plus/3.4.060322-SNAPSHOT/ear
> java.io.FileNotFoundException:
> C:\test\geronimo-1.1-SNAPSHOT\repository\com\acme\foo\foo-server-plus\3.4.060322-SNAPSHOT\
> foo-server-plus-3.4.060322-SNAPSHOT.ear\META-INF\config.info (The system
> cannot find the file specified)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:106)
> at
> org.apache.geronimo.system.configuration.RepositoryConfigurationStore.loadConfigurationInfo(RepositoryConfigurationStore.
> java:401)
> at
> org.apache.geronimo.system.configuration.RepositoryConfigurationStore.listConfigurations(RepositoryConfigurationStore.jav
> a:375)
> {code}
> Error if you attempt to undeploy the configuration you get:
> {code}
> 11:04:27,699 ERROR [RepositoryConfigurationStore] Unable to load
> ConfigurationInfo for com.acme.foo/foo-server-plus/3.4.0
> 60322-SNAPSHOT/ear
> java.io.FileNotFoundException:
> C:\test\geronimo-1.1-SNAPSHOT\repository\com\acme\foo\foo-server-plus\3.4.060322-SNAPSHOT\
> foo-server-plus-3.4.060322-SNAPSHOT.ear\META-INF\config.info (The system
> cannot find the file specified)
> at java.io.FileInputStream.open(Native Method)
> at java.io.FileInputStream.<init>(FileInputStream.java:106)
> at
> org.apache.geronimo.system.configuration.RepositoryConfigurationStore.loadConfigurationInfo(RepositoryConfigurationStore.
> java:401)
> at
> org.apache.geronimo.system.configuration.RepositoryConfigurationStore.listConfigurations(RepositoryConfigurationStore.jav
> a:375)
> at
> org.apache.geronimo.system.configuration.RepositoryConfigurationStore$$FastClassByCGLIB$$968bf00c.invoke(<generated>)
> at net.sf.cglib.reflect.FastMethod.invoke(FastMethod.java:53)
> at
> org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethodInvoker.java:38)
> at
> org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:122)
> at
> org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:817)
> at
> org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
> at
> org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
> at
> org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
> at
> org.apache.geronimo.kernel.config.ConfigurationStore$$EnhancerByCGLIB$$63a4331e.listConfigurations(<generated>)
> at
> org.apache.geronimo.kernel.config.SimpleConfigurationManager.listConfigurations(SimpleConfigurationManager.java:171)
> at
> org.apache.geronimo.kernel.config.SimpleConfigurationManager.listConfigurations(SimpleConfigurationManager.java:164)
> {code}
> h1. Cause
> If an Error (java.lang.Error and its subclasses) occurs during deployment the
> Error is not caught then files that may have been written during the
> deployment operation are not cleaned up. In particular if an Error occurs
> during the serialization phase of deployment, the failure causes an
> (incomplete?) config.ser to be written to the repository and a config.info
> file is not written due to the Error being thrown, which can cause problems
> when Geronimo is restarted (see Symptoms).
> h1. Solution
> Corrected exception handling to catch Errors to perform cleanup of files.
> Also changed order of cleanup so module file in repository is closed before
> attempting to clean it up.
> h1. Workaround
> Correct the cause of the Error during deployment.
> Shut down Geronimo. Remove any <module ..> entry that was added for the
> failed deploy attempt in geronimo\var\config.xml, delete the files that were
> partially deployed under the geronimo\repository directory. Restart Geronimo.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira