[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

To girinois || TimYates :-)

Posted on 2004-08-18
12
Medium Priority
?
348 Views
Last Modified: 2013-11-24
With reference to my previous Q, Please tell me where i am wrong.
----------------
 My web.xml
----------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
      <filter>
            <filter-name> Filter </filter-name>
            <filter-class>de.grassgmbh.kalendartool.filters.MyFilter</filter-class>
      </filter>
      <servlet>
            <servlet-name>action</servlet-name>
            <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
            <init-param>
                  <param-name>config</param-name>
                  <param-value>/WEB-INF/struts-config.xml</param-value>
            </init-param>
            <init-param>
                  <param-name>debug</param-name>
                  <param-value>3</param-value>
            </init-param>
            <init-param>
                  <param-name>detail</param-name>
                  <param-value>3</param-value>
            </init-param>
            <load-on-startup>0</load-on-startup>
      </servlet>
      <servlet-mapping>
            <servlet-name>action</servlet-name>
            <url-pattern>*.do</url-pattern>
      </servlet-mapping>
</web-app>


------------------------
My struts-config.xml
------------------------

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
      <data-sources />
      <form-beans >
            <form-bean name="filterForm" type="de.grassgmbh.kalendartool.form.FilterForm" />
            <form-bean name="registerMaskForm" type="de.grassgmbh.kalendartool.form.RegisterMaskForm" />
            
      </form-beans>

      <global-exceptions />
      <global-forwards />
      <action-mappings >
            <action
                  attribute="filterForm"
                  input="/jsp/ManageCapacity/FilterList.jsp"
                  name="filterForm"
                  path="/filter"
                  scope="request"
                  type="de.grassgmbh.kalendartool.action.FilterAction"
                  unknown="false"
                  validate="false">
                  <forward
                        name="success"
                        path="/jsp/ManageCapacity/ShowList.jsp"
                        redirect="true"
                        contextRelative="false" />
            </action>
            <action
                  attribute="registerMaskForm"
                  input="/jsp/ManageCapacity/RegisterMaskList.jsp"
                  name="registerMaskForm"
                  path="/registerMask"
                  scope="request"
                  type="de.grassgmbh.kalendartool.action.RegisterMaskAction"
                  unknown="false"
                  validate="false">
                  <forward
                        name="reg_success"
                        path="/jsp/ManageCapacity/ShowList.jsp"
                        redirect="true"
                        contextRelative="false" />
            </action>

      </action-mappings>

      <controller
            bufferSize="4096"
            debug="0"
            locale="false"
            nocache="false"
            inputForward="false" />

      <message-resources null="true" parameter="de.grassgmbh.kalendartool.resources" />
      
      <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>


Thanks.
0
Comment
Question by:sangeetha
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 3
  • 2
12 Comments
 
LVL 2

Author Comment

by:sangeetha
ID: 11830505
To give more overview:
----------------------------

KalendarTool
|
|____ src
|           |
|           |___ de.grassgmbh.kalendartool
|           |                   |
|           |                   |____ resources.properties
|           |
|           |___ de.grassgmbh.kalendartool.form
|           |                   |
|           |                   |___ FilterForm.java
|           |                   |___ RegisterMaskForm.java
|           |                  
|           |___ de.grassgmbh.kalendartool.action                  
|           |                   |
|           |                   |___ FilterAction.java
|           |                   |___ RegisterMaskAction.java
|           |
|           |___ de.grassgmbh.kalendartool.filters
|                               |
|                               |___ MyFilter.java
|
|_____ We-Root
               |
               |____ WEB-INF
               |           |
               |           |____ struts-config.xml, web.xml, etc..
               |
               |____ jsp
                           |
                           |____ ManageCapacity
                                            |
                                            |____ FilterList.jsp
                                            |____ RegisterMaskList.jsp
                                            |____ ShowList.jsp



and I have ShowList.jsp as follows:
-----------------------------------------


 ----------------------            -----------------------------
|   FilterList.jsp       |         |  RegisterMaskList.jsp     |
|                           |         |                                    |
 ----------------------            -----------------------------
  ------------------------------------------------------------
|                                                                             |
|                  show the list here                                 |
|                                                                             |
|                                                                             |
  ------------------------------------------------------------
0
 
LVL 35

Accepted Solution

by:
TimYates earned 600 total points
ID: 11830626
You need web.xml like this:

(sorry, I missed a bit out before)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
     <filter>
          <filter-name>Filter</filter-name>
          <filter-class>de.grassgmbh.kalendartool.filters.MyFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.jsp</url-pattern>
     </filter-mapping>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.do</url-pattern>
     </filter-mapping>
     <servlet>
          <servlet-name>action</servlet-name>
          <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
          <init-param>
               <param-name>config</param-name>
               <param-value>/WEB-INF/struts-config.xml</param-value>
          </init-param>
          <init-param>
               <param-name>debug</param-name>
               <param-value>3</param-value>
          </init-param>
          <init-param>
               <param-name>detail</param-name>
               <param-value>3</param-value>
          </init-param>
          <load-on-startup>0</load-on-startup>
     </servlet>
     <servlet-mapping>
          <servlet-name>action</servlet-name>
          <url-pattern>*.do</url-pattern>
     </servlet-mapping>
</web-app>

so that the filter will only be run if you go to a URL with *.jsp or *.do in the filename...

What error are you getting?
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11830702
When i save the web.xml file, it shows the following error in my 'Console' Window:

16:15:59,300 INFO  [TomcatDeployer] undeploy, ctxPath=/KalendarTool, warUrl=file:/C:/Programme/jboss/server/default/deploy/KalendarTool.war/
16:15:59,347 INFO  [TomcatDeployer] deploy, ctxPath=/KalendarTool, warUrl=file:/C:/Programme/jboss/server/default/deploy/KalendarTool.war/
16:15:59,660 INFO  [PropertyMessageResources] Initializing, config='org.apache.struts.action.ActionResources', returnNull=true
16:15:59,707 ERROR [Digester] Begin event threw exception
java.lang.reflect.InvocationTargetException
      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 org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)

// blah...blah............

at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:191)
Caused by: java.lang.LinkageError: loader constraints violated when linking org/apache/struts/action/ActionMapping class
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:141)
      at org.apache.struts.config.FormBeanConfig.class$(FormBeanConfig.java:190)
      at org.apache.struts.config.FormBeanConfig.setType(FormBeanConfig.java:190)
      ... 97 more
16:15:59,707 ERROR [ActionServlet] Parsing error processing resource path
java.lang.reflect.InvocationTargetException
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2540)
      at org.apache.commons.digester.Digester.createSAXException(Digester.java:2566)
      at org.apache.commons.digester.Digester.startElement(Digester.java:1276)
      at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1635)

// blah...blah...

16:15:59,722 INFO  [Engine] StandardContext[/KalendarTool]Marking servlet action as unavailable
16:15:59,722 ERROR [Engine] StandardContext[/KalendarTool]Servlet /KalendarTool threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource path
      at org.apache.struts.action.ActionServlet.handleConfigException(ActionServlet.java:1035)
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 35

Expert Comment

by:TimYates
ID: 11830735
have you tried rebooting tomcat?
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11830746
I doubled the points. I have *many* questions to compete with my points. :-D

Thanks for your wnoderful help so far. :-)
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11830807
Yeahh.. i tried, but same result :-(
0
 
LVL 35

Assisted Solution

by:girionis
girionis earned 200 total points
ID: 11831046
What I suggest you do is the trial and error technique. For start get rid fo the

<filter>
          <filter-name>Filter</filter-name>
          <filter-class>de.grassgmbh.kalendartool.filters.MyFilter</filter-class>
     </filter>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.jsp</url-pattern>
     </filter-mapping>
     <filter-mapping>
         <filter-name>Filter</filter-name>
         <url-pattern>*.do</url-pattern>
     </filter-mapping>

part in your web.xml and try again. If it does not fail then the error is somewhere there, defining the filter. Then try to add tags one by one and try again. This will help you identify the problem.
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11835601
0
 
LVL 35

Expert Comment

by:girionis
ID: 11838489
Any updates on this problem? Are you still getting the same error message?
0
 
LVL 2

Author Comment

by:sangeetha
ID: 11896710
sorry for late...it worked after i restart the application and deployed again. thanks for your help.
0
 
LVL 35

Expert Comment

by:girionis
ID: 11899947
:)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question