Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 3 Sep 2010 07:36:39 -0000 Issue 9162

user-digest-help

2010-09-03


Author LoginPost Reply

user Digest 3 Sep 2010 07:36:39 -0000 Issue 9162

Topics (messages 207352 through 207356):

Re: org.xml.sax.SAXParseException: The content of element type "package" must match
 207352 by: Dave Newton
 207353 by: Dale Newfield
 207354 by: Michal Ciasnocha
 207355 by: Satheesh Kannan A B

Question about Usage of Tasks
 207356 by: Daniel Rindt

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------


Attachment: user_207352.ezm (zipped)
The error message tells you exactly what's wrong, no?

On Thu, Sep 2, 2010 at 10:50 AM, Satheesh Kannan A B wrote:
> The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)".
> [snipalottatext]
>      <package name="KEW" extends="struts-default" >
>            <global-results> ...
>             <interceptors> ...

Dave


Attachment: user_207353.ezm (zipped)
On 9/2/10 10:50 AM, Satheesh Kannan A B wrote:
> The content of element type "package" must match
> "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exc
> eption-mappings?,action*)".

Means exactly what it says. With a package tag, all result-types sub
tags must precede all interceptors sub tags, must precede all
default-interceptor-ref sub tags, etc.

In the xml you include you have global-results before interceptors, so
it doesn't parse correctly.

-Dale


Attachment: user_207354.ezm (zipped)
Check this, it can help you

http://struts.apache.org/2.1.8/docs/strutsxml-examples.html



Satheesh Kannan A B wrote on 2.9.2010 16:50:
> Hi,
>
> I think it's a existing and resolved issues in struts 2.1.8, since I have googled and searched here but am not able to resolve this.
>
> Currently am configuring interceptors in my struts 2.1.8 application using websphere 6.0.1.
> What I have coded is right I think so and u all please verify it and suggest me the thing to resolve this.
> In the below if I remove the interceptors and global exceptions mapping my application working fine.
> Am using struts 2.1.8, jdk 6, websphere 6.0.1, xercesImpl-2.8.1
>
> The exception am getting is  give below .........................
> [9/2/10 18:41:56:113 IST] 0000002c SystemOut   O 2010-09-02 18:41:56,082 [WebContainer : 0] ERROR com.opensymphony.xwork2.util.DomHelper - The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)". at (null:103:12)
> org.xml.sax.SAXParseException: The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)".
>     at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 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 Source)
>     at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
>     at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
>     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
>     at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 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)
>     at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
>     at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:113)
> etc..
>
> and my code wat I have implemented given below ........
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <!DOCTYPE struts PUBLIC
>    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>    "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
>     <constant name="struts.objectFactory" value="spring" />
>     <constant name="struts.devMode" value="false" />
>     <package name="KEW" extends="struts-default">
>
>
>
>         <global-results>
>         <result name="ldaperror">/search/ldaperror.jsp</result>
>       </global-results>
>
>          <interceptors>
>                 <interceptor name="authenticationInterceptor" class="com.aegon.capitalexpiry.web.util.AuthenticationInterceptor"/>
>                 <interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
>                 <interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
>                 <interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
>                 <interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
>                 <interceptor name="modelDriven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
>                 <interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>
>                 <interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
>                 <interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
>                 <interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
>                 <interceptor name="servlet-config" class="com.opensymphony.xwork2.interceptor.ServletConfigInterceptor"/>
>                 <interceptor name="sessionAutowiring" class="com.opensymphony.xwork2.interceptor.SessionContextAutowiringInterceptor"/>
>                 <interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
>                 <interceptor name="token" class="com.opensymphony.xwork2.interceptor.TokenInterceptor"/>
>                 <interceptor name="token-session" class="com.opensymphony.xwork2.interceptor.TokenSessionStoreInterceptor" />
>                 <interceptor name="validation" class="com.opensymphony.xwork2.interceptor.ValidationInterceptor " />
>                 <interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>
>
>               <interceptor-stack name="defaultStack">
>                     <interceptor-ref name="authenticationInterceptor"/>
>                         <interceptor-ref name="fileUpload"/>
>                         <interceptor-ref name="i18n"/>
>                         <interceptor-ref name="logger"/>
>                         <interceptor-ref name="modelDriven"/>
>                         <interceptor-ref name="params"/>
>                         <interceptor-ref name="prepare"/>
>                         <interceptor-ref name="servlet-config"/>
>                         <interceptor-ref name="sessionAutowiring"/>
>                         <interceptor-ref name="timer"/>
>                         <interceptor-ref name="token"/>
>                         <interceptor-ref name="token-session"/>
>                         <interceptor-ref name="validation"/>
>                         <interceptor-ref name="workflow"/>
>                         <interceptor-ref name="static-params"/>
>             </interceptor-stack>
>       </interceptors>
>
>         <default-interceptor-ref name="authenticationInterceptor"/>
>
> <default-interceptor-ref name="defaultLoginStack" />
>
>         <default-action-ref name="start" />
>
>         <global-results>
>             <result name="sessionerror">/html/SessionError.html</result>
>         </global-results>
>
>         <result name="sessionerror">/html/SessionError.html</result>
>
>         <global-exception-mappings>
>         <exception-mapping exception="java.lang.Exception" result="sessionerror"/>
>         </global-exception-mappings>
>
>             <action name="start" class="startAction">
>             <result name="success">index_kew.jsp</result>
>             </action>
>
>     </package>
> </struts>
>
> Thanks and Regards,
>
> Satheesh Kannan A B
>
>
> DISCLAIMER:
> -----------------------------------------------------------------------------------------------------------------------
>
> The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
> It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
> this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
> Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
> this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
> received this email in error please delete it and notify the sender immediately. Before opening any mail and
> attachments please check them for viruses and defect.
>
> -----------------------------------------------------------------------------------------------------------------------
>

Attachment: user_207355.ezm (zipped)
Hi,

I think it's a existing and resolved issues in struts 2.1.8, since I have googled and searched here but am not able to resolve this.

Currently am configuring interceptors in my struts 2.1.8 application using websphere 6.0.1.
What I have coded is right I think so and u all please verify it and suggest me the thing to resolve this.
In the below if I remove the interceptors and global exceptions mapping my application working fine.
Am using struts 2.1.8, jdk 6, websphere 6.0.1, xercesImpl-2.8.1

The exception am getting is  give below .........................
[9/2/10 18:41:56:113 IST] 0000002c SystemOut   O 2010-09-02 18:41:56,082 [WebContainer : 0] ERROR com.opensymphony.xwork2.util.DomHelper - The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)". at (null:103:12)
org.xml.sax.SAXParseException: The content of element type "package" must match "(result-types?,interceptors?,default-interceptor-ref?,default-action-ref?,default-class-ref?,global-results?,global-exception-mappings?,action*)".
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown 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 Source)
   at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
   at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 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)
   at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
   at com.opensymphony.xwork2.util.DomHelper.parse (DomHelper.java:113)
etc..

and my code wat I have implemented given below ........

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
  "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
   <constant name="struts.objectFactory" value="spring" />
   <constant name="struts.devMode" value="false" />
   <package name="KEW" extends="struts-default" >



       <global-results>
       <result name="ldaperror">/search/ldaperror.jsp</result>
    </global-results>

        <interceptors>
               <interceptor name="authenticationInterceptor" class="com.aegon.capitalexpiry.web.util.AuthenticationInterceptor"/>
               <interceptor name="execAndWait" class="org.apache.struts2.interceptor.ExecuteAndWaitInterceptor"/>
               <interceptor name="fileUpload" class="org.apache.struts2.interceptor.FileUploadInterceptor"/>
               <interceptor name="i18n" class="com.opensymphony.xwork2.interceptor.I18nInterceptor"/>
               <interceptor name="logger" class="com.opensymphony.xwork2.interceptor.LoggingInterceptor"/>
               <interceptor name="modelDriven" class="com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor"/>
               <interceptor name="scope" class="org.apache.struts2.interceptor.ScopeInterceptor"/>
               <interceptor name="params" class="com.opensymphony.xwork2.interceptor.ParametersInterceptor"/>
               <interceptor name="prepare" class="com.opensymphony.xwork2.interceptor.PrepareInterceptor"/>
               <interceptor name="static-params" class="com.opensymphony.xwork2.interceptor.StaticParametersInterceptor"/>
               <interceptor name="servlet-config" class="com.opensymphony.xwork2.interceptor.ServletConfigInterceptor"/>
               <interceptor name="sessionAutowiring" class="com.opensymphony.xwork2.interceptor.SessionContextAutowiringInterceptor"/>
               <interceptor name="timer" class="com.opensymphony.xwork2.interceptor.TimerInterceptor"/>
               <interceptor name="token" class="com.opensymphony.xwork2.interceptor.TokenInterceptor"/>
               <interceptor name="token-session" class="com.opensymphony.xwork2.interceptor.TokenSessionStoreInterceptor" />
               <interceptor name="validation" class="com.opensymphony.xwork2.interceptor.ValidationInterceptor " />
               <interceptor name="workflow" class="com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor"/>

             <interceptor-stack name="defaultStack">
                   <interceptor-ref name="authenticationInterceptor"/>
                       <interceptor-ref name="fileUpload"/>
                       <interceptor-ref name="i18n"/>
                       <interceptor-ref name="logger"/>
                       <interceptor-ref name="modelDriven"/>
                       <interceptor-ref name="params"/>
                       <interceptor-ref name="prepare"/>
                       <interceptor-ref name="servlet-config"/>
                       <interceptor-ref name="sessionAutowiring"/>
                       <interceptor-ref name="timer"/>
                       <interceptor-ref name="token"/>
                       <interceptor-ref name="token-session"/>
                       <interceptor-ref name="validation"/>
                       <interceptor-ref name="workflow"/>
                       <interceptor-ref name="static-params"/>
          </interceptor-stack>
     </interceptors>

       <default-interceptor-ref name="authenticationInterceptor"/>

<default-interceptor-ref name="defaultLoginStack" />

       <default-action-ref name="start" />

       <global-results>
           <result name="sessionerror">/html/SessionError.html</result>
       </global-results>

       <result name="sessionerror" >/html/SessionError.html</result>

       <global-exception-mappings>
       <exception-mapping exception="java.lang.Exception" result="sessionerror"/>
       </global-exception-mappings>

           <action name="start" class="startAction">
           <result name="success">index_kew.jsp</result>
           </action>

   </package>
</struts>

Thanks and Regards,

Satheesh Kannan A B


DISCLAIMER:
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

Attachment: user_207356.ezm (zipped)
Hello,

the Tag <s:url ...> prefixes all used URL's with the Application Name.
This is in my case not wanted, so i am looking for a Solution to avoid
the Prefixing.

Thanks in Advance
Daniel

Attachment: signature.asc (zipped)
©2008 gg3721.com - Jax Systems, LLC, U.S.A.