0

jboss-service.xml:

<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:service:7.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
    <mbean name="com.xxx.yyy:service=SomeClass"
        code="com.xxx.yyy.SomeClassBean"  xmbean-dd="META-INF/config-mbeans.xml" />
</server>

我在上面有 jboss-service.xml,我收到了这个错误:

Caused by: java.lang.IllegalStateException: Current state START_ELEMENT is not among the statesCHARACTERS, COMMENT, CDATA, SPACE, ENTITY_REFERENCE, DTD valid for getText() 
    at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.getText(Unknown Source)
    at org.jboss.staxmapper.XMLExtendedStreamReaderImpl.getText(XMLExtendedStreamReaderImpl.java:275)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.unexpectedContent(JBossServiceXmlDescriptorParser.java:638)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.parseMBean(JBossServiceXmlDescriptorParser.java:221)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:192)
    at org.jboss.as.service.descriptor.JBossServiceXmlDescriptorParser.readElement(JBossServiceXmlDescriptorParser.java:48)
    at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
    at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
    at org.jboss.as.service.ServiceDeploymentParsingProcessor.deploy(ServiceDeploymentParsingProcessor.java:96)
    ... 6 more

知道如何解决这个问题吗?尝试了其他建议,但似乎没有任何效果。

4

1 回答 1

0

根据JBossAS docs的第9.6.2节,您需要这样定义:mbean

<?xml version="1.0" encoding="UTF-8"?>
<server xmlns="urn:jboss:service:7.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
    <mbean code="..." name="...">
    </mbean>
</server>

编辑

查看JBossServiceXmlDescriptorParser.java:221的源代码后,我们了解到xmbean-ddWildfly 9 不再需要该元素。只有NAMECODE是预期的。

从您的标签中删除该元素,mbean它将起作用。

于 2016-02-05T08:28:15.517 回答