Hi,

You can create a customer ErrorHandler and configure it into the Jetty Engine like this.

<httpj:engine-factory bus="cxf">
    <httpj:engine port="9001">
      ...
      <httpj:handlers>
        <beans:bean class="com.example.MyErrorHandler"/>
      </httpj:handlers>
    </httpj:engine>
  </httpj:engine-factory>

On 12/21/10 12:00 AM, Matteo Bertamini wrote:
Hi everyone!
I'm new to CXF but I'm finding very well with it. I'm using it to create
a web service with the JAX-WS frontend and the default embedded Jetty:

---------------------------
System.out.println("Starting Server");
HelloWorldImpl implementor = new HelloWorldImpl();
String address = "http://localhost:9000/helloWorld";;
Endpoint e = Endpoint.publish(address, implementor);
---------------------------

everything is working fine in my example, but I would like to handle the
HTTP errors like "404 not found", just to personalize my service in case
someone points to my server address to see what happens.

I've found this page for personalizing what I want in Jetty:
http://docs.codehaus.org/display/JETTY/How+to+Create+Custom+Error+Pages

but I really don't know how to associate this configuration to my
default Jetty CXF server. I'm also using an cxf.xml configuration file
to personalize the Jetty threads:
----------------------------------------
<beans xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration";
        xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                        
http://cxf.apache.org/transports/http-jetty/configuration
http://cxf.apache.org/schemas/configuration/http-jetty.xsd";>
<httpj:engine-factory bus="cxf">
<!-- You can specify a value of 0 for the port attribute. Any threading
properties specified in an httpj:engine element with its port attribute
set to 0 are used as the configuration for all Jetty listeners that are
not explicitly configured. -->
     <httpj:engine port="0">
       <httpj:threadingParameters minThreads="5"
                                  maxThreads="15" />
     </httpj:engine>
   </httpj:engine-factory>


</beans>
----------------------------------------

but I don't know if I can put some configuration I need here because I
haven't found any info about it.

Does someone know a little more about it? Any piece of suggestion?

Thanks :-)
Matteo




--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Reply via email to