Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO]Load an XMIResource Exception!!!([CDO]Load an XMIResource Exception!!!)
[CDO]Load an XMIResource Exception!!! [message #1158641] Mon, 28 October 2013 02:58 Go to next message
wang songbai is currently offline wang songbaiFriend
Messages: 27
Registered: October 2013
Junior Member
final CDOSession session = openSession();
final CDOTransaction transaction = session.openTransaction();

ResourceSet resSet = new ResourceSetImpl();
Resource resource =
resSet.getResource(URI.createPlatformResourceURI("c:/mof1.4.xml"),true);
resource.save(null);

transaction.commit();
transaction.close();



whats wrong???

java.lang.RuntimeException: Cannot create a resource for 'platform:/resource/c:/mof1.4.xml'; a registered resource factory is needed
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:403)
at org.eclipse.emf.cdo.examples.hibernate.client.QuickStartTest.testCreateEcoreFromXMI(QuickStartTest.java:194)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

Re: [CDO]Load an XMIResource Exception!!! [message #1159046 is a reply to message #1158641] Mon, 28 October 2013 09:01 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6441
Registered: July 2009
Senior Member
Am 28.10.2013 03:58, schrieb wang songbai:
> final CDOSession session = openSession();
> final CDOTransaction transaction = session.openTransaction();
> ResourceSet resSet = new ResourceSetImpl();
> Resource resource =
> resSet.getResource(URI.createPlatformResourceURI("c:/mof1.4.xml"),true);
> resource.save(null);
> transaction.commit();
> transaction.close();
>
>
>
> whats wrong???
>
> java.lang.RuntimeException: Cannot create a resource for 'platform:/resource/c:/mof1.4.xml'; a registered resource
> factory is needed
It seems that a registered resource factory is needed.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


> at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:403)
> at org.eclipse.emf.cdo.examples.hibernate.client.QuickStartTest.testCreateEcoreFromXMI(QuickStartTest.java:194)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at junit.framework.TestCase.runTest(TestCase.java:176)
> at junit.framework.TestCase.runBare(TestCase.java:141)
> at junit.framework.TestResult$1.protect(TestResult.java:122)
> at junit.framework.TestResult.runProtected(TestResult.java:142)
> at junit.framework.TestResult.run(TestResult.java:125)
> at junit.framework.TestCase.run(TestCase.java:129)
> at junit.framework.TestSuite.runTest(TestSuite.java:255)
> at junit.framework.TestSuite.run(TestSuite.java:250)
> at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
>
>


Previous Topic:[CDO] Saving resources in transaction
Next Topic:Problem with XML modeling: Class 'name' is not found or is abstract.
Goto Forum:
  


Current Time: Mon Aug 19 09:38:38 GMT 2019

Powered by FUDForum. Page generated in 0.02893 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top