You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ramya lekha <ra...@gmail.com> on 2008/08/04 22:50:19 UTC

Error deploying struts application in tomcat

HI,

I had written a build.xml file for my struts application.. this file creates
a .war file which i can deploy in a tomcat server. I am able to create a
.war file... and wen I deploy it in the server and start calling the
application "servername/proj/index.jsp" i can view the jsp page and wen i
click the link which calls a action (bookList.do). I am getting a error msg
saying "The requested URL /proj/bookList.do was not found on this server."

the directory structure is

webapps/proj/WEB-INF , webapps/proj/jsp
and under WEB-INF i have the files web.xml, struts-config.xml, all struts
tlds files, folders(classes,lib)

my web.xml file is

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http$
  <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>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

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


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config$

<struts-config>
  <data-sources />
  <form-beans >
    <form-bean name="bookListForm"
type="com.yourcompany.struts.form.BookListForm" />
    <form-bean name="bookEditForm"
type="com.yourcompany.struts.form.BookEditForm" />
  </form-beans>

  <global-exceptions />
  <global-forwards >


  </global-forwards>

  <action-mappings >

    <action
      attribute="bookListForm"
      input="/WEB-INF/jsp/bookList.jsp"
      name="bookListForm"
      path="/bookList"
      scope="request"
      type="com.yourcompany.struts.action.BookListAction">
      <forward name="showList" path="/WEB-INF/jsp/bookList.jsp" />
    </action>
    <action
      attribute="bookEditForm"
      name="bookEditForm"
      parameter="do"
      path="/bookEdit"
      scope="request"
      type="com.yourcompany.struts.action.BookEditAction">
      <forward name="showEdit" path="/WEB-INF/jsp/bookEdit.jsp" />
      <forward
        name="showList"
        path="/bookList.do"
        redirect="true" />
      <forward name="showAdd" path="/WEB-INF/jsp/bookAdd.jsp" />
    </action>


  </action-mappings>

  <message-resources parameter="com.yourcompany.struts.ApplicationResources"
/>
</struts-config>

---------------------log file--------------------------------------------

