【问题标题】:java.sql.SQLException: Io exception: The Network Adapter could not establish the connectionjava.sql.SQLException:Io 异常:网络适配器无法建立连接
【发布时间】: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(); 抛出异常

任何帮助将不胜感激。

【问题讨论】:

    标签: java gwt oracle10g ejb


    【解决方案1】:

    我想我终于找到了答案。当我开始开发我的应用程序时,我生成了示例代码。我勾选了“使用 Google App Engine”。现在在没有 GAE 的情况下重新开始整个项目并且它可以工作。 我正在学习 GWT,老实说,我不知道 GAE 是干什么用的。我只是点击了“next-next-finish”,并没有意识到危险......

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-28
      相关资源
      最近更新 更多