解决 axis2 和 OC4J 库冲突

发布于 2024-08-05 02:38:16 字数 675 浏览 2 评论 0原文

我正在尝试将 Axis2 Web 服务部署到 OC4J 10.1.3 应用程序服务器。

我之前使用的是 axis 1.4,刚刚使用所有文件创建了我自己的共享库。 1.4 存在一个问题,已用 1.5 进行了修补,所以现在我正在使用它,但它不包含所有库。这次我将 axis2.war 部署到 OC4J 服务器,并使用 axis2 管理页面尝试部署我的 Web 服务。

如果我通过 axis2 部署 Web 服务,则会收到 java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z 但我找不到冲突的库。 Axis2 中有新的 jax-ws 库,但我认为这是 OC4J 应用服务器上的问题。我排除了 xml.jar(因为它具有旧的 JAXB 1.0 库),这解决了我本地计算机上的问题,但没有解决 Linux 机器上的问题。

我尝试编辑部署计划以首先搜索本地文件夹,这允许我部署服务,但是当我尝试访问它或 WSDL 时,我收到有关类转换异常和 JXDocumentBuilderFactory 的错误(我没有此时的确切错误)。

我将 Linux 机器上的共享库与本地计算机上的共享库进行了比较,并且在每个机器上使用了相同的共享库(不过,我没有验证每个 jar 的版本)。如果 axis2 部署到 OC4J 并且我将服务部署到 axis2 那么我不会继承 axis2 库(jax-ws 等)吗?

I'm trying to deploy an Axis2 web service to an OC4J 10.1.3 app server.

I was using axis 1.4 before and had just created my own shared library with all of the files. There was an issue with 1.4 that was patched with 1.5 so now I'm using that but it does not include all of the libraries. This time I deployed the axis2.war to the OC4J server and I'm using the axis2 admin page to attempt to deploy my web service.

If I deploy a web service through axis2 then I'll get a java.lang.NoSuchMethodError: javax.jws.WebMethod.exclude()Z but I cannot find the conflicting library. Axis2 has the new jax-ws libraries in it but I think it's an issue on the OC4J app server. I excluded xml.jar (since it has old JAXB 1.0 libs) and this resolves the issue on my local machine but not on the linux box.

I tried editing the deployment plan to search local folders first and this allows me to deploy the service, but when I try to access it, or the WSDL, then I get an error regarding a class cast exception and JXDocumentBuilderFactory (I don't have the exact error at this moment).

I compared the shared libraries on the linux box with the ones on my local machine and I used the same ones on each (I didn't verify the versions of each jar, though). If axis2 is deployed to OC4J and I deploy my service to axis2 then wouldn't I inherit the axis2 libraries (jax-ws, etc)?

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

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

发布评论

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

评论(1

樱&纷飞 2024-08-12 02:38:16

尝试通过将其添加到 orion-application.xml 来删除冲突的继承库:

<orion-application>
  <imported-shared-libraries>
    <remove-inherited name="PUT_HERE_THE_NAME_OF_THE_LIBRARY"/>
  </imported-shared-libraries>
</orion-application>

更多信息:删除和/或替换默认导入的 Oracle 共享库

编辑:
我搜索了共享库,发现不存在,jws-api.jar 在启动时加载并且无法轻松删除:

替换 OC4J JAX-WS 库
OC4J 对 JAX-WS 具有初步支持,不幸的是,这意味着在 OC4J 启动期间,它会加载过时的 JAX-WS API 和 Oracle 的实现。这种情况甚至会在共享库生效之前、在 OC4J 启动的早期阶段发生。
引导时 OC4J 库在 $ORACLE_HOME/j2ee/home/oc4j.jar bootstrap jar 中的 boot.xml 文件中配置。要摆脱这个问题:

1-将 jar 文件复制到 ${oracle.home}/webservices/lib/jaxws
2-解压OC4J.jar文件
3-找到 META-INF/boot.xml
4-将这一行中的路径替换为您的 jar:

<code-source 
   path="${oracle.home}/webservices/lib/jws-api.jar" 
   if="java.specification.version == /1\.[5-6]/"
/>  

5-重新打包 oc4j.jar(不要忘记 MANIFEST.MF - 使用 jar -m META-INF/MANIFEST.MF)

原始文章:Web 服务的 OC4J 配置

Try removing the inherited library in conflict by adding this to your orion-application.xml:

<orion-application>
  <imported-shared-libraries>
    <remove-inherited name="PUT_HERE_THE_NAME_OF_THE_LIBRARY"/>
  </imported-shared-libraries>
</orion-application>

More here: Removing and/or Replacing an Oracle Shared Library Imported by Default

Edit:
I searched the shared libraries and found that is not there, jws-api.jar is loaded at boot time and can't be removed easily:

Replace the OC4J JAX-WS Libraries
OC4J has preliminary support for JAX-WS, unfortunately this means that during OC4J boot it loads outdated JAX-WS APIs and implementation by Oracle. This occurs even before shared libraries comes into action, at a very early stage of OC4J boot.
Boot-time OC4J libraries are configured in boot.xml file in $ORACLE_HOME/j2ee/home/oc4j.jar bootstrap jar. To get rid of this:

1-Copy the jar file to ${oracle.home}/webservices/lib/jaxws
2-Unpack the OC4J.jar file
3-Locate META-INF/boot.xml
4-Replace path in this line with your jar:

<code-source 
   path="${oracle.home}/webservices/lib/jws-api.jar" 
   if="java.specification.version == /1\.[5-6]/"
/>  

5-Repackage oc4j.jar (don't forget about MANIFEST.MF - use jar -m META-INF/MANIFEST.MF)

Original article: OC4J Configuration for Web Services

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