展开阅读全文
在使用最新的mysql-connector-java 6.0.5时,获取表定义信息会抛出空指针异常:
[2016-12-15 10:19:28][DEBUG][com.frameworkset.common.poolman.util.JDBCPool] load table[td_sm_dicttype]'s metadata.
java.lang.NullPointerException
at com.frameworkset.common.poolman.util.JDBCPool.buildTableMetaData(JDBCPool.java:1705)
at com.frameworkset.common.poolman.util.JDBCPool.getTableMetaDataFromDatabase(JDBCPool.java:1851)
at com.frameworkset.common.poolman.util.JDBCPool.getTableMetaData(JDBCPool.java:201)
at com.frameworkset.common.poolman.util.JDBCPool.getColumnMetaData(JDBCPool.java:217)
at com.frameworkset.common.poolman.sql.PrimaryKey.(PrimaryKey.java:304)
at com.frameworkset.common.poolman.management.BaseTableManager.getPoolTableInfos(BaseTableManager.java:182)
at com.frameworkset.common.poolman.management.BaseTableManager.initTableInfo(BaseTableManager.java:474)
at com.frameworkset.common.poolman.management.PoolManBootstrap.start(PoolManBootstrap.java:196)
at com.frameworkset.common.poolman.management.PoolManBootstrap.start(PoolManBootstrap.java:99)
at com.frameworkset.common.poolman.util.SQLManager.assertLoaded(SQLManager.java:142)
at com.frameworkset.common.poolman.util.SQLManager.requestConnection(SQLManager.java:304)
at com.frameworkset.platform.sysmgrcore.manager.SysmanagerInit.init(SysmanagerInit.java:39)
at com.frameworkset.platform.config.ConfigManager.startSystems(ConfigManager.java:126)
at com.frameworkset.platform.config.ConfigManager.init(ConfigManager.java:90)
at com.frameworkset.platform.config.ConfigManager.getInstance(ConfigManager.java:138)
at com.frameworkset.platform.security.SYSAuthenticateFilter.(SYSAuthenticateFilter.java:39)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.eclipse.jetty.servlet.ServletContextHandler$Context.createFilter(ServletContextHandler.java:1051)
at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:104)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:768)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:265)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
at org.eclipse.jetty.server.Server.doStart(Server.java:282)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedAdapter.start(JettyEmbeddedAdapter.java:67)
at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)
解决办法:在mysql的连接串中指定参数nullCatalogMeansCurrent=true,
可能还需要指定时区serverTimezone参数否则也会报其他错误:这里指定为serverTimezone=UTC
本文首发在云栖社区,遵循云栖社区版权声明:本文内容由互联网用户自发贡献,版权归用户作者所有,云栖社区不为本文内容承担相关法律责任。云栖社区已在2020年6月升级到阿里云开发者社区。如果您发现有涉嫌抄袭的内容,请填写侵权投诉表单进行举报,一经查实,阿里云开发者社区将协助删除涉嫌侵权内容。
网友评论
登录后评论
0/500
评论