我需要在命名空间中使用自定义前缀,我使用下面的代码
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.
更多推荐
发布评论