When running the code below I'm presented with a popup asking for my username and password.
If I press cancel, then an SQLException is raised but the script never exits. Also the print statement after jaydebeapi.connect never runs. I tried this on Windows 10 with Java 8 and on Ubuntu with Java 8, 11 and 17 using JayDeBeApi 1.2.3 (and JPype1 1.4.0). What is the reason the script won't exit and how can I make it shutdown properly?
Putting a try/except block around jaydebeapi.connect allows the print statement to run, but the script still doesn't exit.
Traceback (most recent call last):
File "org.jpype.JPypeContext.java", line -1, in org.jpype.JPypeContext.callMethod
File "Method.java", line 498, in java.lang.reflect.Method.invoke
File "DelegatingMethodAccessorImpl.java", line 43, in sun.reflect.DelegatingMethodAccessorImpl.invoke
File "NativeMethodAccessorImpl.java", line 62, in sun.reflect.NativeMethodAccessorImpl.invoke
File "NativeMethodAccessorImpl.java", line -2, in sun.reflect.NativeMethodAccessorImpl.invoke0
File "DriverManager.java", line 247, in java.sql.DriverManager.getConnection
File "DriverManager.java", line 664, in java.sql.DriverManager.getConnection
File "AS400JDBCDriver.java", line 403, in com.ibm.as400.access.AS400JDBCDriver.connect
File "AS400JDBCDriver.java", line 1280, in com.ibm.as400.access.AS400JDBCDriver.initializeConnection
File "AS400JDBCDriver.java", line 1446, in com.ibm.as400.access.AS400JDBCDriver.prepareConnection
File "AS400JDBCConnectionImpl.java", line 3513, in com.ibm.as400.access.AS400JDBCConnectionImpl.setProperties
File "AS400.java", line 1371, in com.ibm.as400.access.AS400.connectService
File "AS400.java", line 1414, in com.ibm.as400.access.AS400.connectService
File "AS400.java", line 4375, in com.ibm.as400.access.AS400.signon
File "AS400.java", line 3040, in com.ibm.as400.access.AS400.promptSignon
com.ibm.as400.access.AS400SecurityException: com.ibm.as400.access.AS400SecurityException: Signon was canceled.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "org.jpype.JPypeContext.java", line -1, in org.jpype.JPypeContext.callMethod
File "Method.java", line 498, in java.lang.reflect.Method.invoke
File "DelegatingMethodAccessorImpl.java", line 43, in sun.reflect.DelegatingMethodAccessorImpl.invoke
File "NativeMethodAccessorImpl.java", line 62, in sun.reflect.NativeMethodAccessorImpl.invoke
File "NativeMethodAccessorImpl.java", line -2, in sun.reflect.NativeMethodAccessorImpl.invoke0
File "DriverManager.java", line 247, in java.sql.DriverManager.getConnection
File "DriverManager.java", line 664, in java.sql.DriverManager.getConnection
File "AS400JDBCDriver.java", line 403, in com.ibm.as400.access.AS400JDBCDriver.connect
File "AS400JDBCDriver.java", line 1280, in com.ibm.as400.access.AS400JDBCDriver.initializeConnection
File "AS400JDBCDriver.java", line 1446, in com.ibm.as400.access.AS400JDBCDriver.prepareConnection
File "AS400JDBCConnectionImpl.java", line 3519, in com.ibm.as400.access.AS400JDBCConnectionImpl.setProperties
File "JDError.java", line 568, in com.ibm.as400.access.JDError.throwSQLException
File "JDError.java", line 610, in com.ibm.as400.access.JDError.throwSQLException
File "JDError.java", line 887, in com.ibm.as400.access.JDError.createSQLExceptionSubClass
Exception: Java Exception
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 17, in <module>
jaydebeapi.connect("com.ibm.as400.access.AS400JDBCDriver",
File "/home/user/.local/lib/python3.8/site-packages/jaydebeapi/__init__.py", line 412, in connect
jconn = _jdbc_connect(jclassname, url, driver_args, jars, libs)
File "/home/user/.local/lib/python3.8/site-packages/jaydebeapi/__init__.py", line 230, in _jdbc_connect_jpype
return jpype.java.sql.DriverManager.getConnection(url, *dargs)
java.sql.SQLException: java.sql.SQLException: The application server rejected the connection. (Signon was canceled.)
When running the code below I'm presented with a popup asking for my username and password.
If I press cancel, then an SQLException is raised but the script never exits. Also the print statement after
jaydebeapi.connect
never runs. I tried this on Windows 10 with Java 8 and on Ubuntu with Java 8, 11 and 17 using JayDeBeApi 1.2.3 (and JPype1 1.4.0). What is the reason the script won't exit and how can I make it shutdown properly?Putting a try/except block around
jaydebeapi.connect
allows the print statement to run, but the script still doesn't exit.Logged errors: