2

私は ogsi を初めて使用し、knopfletfish フレームワークでバンドルを実行すると、次のエラーが発生します。

Exception in thread "Thread-17" [stderr] java.lang.NoClassDefFoundError: com/sun/xml/internal/bind/DatatypeConverterImpl
[stderr]    at eu.datex2.schema._2_0._2_3.IntermediatePointOnLinearElement_JaxbXducedAccessor_index.parse(TransducedAccessor_field_Integer.java:57)
[stderr]    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.StructureLoader.startElement(StructureLoader.java:195)
[stderr]    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ProxyLoader.startElement(ProxyLoader.java:45)
[stderr]    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:559)
[stderr]    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:538)
[stderr]    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:153)
[stderr]    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
[stderr]    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:380)
[stderr]    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2781)
[stderr]    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
[stderr]    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:118)
[stderr]    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:504)
[stderr]    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
[stderr]    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
[stderr]    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
[stderr]    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
[stderr]    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
[stderr]    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:243)
[stderr]    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:214)
[stderr]    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
[stderr]    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:162)
[stderr]    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:171)
[stderr]    at core.Transformer.<init>(Transformer.java:57)
[stderr]    at datexdenm.Activator.run(Activator.java:42)
[stderr] Caused by: java.lang.ClassNotFoundException: com.sun.xml.internal.bind.DatatypeConverterImpl
[stderr]    at org.knopflerfish.framework.BundleClassLoader.findClass(BundleClassLoader.java:177)
[stderr]    at org.knopflerfish.framework.BundleClassLoader.loadClass(BundleClassLoader.java:306)
[stderr]    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[stderr]    ... 24 more

なぜこれが起こっているのかわかりません。すべてのjabxb jarを参照しましたが、別のjdk7バンドルを操作するためにjdk8をjdk7で変更したために発生したと言うことが重要かもしれません.

これは、例外がマークされているクラスです。

//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
// Any modifications to this file will be lost upon recompilation of the source schema. 
// Generated on: 2016.08.31 at 09:49:57 AM CEST 
//


package eu.datex2.schema._2_0._2_3;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.DatatypeConverter; //not used


/**
 * <p>Java class for _IntermediatePointOnLinearElement complex type.
 * 
 * <p>The following schema fragment specifies the expected content contained within this class.
 * 
 * <pre>
 * &lt;complexType name="_IntermediatePointOnLinearElement">
 *   &lt;complexContent>
 *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       &lt;sequence>
 *         &lt;element name="referent" type="{http://datex2.eu/schema/2/2_0}Referent"/>
 *       &lt;/sequence>
 *       &lt;attribute name="index" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
 *     &lt;/restriction>
 *   &lt;/complexContent>
 * &lt;/complexType>
 * </pre>
 * 
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "_IntermediatePointOnLinearElement", propOrder = {
    "referent"
})
public class IntermediatePointOnLinearElement {

    @XmlElement(required = true)
    protected Referent referent;
    @XmlAttribute(name = "index", required = true)
    protected int index;

    /**
     * Gets the value of the referent property.
     * 
     * @return
     *     possible object is
     *     {@link Referent }
     *     
     */
    public Referent getReferent() {
        return referent;
    }

    /**
     * Sets the value of the referent property.
     * 
     * @param value
     *     allowed object is
     *     {@link Referent }
     *     
     */
    public void setReferent(Referent value) {
        this.referent = value;
    }

    /**
     * Gets the value of the index property.
     * 
     */
    public int getIndex() {
        return index;
    }

    /**
     * Sets the value of the index property.
     * 
     */
    public void setIndex(int value) {
        this.index = value;
    }

}
4

2 に答える 2

3

com.sun パッケージをブート委譲に追加する必要があると思います。

org.osgi.framework.bootdelegation=com.sun.*
于 2016-10-14T10:21:29.887 に答える
0

getter と setter で Bean の Wrapper クラスを使用します。getter と setter を使用する Bean クラスでプリミティブ データ型を使用しないでください。

間違った:int i;
正しい:Integer i;

于 2017-01-11T07:18:04.347 に答える