Integrate Orbeon with spring mvc

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Integrate Orbeon with spring mvc

waller
I tried to integrate my new test spring mvc application with orbeon war by deploying
separately
when I call http://localhost:8080/NRXRestAPISimpleApps/xforms-jsp/guess-the-number/
I got exception as follow:

javax.servlet.ServletException: Can't find Orbeon Forms context called '/orbeon'. Check the 'oxf.xforms.renderer.context' filter initialization parameter and the <Context crossContext="true"/> attribute.
        org.orbeon.oxf.servlet.OrbeonXFormsFilter.getOPSContext(OrbeonXFormsFilter.java:133)
        org.orbeon.oxf.servlet.OrbeonXFormsFilter.doFilter(OrbeonXFormsFilter.java:100)
        org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
        org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
        org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
        org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)


I set context in server.xml

......
  </Service>
 
 
  <Context path="/NRXRestAPISimpleApps" docBase="NRXRestAPISimpleApps" crossContext="true"/>
 
</Server>

I used tomcat 6.0.24

when I hit http://localhost:8080/orbeon/xforms-jsp/guess-the-number/
it works fine

when I hit http://localhost:8080/NRXRestAPISimpleApps/
it works fine too

both orbeon and NRXRestAPISimpleApps war are in webapps fold

any idea?



Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

Alessandro  Vernet
Administrator
Do both Orbeon and NRXRestAPISimpleApps have crossContext="true" in
your server.xml?

Alex

On Tue, Mar 9, 2010 at 7:34 PM, waller <[hidden email]> wrote:

>
> I tried to integrate my new test spring mvc application with orbeon war by
> deploying
> separately
> when I call
> http://localhost:8080/NRXRestAPISimpleApps/xforms-jsp/guess-the-number/
> I got exception as follow:
>
> javax.servlet.ServletException: Can't find Orbeon Forms context called
> '/orbeon'. Check the 'oxf.xforms.renderer.context' filter initialization
> parameter and the <Context crossContext="true"/> attribute.
>
> org.orbeon.oxf.servlet.OrbeonXFormsFilter.getOPSContext(OrbeonXFormsFilter.java:133)
>
> org.orbeon.oxf.servlet.OrbeonXFormsFilter.doFilter(OrbeonXFormsFilter.java:100)
>
> org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:164)
>        org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
>
> org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
>
> org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
>
>
> I set context in server.xml
>
> ......
>  </Service>
>
>
>  <Context path="/NRXRestAPISimpleApps" docBase="NRXRestAPISimpleApps"
> crossContext="true"/>
>
> </Server>
>
> I used tomcat 6.0.24
>
> when I hit http://localhost:8080/orbeon/xforms-jsp/guess-the-number/
> it works fine
>
> when I hit http://localhost:8080/NRXRestAPISimpleApps/
> it works fine too
>
> both orbeon and NRXRestAPISimpleApps war are in webapps fold
>
> any idea?
>
>
>
>
> --
> View this message in context: http://n4.nabble.com/Integrate-Orbeon-with-spring-mvc-tp1586911p1586911.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

waller
My server.xml file:

<?xml version='1.0' encoding='utf-8'?>

<Server port="8005" shutdown="SHUTDOWN">

 
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
 
  <Listener className="org.apache.catalina.core.JasperListener" />
 
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
 
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <GlobalNamingResources>
 
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>


  <Service name="Catalina">

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
 

   
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>

     
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">



      </Host>
    </Engine>
  </Service>
 
   <Context path="/NRXRestAPISimpleApps" docBase="NRXRestAPISimpleApps" crossContext="true"/>
   <Context path="/orbeon" docBase="orbeon" crossContext="true"/>
 
 
</Server>






******************
my web.xml in NRXRestAPISimpleApps




