简体   繁体   中英

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. 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.

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.

Your exception has nothing to do with AcitveJDBC. There is a problem with your Oracle configuration. I bet you will get the same exception if you try just JDBC with the same parameters. When/if you fix your issue with JDBC, ActiveJDBC will work just fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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