이클립스 오류메세지


org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'commonUrlMapping' defined in ServletContext resource [/WEB-INF/config/app/appContext-servlet.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginController': Autowiring of methods failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void member.web.LoginController.setMemberSecurityService(member.service.MemberSecurityService); nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'memberSecurityService' defined in ServletContext resource [/WEB-INF/config/app/appContext-dao.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'memberSecurityDAO' of bean class [member.service.MemberSecurityServiceImpl]: Bean property 'memberSecurityDAO' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

(보안상 일부 삭제했어요 ~_~)



스프링을 이제 처음 접하는 나에게 왜 이런 시련을.. -_-..


Controller는 있는걸로 쓰고, service, model, dao, ibatis xml 파일까지 만들고, 톰캣 서버를 올렸더니 듣도보다 못한 위 에러 메세지가 떴습니다.


한 30분 삽질해서 서버를 띄웠네요ㅋㅋ



(제가 진행하고 있는 프로젝트 기준으로 쓰는 거라서, 가려서 참고하세요 ^^ㅋ)

스프링은 2.5 버전을 사용하고 있습니다.


1. appContext-dao.xml 파일에 Service와 DAO 추가한 것에 대한 BEAN을 설정해줍니다.

<bean id="Service" class="path" p: blahblah~ >


2. DAO를 호출하는 ServiceImpl 구현클래스에 DAO getter, setter를 만들어줍니다.


3. ibatis 설정파일(sqlMapConfig.xml)에 ibatis xml 파일 추가한 것에 대한 정보를 써줍니다. 

<sqlMap resource="XML PATH"/>




이렇게 해줬는데도 계속 에러가 나서 찾아보니


복사 붙여넣기 한 ServiceImpl 구현클래스에 사소한 오타가 ㅡ_ㅡ^.....


오타난 메소드 고치고 서버 올리니 제대로 올라옵디다ㅠ


















Posted by 야동우
,


// http:// 로 들어왔을 경우 https://로 redirect

String url = request.getRequestURL().toString();


// http:// 로 시작하고, url에 localhost와 test가 들어 있지 않을 경우에만 redirect

if( url.startsWith("http://") && ( url.indexOf("localhost") < 0 && url.indexOf("test") < 0) ) {

url = url.replaceAll("http://", "https://");

response.sendRedirect(url);

}





톰캣 올려서 localhost로 접근하거나, 테스트 서버에 배포하여 url에 test 구문이 들어가지 않은 

실제 서버에 접근했을 때, 


http:// 로 시작한 url일 경우 https:// 로 변경하여 redirect






출처: http://blog.naver.com/PostView.nhn?blogId=dryice80&logNo=80094262790

'Web > JSP' 카테고리의 다른 글

package javax.servlet does not exist 오류 해결방법  (2) 2013.09.17
Posted by 야동우
,

출처 : https://gist.github.com/liamdon/2467603



Preferecnes > Browse Packages 메뉴를 통해 Package들이 설치되어 있는 디렉토리로 가서


git으로 해당 패키지들을 땡겨옵니다.


git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScript
git clone https://github.com/miksago/jade-tmbundle.git Jade
git clone https://github.com/LearnBoost/stylus.git Stylus
git clone git://github.com/gregory-m/ejs-tmbundle.git EJS


그리고 Sublime Text를 재시작하면, 이제 EJS 등 다른 확장자를 가진 파일들도 구문 강조가 되네요 ^^

Posted by 야동우
,