ddud
50
2019-05-14 17:33:36
1
158

mybatis연동시 에러ㅠㅠ



root-context.xml

	<bean id="realDataSource" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
	<constructor-arg ref="dataSource"/>
	<property name="logFormatter">
	<bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">
	<property name="loggingType" value="MULTI_LINE"/>
	<property name="sqlPrefix" value="[SQL]"></property>
	</bean>
	</property>
	</bean>
	
	
	<bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="realDataSource"/>
		<!-- classpath: -> resource 에서 시작한다 -->
		<property name="configLocation" value="classpath:mybatis-config.xml"></property>
		<property name="mapperLocations" value="classpath:mapper/**/*.xml"></property>
	</bean>




에러1:Error creating bean with name 'sqlSessionFactoryBean' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path resource [mybatis-config.xml] cannot be opened because it does not exist


에러2:class path resource [mybatis-config.xml] cannot be opened because it does not exist

경로를 맞게 넣은거 같은데 mybatis-config.xml 경로에러로

위와같은 에러가 납니다.

0
0
  • 답변 1

  • icksss
    1k
    2019-05-14 18:07:17

    / 함 줘봐여

    classpath:/mybatis-config.xml      

    0
  • 로그인을 하시면 답변을 등록할 수 있습니다.