Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

struts-config file errors

Status
Not open for further replies.

shonJava

Programmer
Dec 27, 2004
11
US
Hi All,

Could any one point out whats wrong with my struts-config file..i always get the following excepetions
------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"
<struts-config>

<!-- ========== Data Source Configuration ============================== -->
<data-sources>
</data-sources>

<!-- ========== Form Bean Definitions =================================== -->

<form-beans>
<form-bean name="simplePlateInfoForm" type="com.barcodes.plateloader.form.SimplePlateInfoForm" />
<form-bean name="simpleBarcodeForm" type="com.barcodes.plateloader.form.SimpleBarcodeForm" />
<form-bean name="simpleExcelIDForm" type="com.barcodes.plateloader.form.SimpleExcelIDForm" />
<form-bean name="simpleAssayForm" type="com.barcodes.plateloader.form.SimpleAssayForm" />

</form-beans>

<!-- ========= Global Exception Definitions ============================ -->
<global-exceptions>
</global-exceptions>
<!-- ========== Action Mapping Definitions ============================== -->
<action-mappings>
<action path="/processPlateInfo"
type="com.barcodes.plateloader.action.ProcessPlateInfoAction"
name="simplePlateInfoForm"
scope="session"
input="/SelectPlateInfo.jsp"
validate="true">
<forward name="success" path="/PlateBarcodePage.jsp"/>
</action>
</action-mappings>

<action-mappings>
<action path="/processBarcode"
type="com.barcodes.plateloader.action.ProcessBarcodeAction"
name="simpleBarcodeForm"
scope="session"
input="/PlateBarcodePage.jsp"
validate="true">
<forward name="success" path="/Excelids.jsp"/>
</action>
</action-mappings>

<action-mappings>
<action path="/processExelIDs"
type="com.barcodes.plateloader.action.ProcessExcelIDAction"
name="simpleExcelIDForm"
scope="session"
input="/Excelids.jsp"
validate="true">
<forward name="success" path="/PlateTypes.jsp"/>
</action>
</action-mappings>

<action-mappings>
<action path="/processAssays"
type="com.barcodes.plateloader.action.ProcessAssayAction"
name="simpleAssayForm"
scope="session"
input="/PlateTypes.jsp"
validate="true">
<forward name="success" path="/PreviewPage.jsp"/>
</action>
</action-mappings>


<!-- ========== Controller Configuration =============================== -->

<controller/>
<!-- ========== Message Resources Definitions =========================== -->

<message-resources parameter="com.barcodes.plateloader.ApplicationResources" null="false"/>

<!-- ========== Plug-ins Configuration ================================== -->


<plug-in className="org.apache.struts.validator.ValidatorPlugIn">
<set-property property="pathnames"
value="/WEB-INF/validator-rules.xml,
/WEB-INF/validation.xml" />
</plug-in>
</struts-config>



-------
09:52:50,741 ERROR [Digester] Parse Error at line 85 column 17: The content of e
lement type "struts-config" must match "(data-sources?,form-beans?,global-except
ions?,global-forwards?,action-mappings?,controller?,message-resources*,plug-in*)
".
org.xml.sax.SAXParseException: The content of element type "struts-config" must
match "(data-sources?,form-beans?,global-exceptions?,global-forwards?,action-map
pings?,controller?,message-resources*,plug-in*)".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
known Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
ource)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)

at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
n Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
--
 
Hi,

You are closing the action-mapping for every action. It should be close only once in the config file

Code:
<action-mappings>
        <action path="/processPlateInfo"
        type="com.barcodes.plateloader.action.ProcessPlateInfoAction"
        name="simplePlateInfoForm"
        scope="session"
        input="/SelectPlateInfo.jsp"
        validate="true">
            <forward name="success" path="/PlateBarcodePage.jsp"/>
        </action>
    </action-mappings> [COLOR=red]need be close only once[/color]

    <action-mappings>
        <action path="/processBarcode"
        type="com.barcodes.plateloader.action.ProcessBarcodeAction"
        name="simpleBarcodeForm"
        scope="session"
        input="/PlateBarcodePage.jsp"
        validate="true">
            <forward name="success" path="/Excelids.jsp"/>
        </action>
    </action-mappings> [COLOR=red]need be close only once[/color]
    
    <action-mappings>
        <action path="/processExelIDs"
        type="com.barcodes.plateloader.action.ProcessExcelIDAction"
        name="simpleExcelIDForm"
        scope="session"
        input="/Excelids.jsp"
        validate="true">
            <forward name="success" path="/PlateTypes.jsp"/>
        </action>
    </action-mappings> [COLOR=red]need be close only once[/color]

    <action-mappings>
        <action path="/processAssays"
        type="com.barcodes.plateloader.action.ProcessAssayAction"
        name="simpleAssayForm"
        scope="session"
        input="/PlateTypes.jsp"
        validate="true">
            <forward name="success" path="/PreviewPage.jsp"/>
        </action>
    </action-mappings>

It should be
Code:
 <action-mappings>
        <action path="/processPlateInfo"
        type="com.barcodes.plateloader.action.ProcessPlateInfoAction"
        name="simplePlateInfoForm"
        scope="session"
        input="/SelectPlateInfo.jsp"
        validate="true">
            <forward name="success" path="/PlateBarcodePage.jsp"/>
        </action>
    
         <action path="/processBarcode"
        type="com.barcodes.plateloader.action.ProcessBarcodeAction"
        name="simpleBarcodeForm"
        scope="session"
        input="/PlateBarcodePage.jsp"
        validate="true">
            <forward name="success" path="/Excelids.jsp"/>
        </action>
    
    
    
        <action path="/processExelIDs"
        type="com.barcodes.plateloader.action.ProcessExcelIDAction"
        name="simpleExcelIDForm"
        scope="session"
        input="/Excelids.jsp"
        validate="true">
            <forward name="success" path="/PlateTypes.jsp"/>
        </action>
    

   
        <action path="/processAssays"
        type="com.barcodes.plateloader.action.ProcessAssayAction"
        name="simpleAssayForm"
        scope="session"
        input="/PlateTypes.jsp"
        validate="true">
            <forward name="success" path="/PreviewPage.jsp"/>
        </action>
    </action-mappings>

Cheers
Venu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top