errno

关于JPype报FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/jvm'错误的解决

て烟熏妆下的殇ゞ 提交于 2019-12-01 07:47:27
部署到线上的项目正常运行一年,今天早上突然报FileNotFoundError: [Errno 2] No such file or directory: '/usr/lib/jvm'错误。 JPype是一个能够让 python 代码方便地调用 Java 代码的工具,从而克服了 python 在某些领域(如服务器端编程)中的不足。 JPype的实际运行环境仍然是python runtime,只是在运行期间启动了一个嵌入的jvm。 找不到jvm,大概原因是环境变量没有生效。 平时在命令行中能直接运行java,是因为java所在的bin目录被添加到PATH,且由export PATH后作为环境变量生效。但是JAVA_HOME只是作为普通变量,使用os.getenv()的时候获取环境变量时找不到JAVA_HOME,所以推测应该只要将JAVA_HOME前面添加export,重启项目即可。 解决办法: 在全局配置文件/etc/profile或个人配置文件~/.bashrc或~/.bash_profile中添加export JAVA_HOME即可,如下是我的/etc/profile的设置: # set java path export JAVA_HOME=/usr/local/java/latest export PATH=${JAVA_HOME}/bin:${PATH} export

php中mysqli_connect_errno和mysqli_connect_error

感情迁移 提交于 2019-12-01 06:19:41
mysqli_connect_errno() 返回一个整数,标识连接数据库是否成功和各种错误的数值。 mysqli_connect_error() 返回连接错误信息。 以下是一些连接情况: mysqli_connect_errno mysqli_connect_error 2002 php_network_getaddresses: getaddrinfo failed: 不知道这样的主机。 1045 Access denied for user 'wjj'@'localhost' (using password: YES) 1049 Unknown database 'test' 0(连接成功) null $conn = new mysqli('localhost', 'user', 'pwd', 'dbname', '3306'); if(mysqli_connect_errno()){ exit('Connect failed:' . mysqli_connect_error()); } $conn->set_charset("utf8"); 来源: CSDN 作者: iamjunjie 链接: https://blog.csdn.net/justflyhigh/article/details/7611972

RabbitMQ(二)CentOS6.7 下的 HelloWorld

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 21:36:38
前一篇写了在Windows下的安装使用,这次记录下CentOS6.7下的安装使用. 其实在CentOS下和Windows下过程是一样的,都是 先安装Erlang环境,再安装RabbitMQ Server. 只不过CentOS下经常遇到各种问题,所以感觉上麻烦点. 版本是 CentOS6.7+RabbitMQ3.6.5 ,官方文档地址 http://www.rabbitmq.com/install-rpm.html 主要分以下部分 1) 安装Erlang环境 2) 安装RabbitMQ Server 3) 启动server,并启用管理台插件 4) 新增用户并设置权限 5) 外网 登录管理台 6) 代码连接CentOS下的MQ 7) 遇到的问题及解决办法 1) 安装Erlang环境 官网提供了3种安装方法,我这里用第一种. 按官网指引,来到 https://www.erlang-solutions.com/resources/download.html 页面, 这里可以选择linux的版本进行对应的下载. 我最开始 选择了centos,然后下载19.1.5这个版本, 然后进行安装发现少一堆包. 最后还是安装网页下发的 说明进行在线安装 首先 wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch

出错处理

▼魔方 西西 提交于 2019-11-30 19:40:13
1.错误检查 函数执行失败时,一般都会返回一个特定的值,比如-1,空指针等等。这些值只能说明有错误发生,而不能指出错误的原因。头文件errno.h定义了变量errno,它存储了错误发生时的错误码,通过错误码可以得到错误信息的描述。 程序开始执行时,变量errno被初始化为0,。很多库函数在执行过程中遇到错误就会将errno设置为相应的错误码。注:不能根据errno的值来判断一个函数是否正常执行。 例程 #include<stdio.h> #include<stdlib.h> #include<errno.h> int main() { FILE *fp; char *filename = "only_root.txt"; errno = 0; fp = fopen(filename, "r"); if(fp == NULL) printf("open file %s failed, error is %d\n", filename, errno); else printf("open file %s successfully!\n", filename); } 运行结果 2对应错误码ENOENT,得到出错原因是文件或目录不存在。 附一个errno错误码对照表链接 https://blog.csdn.net/ylwdi/article/details/24628927 2

npm errno -4048错误

99封情书 提交于 2019-11-30 16:38:04
这种错误是缓存原因导致的,首先清除缓存 npm cache clean --force 然后校验缓存依赖的完整和有效性 npm cache verify 最后重新安装即可 来源: https://www.cnblogs.com/nekopower/p/11604500.html

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! platform@1.0.0 start: `node build/dev-server.js`

夙愿已清 提交于 2019-11-30 16:15:37
这种错误是80端口被占用 需要自己手动在任务管理器里面吧这个端口关闭 下面是解决方案: 1 查找哪个程序占用 80 端口 1)“运行”中输入 cmd 2)在命令行中输入 netstat-ano (中间有空格),得到端口号对应的PID如图 查看80端口,所对应的PID并记下 2 打开任务管理器 点击详细信息(win10) 点击结束进程以后 重新运行项目就可以啦! 每次从网上(git)导入项目运行以后都需要把这个80端口关闭!不然还是会出现错误的 来源: CSDN 作者: 温清夜 链接: https://blog.csdn.net/qq_37288477/article/details/80531864

Redirect perror output to fprintf(stderr, “ ”)

青春壹個敷衍的年華 提交于 2019-11-30 14:33:34
问题 In case a system call function fails, we normally use perror to output the error message. I want to use fprintf to output the perror string. How can I do something like this: fprintf(stderr, perror output string here); 回答1: #include <errno.h> fprintf(stderr, "%s\n", strerror(errno)); Note: strerror doesn't apply \n to the end of the message 来源: https://stackoverflow.com/questions/5483120/redirect-perror-output-to-fprintfstderr

Difference between Linux errno 23 and Linux errno 24

拟墨画扇 提交于 2019-11-30 08:55:48
问题 What is the difference between these 2 linux errors in errno.h ? 23 and 24 I tried 2 different sites but can't understand difference between the two. [EMFILE] Too many open files. [ENFILE] Too many files open in system. # define ENFILE 23 /* File table overflow */ # define EMFILE 24 /* Too many open files */ Also, I am getting errno 24 and socket call failing at 974th time. ( AF_INET UDP datagram socket) When I did a cat /proc/sys/fs/file-max I am seeing a value of 334076 ulimit -n showing

Python socket.error: [Errno 111] Connection refused

≯℡__Kan透↙ 提交于 2019-11-30 08:22:57
I am trying to write a program for file transfer using sockets. The server end of the code is running fine. However, in the client side I get the following error Traceback (most recent call last): File "client.py", line 54, in <module> uploadFiles(directory) File "client.py", line 36, in uploadFiles transferFile(fname) File "client.py", line 13, in transferFile cs.connect((HOST, 36258)) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 111] Connection refused My code is as follows import os import socket def transferFile(fname):

Access to errno from Python?

╄→гoц情女王★ 提交于 2019-11-30 04:43:28
I am stuck with a fairly complex Python module that does not return useful error codes (it actually fails disturbingly silently). However, the underlying C library it calls sets errno. Normally errno comes in over OSError attributes, but since I don't have an exception, I can't get at it. Using ctypes, libc.errno doesn't work because errno is a macro in GNU libc. Python 2.6 has some affordances but Debian still uses Python 2.5. Inserting a C module into my pure Python program just to read errno disgusts me. Is there some way to access errno? A Linux-only solution is fine, since the library