How to solve DeploymentException Error due to Unbalanced ELEMENT | Weblogic

Oracle Weblogic Server

While starting/deploying an application we were seeing below error in console as well as in backend logs and the application used to go to failed/prepared state and never starts.

Error message

<Jun 28, 2013 2:26:13 AM PDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID ‘1372411573489’ for task ‘0’. Error is: ‘weblogic.management.DeploymentException: Error at Line:38, token:[SPACE] (
)Unbalanced ELEMENT got:application expected:module’
weblogic.management.DeploymentException: Error at Line:38, token:[SPACE] (
)Unbalanced ELEMENT got:application expected:module
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:188)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:91)
Truncated. see log file for complete stacktrace
Caused By: Error at Line:38, token:[SPACE] (
)Unbalanced ELEMENT got:application expected:module
at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:374)
at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:238)
at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:60)
at weblogic.application.descriptor.DebugStreamReaderDelegate.next(DebugStreamReaderDelegate.java:91)
Truncated. see log file for complete stacktrace

>
<Jun 28, 2013 2:26:13 AM PDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating start task for application ‘SetupApp’.>
<Jun 28, 2013 2:26:13 AM PDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
weblogic.management.DeploymentException: Error at Line:38, token:[SPACE] (
)Unbalanced ELEMENT got:application expected:module
at weblogic.application.internal.EarDeploymentFactory.findOrCreateComponentMBeans(EarDeploymentFactory.java:188)
at weblogic.application.internal.MBeanFactoryImpl.findOrCreateComponentMBeans(MBeanFactoryImpl.java:48)
at weblogic.application.internal.MBeanFactoryImpl.createComponentMBeans(MBeanFactoryImpl.java:110)
at weblogic.application.internal.MBeanFactoryImpl.initializeMBeans(MBeanFactoryImpl.java:76)
at weblogic.management.deploy.internal.MBeanConverter.createApplicationMBean(MBeanConverter.java:91)
Truncated. see log file for complete stacktrace
Caused By: Error at Line:38, token:[SPACE] (
)Unbalanced ELEMENT got:application expected:module
at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:374)
at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.java:195)
at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:238)
at javax.xml.stream.util.StreamReaderDelegate.next(StreamReaderDelegate.java:60)
at weblogic.application.descriptor.DebugStreamReaderDelegate.next(DebugStreamReaderDelegate.java:91)
Truncated. see log file for complete stacktrace
>

Error Seen on Weblogic Admin console while making the application ACTIVE

Weblogic Unbalanced Element Error

Root Cause:

It seems some xml file got corrupted in the applications ear.

Probable solution:

After doing a wild card search in exploded ear folder for the xml files syntax issues we got to know below:

In the deployed ear folder run below query which checks the xml file well formation.
find . – name “*.xml” -exec xmlwf ‘{}’ \;

We found out that the error was in applications.xml file in ear which had a bad mapping where the tags(E.g<module>SetupApp</module>) at line no 39(as reported in logs) was not ended properly.
Which was causing this issue and the application ear was failing to come ACTIVE state.

We added the end tag and did a xmlwf applications.xml and it went through fine without reporting any issue with syntax.

We then cleaned the tmp and cache folders and then restarted the application and it came ACTIVE without any issues.

 

In case of any ┬ęCopyright or missing credits issue please check CopyRights page for faster resolutions.

Leave a Reply