Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » BPEL Designer » Problem when open a bpel file
Problem when open a bpel file [message #11774] Fri, 08 May 2009 06:57 Go to next message
lancel lau is currently offline lancel lau
Messages: 31
Registered: July 2009
Member
Hi,
i try to open a bpel file with following code:

BPELPackage.eINSTANCE.eClass();
Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
Map<String, Object> m = reg.getExtensionToFactoryMap();
m.put("bpel", new BPELResourceFactoryImpl());
ResourceSet resSet = new ResourceSetImpl();
URI uri = URI.createURI("test/SynchronousSample.bpel");
Resource resource = resSet.getResource(uri, true);
Process process = (Process)resource.getContents().get(0);

and i got some error messages:

Exception in thread "main" java.lang.IllegalStateException: INamespaceMap
cannot be attached to an eObject
at
org.eclipse.bpel.model.util.BPELUtils.getNamespaceMap(BPELUt ils.java:260)
at
org.eclipse.bpel.model.resource.BPELReader.saveNamespacePref ix(BPELReader.java:512)
at
org.eclipse.bpel.model.resource.BPELReader.xml2Process(BPELR eader.java:932)
at
org.eclipse.bpel.model.resource.BPELReader.xml2Resource(BPEL Reader.java:912)
at org.eclipse.bpel.model.resource.BPELReader.pass1(BPELReader. java:389)
at org.eclipse.bpel.model.resource.BPELReader.read(BPELReader.j ava:321)
at
org.eclipse.bpel.model.resource.BPELResourceImpl.doLoad(BPEL ResourceImpl.java:132)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1445)
at
org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(Resour ceImpl.java:1241)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo ad(ResourceSetImpl.java:255)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(ResourceSetImpl.java:270)
at
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetImpl.java:397)
at main(Loadtest.java:38)


i do not know how to solve it. Can anyone give me some advices?

regards
Re: Problem when open a bpel file [message #849867 is a reply to message #11774] Thu, 19 April 2012 10:18 Go to previous messageGo to next message
Allen Zhang is currently offline Allen Zhang
Messages: 14
Registered: February 2012
Junior Member
I have the same problem. Can anyone help me?
Re: Problem when open a bpel file [message #855262 is a reply to message #849867] Tue, 24 April 2012 12:54 Go to previous message
Robert Brodt is currently offline Robert Brodt
Messages: 589
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi all,

I suggest you have a look at the org.eclipse.bpel.ui.util.BPELReader class - this is used by the editor to load the BPEL model and does a bunch of (necessary!) initialization, including the namespace map.

HTH,
Bob
Previous Topic:exception when opening a BPEL file
Next Topic:Working directory does not exist
Goto Forum:
  


Current Time: Wed Aug 20 02:56:23 EDT 2014

Powered by FUDForum. Page generated in 0.03633 seconds