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

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

问题描述

我有REST(Jersey)webservice,它使用一些编组/解组到XML的数据对象。数据对象位于web服务战争所依赖的单独项目/ 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。属性文件是否包含在数据对象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:

  • http://bdoughan.blogspot.com/2010/08/creating-restful-web-service-part-35.html

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

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