如何引用外部JPA/JAXB域模型项目?
我目前正在开发一个客户端/服务器应用程序,其中服务器由 RESTful 接口 (jersey) 组成,客户端是 JSF 应用程序。两者都在 glassfish 3.1.1 服务器上运行。为了保留一些数据并生成 XML 输出,我创建了一个带有 JAXB 和 JPA (eclipselink) 注释的域模型。一切都很好,只要域类位于服务器项目内即可。 但我想在外部项目中定义域模型,以便客户端(xml -> 对象)和 REST 服务器(对象 -> xml)可以通过引用其 *.jar 来使用它。 我已经实现了 JPA 在服务器上正常工作,但 JAXB 功能已被“删除”。
我对 Java EE 堆栈非常陌生。也许我打包的方式错误。如果有人能给我提示,我会很高兴:-)
I am developing a client/server application currently, where the server consists of a RESTful interface (jersey) and the client is a JSF application. Both are running on a glassfish 3.1.1 server. To persist some data and produce XML output I created a domain model with JAXB and JPA (eclipselink) annotations. Everything is fine, as long as the domain classes are within the server project.
But I want to define the domain model in an external project, so that it can be used by the client (xml -> object) and the REST server (object -> xml) by referencing its *.jar.
I alread achieved, that the JPA works correctly on the server, but the JAXB functionality has been "removed".
I am very new to the Java EE stack.. maybe I am packaging in a wrong way. Would be very happy, if someone could give me a hint :-)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,在设置以下项目方面后它就起作用了:
之后:添加到构建路径并设置项目引用...
Ok, it worked after setting the following project facets:
After that: adding to build path and setting a project reference...