<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

       
        <filter>
                <filter-name>UrlRewriteFilter</filter-name>
                <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
        </filter>

        <filter-mapping>
                <filter-name>UrlRewriteFilter</filter-name>
                <url-pattern>/*</url-pattern>
        </filter-mapping>
               
               
       
<filter>
    <filter-name>orbeon-xforms-filter</filter-name>
    <filter-class>org.orbeon.oxf.servlet.OrbeonXFormsFilter</filter-class>
    <init-param>
        <param-name>oxf.xforms.renderer.context</param-name>
        <param-value>/orbeon</param-value>
    </init-param>
</filter>

<filter-mapping>
    <filter-name>orbeon-xforms-filter</filter-name>
    <url-pattern>/xforms-jsp/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>

<filter-mapping>
    <filter-name>orbeon-xforms-filter</filter-name>
    <url-pattern>/orbeon/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
</filter-mapping>       
               
               
       
        <servlet>
                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
                <init-param>
                        <param-name>contextConfigLocation</param-name>
                        <param-value>
                                /WEB-INF/spring/*.xml
                        </param-value>
                </init-param>
                <load-on-startup>1</load-on-startup>
        </servlet>
               
       
        <servlet-mapping>
                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                <url-pattern>/app/*</url-pattern>
        </servlet-mapping>
       
</web-app>
Reply | Threaded
Open this post in threaded view
|

Re: Re: Integrate Orbeon with spring mvc

Alessandro  Vernet
Administrator
This is rather strange. You have crossContext="true" on both your app
and the Orbeon app, the Orbeon app is deployed on /orbeon. So
everything looks right, but you get the error: Can't find Orbeon Forms
context called '/orbeon'.

Does it work if you do this from another minimal war file that just
contains the filter, a web.xml, and a JSP that generates XForms?

Alex

On Thu, Mar 11, 2010 at 7:14 PM, waller <[hidden email]> wrote:

>
> My server.xml file:
>
> <?xml version='1.0' encoding='utf-8'?>
>
> <Server port="8005" shutdown="SHUTDOWN">
>
>  <!--APR library loader. Documentation at /docs/apr.html -->
>  <Listener className="org.apache.catalina.core.AprLifecycleListener"
> SSLEngine="on" />
>  <!--Initialize Jasper prior to webapps are loaded. Documentation at
> /docs/jasper-howto.html -->
>  <Listener className="org.apache.catalina.core.JasperListener" />
>  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
>  <Listener
> className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
>  <!-- JMX Support for the Tomcat server. Documentation at
> /docs/non-existent.html -->
>  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
> />
>  <Listener
> className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
>
>  <GlobalNamingResources>
>
>    <Resource name="UserDatabase" auth="Container"
>              type="org.apache.catalina.UserDatabase"
>              description="User database that can be updated and saved"
>              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
>              pathname="conf/tomcat-users.xml" />
>  </GlobalNamingResources>
>
>
>  <Service name="Catalina">
>
>    <Connector port="8080" protocol="HTTP/1.1"
>               connectionTimeout="20000"
>               redirectPort="8443" />
>
>
>    <!-- Define an AJP 1.3 Connector on port 8009 -->
>    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
>
>    <Engine name="Catalina" defaultHost="localhost">
>
>      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
>             resourceName="UserDatabase"/>
>
>      <!-- Define the default virtual host
>           Note: XML Schema validation will not work with Xerces 2.2.
>       -->
>      <Host name="localhost"  appBase="webapps"
>            unpackWARs="true" autoDeploy="true"
>            xmlValidation="false" xmlNamespaceAware="false">
>
>
>
>      </Host>
>    </Engine>
>  </Service>
>
>   <Context path="/NRXRestAPISimpleApps" docBase="NRXRestAPISimpleApps"
> crossContext="true"/>
>   <Context path="/orbeon" docBase="orbeon" crossContext="true"/>
>
>
> </Server>
>
>
>
>
>
>
> ******************
> my web.xml in NRXRestAPISimpleApps
>
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
>        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
>
>        <!-- Enables clean URLs with JSP views e.g. /welcome instead of
> /app/welcome -->
>        <filter>
>                <filter-name>UrlRewriteFilter</filter-name>
>
> <filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
>        </filter>
>
>        <filter-mapping>
>                <filter-name>UrlRewriteFilter</filter-name>
>                <url-pattern>/*</url-pattern>
>        </filter-mapping>
>
>
>        <!-- Declare and configure the Orbeon Forms XForms filter -->
> <filter>
>    <filter-name>orbeon-xforms-filter</filter-name>
>    <filter-class>org.orbeon.oxf.servlet.OrbeonXFormsFilter</filter-class>
>    <init-param>
>        <param-name>oxf.xforms.renderer.context</param-name>
>        <param-value>/orbeon</param-value>
>    </init-param>
> </filter>
> <!-- Any web resource under /xforms-jsp is processed by the XForms engine
> -->
> <filter-mapping>
>    <filter-name>orbeon-xforms-filter</filter-name>
>    <url-pattern>/xforms-jsp/*</url-pattern>
>    <dispatcher>REQUEST</dispatcher>
>    <dispatcher>FORWARD</dispatcher>
> </filter-mapping>
> <!-- This is necessary so that XForms engine resources can be served
> appropriately -->
> <filter-mapping>
>    <filter-name>orbeon-xforms-filter</filter-name>
>    <url-pattern>/orbeon/*</url-pattern>
>    <dispatcher>REQUEST</dispatcher>
>    <dispatcher>FORWARD</dispatcher>
> </filter-mapping>
>
>
>        <!-- Handles all requests into the application -->
>        <servlet>
>                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>
> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
>                <init-param>
>                        <param-name>contextConfigLocation</param-name>
>                        <param-value>
>                                /WEB-INF/spring/*.xml
>                        </param-value>
>                </init-param>
>                <load-on-startup>1</load-on-startup>
>        </servlet>
>
>        <!-- Maps all /app requests to the DispatcherServlet for handling -->
>        <servlet-mapping>
>                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
>                <url-pattern>/app/*</url-pattern>
>        </servlet-mapping>
>
> </web-app>
>
> --
> View this message in context: http://n4.nabble.com/Integrate-Orbeon-with-spring-mvc-tp1586911p1590094.html
> Sent from the Orbeon Forms (ops-users) mailing list archive at Nabble.com.
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

Karolin.Krieg
In reply to this post by waller
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

Karolin Heiss
In reply to this post by waller
Check your server.xml configuration:

  <Service> 
    <Engine>
      <Host>
        <Context path /orbeon docBase="orbeon" crossContext="true"/>
        <Context path /myapp docBase="myapp" crossContext="true"/>
      </Host>
    </Engine>
  </Service> 
Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

waller
thank you for your information,
Right now, we use spring 3.0 mvc, so everything is go through http.
Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

Jiang Bian
Have you got your problem solved?

I'm trying to do the same thing, but I can't even get an error message...
When I hit http://localhost:8080/iris/xforms-jsp/guess-the-number/
It just gives a white page with nothing...
Even no exception...

Could you show me your urlrewrite.xml?
Do I need to  do
<rule>
        <from>/xforms-jsp/**</from>
        <to last="true">/xforms-jsp/$1</to>
</rule>

because my spring dispatch listens on /app/**...
and I have something like
<rule>
        <from>/**</from>
        <to>/app/$1</to>
</rule>

in my urlrewrite.xml...

Thanks,

Jiang
Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

waller
you do not change anything in urlrewrite.xml, for Spring 3.0 it support REST perfect.
just deploy xfrom war and your application war together.
and call REST services directory in your XFORM

the only thing is context name is not the same.




On Tue, Apr 20, 2010 at 10:56 AM, Jiang Bian [via Orbeon Forms (ops-users)] <[hidden email]> wrote:
Have you got your problem solved?

I'm trying to do the same thing, but I can't even get an error message...
When I hit http://localhost:8080/iris/xforms-jsp/guess-the-number/
It just gives a white page with nothing...
Even no exception...

Could you show me your urlrewrite.xml?
Do I need to  do
<rule>
        <from>/xforms-jsp/**</from>
        <to last="true">/xforms-jsp/$1</to>
</rule>

because my spring dispatch listens on /app/**...
and I have something like
<rule>
        <from>/**</from>
        <to>/app/$1</to>
</rule>

in my urlrewrite.xml...

Thanks,

Jiang


View message @ http://n4.nabble.com/Integrate-Orbeon-with-spring-mvc-tp1586911p2017504.html
To unsubscribe from Re: Integrate Orbeon with spring mvc, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Integrate Orbeon with spring mvc

Jiang Bian
Well, I had it figured out. And in my case, I do have to change urlrewrite, since it's before the orbeon filter...
And I don't think this has anything to do with REST in spring.