The CodeDeploy agent did not find an AppSpec file within the unpacked revision directory at revision-relative path "appspec.yml". The revision was unpacked to directory "/opt/codedeploy-agent/deployment-root/7a4336d8-06e1-4025-abe0-192e0bffa4e1/d-L0T638J4B/deployment-archive", and the AppSpec file was expected but not found at path "/opt/codedeploy-agent/deployment-root/7a4336d8-06e1-4025-abe0-192e0bffa4e1/d-L0T638J4B/deployment-archive/appspec.yml". Consult the AWS CodeDeploy Appspec documentation for more information at http://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file.html
The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.
PetService petService = new JdbcPetService();
Pet pet ;
try {
pet = petService.get(id_);//펫id
pet.setId(id_);
pet.setName(name);
pet.setGender(gender);
pet.setBirthday(birthday);
pet.setPersonality(personality);
// pet.setMemberId(id_);
pet.setBreedId(breedId);
petService.updatePetProfile(pet);
} catch (Exception e) {
resp.sendRedirect("exception.html");
}
JdbcPetService.java수정
Pet테이블에 없는열이름으로 게터 세터하고있어서 '열명이 부적합하다'는 에러 발생
Pet테이블에 없는 애들 지우기
sql left join적용해서 getList()와 형식맞추기
@Override
public Pet get(int id) {
// String sql = String.format("SELECT * FROM PET WHERE PET.ID=%d", id);
String sql = String.format("SELECT P.*,B.NAME BREED,TO_CHAR(SYSDATE,'YYYY')-TO_CHAR(BIRTHDAY, 'YYYY')+1 AGE FROM PET P LEFT JOIN BREED B ON B.ID = p.breed_id WHERE P.ID =%d", id);
try {
String url = "jdbc:oracle:thin:@hi.namoolab.com:1521/xepdb1";
Class.forName("oracle.jdbc.OracleDriver");
Connection con = DriverManager.getConnection(url, "PETHARU", "1357");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(sql);
rs.next();
String name = rs.getString("name");
String gender = rs.getString("gender");
String birthday = rs.getString("birthday");
String personality = rs.getString("personality");
int age = rs.getInt("age");
Pet pet = new Pet();
pet.setName(name);
pet.setGender(gender);
pet.setBirthday(birthday);
pet.setPersonality(personality);
pet.setAge(age);
rs.close();
st.close();
con.close();
return pet;
} catch (Exception e) {
e.printStackTrace();
throw new ServiceException();
}
}
Select option DB연동
강아지 품종테이블은 Pet과 별도이므로
- DB : Breed 테이블에 품종 및 아이디 미리 insert후, 사용자는 breed_id만 사용
- JdbcPetService : Reg, edit 의 sql에 left join 적용
- JSP(HTML) : select 태그 입력, name = "breed_id" 적용
view table생성하면 left join의 번거로움을 줄일 수있고 sql도 간편해진다고하는데 , 뷰를 위한 left join을 일단 해야하는데 left join이 잘안된다.. 내일은 이걸로 시간 다보내겠구나