troubleshooting Question

I am recieving "java.lang.IllegalArgumentException: Path welcome does not start with a "/" character" when tryign to create a simple struts app with MyEclipse

Avatar of mallocaway
mallocaway asked on
Java EE
6 Comments1 Solution7246 ViewsLast Modified:
I am receiving the following error message when attempting to create a simple J2EE application with Struts and MyEclipse

java.lang.IllegalArgumentException: Path welcome does not start with a "/" character

Here is 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="welcomeForm" type="com.yourcompany.struts.form.WelcomeForm" />
  </form-beans>

  <global-exceptions />
  <global-forwards >
    <forward
      name="welcome"
      path="/welcome.do"
      redirect="true" />
  </global-forwards>

  <action-mappings >
    <action
      attribute="welcomeForm"
      input="/jsp/welcome.jsp"
      name="welcomeForm"
      path="/welcome"
      scope="request"
      type="com.yourcompany.struts.action.WelcomeAction" >
        <forward name="success" path="welcome" />
    </action>
  </action-mappings>

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

Here is my WelcomeAction.java  execute() method:
public ActionForward execute(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) {
      WelcomeForm welcomeForm = (WelcomeForm) form;// TODO Auto-generated method stub
      mapping.findForward("success");
      return mapping.findForward("success");
}

I get the error mentioned above.
Below is the log:
Jul 18, 2008 12:00:26 PM org.apache.struts.util.PropertyMessageResources <init>
INFO: Initializing, config='org.apache.struts.taglib.logic.LocalStrings', returnNull=true
Jul 18, 2008 12:00:49 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet action threw exception
java.lang.IllegalArgumentException: Path welcome does not start with a "/" character
      at org.apache.catalina.core.ApplicationContext.getRequestDispatcher(ApplicationContext.java:379)
      at org.apache.catalina.core.ApplicationContextFacade.getRequestDispatcher(ApplicationContextFacade.java:195)
      at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1062)
      at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
      at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
      at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
      at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
      at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
      at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
      at java.lang.Thread.run(Thread.java:619)

I'm new to this.
Can anyone give me some guidance?
Thank you!
ASKER CERTIFIED SOLUTION
krishna kishore mellacheruvu venkata
Associate Manager

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros