java 启动时捕获异常 ConfigurationPersistenceException
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32284795/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Caught exception during boot ConfigurationPersistenceException
提问by Joe
Environment:
环境:
- Ubuntu 14.04
- Netbeans 8.0.2
- Wildfly 8.2.1
- JDK 1.8.0_60
- Ubuntu 14.04
- Netbeans 8.0.2
- 野蝇8.2.1
- JDK 1.8.0_60
I can build without error, but when I try to Run the project I get this error, but I don't have any persistance configuration yet.
我可以无误地构建,但是当我尝试运行项目时出现此错误,但我还没有任何持久性配置。
Error log
错误日志
11:47:56,871 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.3.Final
11:47:57,070 INFO [org.jboss.msc] (main) JBoss MSC version 1.2.2.Final
11:47:57,144 INFO [org.jboss.as] (MSC service thread 1-6) JBAS015899: WildFly 8.2.1.Final "Tweek" starting
11:47:57,534 ERROR [org.jboss.as.server] (Controller Boot Thread) JBAS015956: Caught exception during boot: org.jboss.as.controller.persistence.ConfigurationPersistenceException: JBAS014676: Failed to parse configuration
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:112)
at org.jboss.as.server.ServerService.boot(ServerService.java:331)
at org.jboss.as.controller.AbstractControllerService.run(AbstractControllerService.java:259)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3,1]
Message: Unexpected element '{urn:jboss:domain:3.0}server'
at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:108)
at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
at org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:104)
... 3 more
11:47:57,535 FATAL [org.jboss.as.server] (Controller Boot Thread) JBAS015957: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.
11:47:57,545 INFO [org.jboss.as] (MSC service thread 1-8) JBAS015950: WildFly 8.2.1.Final "Tweek" stopped in 3ms
How can I fix this?
我怎样才能解决这个问题?
回答by Tair
Your server can't start because there is an issue with your server configuration. According to your error message, your configuration starts with something like this:
您的服务器无法启动,因为您的服务器配置存在问题。根据您的错误消息,您的配置以这样的方式开始:
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:3.0">
...
but wildfly 8.2.1 as I know supports server configuration version 2.2 and your config should look like this:
但据我所知,wildfly 8.2.1 支持服务器配置版本 2.2,您的配置应如下所示:
<?xml version='1.0' encoding='UTF-8'?>
<server xmlns="urn:jboss:domain:2.2">
...
How could this happen? Most probably, you have misconfigured your IDE or environment properties, so that Wildfly looks in wrong place for configuration. Check JBOSS_HOME environment property, in most situations you don't need that, so unset it.
这怎么会发生?最有可能的是,您错误地配置了 IDE 或环境属性,因此 Wildfly 看起来配置错误。检查 JBOSS_HOME 环境属性,在大多数情况下你不需要它,所以取消它。
$ env | grep JBOSS_HOME
otherwise review carefully your server configuration in Netbeans.
否则请仔细检查您在 Netbeans 中的服务器配置。