- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我测试了一个简单的 hello world 行来测试 JPype:
jpype.java.lang.System.out.println(" Hello World ")
它在“主”python 程序的上下文中运行良好。但是,在运行线程的上下文中,我得到以下响应:
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f5272aeb226, pid=7888, tid=139991902578432
#
# JRE version: 7.0_01-b08
# Java VM: Java HotSpot(TM) 64-Bit Server VM (21.1-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C [_jpype.so+0x33226] JPJavaEnv::FindClass(char const*)+0x36
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/imedia/NTsvm/src/server/nlp/hs_err_pid7888.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
Aborted
最佳答案
引用自JPype documentation :
Python Threads
For the most part, python threads based on OS level threads (i.e posix threads), will work without problem. The only thing to remember is to call
jpype.attachThreadToJVM()
in the thread body to make the JVM usable from that thread. For threads that you do not start yourself, you can callisThreadAttachedToJVM()
to check.
HTH
关于java - JPype 不能在线程内工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7861299/
我正在使用 JayDeBeAPI在 PySpark(Apache Spark Python API)中,这是我的代码的开头(请注意,我实际上是通过 PySpark 的交互式 shell 运行所有这些代
我已经阅读并搜索了所有堆栈溢出..我还找到了JPype class not found但它并没有帮助我,虽然它已经解决了!我也有同样的问题 !我正在使用 Mac,python 2.7.6 我的 pyt
我找到了一些关于如何将用户构建的 .class 和 .jar 文件导入 JPype 的说明,但我似乎很难让任何东西正常工作。 有效方法:我可以导入标准的 java 内容并打印 HELLO WORLD
我在下面附上我的代码 from jpype import * from javax.swing import JFrame classpath = "-Djava.class.path=praat.j
我测试了一个简单的 hello world 行来测试 JPype: jpype.java.lang.System.out.println(" Hello World ") 它在“主”python 程序
除了 print 语句之外,还有其他方法可以检查 jpype 和 java 之间的连接吗?我已经在 anaconda(Windows 10 64 位、anaconda python27(64 位)和来
我有一个 python 代码,它通过 jpype 使用 java 库。目前,每次运行我的函数都会检查 JVM 是否存在,如果不存在则创建它 import jpype as jp def myfunc(
我有一个类似的代码 message = "abc".encode() messageDigest = java.security.MessageDigest.getInstance("SHA-256"
我们有用 Python 编写的软件,它使用 JPype 调用 Java,Java 执行各种资源繁重的计算/报告构建。我们最初在启动 JVM 时分配了 800mb 的堆空间。 Java 端是完全多线程的
我有一个java程序员,有以下行 service.loadPropertiesForItems(Inbox, new PropertySet(ItemSchema.Subject, ItemSchem
当我尝试使用 jpype 使用 stanford 解析器时,出现以下错误 文件“C:\Python26\lib\site-packages\stanford_parser\parser.py”,第 1
JPype 是一个了不起的项目,因为我允许直接从 Python 实例化一个 JVM。 不幸的是,我陷入了第一步。 我有 A.java 源代码(位于 C:\tmp 文件夹): class A {
我的代码: jarLocation = "C:/Users/LahiruGunawardhana/Desktop/New folder/info/infodynamics.jar" # Start t
我有一个 java 外观类,我试图从 python 访问,所以我决定使用 JPype。我的外观类只有一个构造函数(无默认值)和四个参数 public facade(String a, String b
我正在尝试使用 JPype 从 Python 调用 Apache Pdfbox,但实际上在导入这些类时遇到了一些困难。它似乎无法从类路径中的 jar 文件中读取它们。 from jpype impor
我正在开发一个客户端 - 服务器软件,其中服务器由 python 开发。我想从python中的java程序调用一组方法。所有 java 方法都存在于一个 jar 文件中。这意味着我不需要加载不同的 j
我从 https://github.com/Netflix/photon 构建了 Netflix Photon docker 镜像它的工作原理就像我能够启动容器并运行提供的 java 应用程序一样。
是否存在可在 NumPy 之间进行转换的库或脚本和 JPype数组? 最佳答案 没有 JArray(float, 1)(numpyarray) 工作? 至少 JArray(float, 1)(nump
我正在尝试在 JPype 中实例化 Properties 对象,但遇到了一些困难。下面的命令... props = JClass('java.util.Properties') props.setPr
我使用 JPype 是为了在 python 中使用 java 类。我有一个文件夹,其中包含多个自写的 .jar 文件。 我知道如何长期导入多个 .jar: ... CLASSPATH = "/path
我是一名优秀的程序员,十分优秀!