Announcement Announcement Module
Collapse
No announcement yet.
Bean for FlowController not recognized Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bean for FlowController not recognized

    My apologies in advance for what could be a total newbie question.

    But I could use a little help with a question.

    My app is called gci. When I start the tomcat server I go to http://localhost:8080/gci/index.htm (BTW, the server works fine and I can run the example servlets and JSPs in tomcat)

    I am using webflow. And the problem I'm having is that the app doesn't seem to be picking up the bean for the FlowController. When I go to the URL above I get a 404, Requested Resource not available error. (The file does not in fact exist.) But that URL should be caught by the bean below:

    <bean name="/index.htm" class="org.springframework.webflow.executor.mvc.Fl owController">
    <property name="flowExecutor" ref="flowExecutor" />
    <property name="defaultFlowId" value="main-flow"/>
    </bean>

    I'm not getting any error messages in the Console. But that would be logical since the app doesn't even seem to be starting.

    This did all work at one point. But I had to move things around for release engineering’s reorg of the svn repository. I'm sure this must be something simple, but I don't have any errors to see, so I don't know where to look.

    Which makes me think the spring part isn't even starting, because the logging for the app isn't generating anything.

    I know this must be difficult to troubleshoot in any way from my description, but if you have suggestions or anything jumps out at you I would appreciate all the help I could get.

  • #2
    need some more info

    Do you have a view resolver?
    something like:
    Code:
    <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
            <property name="prefix"><value>/WEB-INF/jsp/</value></property>
            <property name="suffix"><value>.jsp</value></property>
        </bean>
    When you get the 404 error what is the file it can't find? If you don't have a view resolver and it can't find your index.htm perhaps your flow executor is setup wrong.

    What does your x-servlet-config.xml and x-webflow-config.xml look like?

    do you have any flows setup?

    Comment


    • #3
      more info

      thanks for the response.

      actually, my view resolver is exactly what you posted for jsp files.

      however, I thought the bean for /index.htm would intercept if the URL was for that.

      the 404 error says it can't find /gci/index.htm
      I know that file isn't there, but maybe I misunderstand the configuration, but I thought the /index.htm bean would intercept.

      I have attached a text file that contains the two config files you mentioned.

      thanks again for the response.

      Comment


      • #4
        Originally posted by jodo3k View Post
        the 404 error says it can't find /gci/index.htm
        You are right that it should be going to your defaultFlowId. What happens when you try going to /gci/index.htm?_flowId=main-flow

        Comment


        • #5
          I get the same 404 error for /gci/index.htm.

          Comment


          • #6
            You did not post your web.xml config. Is your spring dispatcher servlet configured to handle *.htm requests?

            Comment


            • #7
              sorry

              this is the web.xml

              Code:
              <?xml version="1.0" encoding="UTF-8"?>
              
              <web-app version="2.4" 
                  xmlns="http://java.sun.com/xml/ns/j2ee" 
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
                      http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
              
              	<display-name>GCI Shopping Application</display-name>
              	
              	<listener>
              		<listener-class>
              			org.springframework.web.context.ContextLoaderListener
              		</listener-class>
              	</listener>
              
              	<servlet>
                          <servlet-name>gci</servlet-name>
                          <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
              	    <load-on-startup>1</load-on-startup>
                      </servlet>
                  
              	<servlet-mapping>
                          <servlet-name>gci</servlet-name>
                          <url-pattern>*.htm</url-pattern>
                      </servlet-mapping>
                  
                  <welcome-file-list>
                      <welcome-file>index.htm</welcome-file>
                  </welcome-file-list>
                   
              </web-app>

              Comment


              • #8
                you need to map your contextConfigLocations:

                Code:
                	<servlet>
                		<servlet-name>gci</servlet-name>
                		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
                		<init-param>
                			<param-name>contextConfigLocation</param-name>
                			<param-value>
                				/WEB-INF/gci-servlet.xml
                				/WEB-INF/gci-webflow.xml				
                			</param-value>
                		</init-param>
                		<load-on-startup>1</load-on-startup>
                	</servlet>

                Comment


                • #9
                  thanks.

                  I had that in there. both in the "default" place and in a config directory where I wanted to put them.

                  But it didn't seem to make a difference.

                  Comment


                  • #10
                    So did it fix it or do you still have the same issue?

                    Comment


                    • #11
                      I still have the issue. Any of the three conditions has the same results:

                      1. no config param - default places
                      2. config param for default places
                      3. config param for config directory

                      all generate the same 404 error mentioned above.

                      I do appreciate your thinking the problem though.

                      Comment


                      • #12
                        ok i think i found it

                        Ok I think I found the issue...your not going to like it though

                        Are you using jsps? Try changing your:
                        Code:
                          	<welcome-file-list>
                            	<welcome-file>
                              		index.htm
                            	</welcome-file>
                          	</welcome-file-list>
                        to:
                        Code:
                          	<welcome-file-list>
                            	<welcome-file>
                              		index.jsp
                            	</welcome-file>
                          	</welcome-file-list>
                        index.jsp is my default page right now but when I changed it to match your index.htm I got a 404 error. Perhaps the web.xml is overriding your *.htm mapping. Not sure I fully understand what is going on but its worth a try to see if changing your welcome file fixes the issue. Let me know...

                        Comment


                        • #13
                          and just so you know

                          Here is what my index.jsp looks like:

                          Code:
                          <%@ page session="false"%>
                          <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
                          <%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
                          <%-- Redirected because we can't set the welcome page to a virtual URL. --%>
                          <c:redirect url="/ownerinformation.htm?_flowId=login-flow"/>
                          As noted in the comment you can't set the welcome page to a virtual URL so you may want to change that to something else

                          Comment


                          • #14
                            argh!

                            ok. I will remain calm...

                            I added the file. I did it with index.htm and index.jsp.

                            neither worked. it displayed the index.htm or index.jsp.

                            The connection to the webflow is just not being made.

                            I'm getting no errors. I keep reading the docs. I can't see what I'm leaving out.

                            Comment

                            Working...
                            X