Since our new Jira/Confluence setup is working now,
please open a Jira Issue for it with some details on the use case and how to test it :-)

I'll take a look if it's going to fit into a 1.1.0 or a 2.0.

regards, Achim

Am 03.06.2011 21:51, schrieb Troy Waldrep:
That sounds like a great opportunity for a new feature in PAX Web, i.e. the 
ability to consume a set of rewrite rules in the org.ops4j.pax.web.cfg file.  I 
would conjecture that many others have needed this capability and just probably 
gave up.

Troy

-----Original Message-----
From: general-boun...@lists.ops4j.org [mailto:general-boun...@lists.ops4j.org] 
On Behalf Of Achim Nierbeck
Sent: Friday, June 03, 2011 2:14 PM
To: general@lists.ops4j.org
Subject: Re: PAX Web Fragment Bundle Issue

Ok,

from finally realizing on what you are trying to do, I have to tell you
this won't work.
Not for 0.7.x nor for the 1.0.x version of pax web.

Since pax web starts and configures the jetty server during runtime
there is no
easy way to get a hold of the specialized HandlerCollection. And to make it
even worse, I think the RewriteHandler will never work since pax web does
it's own rewriting and handling of requests and request contexts.

Regards, Achim

Am 03.06.2011 19:38, schrieb Troy Waldrep:
The "addHandler" approach doesn't work (at least for me) in a custom jetty.xml 
in 6.1.26 standalone.  The following DOES work.

      <Set name="handler">
         <New id="Handlers" class="org.mortbay.jetty.handler.RewriteHandler">
           <Set name="rewriteRequestURI">false</Set>
           <Set name="rewritePathInfo">false</Set>
           <Set name="originalPathAttribute">requestedPath</Set>
           <Call 
