File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes org.xml.sax.SAXParseException: The content of element type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "org.xml.sax.SAXParseException: The content of element type "forward" must match"  Please help" Watch "org.xml.sax.SAXParseException: The content of element type "forward" must match"  Please help" New topic
Author

org.xml.sax.SAXParseException: The content of element type "forward" must match" Please help

Acharya Thiyagarajan
Greenhorn

Joined: Aug 01, 2009
Posts: 18
Hi,

I have the below issue now. I have 9.2 MP3 and I am getting the below error when i try deployin a web application what can be the possible issue? Below is the stack trace.

09 Aug 2009 13:42:55,334 ERROR Digester []: Parse Error at line 107 column 14: The content of element type "forward" must match "(icon?,display-name?,description?,set-property*)".
org.xml.sax.SAXParseException: The content of element type "forward" must match "(icon?,display-name?,description?,set-property*)".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:236)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:172)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:382)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:316)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2048)
at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:932)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanEndElement(XMLNSDocumentScannerImpl.java:719)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1685)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133)
at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:153)
at org.apache.commons.digester.Digester.parse(Digester.java:1548)
at org.apache.struts.action.ActionServlet.parseModuleConfigFile(ActionServlet.java:1006)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:955)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:482)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:278)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:64)
at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
at weblogic.servlet.internal.StubLifecycleHelper.<init>(StubLifecycleHelper.java:48)
at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:507)
at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:1715)
at weblogic.servlet.internal.WebAppServletContext.loadServletsOnStartup(WebAppServletContext.java:1692)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1612)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:2750)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:889)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:333)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.ScopedModuleDriver.start(ScopedModuleDriver.java:200)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:117)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:204)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:60)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:26)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:635)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:212)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:80)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.activate(AbstractOperation.java:566)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.activateDeployment(ActivateOperation.java:136)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doCommit(ActivateOperation.java:104)
at weblogic.deploy.internal.targetserver.operations.StartOperation.doCommit(StartOperation.java:139)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.commit(AbstractOperation.java:320)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentCommit(DeploymentManager.java:815)
at weblogic.deploy.internal.targetserver.DeploymentManager.activateDeploymentList(DeploymentManager.java:1222)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleCommit(DeploymentManager.java:433)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.commit(DeploymentServiceDispatcher.java:161)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doCommitCallback(DeploymentReceiverCallbackDeliverer.java:181)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$100(DeploymentReceiverCallbackDeliverer.java:12)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$2.run(DeploymentReceiverCallbackDeliverer.java:67)
at weblogic.work.ServerWorkManagerImpl$WorkAdapterImpl.run(ServerWorkManagerImpl.java:518)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Acharya Thiyagarajan
Greenhorn

Joined: Aug 01, 2009
Posts: 18
We are trying to solve this for the past 2 weeks and since then no progress please help.. I have no clues on this. Below is the list of jars we are having:

activation.jar
axis-ant.jar
axis.jar
commons-beanutils.jar
commons-collections.jar
commons-digester.jar
commons-discovery-0.2.jar
commons-fileupload.jar
commons-httpclient.jar
commons-lang.jar
commons-logging.jar
commons-validator.jar
dsApplicationClient.jar
dsClient.jar
dsCompanyProfileClient.jar
dsDunsClient.jar
dsPublisher.jar
dsUserProfileClient.jar
gqts_aws_axis.jar
iText-2.0.8.jar
jaxrpc.jar
jce1_2_2.jar
jstl.jar
local_policy.jar
log4j.jar
mail.jar
ncpro.jar
poi.jar
saaj.jar
spdsJMSClient.jar
standard.jar
struts.jar
sunjce_provider.jar
US_export_policy.jar
webserviceclient.jar
wsdl4j-1.5.1.jar
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

It's telling you *precisely* what the error is:
Acharya Thiyagarajan
Greenhorn

Joined: Aug 01, 2009
Posts: 18
Hi,

But the same xmls are working in another enviroment but not in mine. The Ears are the same. I am really sceptacle abt teh jars, thats why i have given the jars . Please help.

Regards,
Acharya
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

struts-config.xml is not valid. Validate it against the DTD.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Acharya Thiyagarajan
Greenhorn

Joined: Aug 01, 2009
Posts: 18
hi all,

thankx for your response.. well there are many sturts configs each corresponding to a module and there are many tags how can i validate each of them ?? i have eclipse galileo I am ready to install anything to solve this issue?

Please help

Regards,
Acharya
Acharya Thiyagarajan
Greenhorn

Joined: Aug 01, 2009
Posts: 18
I have validated the dtds below is the entr in all the struts configs .. what can be the issue? this is also in the earlier code base

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
vishwa venkat
Ranch Hand

Joined: Nov 22, 2003
Posts: 185
Verify what version of struts you are using 1.1. or 1.2 or 1.3.

Unzip/Unjar struts.jar and check the MANIFEST.MF in META-INF.

and make sure you have correct DTD specifier in your struts.xml
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Acharya Thiyagarajan wrote: well there are many sturts configs each corresponding to a module and there are many tags how can i validate each of them ?? i have eclipse galileo I am ready to install anything to solve this issue?

You do not have to validate each tag, you have to validate each config file.

Look at this link for tutorial explaining XML validation in Eclipse
Acharya Thiyagarajan
Greenhorn

Joined: Aug 01, 2009
Posts: 18
Sagar Rohankar

Many congratulatiosn and thankx for all your help.. I indeed used your solution to check the same and the problem is solved there was a forward entry in the struts config which was not there in corresponding action and hence the application didnt even deploy.

From when did weblogic start doing such strict type checking? how can we disable it? Fresh install of weblogic 9.2 MP3 the check is enabled by default. once again thanks to all and in particular Sagar Rohankar from our whole team

Regards,
Acharya
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Acharya Thiyagarajan wrote:From when did weblogic start doing such strict type checking? how can we disable it?

You can't disable it and every Java application server checks your xml for well formed ness and valid form before deploying them.

Acharya Thiyagarajan wrote:thanks to all and in particular Sagar Rohankar from our whole team

Others input too are correct, I just differ in explaining it more.. and welcome
Michael Monson
Greenhorn

Joined: Apr 30, 2011
Posts: 1

As a quick update, I was dealing with a nearly identical issue just today. As was previously stated, the error (if you take the time to read it), does specifically describe precisely where the error was occuring. In my case, it was because several of my action-mapping's had a stray quotation mark at the end of each forward entry. Once removed, the struts-config parsed correctly and my server started successfully.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.xml.sax.SAXParseException: The content of element type "forward" must match" Please help
 
Similar Threads
Servlet failed to preload on startup in Web application
Servlet failed to preload on startup in Web application
ModuleException while publishing the EAR in Weblogic Server
Log4j in Weblogic - ClassNotFoundException please help
Servlet: "action" failed to preload on startup in Web application: "MyAPPName"