iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >java process.waitfor返回1的原因及解决
  • 407
分享到

java process.waitfor返回1的原因及解决

2024-04-02 19:04:59 407人浏览 八月长安

Python 官方文档:入门教程 => 点击学习

摘要

目录java process.waitfor返回1大致的原因如下process.waitFor()的返回值含义以下是linux中返回值对照表java process.waitfor返

java process.waitfor返回1

java的process,在执行命令时,出现waitfor返回1错误。根据java文档,是operation not permited。但绝大多数情况下,这是瞎扯。

真正原因是,你执行的命令(dos或linux下的命令),java的process执行时候,出错了。而错误本身是在这个命令的字符串上。

大致的原因如下

1. 字符串中包含额外的空格,导致命令不对。比如文件名之类的。解决方案,无非用引号把文件名之类的参数引起来

2. 还一个比较恶心的是,执行的命令,你最好用绝对路径。很多情况下,你要执行的工具可能放在系统默认的路径下,这种情况下,你直接在dos窗口或linux命令行下,执行都是正常的,但是一到程序中,就死活返回1的错误。

3. 另一个process执行返回1的原因可能是:进程执行所需的环境不正确。

当然,我碰到的问题不属于上面情况。Process里执行的shell脚本要操作文件,结果这个文件在其它地方被占用了,导致process执行失败

process.waitFor()的返回值含义

以下是Linux中返回值对照表