name="addRewriteRule"><Arg>/howdy/*</Arg><Arg>/hello</Arg></Call>
           <Call 
name="addRewriteRule"><Arg>/docs/*</Arg><Arg>/javadoc</Arg></Call>
           <Set name="handler">
             <New id="Handlers" 
class="org.mortbay.jetty.handler.HandlerCollection">
               <Set name="handlers">
                <Array type="org.mortbay.jetty.Handler">
                  <Item>
                    <New id="Contexts" 
class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
                  </Item>
                  <Item>
                    <New id="DefaultHandler" 
class="org.mortbay.jetty.handler.DefaultHandler"/>
                  </Item>
                  <Item>
                    <New id="RequestLog" 
class="org.mortbay.jetty.handler.RequestLogHandler"/>
                  </Item>
                </Array>
               </Set>
             </New>
           </Set>
         </New>
       </Set>

Here, I'm setting the RewriteHandler as the handler that is returned for name 
"handler".  I then add the other required handlers as an array to it.  This 
works fine in standalone.  Seems like I could do something similar with PAX Web, but I 
don't really know anything about PAX Web 0.7.4 handler customizations.  If this was 
exposed, I could simply add PAX Web's customized Handler(s) to the array.

Troy
________________________________________
From: general-boun...@lists.ops4j.org [general-boun...@lists.ops4j.org] on 
behalf of Achim Nierbeck [bcanh...@googlemail.com]
Sent: Friday, June 03, 2011 11:47 AM
To: general@lists.ops4j.org
Subject: Re: PAX Web Fragment Bundle Issue

Hi Troy,

the only other idea that crosses my mind is to test it on a vanilla
Jetty server if that configuration works
out of the box since if the jetty server supports it it should also work
inside the pax-web context.

regards, Achim

Am 03.06.2011 00:49, schrieb Troy Waldrep:
We're too close to product release to try such a risky move, so no we haven't.  
I was hoping that it would work with the version of PAX Web that's already in 
our stack.

I can run a test on 1.0.3 to see if it works.  I'll have to change the 
jetty.xml if I do that since the RewriteHandler's API changed pretty 
significantly, so it won't be an apples to apples comparison.

Troy

-----Original Message-----
From: general-boun...@lists.ops4j.org [mailto:general-boun...@lists.ops4j.org] 
On Behalf Of Achim Nierbeck
Sent: Thursday, June 02, 2011 3:48 PM
To: general@lists.ops4j.org
Subject: Re: PAX Web Fragment Bundle Issue

Did you try with the latest pax web version, 1.0.3 and jetty 7?
I never tried with the 0.7 version of pax web and it's kind of outdated.

regards, Achim

Am 02.06.2011 16:39, schrieb Troy Waldrep:
I read the documented APIs of the exact version of Jetty 6 that is used by PAX 
Web 0.7.4, and it does support the methods and signatures that I'm using.  I 
also double-checked by opening the jetty jar and looked at the signatures of 
the associated classes.  So... I'm at a bit of a loss.

Troy
________________________________
From: general-boun...@lists.ops4j.org [general-boun...@lists.ops4j.org] on 
behalf of Achim Nierbeck [bcanh...@googlemail.com]
Sent: Thursday, June 02, 2011 4:07 AM
To: general@lists.ops4j.org
Subject: Re: PAX Web Fragment Bundle Issue

Hi Troy,

you might stop banging your head, it's not due to a failure of you :-)

The thing is, pax-web needs to create a specialized Context Handler,

the steps in 
http://ops4j1.jira.com/wiki/display/paxweb/Advanced+Jetty+Configuration
for adding specialized handlers was tested with pax-web 1.0.3 and Jetty 7.x
So this might be an issue of Jetty itself.
I don't know if jetty 6 supports the addHandle method at all.
You have to take a look at the jetty documentation.
Besides that your jetty.xml looks good so far I can not see
why this wouldn't work, besides that jetty might not support it. :(


regards, Achim

Am 02.06.2011 00:45, schrieb Troy Waldrep:
Hello,

We're hooking up a fragment bundle that contains a custom jetty.xml file to the 
jetty bundle of PAX Web 0.7.4 (bundles Jetty 6.1.26.1).  Part of the jetty.xml 
works as expected and exposes jetty&     PAX Web MBeans.  The second part 
attempts to add a custom Handler to rewrite shortcut URLs to our *real* URLs.  For 
some reason, the second part throws an illegal argument error.  I banged my head on 
this one for a day before deciding to ask the list.  No further information beyond 
the illegal argument error is provided, even at debug-level logging.  The actual 
error message is provided below the message below.

The jetty.xml file:

<Configure class="org.mortbay.jetty.Server">
        <!-THIS PART WORKS GREAT!!! -->
        <Call id="jettyMBeanServer" class="java.lang.management.ManagementFactory" 
name="getPlatformMBeanServer"/>
        <Get id="Container" name="container">
            <Call name="addEventListener">
                <Arg>
                    <New class="org.mortbay.management.MBeanContainer">
                        <Arg>
                            <Ref id="jettyMBeanServer"/>
                        </Arg>
                        <Call name="start"/>
                    </New>
                </Arg>
            </Call>
        </Get>

        <!-THIS PART THROWS AN ILLEGAL ARGUMENT ERROR -->
        <Get id="Handler" name="handler">
            <Call name="addHandler">
              <Arg>
                <New class="org.mortbay.jetty.handler.RewriteHandler">
                    <Set name="rewriteRequestURI">true</Set>
                    <Set name="rewritePathInfo">false</Set>
                    <Set name="originalPathAttribute">requestedPath</Set>
                    <Call 
name="addRewriteRule"><Arg>/designers</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/design</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/digui</Arg><Arg>/Designers</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/home</Arg><Arg>/Designers/HomePage.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/pd</Arg><Arg>/Designers/ProcessDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/md</Arg><Arg>/Designers/MapDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/im</Arg><Arg>/Designers/IntegrationManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/admin</Arg><Arg>/Designers/Admin.html</Arg></Call>
                </New>
              </Arg>
            </Call>
        </Get>
</Configure>

The error from the log file:

01 Jun 2011 17:14:24,083 | DEBUG | guration Updater | jetty                     
       | service.jetty.internal.JCLLogger   85 | XML get handler
01 Jun 2011 17:14:24,084 | WARN  | guration Updater | jetty                            | 
service.jetty.internal.JCLLogger  122 | Config error at<Call name="addHandler">
              <Arg>
                <New class="org.mortbay.jetty.handler.RewriteHandler">
                    <Set name="rewriteRequestURI">true</Set>
                    <Set name="rewritePathInfo">false</Set>
                    <Set name="originalPathAttribute">requestedPath</Set>
                    <Call 
name="addRewriteRule"><Arg>/designers</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/design</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/digui</Arg><Arg>/Designers</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/home</Arg><Arg>/Designers/HomePage.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/index.html</Arg><Arg>/Designers</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/pd</Arg><Arg>/Designers/ProcessDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/md</Arg><Arg>/Designers/MapDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/im</Arg><Arg>/Designers/IntegrationManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/admin</Arg><Arg>/Designers/Admin.html</Arg></Call>
                </New>
              </Arg>
            </Call>
01 Jun 2011 17:14:24,084 | WARN  | guration Updater | jetty                            | 
service.jetty.internal.JCLLogger  122 | Config error at<Get id="Handler" 
name="handler">
            <Call name="addHandler">
              <Arg>
                <New class="org.mortbay.jetty.handler.RewriteHandler">
                    <Set name="rewriteRequestURI">true</Set>
                    <Set name="rewritePathInfo">false</Set>
                    <Set name="originalPathAttribute">requestedPath</Set>
                    <Call 
name="addRewriteRule"><Arg>/designers</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/design</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/digui</Arg><Arg>/Designers</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/home</Arg><Arg>/Designers/HomePage.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/index.html</Arg><Arg>/Designers</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/pd</Arg><Arg>/Designers/ProcessDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/md</Arg><Arg>/Designers/MapDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/im</Arg><Arg>/Designers/IntegrationManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/admin</Arg><Arg>/Designers/Admin.html</Arg></Call>
                </New>
              </Arg>
            </Call>
        </Get>
01 Jun 2011 17:14:24,084 | ERROR | guration Updater | JettyServerImpl                  | 
e.jetty.internal.JettyServerImpl   78 | java.lang.IllegalArgumentException:<Call 
name="addHandler">
              <Arg>
                <New class="org.mortbay.jetty.handler.RewriteHandler">
                    <Set name="rewriteRequestURI">true</Set>
                    <Set name="rewritePathInfo">false</Set>
                    <Set name="originalPathAttribute">requestedPath</Set>
                    <Call 
name="addRewriteRule"><Arg>/designers</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/design</Arg><Arg>/Designers/DesignManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/digui</Arg><Arg>/Designers</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/home</Arg><Arg>/Designers/HomePage.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/index.html</Arg><Arg>/Designers</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/pd</Arg><Arg>/Designers/ProcessDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/md</Arg><Arg>/Designers/MapDesigner.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/im</Arg><Arg>/Designers/IntegrationManager.html</Arg></Call>
                    <Call 
name="addRewriteRule"><Arg>/admin</Arg><Arg>/Designers/Admin.html</Arg></Call>
                </New>
              </Arg>
            </Call>

Thanks in advance for any pointers that can be provided.

Troy Waldrep


_______________________________________________
general mailing list
general@lists.ops4j.org<mailto:general@lists.ops4j.org>
http://lists.ops4j.org/mailman/listinfo/general




_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general



_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general



_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general



_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general


_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to