1 2 Previous Next 17 Replies Latest reply on Mar 25, 2003 8:02 AM by jules

    JBoss/Jetty FAQ...

      I may make this a regular posting.

      Let me know if there a useful Q&As that you would like to see in this document, points that need expanding, etc....

      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jboss/contrib/jetty/FAQ?rev=HEAD&content-type=text/vnd.viewcvs-markup

      Jules

        • 1. Re: JBoss/Jetty FAQ...
          joelvogt

          I just had a read through and found this section interesting:

          *quote*

          I want to serve content from outside a war
          -------------------------------------------------

          To serve external content, you can step outside the J2EE way of doing
          things and use Jetty's proprietary configuration mechanism to tell it
          to serve pages from anywhere on your disc.

          Add something like this to the ConfigurationElement in
          jbossweb.sar/META-INF/jboss-service.xml, to serve static pages:


          /documents/*
          /docroot/
          TRUE


          This example maps the context /documents to the directory /docroot, so
          to retrieve e.g. /docroot/myfile.html you would hit
          http://localhost:8080/documents/myfile.html.

          *quote*

          This is all well and good, does anyone know how to do this using tomcat/catalina?

          • 2. Re: JBoss/Jetty FAQ...
            coughlam

            Hi,
            I tried your suggestion by placing the "Call" tags below in the xml file. However, when I done this I got a SaxParseException:

            --- Start Exception
            11:22:06,688 WARN [Jetty] WARNING: ERROR@null line:2 col:-1 : org.xml.sax.SAXParseException: Root element type is "Call", but was declared to be "Configure".
            11:22:06,698 ERROR [Jetty] problem configuring Jetty:
            org.xml.sax.SAXParseException: Root element type is "Call", but was declared to be "Configure".
            at org.apache.crimson.parser.Parser2.error(Parser2.java:3086)
            at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1325)
            --- End Exception


            My JBoss service xml document's ConfigurationElement section looks like this:



            /monitoring/*
            f:/monitoring/
            TRUE






            etc......................


            Any suggestions ??

            Thanks in advance,
            Mick



            • 3. Re: JBoss/Jetty FAQ...
              coughlam

              It's OK, I got it working,it was my own fault.

              Thanks !
              Mick

              • 4. Re: JBoss/Jetty FAQ...

                It looks like it is time this was posted again.

                Jules

                • 5. Re: JBoss/Jetty FAQ...

                  and again.....


                  Jules

                  • 6. Re: JBoss/Jetty FAQ...
                    tcabot

                    I think that the "howto change the jetty listener port" topic needs to change slightly. In the jboss distro that I'm currently using (3.0.0 I think) the sar is jetty-plugin.sar (not jbossweb.sar).

                    Anyway, thanks for the FAQ!

                    • 7. Re: JBoss/Jetty FAQ...

                      3.0.0 is pretty out of date - 3.0.2 is out.

                      I'm afraid I only maintain the FAQ on HEAD - i.e. for the latest version, otherwise my life just gets even more complicated than it already is.

                      But thanks for the comment.

                      Jules

                      • 8. Re: JBoss/Jetty FAQ...

                        and again...

                        • 9. Re: JBoss/Jetty FAQ...
                          tsangcn

                          Hello Jules,

                          I have the following comments on the FAQ

                          Don't delete JSP compilation results...
                          ------------------------------------
                          The keepgenerated init parameter doesn't help. It only controls the generated Java source files but not the compiled Java classes.

                          I want to add the following to the FAQ

                          Where should I put the webdefault.xml
                          -------------------------------------
                          The default file is in $JBOSS_HOME/deploy/jbossweb.sar/org.mortbay.jetty.jar/org/mortbay/jetty/servlet/webdefault.xml
                          But I want to keep it unmodified. I want to keep my modified version somewhere else. But how to specify the location.
                          Specify it in $JBOSS_HOME/deploy/jbossweb.sar/META-INF/jboss-service.xml
                          Yes, but how to specified the format.
                          I have try this
                          webdefault.xml
                          The JBoss server's log saying that it cannot find this resource.
                          It seems that it expect to find the file in the current directory where JBoss is started.
                          OK, I put it in $JBOSS_HOME/bin. Then I have the following in server.log

                          DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.web:service=JBossWeb
                          DEBUG [org.jboss.system.ServiceConfigurator] WebDefault set to webdefault.xml in jboss.web:service=JBossWeb
                          DEBUG [org.jboss.jetty.JettyService] set WebDefault to webdefault.xml
                          WARN [org.jboss.jbossweb] Cannot find resource for webdefault.xml: using default
                          DEBUG [org.jboss.jbossweb] webdefault specification is: file:/C:/jboss8080/bin/./webdefault.xml

                          Why it still complaint cannot find resource for webdefault.xml, but then it use my webdefault.xml as default.
                          Something quite contradict.

                          Then I have try this
                          META-INF/webdefault.xml

                          This time, I have the following in server.log

                          DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.web:service=JBossWeb
                          DEBUG [org.jboss.system.ServiceConfigurator] WebDefault set to META-INF/webdefault.xml in jboss.web:service=JBossWeb
                          DEBUG [org.jboss.jetty.JettyService] set WebDefault to META-INF/webdefault.xml
                          WARN [org.jboss.jbossweb] Cannot find resource for META-INF/webdefault.xml: using default
                          DEBUG [org.jboss.jbossweb] webdefault specification is: file:/C:/jboss8080/server/default/deploy/jbossweb.sar/META-INF/./webdefault.xml

                          This time, it expect it not to relative to $JBOSS_HOME/bin but ..../jbossweb.sar
                          But it still complaint "Cannot find resource for ..."

                          So, what is the rule to specify webdefault.xml?


                          the scratchdir init parameter for JSP
                          -------------------------------------
                          If the parameter value is not begin with "/", the directory should be relative to the current directory where JBoss is started
                          If it start with "/", it is the root directory of the file system.

                          Thanks
                          CN

                          • 10. Re: JBoss/Jetty FAQ...

                            and again....

                            • 11. Re: JBoss/Jetty FAQ...

                              and again...

                              • 12. Re: JBoss/Jetty FAQ...

                                I've added a number of new items and expanded some old ones...


                                Jules

                                • 13. Re: JBoss/Jetty FAQ...

                                  it's time this was posted again...

                                  • 14. Re: JBoss/Jetty FAQ...

                                    and again - a few updates...

                                    1 2 Previous Next