在哪里包含 jaxb.properties 文件? [英] Where to include jaxb.properties file?

查看:33
本文介绍了在哪里包含 jaxb.properties 文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 REST (Jersey) webservice,它利用了一些编组/解组到/来自 XML 的数据对象.数据对象位于 webservice war 所依赖的单独项目/jar 中.

I have REST (Jersey) webservice that makes use of some data objects that are marshalled/unmarshalled to/from XML. The data objects are in a separate project/jar that the webservice war depends on.

我使用 MOXy 作为我的 JAXB 实现,因为我要部署到 Glassfish 并且它已经包含在内.我知道我需要一个 jaxb.properties 文件来使用这个条目将 JAXB 实现设置为 MOXy:

I'm using MOXy as my JAXB implementation since I'm deploying to Glassfish and that's already included. I know I need a jaxb.properties file to set the JAXB implementation to MOXy with this entry:

javax.xml.bind.context.factory=org.eclipse.persistence.jaxb.JAXBContextFactory

问题是,jaxb.properties 文件应该包含在数据对象 jar 中还是包含在 webservice war 中,或者两者都包含?

The question is, should the jaxb.properties file be included in the data object jar or in the webservice war or both?

推荐答案

您将 jaxb.properties 文件与您的模型类打包在一起.GlassFish 尚不包含 MOXy 包,但您可以轻松添加它.查看我的博客了解更多信息:

You package the jaxb.properties file with your model classes. GlassFish does not include the MOXy bundle yet, but you can add it easily. Check out my blog for more info:

这篇关于在哪里包含 jaxb.properties 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