2008-08-04 20:33:55
StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init():
ruleChain: [org.apache.webapp.balancer.RuleChain:
[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News /
Redirect URL: http://www.cnn.com],
[org.apache.webapp.balancer.rules.RequestParameterRule: Target param name:
paramName / Target param value: paramValue / Redirect URL:
http://www.yahoo.com],
[org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
http://jakarta.apache.org]]


Can you please let me know wer is the error...???

Thanks in advance

Ramya

Re: Error deploying struts application in tomcat

Posted by ramya lekha <ra...@gmail.com>.
I had made the change but still i am getting the same error in my log
file....

2008-08-05 13:37:17
StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init():
ruleChain: [org.apache.webapp.balancer.RuleChain:
[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News /
Redirect URL: http://www.cnn.com],
[org.apache.webapp.balancer.rules.RequestParameterRule: Target param name:
paramName / Target param value: paramValue / Redirect URL:
http://www.yahoo.com],
[org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
http://jakarta.apache.org]]

Can someone please help me ot in this....

Thanks
Ramya



On 8/4/08, Tandel, Aswin <as...@citi.com> wrote:
>
> Hi,
>
> I think ur context name in incorrect.
> Check your context name on your admin console. It is generally ur war
> file name. Give that context name before the action path and it should
> work.
>
> In ur case /proj/bookList.do .... <proj> should be replaced with the
> context name..
>
> Thanks and Regards,
> Ashwin Tandel
> Email - aswin.tandel@citi.com
>
>
> -----Original Message-----
> From: ramya lekha [mailto:ramyalekhaa1@gmail.com]
> Sent: Monday, August 04, 2008 4:50 PM
> To: Tomcat Users List
> Subject: Error deploying struts application in tomcat
>
> HI,
>
> I had written a build.xml file for my struts application.. this file
> creates
> a .war file which i can deploy in a tomcat server. I am able to create a
> .war file... and wen I deploy it in the server and start calling the
> application "servername/proj/index.jsp" i can view the jsp page and wen
> i
> click the link which calls a action (bookList.do). I am getting a error
> msg
> saying "The requested URL /proj/bookList.do was not found on this
> server."
>
> the directory structure is
>
> webapps/proj/WEB-INF , webapps/proj/jsp
> and under WEB-INF i have the files web.xml, struts-config.xml, all
> struts
> tlds files, folders(classes,lib)
>
> my web.xml file is
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance" version="2.4"
> xsi:schemaLocation="http$
> <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>
> <welcome-file-list>
>    <welcome-file>index.jsp</welcome-file>
> </welcome-file-list>
> </web-app>
>
> ---------------------struts-config.xml------------------
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD
> Struts
> Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config$
>
> <struts-config>
> <data-sources />
> <form-beans >
>    <form-bean name="bookListForm"
> type="com.yourcompany.struts.form.BookListForm" />
>    <form-bean name="bookEditForm"
> type="com.yourcompany.struts.form.BookEditForm" />
> </form-beans>
>
> <global-exceptions />
> <global-forwards >
>
>
> </global-forwards>
>
> <action-mappings >
>
>    <action
>      attribute="bookListForm"
>      input="/WEB-INF/jsp/bookList.jsp"
>      name="bookListForm"
>      path="/bookList"
>      scope="request"
>      type="com.yourcompany.struts.action.BookListAction">
>      <forward name="showList" path="/WEB-INF/jsp/bookList.jsp" />
>    </action>
>    <action
>      attribute="bookEditForm"
>      name="bookEditForm"
>      parameter="do"
>      path="/bookEdit"
>      scope="request"
>      type="com.yourcompany.struts.action.BookEditAction">
>      <forward name="showEdit" path="/WEB-INF/jsp/bookEdit.jsp" />
>      <forward
>        name="showList"
>        path="/bookList.do"
>        redirect="true" />
>      <forward name="showAdd" path="/WEB-INF/jsp/bookAdd.jsp" />
>    </action>
>
>
> </action-mappings>
>
> <message-resources
> parameter="com.yourcompany.struts.ApplicationResources"
> />
> </struts-config>
>
> ---------------------log
> file--------------------------------------------
>
> 2008-08-04 20:33:55
> StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter:
> init():
> ruleChain: [org.apache.webapp.balancer.RuleChain:
> [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string:
> News /
> Redirect URL: http://www.cnn.com],
> [org.apache.webapp.balancer.rules.RequestParameterRule: Target param
> name:
> paramName / Target param value: paramValue / Redirect URL:
> http://www.yahoo.com],
> [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
> http://jakarta.apache.org]]
>
>
> Can you please let me know wer is the error...???
>
> Thanks in advance
>
> Ramya
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

RE: Error deploying struts application in tomcat

Posted by "Tandel, Aswin " <as...@citi.com>.
Hi,

I think ur context name in incorrect.
Check your context name on your admin console. It is generally ur war
file name. Give that context name before the action path and it should
work.

In ur case /proj/bookList.do .... <proj> should be replaced with the
context name.. 

Thanks and Regards,
Ashwin Tandel
Email - aswin.tandel@citi.com


-----Original Message-----
From: ramya lekha [mailto:ramyalekhaa1@gmail.com] 
Sent: Monday, August 04, 2008 4:50 PM
To: Tomcat Users List
Subject: Error deploying struts application in tomcat

HI,

I had written a build.xml file for my struts application.. this file
creates
a .war file which i can deploy in a tomcat server. I am able to create a
.war file... and wen I deploy it in the server and start calling the
application "servername/proj/index.jsp" i can view the jsp page and wen
i
click the link which calls a action (bookList.do). I am getting a error
msg
saying "The requested URL /proj/bookList.do was not found on this
server."

the directory structure is

webapps/proj/WEB-INF , webapps/proj/jsp
and under WEB-INF i have the files web.xml, struts-config.xml, all
struts
tlds files, folders(classes,lib)

my web.xml file is

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http$
  <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>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

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


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD
Struts
Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config$

<struts-config>
  <data-sources />
  <form-beans >
    <form-bean name="bookListForm"
type="com.yourcompany.struts.form.BookListForm" />
    <form-bean name="bookEditForm"
type="com.yourcompany.struts.form.BookEditForm" />
  </form-beans>

  <global-exceptions />
  <global-forwards >


  </global-forwards>

  <action-mappings >

    <action
      attribute="bookListForm"
      input="/WEB-INF/jsp/bookList.jsp"
      name="bookListForm"
      path="/bookList"
      scope="request"
      type="com.yourcompany.struts.action.BookListAction">
      <forward name="showList" path="/WEB-INF/jsp/bookList.jsp" />
    </action>
    <action
      attribute="bookEditForm"
      name="bookEditForm"
      parameter="do"
      path="/bookEdit"
      scope="request"
      type="com.yourcompany.struts.action.BookEditAction">
      <forward name="showEdit" path="/WEB-INF/jsp/bookEdit.jsp" />
      <forward
        name="showList"
        path="/bookList.do"
        redirect="true" />
      <forward name="showAdd" path="/WEB-INF/jsp/bookAdd.jsp" />
    </action>


  </action-mappings>

  <message-resources
parameter="com.yourcompany.struts.ApplicationResources"
/>
</struts-config>

---------------------log
file--------------------------------------------

2008-08-04 20:33:55
StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter:
init():
ruleChain: [org.apache.webapp.balancer.RuleChain:
[org.apache.webapp.balancer.rules.URLStringMatchRule: Target string:
News /
Redirect URL: http://www.cnn.com],
[org.apache.webapp.balancer.rules.RequestParameterRule: Target param
name:
paramName / Target param value: paramValue / Redirect URL:
http://www.yahoo.com],
[org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
http://jakarta.apache.org]]


Can you please let me know wer is the error...???

Thanks in advance

Ramya

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org