I modify the inherited code and keep getting the weird “can't find character” error that throws me away.
//======= Error ========= Compiling 1 source file to /Users/Inprimus/Projects/Workspace/Soft/build/web/WEB-INF/classes /Users/Inprimus/Projects/Workspace/Soft/WebContent/WEB-INF/classes/fr/service/CarPeer.java:49: cannot find symbol symbol : method addCarToCompany(java.lang.Long,fr.model.company.Car) location: class fr.dao.CompanyDAO cmpDAO.addCarToCompany(idCompany,car); ^ 1 error
Car peer:
package fr.service; import fr.model.company.Car; import fr.dao.CompanyDAO; import fr.dao.CarDao; public class CarPeer { private static CarDao carDAO= new CarDao(); private static CompanyDAO cmpDAO = new CompanyDAO(); public static void storeCar(Long idCompany, Car car) throws UserServiceException, Exception { try { cmpDAO.addCarToCompany(idCompany,car); System.out.println("Car stored : "+car.toString()+" in "+idCompany); carDAO.storeCar(car); } catch(DAOException ex) { throw new UserServiceException(ex.getMessage(), ex); } } }
CompanyDao:
package fr.dao; import fr.model.accounting.Cost; import fr.model.company.Car; public class CompanyDAO extends GenericDAO<Company> { private enum ChildType { COST{ public void addChildToCompany(Company company, Object child) { company.addCost((Cost)child); } }, CAR{ public void addChildToCompany(Company company, Object child) { company.addCar((Car)child); } }; public abstract void addChildToCompany(Company company, Object child); } private void addChildToCompany(Long idCompany, Object child, ChildType type) throws NotFoundDAOException, AlreadyExistDAOException, Exception { try {
I checked triple, but still can not find anything bad in the code. I create it in Netbeans 7.0.1. I should mention that I get this error on creation, but I can run the web application without any problems (for now). But I'm worried that it might come back to bite after itself.
I just noticed in the file tree that the CompanyDAO classes have similar file names with the format: CompanyDAO $ ChildType # .class (# matches the number) I assume that he did not recompile the class to generate an additional child type I added. How can i do this?
source share