自定义数据库连接不成功的问题

加载了我拷贝过去的驱动,但是连接不上,我的配置是没问题的!

把完整的异常日志贴出来看看

idea.log (64.3 KB)

从日志看连接超时了:
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.informix.asf.Connection.getSocket(Connection.java:2201)
at com.informix.asf.Connection.openSocket(Connection.java:1819)

确定连接串配置的正确的吗?

配置是没问题的!

你是如何确定配置的连接串没有问题?



第一个图片配置与第二个图片配置一致,我直接执行第二个图片进行数据库更新操作是没有问题的!

项目在启动的试试,数据源是可以加载的!!!能正常访问到数据库的数据!!!只有cuba studio 中连接不上!!

具体哪个操作步骤连接不上?

这个帖子一开始说的就是这个位置出现的错误吗?

是的!

启用 CUBA Studio 的 DEBUG 级别日志,然后再重新操作一下,把输出的日志贴上来。

2020-01-09 15:15:57,097 [15293525] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 135 ms
2020-01-09 15:16:38,893 [15335321] INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: #com.haulmont.studio
2020-01-09 15:16:40,269 [15336697] DEBUG - ckend.pm.RunningProjectWatcher - Could not connect to {}:{}: {}localhost8080java.net.ConnectException: Connection refused: connect
2020-01-09 15:16:42,669 [15339097] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 136 ms
2020-01-09 15:16:42,684 [15339112] DEBUG - tellij.ui.cubatree.CubaSection - [perf] ModuleSettingsSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,686 [15339114] DEBUG - tellij.ui.cubatree.CubaSection - [perf] ModuleSettingsSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,686 [15339114] DEBUG - tellij.ui.cubatree.CubaSection - [perf] ModuleSettingsSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,686 [15339114] DEBUG - tellij.ui.cubatree.CubaSection - [perf] WarSubSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,686 [15339114] DEBUG - tellij.ui.cubatree.CubaSection - [perf] UberJarSubSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,686 [15339114] DEBUG - tellij.ui.cubatree.CubaSection - [perf] ProjectSection#contains(VirtualFile). Time: 6ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] DataModelSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] ServicesSubSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] BeansSubSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] MiddlewareSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] MainMessagePackSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] ScreensSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] ThemesSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] GenericUiSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:42,687 [15339115] DEBUG - tellij.ui.cubatree.CubaSection - [perf] UrlsSection#contains(VirtualFile). Time: 0ms
2020-01-09 15:16:43,274 [15339702] DEBUG - ckend.pm.RunningProjectWatcher - Could not connect to {}:{}: {}localhost8080java.net.ConnectException: Connection refused: connect
2020-01-09 15:16:44,669 [15341097] DEBUG - i.cubatree.CubaProjectViewPane - [perf] CubaProjectViewPane#updateFromRoot. Time: 0 ms
2020-01-09 15:16:46,281 [15342709] DEBUG - ckend.pm.RunningProjectWatcher - Could not connect to {}:{}: {}localhost8080java.net.ConnectException: Connection refused: connect
2020-01-09 15:16:49,287 [15345715] DEBUG - ckend.pm.RunningProjectWatcher - Could not connect to {}:{}: {}localhost8080java.net.ConnectException: Connection refused: connect
2020-01-09 15:16:52,290 [15348718] DEBUG - ckend.pm.RunningProjectWatcher - Could not connect to {}:{}: {}localhost8080java.net.ConnectException: Connection refused: connect
2020-01-09 15:17:02,332 [15358760] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_221
2020-01-09 15:17:02,338 [15358766] INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Java/jdk1.8.0_221
2020-01-09 15:17:10,102 [15366530] WARN - ndling.DefaultExceptionHandler - Studio error:
java.sql.SQLException: com.informix.asf.IfxASFException: Attempt to connect to database server (gbaseserver) failed.
at com.informix.jdbc.IfxSqliConnect.(IfxSqliConnect.java:1528)
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 com.informix.jdbc.IfxDriver.connect(IfxDriver.java:245)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at com.haulmont.studio.backend.ed.ddl.DbManager.openConnection(SourceFile:269)
at com.haulmont.studio.backend.ed.ddl.DbManager.getConnection(SourceFile:122)
at com.haulmont.studio.backend.ed.ddl.DbManager.getConnection(SourceFile:116)
at com.haulmont.studio.backend.ed.ddl.DbManager.getTablesInLowerCase(SourceFile:160)
at com.haulmont.studio.backend.ed.ddl.DbManager.requiredTablesExist(SourceFile:189)
at com.haulmont.studio.backend.ed.ddl.DbManager.requiredTablesExist(SourceFile:185)
at com.haulmont.studio.intellij.runconfiguration.InteractiveDbChecker.lambda$checkExistingDb$0(SourceFile:117)
at com.haulmont.studio.intellij.CubaDumbService.lambda$smartRead$0(SourceFile:53)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:974)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
at com.haulmont.studio.intellij.CubaDumbService.smartRead(SourceFile:46)
at com.haulmont.studio.intellij.runconfiguration.InteractiveDbChecker.checkExistingDb(SourceFile:117)
at com.haulmont.studio.intellij.runconfiguration.InteractiveDbChecker.checkDatabaseState(SourceFile:112)
at com.haulmont.studio.intellij.runconfiguration.InteractiveDbChecker.canStart(SourceFile:92)
at com.haulmont.studio.intellij.runconfiguration.stepbefore.CheckDataBaseTaskProvider.executeTask(SourceFile:63)
at com.intellij.execution.impl.ExecutionManagerImpl.lambda$compileAndRun$0(ExecutionManagerImpl.java:328)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.informix.asf.IfxASFException: Attempt to connect to database server (gbaseserver) failed.
at com.informix.util.IfxErrMsg.getLocIfxASFException(IfxErrMsg.java:751)
at com.informix.asf.Connection.openSocket(Connection.java:1857)
at com.informix.asf.Connection.(Connection.java:399)
at com.informix.jdbc.IfxSqliConnect.(IfxSqliConnect.java:1248)
… 29 more
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at com.informix.asf.Connection.getSocket(Connection.java:2201)
at com.informix.asf.Connection.openSocket(Connection.java:1819)
… 31 more
2020-01-09 15:17:23,193 [15379621] INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 123 ms

idea.log 上传一下

idea.log (741.6 KB)

我们正在英文论坛处理这个问题,请看这个帖子:https://www.cuba-platform.com/discuss/t/how-to-enable-debug-log-level-in-studio/11171/7 .

现在需要上传几个文件来帮助排查问题,方便的话请在英文论坛上跟帖上传需要的文件。

已经上传到英文论坛!非常感谢!