IBM Websphere portlet 类加载器问题

发布于 2024-11-11 14:45:48 字数 313 浏览 5 评论 0原文

我目前正在开发一个使用 commons-collections jar 文件的 portlet,并且收到了 NoSuchMethodError。要解决此问题,我需要将 WAR 文件的类加载器从 PARENT_FIRST 更改为 PARENT_LAST(在 application.xml 文件中)。

但是,当我执行此操作时,我的 portlet 将不会启动,并且当我登录到控制台时,它会显示消息“Portlet 暂时禁用”。如果我将类加载器更改回 PARENT_FIRST,那么它将再次启动,但随后我收到 NoSuchMethodError。

有人对如何解决这个问题有任何建议吗?

I am currently working on a portlet that is using the commons-collections jar file and am getting a NoSuchMethodError. To resolve this issue I need to change the classloader of my WAR file from PARENT_FIRST to PARENT_LAST (in the application.xml file).

However, when I do this my portlet will not launch and when I log into the console it displays the message "The portlet is temporarily disabled". If I change the classloader back to PARENT_FIRST then it will launch again but then I get the NoSuchMethodError.

Does anybody have any suggestions on how to fix this issue ?

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

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

发布评论

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

评论(3

_畞蕅 2024-11-18 14:45:48

我不知道如何,但今天当我收到“Portlet 暂时禁用”时,我开始在日志中收到错误消息。我收到了 java.lang.LinkageError ,这是由于我有 servlet-api-2.5.jar 和 jaxb jar 与 webshpere j2ee.jar 冲突。一旦我删除了这些依赖项并将类加载器设置为 PARENT_LAST,它似乎就可以正常工作。看来很多人都面临着类似的问题。下面的链接也很有用 http://forum.springsource.org/showthread.php?33663-dispatcher-servlet-quot-not-a-servlet-class-quot-in-websphere

I am not sure how, but today I started getting error messages in the logs when I was getting "The portlet is temporarily disabled". I was getting a java.lang.LinkageError which was down to the fact that I had the servlet-api-2.5.jar and a jaxb jar which was conflicting with webshpere j2ee.jar. Once I removed these dependencies and set the classloader to PARENT_LAST, it seems to work properly. It seems that a lot of people face similar issues. The link below is also useful http://forum.springsource.org/showthread.php?33663-dispatcher-servlet-quot-not-a-servlet-class-quot-in-websphere

木槿暧夏七纪年 2024-11-18 14:45:48

@MTH,

请尝试添加 commons-collections 作为共享库。请参阅此处有关其他人如何使用共享库支持的示例 [1]。这将为您提供步骤,只需对需要从 WAS 的类加载器覆盖/替换的 jar 进行操作即可

[1] http://portals.apache.org/jetspeed-2/deployguide/deploying-jetspeed-to-websphere.html#section_4_2

谢谢,
变暗

@MTH,

please try adding commons-collections as a shared library. See here for an example on how others have used shared library support [1]. That will give you the steps, just do it for the jars that you need to override/replace from WAS's classloader

[1] http://portals.apache.org/jetspeed-2/deployguide/deploying-jetspeed-to-websphere.html#section_4_2

thanks,
dims

夏夜暖风 2024-11-18 14:45:48

您尚未提供任何日志...但是,将应用程序设置为运行 PARENT_LAST 时需要注意的最重要的事情之一是您的应用程序未与任何系统级捆绑在一起可能与 WebSphere Portal 提供的类冲突。例如,属于 Portlet 规范或 JavaEE 规范的类。

You haven't provided any logs... but still, one of the most important things to look out for when setting your application to run PARENT_LAST is that your application isn't bundled with any system-level classes that may conflict with the ones provided by WebSphere Portal. For example, classes that pertain to the Portlet specification or the JavaEE specification.

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