在我的 Web 应用程序在 JRUBY 中构建之前,Tomcat 可能不会从 JAXB 加载 TOMCAT JAR

发布于 2024-09-29 04:02:20 字数 738 浏览 1 评论 0原文

当我尝试在“Tomcat”中运行时,我的应用程序出现此错误,在 WEBrick 中工作正常:

严重:应用程序错误 org.jruby.rack.RackInitializationException:参数数量错误(0 为 1) 来自/home/gpereira/apache/apache-tomcat-6.0.18/webapps/vtsbackoffice/WEB-INF/app/controllers/application_controller.rb:5

并在第 5 行我有导入:

5  import javax.xml.bind.JAXBContext
6  import javax.xml.bind.Unmarshaller

我正在使用 Rails 版本 3,jruby 1.5.1、安装JWSD2.0。操作系统:Ubuntu

我需要这个,因为我正在连接:REST API 并且我有 XSD 文件。

我能够找到什么:

如果我尝试放置其他类,例如“javaxii.kkk”,它会让我找不到。当我从我的应用程序库中导入并删除 jar 文件时,它仍然给我带来错误!!!!所以他发现了一些我不想要的东西...

我尝试在TOMCAT中安装JWSDP2.0,但似乎也不起作用。同样的错误...

所以我迫切希望找到一些首先加载我的 jar 的东西,然后添加 tomcat 类...

谢谢您的帮助。

I get this error on my application when i try to run in "Tomcat", in WEBrick works fine:

SEVERE: Application Error
org.jruby.rack.RackInitializationException: wrong # of arguments(0 for 1)
from /home/gpereira/apache/apache-tomcat-6.0.18/webapps/vtsbackoffice/WEB-INF/app/controllers/application_controller.rb:5

and in line 5 i have the import :

5  import javax.xml.bind.JAXBContext
6  import javax.xml.bind.Unmarshaller

I am using Rails version 3, jruby 1.5.1, JWSD2.0 installed. O.S. : Ubuntu

I need this because i am connecting: REST API and i have XSD files.

What i was capable to find:

If i try to put other class for example "javaxii.kkk", it gives me not found. When i put that import and remove jar files from my app lib it still get me the error!!!! So he find something that i don't want...

I try to install JWSDP2.0 in TOMCAT, but it seems that don't work either. same error...

so i am desperate to find something that first loads me jar and after this add tomcat class...

Thank you for your help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

私藏温柔 2024-10-06 04:02:20

问题是在我的 config/environment.rb 中

我正在编写

load RAILS_ROOT + "/lib/mypack.jar" 

并更改为:

load "#{RAILS_ROOT}/lib/mypack.jar" 

现在它可以在 tomcat/jboss/weblogic/webrick 中工作...

我不明白为什么他在导入上给我错误而不是在环境上.rb,但重要的是现在它工作得很好。

The problem was that in my config/environment.rb

I was writing

load RAILS_ROOT + "/lib/mypack.jar" 

and i change to this :

load "#{RAILS_ROOT}/lib/mypack.jar" 

and now it works in tomcat/jboss/weblogic/webrick...

I don't get why he give me errors on imports instead on environment.rb, but what is important is that now it works just fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文