我不知道这是否真的与我让服务器使用 SSL 这一事实有关,但这是我所做的唯一更改。
这是两个参数列表:
没有 SSL:
-superDevMode -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl index.html -logLevel INFO -codeServerPort 9997 -port 8888 -server com.google.appengine.tools.development.gwt.AppEngineLauncher -war E:\java\mahlzeit-web\mahlzeit-web\war com.mahlzeit.web.Mahlzeit_web_server
这里使用 SSL:
-superDevMode -remoteUI "${gwt_remote_ui_server_port}:${unique_id}" -startupUrl index.html -logLevel INFO -codeServerPort 9997 -port 8888 -server com.google.appengine.tools.development.gwt.AppEngineLauncher -war E:\java\mahlzeit-web\mahlzeit-web\war com.mahlzeit.web.Mahlzeit_web_server -server :ssl com.mahlzeit.web.Mahlzeit_web_server
如果我使用 SSL 运行,我会收到以下错误:
org.hibernate.HibernateException: Could not instantiate dialect class
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:82)
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:64)
at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:148)
...
Caused by: java.lang.ClassCastException: org.hibernate.dialect.MySQLDialect cannot be cast to org.hibernate.dialect.Dialect
at org.hibernate.service.jdbc.dialect.internal.DialectFactoryImpl.constructDialect(DialectFactoryImpl.java:73)
... 33 more
我真的不知道 this 与 SSL 有什么关系,但是你去..我期待得到启发..
最佳答案
当你使用 -server :ssl
时,你不再使用 AppEngineLauncher
,所以类加载是不同的;使用类路径的父类加载器(AppEngine仅使用WEB-INF/{classes,lib}
);这就是导致 ClassCastException
的原因。
尝试从 DevMode 类路径中删除服务器依赖项作为起点;将它们仅留在 WEB-INF/lib
中。
关于 hibernate 异常 : Could not instantiate dialect class when using HTTPS for GWT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30673938/