出现泽西岛MIME类型"text/xml; charset = UTF-8找不到"的问题. [英] Trouble with Jersey MIME Type "text/xml;charset=UTF-8 was not found"

查看:292
本文介绍了出现泽西岛MIME类型"text/xml; charset = UTF-8找不到"的问题.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么在jar捆绑包中运行程序时出现以下异常,而在netbeans中执行该异常却没有得到该异常?

Why do I get the following Exception when running the program within a jar bundle, but not getting this Exception when executing it within netbeans?

com.sun.jersey.api.client.ClientHandlerException:Java类javax.xml.bind.JAXBElement和Java类型javax.xml.bind.JAXBElement和MIME媒体类型text/的消息正文阅读器xml; charset = UTF-8未找到

我正在使用maven和程序集插件构建程序.

I am building my program with maven and the assembly plugin.

MVN Assembly:assembly

mvn assembly:assembly

当我运行运行文件"时,netbeans有什么不同?

What does netbeans do different when I am running "Run File"?

推荐答案

我在球衣邮件列表(http://java.net/projects/jersey/lists)上问了同样的问题,并收到了有效的答案,这让我在这里回答我的问题.但是我不得不承认我不完全理解问题的解决方案和原因.因此,请随意发表评论或提出新的答案.

I've asked the same question on the jersey mailing (http://java.net/projects/jersey/lists) list and recieved a working answer, which leaves me answering my on question here. But I have to admit that I dont completely understand the solution and reason for the problem. So please fell free to leave some comments or a new answer.

问题似乎是,程序集插件未正确合并某些META-INF文件.在我了解的情况下,需要对描述进行重命名!!

The problem seems to be, that the assembly plugin is not correctly merging some META-INF files. As I undertand there needs to be a renaming of descriptions or so!?

不是使用Assembly插件来使用Maven,而是使用shade插件!

Instead of using the assembly plugin for maven use the shade plugin!

在此处阅读问题和解决方案: http://jersey.576304 .n2.nabble.com/issue-with-POST-when-packaging-into-jar-td5460103.html

Read the problem and solution here: http://jersey.576304.n2.nabble.com/issue-with-POST-when-packaging-into-jar-td5460103.html

在这里查看maven的阴影插件: http://maven.apache.org/plugins/maven-shade-plugin/

And see the shade plugin for maven here: http://maven.apache.org/plugins/maven-shade-plugin/

这篇关于出现泽西岛MIME类型"text/xml; charset = UTF-8找不到"的问题.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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