FYI 

I just tried it with  SNAPSHOT apache-cxf-2.1.1-20080605.204511-10 and it
has the same problem.

The working (order) code can be found below, if the position of getOrderItem
and getOrder is swapped getOrderItem is resolved to getOrder instead.

@Path("/customerservice/order/")
public class CustomerService {

    Map<Long, Customer> customers = new HashMap<Long, Customer>();
    Map<Long, Order> orders = new HashMap<Long, Order>();

    public CustomerService() {
        init();

    }

    @GET
    @Path("{orderId}")
    public Order getOrderItem(@PathParam("orderId") String orderId) {
        System.out.println("----invoking getOrderItem, Order id is: " +
orderId);
        long idNumber = Long.parseLong(orderId);
        Order c = orders.get(idNumber);
        return c;
    }


    @Path("{orderId}")
    public Order getOrder(@PathParam("orderId") String orderId) {
        System.out.println("----invoking getOrder, Order id is: " +
orderId);
        long idNumber = Long.parseLong(orderId);
        Order c = orders.get(idNumber);
        return c;
    }

    @GET
    public List<Order> getOrderList() {
        System.out.println("----invoking getOrderList");

        return null;
    }    

    final void init() {



        Customer c = new Customer();
        c.setName("John");
        c.setId(123);
        customers.put(c.getId(), c);


        Order o = new Order();
        o.setName("order 223");
        o.setId(223);
        orders.put(o.getId(), o);
    }

}



-- 
View this message in context: 
http://www.nabble.com/jax-rs-strange-behaviour-resolving-end-points-tp17791427p17812563.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to