"OS error code   1:  Operation not permitted"
"OS error code   2:  No such file or directory"
"OS error code   3:  No such process"
"OS error code   4:  Interrupted system call"
"OS error code   5:  Input/output error"
"OS error code   6:  No such device or address"
"OS error code   7:  Argument list too long"
"OS error code   8:  Exec fORMat error"
"OS error code   9:  Bad file descriptor"
"OS error code  10:  No child processes"
"OS error code  11:  Resource temporarily unavailable"
"OS error code  12:  Cannot allocate memory"
"OS error code  13:  Permission denied"
"OS error code  14:  Bad address"
"OS error code  15:  Block device required"
"OS error code  16:  Device or resource busy"
"OS error code  17:  File exists"
"OS error code  18:  Invalid cross-device link"
"OS error code  19:  No such device"
"OS error code  20:  Not a directory"
"OS error code  21:  Is a directory"
"OS error code  22:  Invalid argument"
"OS error code  23:  Too many open files in system"
"OS error code  24:  Too many open files"
"OS error code  25:  Inappropriate ioctl for device"
"OS error code  26:  Text file busy"
"OS error code  27:  File too large"
"OS error code  28:  No space left on device"
"OS error code  29:  Illegal seek"
"OS error code  30:  Read-only file system"
"OS error code  31:  Too many links"
"OS error code  32:  Broken pipe"
"OS error code  33:  Numerical argument out of domain"
"OS error code  34:  Numerical result out of range"
"OS error code  35:  Resource deadlock avoided"
"OS error code  36:  File name too long"
"OS error code  37:  No locks available"
"OS error code  38:  Function not implemented"
"OS error code  39:  Directory not empty"
"OS error code  40:  Too many levels of symbolic links"
"OS error code  42:  No message of desired type"
"OS error code  43:  Identifier removed"
"OS error code  44:  Channel number out of range"
"OS error code  45:  Level 2 not synchronized"
"OS error code  46:  Level 3 halted"
"OS error code  47:  Level 3 reset"
"OS error code  48:  Link number out of range"
"OS error code  49:  Protocol driver not attached"
"OS error code  50:  No CSI structure available"
"OS error code  51:  Level 2 halted"
"OS error code  52:  Invalid exchange"
"OS error code  53:  Invalid request descriptor"
"OS error code  54:  Exchange full"
"OS error code  55:  No anode"
"OS error code  56:  Invalid request code"
"OS error code  57:  Invalid slot"
"OS error code  59:  Bad font file format"
"OS error code  60:  Device not a stream"
"OS error code  61:  No data available"
"OS error code  62:  Timer expired"
"OS error code  63:  Out of streams resources"
"OS error code  64:  Machine is not on the network"
"OS error code  65:  Package not installed"
"OS error code  66:  Object is remote"
"OS error code  67:  Link has been severed"
"OS error code  68:  Advertise error"
"OS error code  69:  Srmount error"
"OS error code  70:  Communication error on send"
"OS error code  71:  Protocol error"
"OS error code  72:  Multihop attempted"
"OS error code  73:  RFS specific error"
"OS error code  74:  Bad message"
"OS error code  75:  Value too large for defined data type"
"OS error code  76:  Name not unique on network"
"OS error code  77:  File descriptor in bad state"
"OS error code  78:  Remote address changed"
"OS error code  79:  Can not access a needed shared library"
"OS error code  80:  Accessing a corrupted shared library"
"OS error code  81:  .lib section in a.out corrupted"
"OS error code  82:  Attempting to link in too many shared libraries"
"OS error code  83:  Cannot exec a shared library directly"
"OS error code  84:  Invalid or incomplete multibyte or wide character"
"OS error code  85:  Interrupted system call should be restarted"
"OS error code  86:  Streams pipe error"
"OS error code  87:  Too many users"
"OS error code  88:  Socket operation on non-socket"
"OS error code  89:  Destination address required"
"OS error code  90:  Message too long"
"OS error code  91:  Protocol wrong type for socket"
"OS error code  92:  Protocol not available"
"OS error code  93:  Protocol not supported"
"OS error code  94:  Socket type not supported"
"OS error code  95:  Operation not supported"
"OS error code  96:  Protocol family not supported"
"OS error code  97:  Address family not supported by protocol"
"OS error code  98:  Address already in use"
"OS error code  99:  Cannot assign requested address"
"OS error code 100:  Network is down"
"OS error code 101:  Network is unreachable"
"OS error code 102:  Network dropped connection on reset"
"OS error code 103:  Software caused connection abort"
"OS error code 104:  Connection reset by peer"
"OS error code 105:  No buffer space available"
"OS error code 106:  Transport endpoint is already connected"
"OS error code 107:  Transport endpoint is not connected"
"OS error code 108:  Cannot send after transport endpoint shutdown"
"OS error code 109:  Too many references: cannot splice"
"OS error code 110:  Connection timed out"
"OS error code 111:  Connection refused"
"OS error code 112:  Host is down"
"OS error code 113:  No route to host"
"OS error code 114:  Operation already in progress"
"OS error code 115:  Operation now in progress"
"OS error code 116:  Stale NFS file handle"
"OS error code 117:  Structure needs cleaning"
"OS error code 118:  Not a XENIX named type file"
"OS error code 119:  No XENIX semaphores available"
"OS error code 120:  Is a named type file"
"OS error code 121:  Remote I/O error"
"OS error code 122:  Disk quota exceeded"
"OS error code 123:  No medium found"
"OS error code 124:  Wrong medium type"
"OS error code 125:  Operation canceled"
"OS error code 126:  Required key not available"
"OS error code 127:  Key has expired"
"OS error code 128:  Key has been revoked"
"OS error code 129:  Key was rejected by service"
"OS error code 130:  Owner died"
"OS error code 131:  State not recoverable"
"Mysql error code 132: Old database file"
"mysql error code 133: No record read before update"
"Mysql error code 134: Record was already deleted (or record file crashed)"
"MySQL error code 135: No more room in record file"
"MySQL error code 136: No more room in index file"
"MySQL error code 137: No more records (read after end of file)"
"MySQL error code 138: Unsupported extension used for table"
"MySQL error code 139: Too big row"
"MySQL error code 140: Wrong create options"
"MySQL error code 141: Duplicate unique key or constraint on write or update"
"MySQL error code 142: Unknown character set used"
"MySQL error code 143: Conflicting table definitions in sub-tables of MERGE table"
"MySQL error code 144: Table is crashed and last repair failed"
"MySQL error code 145: Table was marked as crashed and should be repaired"
"MySQL error code 146: Lock timed out; Retry transaction"
"MySQL error code 147: Lock table is full;  Restart program with a larger locktable"
"MySQL error code 148: Updates are not allowed under a read only transactions"
"MySQL error code 149: Lock deadlock; Retry transaction"
"MySQL error code 150: Foreign key constraint is incorrectly formed"
"MySQL error code 151: Cannot add a child row"
"MySQL error code 152: Cannot delete a parent row"

以上为个人经验,希望能给大家一个参考,也希望大家多多支持编程网。

--结束END--

本文标题: java process.waitfor返回1的原因及解决

本文链接: https://www.lsjlt.com/news/159825.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • java process.waitfor返回1的原因及解决
    目录java process.waitfor返回1大致的原因如下process.waitFor()的返回值含义以下是Linux中返回值对照表java process.waitfor返...
    99+
    2024-04-02
  • java file.renameTo返回false的原因及解决方案
    java file.renameTo返回false原因 需要对文件夹下的文件重命名,发现返回false了,先用main方法测试,发现没问题,如下 public static vo...
    99+
    2024-04-02
  • VSstudio中scanf返回值被忽略的原因及解决方法(推荐)
    相信有不少人在使用vs的时候会遇到以下这个问题:scanf返回值被忽略,接下来我就告诉大家该如何解决这个问题 出现问题的原因: 因为scanf()在读取数据时不检查边界,所以可能会...
    99+
    2024-04-02
  • 使用JSON.toJSONString()返回{}的原因
    目录JSON.toJSONString()返回{}原因测试代码原因JSON.toJSONString的坑有些字段没有了1.问题2.解决方式3.原因JSON.toJSONString(...
    99+
    2024-04-02
  • Java OOM原因以及解决方案
    1)什么是OOM? OOM,全称“Out Of Memory”,翻译成中文就是“内存用完了”,来源于java.lang.OutOfMemoryError。看下关于的官方说明...
    99+
    2024-04-02
  • 阿里云服务器返回RST的原因与解决方法
    阿里云服务器返回RST是一个常见的网络错误,它表示服务器返回了一个“请求状态”(ResponseStatus)的表示。这个表示可能包含服务器返回的信息,如请求的成功或失败,以及错误的原因。这篇文章将详细说明阿里云服务器返回RST的原因,并...
    99+
    2023-11-23
    阿里 解决方法 原因
  • redis setIfAbsent返回null的问题及解决
    目录起因原因解决起因 今天在写业务代码的时候,用到了StringRedisTemplate中redisTemplate.opsForValue().setIfAbsent()中并不是我期望的true或者false而是返回...
    99+
    2022-11-22
    redis setIfAbsent setIfAbsent返回null redis setIfAbsent返回null
  • java.lang.StackOverflowError出现的原因及解决
    目录java.lang.StackOverflowError出现的原因深入理解java.lang.StackOverflowError栈的特点出现StackOverflowError...
    99+
    2024-04-02
  • Java中java.lang.ClassCastException异常原因及解决方法
    通常我们在 OOP 设计中都会使用到继承。 ​​但是在继承对象之间的强制转换可能会遇到​​java.lang.ClassCastException​​异常的错误。 错误的日志如下:...
    99+
    2024-04-02
  • PHP返回非JSON格式数据的可能原因与解决方案
    PHP返回非JSON格式数据的可能原因与解决方案 在开发Web应用程序时,经常会使用PHP作为后端语言来处理数据并将其返回给前端页面。通常情况下,我们会选择将数据以JSON格式返回给前...
    99+
    2024-03-13
    数据 php json
  • SpringMvc返回modelandview返回的页面无法跳转问题及解决
    目录关于modelandview跳转问题modelandview跳转出错解决原因:引错了包!!!关于modelandview跳转问题 小白刚刚开始学习使用springmvc框架,配置...
    99+
    2024-04-02
  • 探讨PHP返回数据乱码问题的原因和解决方法
    PHP作为一种流行的脚本语言,通过处理HTTP请求和响应的方式,使得Web应用程序开发变得简单高效。然而,PHP返回数据乱码问题在应用程序开发过程中经常出现,这给开发人员带来了很多麻烦。本篇文章将探讨PHP返回数据乱码问题的原因和解决方法。...
    99+
    2023-05-14
  • excel下拉排序都是1的原因是什么及如何解决
    今天小编给大家分享一下excel下拉排序都是1的原因是什么及如何解决的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。excel...
    99+
    2023-07-02
  • mysql锁表原因及解决
    mysql锁表原因及解决 问题如图 锁表发生原因 锁表发生在 insert、update、delete中;锁表的原理是数据库使用独占式锁机制,当执行上面的语句时,对表进行锁住,直到发生co...
    99+
    2023-09-01
    mysql 数据库 sql
  • SpringMVC返回的ResponseEntity出现乱码及解决
    目录返回ResponseEntity乱码问题原因解决ResponseEntity下载文件名中文乱码解决办法问题解决返回ResponseEntity乱码 问题 前台通过数据到后台查询相...
    99+
    2024-04-02
  • 详解Java中NullPointerException异常的原因以及解决方法
    NullPointerException是Java中常见的异常之一,通常是在运行时发生的。该异常表示程序试图访问一个空对象的属性或调...
    99+
    2023-08-11
    java
  • Python返回函数的原理及使用
    这篇文章主要介绍“Python返回函数的原理及使用”,在日常操作中,相信很多人在Python返回函数的原理及使用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Python返回函数的原理及使用”的疑惑有所帮助!...
    99+
    2023-06-15
  • json接口返回错误的原因有哪些
    参数错误:接口请求时传递的参数不符合接口要求,或者缺少必要的参数。 权限不足:用户没有足够的权限访问该接口,需要提供有效的授权信息...
    99+
    2024-03-08
    json
  • java返回json请求中文变成问号的问题及解决
    目录java返回json请求中文变成问号json返回中文全是问号java返回json请求中文变成问号 原来在个人项目时,用layui的数据表格获取数据时,不会出现中文变问号问题 后来...
    99+
    2024-04-02
  • mybatis中返回主键一直为1的问题怎么解决
    今天小编给大家分享一下mybatis中返回主键一直为1的问题怎么解决的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。mybat...
    99+
    2023-07-05
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作