Da farko da gabatarwa, kuskuren "javax.xml.bind ba ya wanzu" yana ษaya daga cikin matsalolin da masu haษakawa ke fuskanta lokacin da ake canjawa daga tsoffin juzu'in Java zuwa sababbi, musamman daga Java 8 zuwa Java 9, ko kuma sabo. A lokacin wannan canji, kuna iya ci karo da wannan saฦon da ke nuni da cewa wani fakitin ya ษace, musamman saboda an cire javax.xml.bind a Java 9, kuma an cire shi daga Java 11.
Ana amfani da `javax.xml.bind` don Architecture na Java don daurin XML (JAXB). Ana aiki dashi don canza abubuwan Java zuwa XML kuma akasin haka. Muhimmancin JAXB ba za a iya wuce gona da iri ba, saboda yana ba da hanyoyin da ba za a iya warwarewa ba, marshal da ingantattun ayyuka.
Matsalolin JDK da Magani
Babban dalilin wannan saฦon kuskure shine tare da sakin Java SE 9 da tsarin tsarin, an cire wasu fakiti daga hanyar da aka saba, gami da `javax.xml.bind`.
Don gyara mai sauri da ษan lokaci, zaku iya amfani da zaษin layin umarni na `โadd-modulesโ idan kuna gudanar da shirin ku daga layin umarni. Don Maven da sauran makamantan kayan aikin gini, zaku iya ฦara abubuwan dogaro kai tsaye a cikin fayil ษin pom.xml ko build.gradle.
<!-- This command tells Java to add the 'java.xml.bind' module to your classpath --> java --add-modules java.xml.bind YourApp
Koyaya, don ฦarin bayani na dindindin, musamman idan kuna shirin ฦaura ayyukanku zuwa Java 11 da kuma bayan haka, dole ne ku haษa ษakin karatu na JAXB (javax.xml.bind) da hannu a cikin hanyar aikinku.
ฦara Dogaran JAXB, Mataki-mataki
Don haษa JAXB a cikin aikinku, da farko kuna buฦatar ฦara dogaro da `jaxb-api` zuwa pom.xml ko build.gradle. Ana samar da aiwatar da JAXB a cikin ma'ajiyar ta `com.sun.xml.bind`.
<!-- In pom.xml, add the following dependencies --> <dependencies> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.1</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.3.1</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId> <version>2.3.0.1</version> </dependency> </dependencies>
Bayan haษa waษannan abubuwan dogaro a cikin aikin ku, ya kamata a warware batun ku tare da "javax.xml.bind ba ya wanzu".
Fahimtar Tasirin Canje-canje a cikin Java 9 da Beyond
Java 9 ya gabatar da sabon tsarin tsarin wanda ya yi tasiri sosai kan yadda masu haษakawa ke ginawa da sarrafa aikace-aikacen su. Ta hanyar yin fakiti kamar `javax.xml.bind` ba za a iya samun su ta tsohuwa ba, an tilasta wa masu haษakawa su kasance da hankali game da dogaro da ayyukansu.
Wannan canjin, ko da yake yana daษaษawa a farko, ya ฦare yana ฦarfafa kyakkyawan aiki a gudanar da dogaro, yana sa ayyukan su zama masu ฦarfi da sauฦin kiyayewa a cikin dogon lokaci.
Wannan ya ce, waษannan canje-canjen suna nufin cewa masu haษakawa suna buฦatar sanin kansu da sabon tsarin tsarin da yadda ake sarrafa abin dogaro a sarari. Amma tare da wasu ayyuka, magance batutuwan da suka shafi bacewar kayayyaki a cikin Java 9 da kuma bayan sun zama abin sarrafawa, har ma da yanayi na biyu.
Wannan daidaitawa ga tsarin ฦirar Java shaida ce ga haษakar yanayin fasaha da ikon masu haษakawa don daidaitawa da canje-canje tare da sabbin ayyuka.