mac tomcat 不能访问mysql数据库吗_tomcat无法访问数据库,

在Mac上运行Tomcat时遇到错误,显示无法初始化Spring WebApplicationContext,具体表现为Bean创建失败,特别是'sessionFactory' bean。错误原因是转换bean属性时出现问题,涉及到'annotatedClasses'类型不匹配。尽管数据库本身没有问题,因为开发环境可以正常连接,但Tomcat在启动时遇到了权限问题,可能与marage目录的权限设置有关。
摘要由CSDN通过智能技术生成

异常:17-Aug-201523:23:35.709INFO[localhost-startStop-1]org.apache.catalina.core.ApplicationContext.logContextListener:contextInitialized()17-Aug-201523:23:35.709INFO[loc...

异常:

17-Aug-2015 23:23:35.709 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()

17-Aug-2015 23:23:35.709 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()

17-Aug-2015 23:23:38.503 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath

17-Aug-2015 23:23:38.543 INFO [localhost-startStop-1] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext

17-Aug-2015 23:23:39.351 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/daoContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'java.util.ArrayList' to required type 'java.lang.Class[]' for property 'annotatedClasses'; nested exception is java.lang.IllegalArgumentException: Error loading class [com.marage.geo.db.Country]: problem with class file or dependent class.

权限设置:

drwxr-xr-x 9 tomcat tomcat 4.0K Aug 11 21:25 marage

数据库没有问题,因为使用开发环境连接数据库,正常。

展开

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值