Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] NPE at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984)
[CDO] NPE at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984) [message #1005411] Fri, 25 January 2013 10:43 Go to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
I have a transaction with a new object and am about to commit that transaction, but getting the following exception:


Caused by: java.lang.NullPointerException
	at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984)
	at org.eclipse.emf.internal.cdo.view.AbstractCDOView.provideCDOID(AbstractCDOView.java:1134)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.provideCDOID(CDOTransactionImpl.java:2237)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.writeValues(BaseCDORevision.java:893)
	at org.eclipse.emf.cdo.spi.common.revision.BaseCDORevision.write(BaseCDORevision.java:236)
	at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:381)
	at org.eclipse.emf.cdo.spi.common.protocol.CDODataOutputImpl.writeCDORevision(CDODataOutputImpl.java:372)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requestingCommit(CommitTransactionRequest.java:178)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CommitTransactionRequest.requesting(CommitTransactionRequest.java:128)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientRequestWithMonitoring.requesting(CDOClientRequestWithMonitoring.java:91)
	at org.eclipse.net4j.signal.RequestWithMonitoring.requesting(RequestWithMonitoring.java:165)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExtendedOutput(RequestWithConfirmation.java:119)
	at org.eclipse.net4j.signal.Signal.doOutput(Signal.java:298)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doExecute(RequestWithConfirmation.java:104)
	at org.eclipse.net4j.signal.RequestWithMonitoring.doExecute(RequestWithMonitoring.java:235)
	at org.eclipse.net4j.signal.SignalActor.execute(SignalActor.java:53)
	at org.eclipse.net4j.signal.Signal.runSync(Signal.java:253)
	at org.eclipse.net4j.signal.SignalProtocol.startSignal(SignalProtocol.java:431)
	at org.eclipse.net4j.signal.RequestWithConfirmation.doSend(RequestWithConfirmation.java:89)
	at org.eclipse.net4j.signal.RequestWithConfirmation.send(RequestWithConfirmation.java:75)
	at org.eclipse.net4j.signal.RequestWithMonitoring.send(RequestWithMonitoring.java:110)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.send(CDOClientProtocol.java:518)
	at org.eclipse.emf.cdo.internal.net4j.protocol.CDOClientProtocol.commitTransaction(CDOClientProtocol.java:393)
	at org.eclipse.emf.internal.cdo.transaction.CDOSingleTransactionStrategyImpl.commit(CDOSingleTransactionStrategyImpl.java:71)
	at org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.commit(CDOTransactionImpl.java:1181)
	... 5 more


Any hints where to look at?
Re: [CDO] NPE at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984) [message #1005416 is a reply to message #1005411] Fri, 25 January 2013 11:12 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
Additional note:

this line causes the NPE:

        return resource.getURI().appendFragment(resource.getURIFragment(eObject));


resource is an instance of ResourceImpl with no URI set.
Re: [CDO] NPE at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984) [message #1005420 is a reply to message #1005416] Fri, 25 January 2013 11:33 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
It seems to have been faulty user code not specific to CDO.
Somewhere in the user code, we created a new ResourceImpl which the CDOObject was added to and that caused this NPE when committing the transaction.
Re: [CDO] NPE at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984) [message #1005421 is a reply to message #1005416] Fri, 25 January 2013 11:31 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26285
Registered: July 2009
Senior Member
Erdal,

We should guard against that case too. Please open an EMF Core bugzilla.

On 25/01/2013 12:12 PM, Erdal Karaca wrote:
> Additional note:
>
> this line causes the NPE:
>
>
> return
> resource.getURI().appendFragment(resource.getURIFragment(eObject));
>
>
> resource is an instance of ResourceImpl with no URI set.
>
Re: [CDO] NPE at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984) [message #1005424 is a reply to message #1005420] Fri, 25 January 2013 11:39 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 26285
Registered: July 2009
Senior Member
Erdal,

Yes, it's not such a sensible state, but we should still guard against it...

On 25/01/2013 12:33 PM, Erdal Karaca wrote:
> It seems to have been faulty user code not specific to CDO.
> Somewhere in the user code, we created a new ResourceImpl which the
> CDOObject was added to and that caused this NPE when committing the
> transaction.
Re: [CDO] NPE at org.eclipse.emf.ecore.util.EcoreUtil.getURI(EcoreUtil.java:2984) [message #1005438 is a reply to message #1005421] Fri, 25 January 2013 12:55 Go to previous message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
Ed Merks wrote on Fri, 25 January 2013 12:31

We should guard against that case too. Please open an EMF Core bugzilla.


Done:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=399076
Previous Topic:[CDO] PartialCollectionLoadingNotSupportedException at rollbacking
Next Topic:[CDO] Updating CDO references in XMI Resource
Goto Forum:
  


Current Time: Sat Dec 20 23:06:05 GMT 2014

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

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