【发布时间】:2013-09-01 16:50:53
【问题描述】:
我开始在 GWT 中开发应用程序。首先,我尝试了一个简单的登录。当用户点击登录按钮时,如果用户名和密码在数据库中,异步调用会检查服务器。 当我仅在服务器端运行它时(在一个简单的 main() 方法中)它工作正常。但是当我在我的浏览器中使用 GWT(实际上最后调用相同的方法)尝试它时,它会抛出以下异常(简而言之):
javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Io exception: The Network Adapter could not establish the connection
Error Code: 17002
我注意到EntityManagerFactory emf = Persistence.createEntityManagerFactory(...) 没问题,EntityManager em = emf.createEntityManager(); 抛出异常
任何帮助将不胜感激。
【问题讨论】: