Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

JAXBException bei der unmarshal-Methode

Empfohlene Antworten

Hallo,

folgendes Problem. Wenn ich die unmarshal Methode auf mein XML- File ausführe bekomme ich eine JAXBException.


Users users = (Users)u.unmarshal(new File("user.xml"));

in dem user.xml befindet sich als root-element das element users. dieses enthählt mehrere user elemente welche widerrum die elemente passwort und user-name besitzen. mit dem dazugehörigen xml-schema hab ich mir zwei klassen erstellen lassen(mit JAXB). eine User klasse und eine Users Klasse. gibt es jemanden der mir helfen könnte oder vielleicht einen tip hat wie ich den fehler eingrenzen könnte?

ok, hier ist meine user.xml


<?xml version="1.0" encoding="UTF-8"?>

<users

xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance"

xsd:noNamespaceSchemaLocation="user.xsd">


	<user>

		<User-Name>Franz</User-Name>

		<Passwort>hallo</Passwort>

	</user>


	<user>

		<User-Name>hans</User-Name>

		<Passwort>hallo</Passwort>

	</user>


</users>

und die Ausgabe der Exception? Da kenn ich mich nicht so aus. Aber ich denke mal mit printStackTrace() oder? die wäre aber echt lang...

edit: ok der Fehler ist beseitigt. Ich hab den Pfad der XML-Datei falsch angegeben.

Bearbeitet von cable545

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.