我有一个对我没有任何意义的堆栈跟踪。我认为它的本质是“找不到数据源名称并且没有指定默认驱动程序”部分,但我注册了一个驱动程序而我没有使用数据源。如果有帮助,我使用的是SQL Anywhere 10驱动程序(ianywhere)。有没有人有任何想法?
2013-02-15 13:16:58,076 [http-apr-80-exec-1] ERROR errors.GrailsExceptionResolver - SQLException occurred when processing request: [GET] /Booklist/booklist/show
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. Stacktrace follows:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
at ianywhere.ml.jdbcodbc.jdbc3.IDriver.connect(IDriver.java:490)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:243)
at booklist.Book.getClassesWithBooks(Book.groovy:22)
at booklist.BooklistController.show(BooklistController.groovy:11)
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:195)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
编辑:问题是,这在我的本地开发机器上运行得很好,但是只要我们构建一个War并将它放在tomcat服务器上,就会弹出这个可爱的错误
答案 0 :(得分:0)
我认为这条痕迹很清楚。查看第一条错误消息:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. Stacktrace follows:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
ODBC驱动程序未正确设置。它指向一个不存在的数据库。或者,也许是对于不存在的服务器。
答案 1 :(得分:0)
这似乎是Grails
配置问题。检查您正在构建战争(开发,生产)的环境以及DataSource.groovy中的相关配置。 Grails Documentation