简体   繁体   English

套接字写入错误与activejdbc

[英]Socket write error with activejdbc

I have a pretty simple commandline app that runs inside of eclipse that connects to an Oracle 12 database and issues a pretty simple query. 我有一个非常简单的命令行应用程序,该应用程序在Eclipse中运行,可连接到Oracle 12数据库并发出非常简单的查询。 I'm getting the following exception: 我收到以下异常:

Exception in thread "main" org.javalite.activejdbc.InitException: Failed to connect to JDBC URL: jdbc:oracle:thin:@oratest2a.emspic.org:1521:workstst
    at org.javalite.activejdbc.DB.open(DB.java:93)
    at org.javalite.activejdbc.Base.open(Base.java:64)
    at org.emspic.works.RegistrationUtil.doMain(RegistrationUtil.java:135)
    at org.emspic.works.RegistrationUtil.main(RegistrationUtil.java:75)
Caused by: java.sql.SQLRecoverableException: IO Error: Connection reset by peer: socket write error
    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:752)
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:666)

Code throwing the exception is basically this: 引发异常的代码基本上是这样的:

        // use properties to open the datasource for work
        System.out.println("Opening database connection.");
        logger.info("Opening database");
        String dbDriver = dbProps.get("dbDriver");
        String dbURL = dbProps.get("dbURL");
        String username = dbProps.get("username");
        String password = dbProps.get("password");

        Base.open(dbDriver, dbURL, username, password);
        logger.info("Database successfully opened.");

Everything I've googled indicates the problem is a "network issue"...except that on this same machine, I am currently connected to the very table I'm trying to open via TOAD...and I also am running a jboss as server connecting to that very same database...so there is no way it is a network problem. 我搜索过的所有内容都表明问题是“网络问题” ...除了在同一台计算机上,我目前已连接到我正试图通过TOAD打开的桌子上,而且我还在运行jboss当服务器连接到相同的数据库时...所以这根本不是网络问题。

I'm at a total loss. 我完全不知所措。

Java1.8, ojdbc7.jar, all running on a Microsoft Surface Pro 3..., Oracle version is 12.0.2 running remotely. Java1.8,ojdbc7.jar全部运行在Microsoft Surface Pro 3 ...上,Oracle版本是12.0.2远程运行。

Your exception has nothing to do with AcitveJDBC. 您的异常与AcitveJDBC没有关系。 There is a problem with your Oracle configuration. 您的Oracle配置有问题。 I bet you will get the same exception if you try just JDBC with the same parameters. 我敢打赌,如果您仅尝试使用具有相同参数的JDBC,您将获得相同的例外。 When/if you fix your issue with JDBC, ActiveJDBC will work just fine. 当/如果您解决了JDBC问题,ActiveJDBC将会很好地工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM