Results 1 to 6 of 6

Thread: Spring Roo examples and BlazeDS deploying

  1. #1
    Join Date
    Aug 2005
    Location
    Milton Keynes, UK
    Posts
    39

    Default Spring Roo examples and BlazeDS deploying

    I've had problems getting the correct version of STS 2.3.3.M1
    So, I worked out how to do everything from the Roo shell and have a packaged war to deploy.
    I've got the turnkey BlazeDS installed and ascertained that it is configured on port 8400 by default.
    Normally I think you just copy the war to the webapp folder and it'll deploy
    Is there a Tomcat deployment manager for BlazeDS.
    Any documentation you can point me to would be greatly appreciated.
    Cheers.

    Right...
    I think it is a case of just dumping the war in the webapps folder...
    But when I run the app as described in the Youtube demo (Roo/Flex one - like rootunes) - I get the following in the log files:

    Oct 12, 2010 2:09:46 PM org.apache.catalina.core.ApplicationDispatcher invoke
    SEVERE: Servlet.service() for servlet jgf threw exception
    javax.servlet.ServletException: Circular view path [index]: would dispatch back to the current handler URL [/jgf-0.1.0-SNAPSHOT/app/index] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
    at org.springframework.web.servlet.view.InternalResou rceView.prepareForRendering(InternalResourceView.j ava:275)
    at org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:214)
    at org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
    at org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1060)
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:798)
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:716)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:654)
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:445)
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:379)
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:292)
    at org.tuckey.web.filters.urlrewrite.NormalRewrittenU rl.doRewrite(NormalRewrittenUrl.java:195)
    at org.tuckey.web.filters.urlrewrite.RuleChain.handle Rewrite(RuleChain.java:159)
    at org.tuckey.web.filters.urlrewrite.RuleChain.doRule s(RuleChain.java:141)
    at org.tuckey.web.filters.urlrewrite.UrlRewriter.proc essRequest(UrlRewriter.java:90)
    at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter .doFilter(UrlRewriteFilter.java:417)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.HiddenHttpMethodFil ter.doFilterInternal(HiddenHttpMethodFilter.java:7 7)
    at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :88)
    at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.springframework.orm.jpa.support.OpenEntityMana gerInViewFilter.doFilterInternal(OpenEntityManager InViewFilter.java:113)
    at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:263)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:584)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:637)

    Passing comments:
    Looking at the web.xml that Roo generates I'm surprised the welcome-flle-list doesn't point to the scaffold.html, but since that's deployed outside the WEB-INF folder, I'm not sure on how that should work.
    It currently has a value of index - not index.html or anything conventional..

    I'm also getting Remote operation failed messages and this in the log files:

    Oct 12, 2010 2:33:21 PM org.apache.catalina.core.StandardHostValve custom
    SEVERE: Exception Processing ErrorPage[errorCode=404, location=/app/resourceNotFound]
    javax.servlet.ServletException: Circular view path [resourceNotFound]: would dispatch back to the current handler URL [/jgf-0.1.0-SNAPSHOT/app/resourceNotFound] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
    at org.springframework.web.servlet.view.InternalResou rceView.prepareForRendering(InternalResourceView.j ava:275)
    at org.springframework.web.servlet.view.InternalResou rceView.renderMergedOutputModel(InternalResourceVi ew.java:214)
    at org.springframework.web.servlet.view.AbstractView. render(AbstractView.java:250)
    at org.springframework.web.servlet.DispatcherServlet. render(DispatcherServlet.java:1060)
    at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:798)
    at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:716)
    at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:644)
    at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:549)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:690)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.ApplicationDispatcher.inv oke(ApplicationDispatcher.java:654)
    at org.apache.catalina.core.ApplicationDispatcher.pro cessRequest(ApplicationDispatcher.java:447)
    at org.apache.catalina.core.ApplicationDispatcher.doF orward(ApplicationDispatcher.java:379)
    at org.apache.catalina.core.ApplicationDispatcher.for ward(ApplicationDispatcher.java:292)
    at org.apache.catalina.core.StandardHostValve.custom( StandardHostValve.java:424)
    at org.apache.catalina.core.StandardHostValve.status( StandardHostValve.java:343)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:144)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:263)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:584)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:637)

    Once again I think this is likely to be down to the web.xml
    the servlet mapping for the Dispatcher servlet (named after app) having an incorrect url pattern:


    <!-- Handles Spring requests -->
    <servlet>
    <servlet-name>jgf</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/webmvc-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
    <servlet-name>jgf</servlet-name>
    <url-pattern>/app/*</url-pattern>
    </servlet-mapping>


    Remove the /app/* and just have /* surely...

    Hmm.. Looks to be more to this than meets the eye. Seems there is a urlrewrite.xml file I'm unfamiliar with. Wondering if that's creating a virtual representation of an app folder..

    I re-ran the perform package command and attached the output in case there are any indicators for what's going wroing in that.

    Could the lack of constructors in the AS3 Album/Artist files be the issue?
    Attached Files Attached Files
    Last edited by JGF; Oct 12th, 2010 at 09:57 AM.

  2. #2
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    With the way the Roo addon sets up the project for Maven, there is no need to get the Adobe BlazeDS distro involved at all. You should be able to deploy the war to a vanilla Tomcat. Alternatively you can just execute "mvn tomcat:run" to use the Tomcat Maven plugin that is already configured.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  3. #3
    Join Date
    Aug 2005
    Location
    Milton Keynes, UK
    Posts
    39

    Default

    Sweet.
    Had to remove my CATALINA_HOME environment variable, for mvn tomcat target (port 8080 conflict otherwise) and it worked liked a charm.

    The tuckey urlrewriting that's going on with /app/ etc... Where can I find out more about that stuff?

    I actually found it was covered in one of my books. Seam in Action. Section 3.4.3 - P120-121. Google books is always a great resource for this.
    http://tinyurl.com/33vrcys
    http://www.tuckey.org/
    Last edited by JGF; Oct 12th, 2010 at 10:53 AM.

  4. #4
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    Worth noting - prior to Roo 1.1.0.M3, we were using UrlRewriteFilter to get nice clean URLs (i.e., without the Servlet path in there). UrlRewriteFilter is a really nice flexible tool, but ultimately we found it was a little too complicated to get working with all the possible Roo front-ends (which now include the traditional out-of-the-box Spring MVC, GWT, and Flex) using a single UrlRewrite config. The <mvc:default-servlet-handler> config tag essentially eliminates the need for it, as it allows us to map the DispatcherServlet to /* while still allowing the Servlet container's default Servlet to be invoked for static resources. So in Roo 1.1.0.M3 and onwards, the UrlRewriteFilter has been taken out. The M2 release of the Flex addon will sync up with the new approach.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  5. #5
    Join Date
    May 2008
    Location
    Silicon Valley, CA
    Posts
    139

    Default

    FWIW: With the pre-1.1.0, I added this to the urlrewrite.xml to make it work:
    Code:
    <urlrewrite default-match-type="wildcard">
    	<rule>
    		<from>/messagebroker/**</from>
    		<to last="true">/messagebroker/$1</to>
    	</rule>
    	<!-- support RDS url: -->
    	<!-- 	 -->
    	<rule>
    		<from>/CFIDE/**</from>
    		<to last="true">/CFIDE/$1</to>
    	</rule>
    ...

  6. #6
    Join Date
    Sep 2010
    Location
    Sri Lanka
    Posts
    61

    Question roo flex spring integrationb ERROR

    here is mine.but same error

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.2//EN" "http://tuckey.org/res/dtds/urlrewrite3.2.dtd">
    
    <urlrewrite default-match-type="wildcard">
    	<rule>
    		<from>/resources/**</from>
    		<to last="true">/resources/$1</to>
    	</rule>
    	<rule>
    		<from>/static/WEB-INF/**</from>
    		<set type="status">403</set>
    		<to last="true">/static/WEB-INF/$1</to>
    	</rule>
    	<rule>
    		<from>/static/**</from>
    		<to last="true">/$1</to>
    	</rule>
    	<rule>
    		<from>/</from>
    		<to last="true">/rootunes_scaffold.html</to>		
    	</rule>
    	<rule>
    		<from>/rootunes/**</from>
    		<to last="true">/rootunes/$1</to>
    	</rule>
    	<rule>
    		<from>/*.*</from>
    		<to>/$1.$2</to>
    	</rule>
    	<rule>
    		<from>/**/*.*</from>
    		<to>/$1/$2.$3</to>
    	</rule>
    	<rule>
    		<from>/**</from>
    		<to>/app/$1</to>
    	</rule>
    	<outbound-rule>
    		<from>/app/**</from>
    		<to>/$1</to>
    	</outbound-rule>	
    </urlrewrite>
    Error :
    Attached Images Attached Images
    Last edited by priyanka_hdp; Jul 3rd, 2012 at 11:57 AM. Reason: ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •