0

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.

Paul
  • 1

1 Answers1

0

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.

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
  • ipolevoy, that was a good suggestion...I replaced all my activejdbc code with jdbc code, and was in fact getting the same error. After a LOT of tinkering, I switched to Java1.7, and the problem went away. However, with Java1.8 and ojdbc8.jar, I cannot connect to the database. JDBC or otherwise. Not sure what is going on. I inherited this codebase from another developer, and much of the code depends on Java1.8 features...so I'm in a quandry. – Paul Nov 16 '17 at 21:41
  • if much of the code depends on Java8 and Oracle, then they should work together, right? Maybe you need to talk to an Oracle admin. – ipolevoy Nov 16 '17 at 22:09