Title: Unable to run Jython on Windows Server 2008 R2
Type: crash Severity: normal
Components: Core Versions: Jython 2.7.1
Status: closed Resolution: duplicate
Dependencies: Superseder: jython-Installer 2.7.1 error code 14001
View: 2620
Assigned To: Nosy List: jeff.allen, marcuswongkl
Priority: normal Keywords:

Created on 2019-11-12.05:58:06 by marcuswongkl, last changed 2019-12-13.07:34:26 by jeff.allen.

msg12768 (view) Author: (marcuswongkl) Date: 2019-11-12.05:58:06
Hi, we try to run Jython 2.7.1 on following environment but receiving error code 14001 upon executing jython.exe

Error message: Error loading Python DLL: D:\{folder}\jython2.7.1\bin\python27.dll (error code 14001)

OS: Windows Server 2008 R2 Enterprise
Java: version "1.8.0_161"
Java(TM) SE Runtime Environment (build - pwi3280sr5fp10-20180214_01(SR5 FP10))

Wonder if there is any compatibility issue with above configurations.

Any advice would be much appreciated.

msg12774 (view) Author: Jeff Allen (jeff.allen) Date: 2019-11-15.08:54:05
jython.exe is a launcher compiled from and depends on python27.dll (also in bin). If you don't have the DLL, the launcher doesn't work.

There is a bug #2620 related to this that stems from something Windows does to make sure you're using the most up-to-date DLL. (This is as I understand it.) It worked fine when we built 2.7.1, but if you install a later Python 2.7, it stops working. This may be your problem.

You can work around this by doing for yourself what the launcher would do, something like:

java -Xmx512m -Xss2560k -classpath D:\{folder}\jython2.7.1\jython.jar;. -Dpython.home=D:\{folder}\jython2.7.1 -Dpython.executable=D:\{folder}\jython2.7.1\bin\jython.exe -Dpython.launcher.uname=windows -Dpython.launcher.tty=true org.python.util.jython 

Arguments to the jython command follow this. Not all of it may be necessary for your application. You may still run into problems if you use subprocess to launch Jython, since it will go for jython.exe again.

In 2.7.2 (available in beta) we wrap the correct DLL into the jython.exe to fix #2620. If you're happy to trust your work to our 2.7.2b2 it may solve your problem, and we'd appreciate the test.
msg12794 (view) Author: (marcuswongkl) Date: 2019-11-25.05:20:35
hi Jeff, thank you for your reply. The workaround works well for us. Happy to try out new Jython version once our testing has stabilise as current setup has couple of dependencies on other open source libraries. 

Happy to close this issue for now.

msg12824 (view) Author: Jeff Allen (jeff.allen) Date: 2019-12-13.07:34:26
That's good. Closing as duplicate.
Date User Action Args
2019-12-13 07:34:26jeff.allensetstatus: pending -> closed
messages: + msg12824
2019-11-25 05:20:35marcuswongklsetmessages: + msg12794
2019-11-15 08:54:05jeff.allensetstatus: open -> pending
superseder: jython-Installer 2.7.1 error code 14001
messages: + msg12774
priority: normal
nosy: + jeff.allen
resolution: duplicate
2019-11-12 05:58:06marcuswongklcreate