当前位置: 首页 > 知识库问答 >
问题:

为什么Jruby不能要求'net/http/server'和gnu.io.portinuseException错误

经和歌
2023-03-14

我试图运行jruby应用程序,但失败并出现错误:


LoadError: no such file to load -- net/http/server
  require at org/jruby/RubyKernel.java:1054
  require at ../jruby-1.7.4/lib/ruby/shared/rubygems/custom_require.rb:36
   (root) at lib/main.rb:4


bmalets:trunk bmalets$ sh bin/qatcher.sh 
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7
Connecting to serial port /dev/tty.usbmodemfa131
CommPortIdentifier.java:354:in `open': gnu.io.PortInUseException: Unknown Application
    from NativeMethodAccessorImpl.java:-2:in `invoke0'
    from NativeMethodAccessorImpl.java:39:in `invoke'
    from DelegatingMethodAccessorImpl.java:25:in `invoke'
    from Method.java:597:in `invoke'
    from JavaMethod.java:470:in `invokeDirectWithExceptionHandling'
    from JavaMethod.java:328:in `invokeDirect'
    from InstanceMethodInvoker.java:71:in `call'
    from CachingCallSite.java:346:in `cacheAndCall'
    from CachingCallSite.java:204:in `call'
    from CallTwoArgNode.java:59:in `interpret'
    from InstAsgnNode.java:95:in `interpret'
    from NewlineNode.java:105:in `interpret'
    from BlockNode.java:71:in `interpret'
    from ASTInterpreter.java:74:in `INTERPRET_METHOD'
    from InterpretedMethod.java:139:in `call'
    from DefaultMethod.java:170:in `call'
    from CachingCallSite.java:306:in `cacheAndCall'
    from CachingCallSite.java:136:in `call'
    from VCallNode.java:88:in `interpret'
    from NewlineNode.java:105:in `interpret'
    from BlockNode.java:71:in `interpret'
    from ASTInterpreter.java:74:in `INTERPRET_METHOD'
    from InterpretedMethod.java:204:in `call'
    from DefaultMethod.java:194:in `call'
    from CachingCallSite.java:336:in `cacheAndCall'
    from CachingCallSite.java:179:in `callBlock'
    from CachingCallSite.java:183:in `call'
    from RubyClass.java:855:in `newInstance'
    from RubyClass$INVOKER$i$newInstance.gen:-1:in `call'
    from JavaMethod.java:294:in `call'
    from CachingCallSite.java:326:in `cacheAndCall'
    from CachingCallSite.java:170:in `call'
    from CallOneArgNode.java:57:in `interpret'
    from InstAsgnNode.java:95:in `interpret'
    from NewlineNode.java:105:in `interpret'
    from BlockNode.java:71:in `interpret'
    from ASTInterpreter.java:74:in `INTERPRET_METHOD'
    from InterpretedMethod.java:204:in `call'
    from DefaultMethod.java:194:in `call'
    from CachingCallSite.java:336:in `cacheAndCall'
    from CachingCallSite.java:179:in `callBlock'
    from CachingCallSite.java:183:in `call'
    from RubyClass.java:855:in `newInstance'
    from RubyClass$INVOKER$i$newInstance.gen:-1:in `call'
    from JavaMethod.java:294:in `call'
    from CachingCallSite.java:326:in `cacheAndCall'
    from CachingCallSite.java:170:in `call'
    from lib/main.rb:37:in `chained_0_rescue_1$RUBY$SYNTHETIC__file__'
    from lib/main.rb:34:in `__file__'
    from lib/main.rb:-1:in `load'
    from Ruby.java:807:in `runScript'
    from Ruby.java:800:in `runScript'
    from Ruby.java:669:in `runNormally'
    from Ruby.java:518:in `runFromMain'
    from Main.java:390:in `doRunFromMain'
    from Main.java:279:in `internalRun'
    from Main.java:221:in `run'
    from Main.java:201:in `main'

    null

java版本:

  • Java版本“1.6.0_65”
  • Java(TM)SE运行时环境(构建1.6.0_65-B14-462-11M4609)
  • Java HotSpot(TM)64位服务器VM(构建20.65-b04-462,混合模式)

共有1个答案

秦毅
2023-03-14

如果错误原因:


CommPortIdentifier.java:354:in `open': gnu.io.PortInUseException: Unknown Application

只需创建和chmod/var/lock文件夹:)


mkdir /var/lock
chmod go+rwx /var/lock

 类似资料:
  • 对日志处理框架有一些了解的都知道,大多数框架都是用 Java 写的,毕竟做大规模系统 Java 有天生优势。而另一个新生代 fluentd 则是标准的 Ruby 产品(即 Matz's Ruby Interpreter)。logstash 选用 JRuby 来实现,似乎有点两头不讨好啊? 乔丹西塞曾经多次著文聊过这个问题。为了避凑字数的嫌,这里罗列他的 gist 地址: Time sucks 一文

  • 尽管有值,但我不能得到一个用户的值的和时间。 即使用户17有工作时间值,我也会在sumTW列中得到该用户的NULL值。我该怎么解决? 这就是我的查询看起来的样子: 下面是表格代码: (这个表和原来的不一样,原来的有外键。我去掉它们只是为了能够再现同样的问题,同样的问题被报告了)。

  • C++20概念的一个特点是,在某些情况下,您必须编写。例如,[expr.prim.req]/3中的这个示例:

  • 我正在尝试设置Azure Application Insights以监视Azure App Services中承载的ASP.NET Core Web App和Web API的以下指标的性能计数器: null 我相当肯定Application Insights的配置是正确的,因为我可以看到门户中显示的其他度量。是不是有什么原因,这些特定的度量似乎没有出现?我甚至尝试使用一个默认的ASP.NET核心模

  • 我正在尝试测试我的贝宝沙箱帐户中的经常性付款。我跟踪了这个链接https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/ht_ec-recurringpaymentprofile-curl-etc/ 我试了很多次,贝宝只显示这个消息。我怎样才能为我的沙箱帐户实现不出错的重复支付?

  • 问题内容: 为什么在下面的代码中没有出现编译错误?我得到一个有点混乱的地方。是因为它们有关系吗? 问题答案: 为什么在下面的代码中没有出现编译错误? 因为编译器只关心您要强制转换的表达式的静态类型。 看这两行: 您 知道在第二行中,由于第一行,该值仅引用类型的对象,而编译器则没有。对于所有的编译器知道(编译第二线时),它 可能 实际上已经: …哪里有扩展和实现的类。因此它是有效的(在编译时),以铸