Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [] PackageNotFoundException when trying to load XML (or XMI) from a InputStream

Hi Jean,

I'm not sure what the problem is with your plugin, but I was able to get these files (and others) to load using the modelreader example plugin from the BPMN2 Modeler project [1].
The only difference I can see is that the modelreader code adds this before the load() call:

		HashMap<Object, Object> options = new HashMap<Object, Object>();
		options.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, true);

this causes forward references to objects by their IDs to be deferred until the entire file is loaded, but this shouldn't be the reason why this code works and yours doesn't.



----- Original Message -----
> Hi devs,
> I'm actually trying to parse a BPMN2 file coming from an InputStream
> (I'm developing a REST service where you can send a BPMN file which will
> be parsed to do stuff).  However, each time I'm trying to load the
> stream, I reach a PackageNotFoundException.
> This is the incriminated code as far as I know.
> -----
> Bpmn2ResourceFactoryImpl resourceFactory = new Bpmn2ResourceFactoryImpl();
> Resource resource =
> resourceFactory.createResource(URI.createURI(httpHeaders.getFirst("host")));
> resource.load(entityStream, Collections.EMPTY_MAP);
> -----
> I've tried different bpmn2 file (XML and XMI) found here and there on
> the web (some examples from bpmn-js, some export from MagicDraw, some
> others found on this same mailing list, produced by Reiner) but each
> time, I reach the same following error.  In case of XMI file, the error
> is similar with a different URI (with MODEL-XMI).
> -----
> Caused by: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package
> with uri '' not found.
> (localhost:8080, 2, 472)
> -----
> (see the complete log on [1]).
> These are the files I tried. (see also the links).
> [2] Atomic XML file
> [3] simple XML file
> [4] XMI file
> I hope I give enough information.  Don't hesitate to ask for more if
> needed.  At the moment, I'm completely stuck with this and don't find
> any hint on how to move forward.
> Thank you!
> [1]
> [2]
> [3]
> [4]
> --
> Jean Simard
> jean.simard@xxxxxxxxx
> Research engineer at XWiki SAS
> Committer on the project
> _______________________________________________
> mailing list
> To change your delivery options, retrieve your password, or unsubscribe from
> this list, visit

Back to the top