如何避免从weblogic的javaee.jar中获取Jaxb marshaller?(How to avoid Jaxb marshaller to be taken from javaee.jar

编程入门 行业动态 更新时间:2024-10-24 00:23:47
如何避免从weblogic的javaee.jar中获取Jaxb marshaller?(How to avoid Jaxb marshaller to be taken from javaee.jar of weblogic?)

我需要在命名空间中使用自定义前缀,我使用下面的代码

marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper", new NamespacePrefixMapper() { @Override public String getPreferredPrefix(String arg0, String arg1, boolean arg2) { return "tf"; } });

但是,它仍然给了我propertexception ,经过分析我发现我使用的marshaller和jaxbcontent来自weblogic.But的javaee.jar,我想要它来自java 1.6。

我试图在我的weblogic启动中指定它。 但没有用...... !! 我错过了什么.. !! 如何提及java从它自己的rt.jar中获取它而不是weblogic的javaee.jar?

I need a custom prefix in namespace,I have used below code

marshaller.setProperty("com.sun.xml.internal.bind.namespacePrefixMapper", new NamespacePrefixMapper() { @Override public String getPreferredPrefix(String arg0, String arg1, boolean arg2) { return "tf"; } });

But, it still giving me propertexception, after analysis i found out that the marshaller and jaxbcontent i was using are from javaee.jar of weblogic.But, I want it from java 1.6.

I have tried to specify it in my weblogic startup. But no use...!! What am i missing..!! How to mention java to take it from it's own rt.jar rather than javaee.jar of weblogic??

最满意答案

自己找到了解决方案。

在运行时,创建的jaxbcontext来自weblogic的glassfish jar。

当我避免我的应用程序访问它时,它花了java jdk的常规rt.jar并成功生成了前缀。

Found the solution myself.

At runtime the jaxbcontext created was from glassfish jar of weblogic.

When i have avoided my application to access it, it took the regular rt.jar of java jdk and the prefix got generated successfully.

更多推荐

本文发布于:2023-07-31 02:03:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1340550.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:jar   javaee   weblogic   avoid   marshaller

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!