'Error creating bean with name '' defined in ServletContext resource'에 해당되는 글 1건

  1. 2007/08/15 iamyhs Flex(Cairngorm)+Spring+iBATIS+Oracle+Resin 연동시 대표적인 에러 몇가지들 (4)
1)테스트 환경
Resin Pro 3.0.23
Flex 3.0b,Cairngorm 2.2
Spring 2.0.6
iBATIS 2.3.0.677
Oracle 9i


Error 내용 :
[RPC Fault faultString="Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource" faultCode="Server.Processing" faultDetail="null"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at mx.rpc::Responder/fault()
    at mx.rpc::AsyncRequest/fault()
    at ::NetConnectionMessageResponder/NetConnectionChannel.as$40:NetConnectionMessageResponder::statusHandler()
    at mx.messaging::MessageResponder/status()

java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource


Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource

Error 해결 : commons-dbcp-1.2.2.jar 파일을 WEB-INF/lib 에 카피해서 해결




Error 내용 :
Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool

[RPC Fault faultString="Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool" faultCode="Server.Processing" faultDetail="null"]
    at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
    at mx.rpc::Responder/fault()
    at mx.rpc::AsyncRequest/fault()
    at ::NetConnectionMessageResponder/NetConnectionChannel.as$40:NetConnectionMessageResponder::statusHandler()
    at mx.messaging::MessageResponder/status()

Error 해결 : commons-pool-1.3.jar  파일을 WEB-INF/lib 에 카피해서 해결



Error 내용 :
Error creating bean with name 'categoryService' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'categoryDao' of bean class [com.appfoundation.flexibatis.services.CategoryServiceImpl]: Bean property 'categoryDao' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

Error 해결 : 주의할 것!! CategoryServiceImpl *Service 인터페이스를 구현한 클래스 에는 반드시 Spring applicationContext.xml 에서 DAO Config 부분의 bean id와 같은 getter,setter가 있어야한다. 익숙하기 전까지는 자주 실수하는 부분이다.


Error 내용 :
org.springframework.jdbc.CannotGetJdbcConnectionException : Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (ORA-01017: invalid username/password; logon denied
)

Error 해결 : application.properties 안의 아이디 비번이 틀린경우이다.


Error 내용 :
com.ibatis.sqlmap.client.SqlMapException : There is no statement named Category.getCategoryList in this SqlMap.
   
Error 해결 : SqlMapConfig.xml 파일에서 해당 sqlmap 파일을 명시하지 않았다
(아니면 이미 있는데,테스트시 코멘트 처리한걸 풀어주지 않고 테스트하는 경우가 있다.)


Error 내용 :
//com.ibatis.sqlmap.client.SqlMapException: There is already a statement named getContacts in this SqlMap.

가령 ContactDaoImpl 클래스를 코딩할때 아래처럼 Contact.getContacts 처럼 해줘야한다,다른 map 파일에서 똑같은 이름의 메소드가 있다면,아래 에러가 난다.
이 에러때문에 한참 헤맸었다.아래 포스팅에도 언급해놨지만, 이 부분때문에 반나절을 헤맨 기억이 나서 다시 중복으로 언급해둔다.

위와 관련해서 sqlmapconfig.xml 에 아래의 태그를 추가해준다.

    <settings useStatementNamespaces="true"/>
   

    public List getContacts() throws DataAccessException {
        //return getSqlMapClientTemplate().queryForList("getContacts");   //이게 아니라 아래처럼이다.
        return getSqlMapClientTemplate().queryForList("Contact.getContacts");           
    }
   




2007/08/15 16:59 2007/08/15 16:59