Calculate amount in sales order -build error

Hi
While i was just following the Bicycle Workshop example apps, i am getting exception even my code looks the same and the relevant bean is also having no errors; I have attached the image. thanks in advance for help.

cuba4

Hello,
Could you please share whole code of OrderService interface? What type do you use for order parameter of calculateAmount method?

Here is the codes:

/* 
 * Copyright (c) 2016 sales 
 */ 
package com.inteacc.sales.service; 
/** 
 * @author mortoza 
 */ 
public interface OrderService { 
    String NAME = "sales_OrderService"; 
    BigDecimal calculateAmount(Order order); 
} 

/* 
 * Copyright (c) 2016 sales 
 */ 
package com.inteacc.sales.service; 
import com.inteacc.sales.entity.Order; 
import com.inteacc.sales.entity.SparePart; 
import org.springframework.stereotype.Service; 
import java.math.BigDecimal; 
/** 
 * @author mortoza 
 */ 
@Service(OrderService.NAME) 
public class OrderServiceBean implements OrderService { 
 @Override 
    public BigDecimal calculateAmount(Order order){ 
     BigDecimal amount = new BigDecimal(0); 
     if(order.getHoursSpent()!=null){ 
         amount=amount.add(new BigDecimal(order.getHoursSpent()).multiply(order.getMechanic().getHourlyRate())); 
     } 
     if(order.getParts()!=null){ 
         for(SparePart part : order.getParts()){ 
             amount=amount.add(part.getPrice()); 
         } 
     } 
     return amount; 
 } 
} 


/* 
 * Copyright (c) 2016 sales 
 */ 
package com.inteacc.sales.gui.order; 
import com.haulmont.cuba.gui.components.AbstractEditor; 
import com.inteacc.sales.entity.Order; 
import com.inteacc.sales.service.OrderService; 
import javax.inject.Inject; 
/** 
 * @author mortoza 
 */ 
public class OrderEdit extends AbstractEditor<Order> { 
    @Inject 
    private OrderService orderService; 
    @Override 
    protected boolean preCommit(){ 
        Order order = getItem(); 
        order.setAmount(orderService.calculateAmount(order)); 
        return  super.preCommit(); 
    } 
}

Hi
I just found the issue, it was the parameter type path in OrderService. Here is the updated code that works fine


/*
 * Copyright (c) 2016 sales
 */
package com.inteacc.sales.service;

import com.inteacc.sales.entity.Order;

import java.math.BigDecimal;

/**
 * @author mortoza
 */
public interface OrderService {
    String NAME = "sales_OrderService";
    BigDecimal calculateAmount(Order order);
}