Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » NPE while loading OCL file(OCL Editor NPE Problem)
NPE while loading OCL file [message #1805858] Thu, 25 April 2019 15:55 Go to next message
Johannes Schmidt is currently offline Johannes SchmidtFriend
Messages: 1
Registered: April 2019
Junior Member
In the Complete OCL Editor, I always get a NullPointerException and my content is underlined in red.

Here the exception
	at org.eclipse.ocl.pivot.internal.complete.AbstractCompletePackages.didRemovePackage(
	at org.eclipse.ocl.pivot.internal.CompletePackageImpl.didRemoveNestedPackage(
	at org.eclipse.ocl.pivot.internal.complete.PartialPackages.didRemovePackage(
	at org.eclipse.ocl.pivot.internal.complete.ModelListeners.didRemovePackage(
	at org.eclipse.ocl.pivot.internal.PackageImpl.didRemovePackage(
	at org.eclipse.ocl.pivot.internal.PackageImpl$2.didRemove(
	at org.eclipse.ocl.pivot.internal.PackageImpl$2.didRemove(
	at org.eclipse.emf.common.util.BasicEList.remove(
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doRemove(
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(
	at org.eclipse.emf.common.util.AbstractEList.remove(
	at org.eclipse.ocl.xtext.base.cs2as.CS2ASConversion.update(
	at org.eclipse.ocl.xtext.base.cs2as.CS2AS.update(
	at org.eclipse.ocl.xtext.base.utilities.CS2ASLinker.afterModelLinked(
	at org.eclipse.xtext.linking.impl.AbstractCleaningLinker.linkModel(
	at org.eclipse.xtext.resource.XtextResource.doLinking(
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doLinking(
	at org.eclipse.ocl.xtext.essentialocl.utilities.EssentialOCLCSResource.doLinking(
	at org.eclipse.xtext.resource.XtextResource.updateInternalState(
	at org.eclipse.xtext.resource.XtextResource.updateInternalState(
	at org.eclipse.xtext.resource.XtextResource.update(
	at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.doReconcile(
	at org.eclipse.xtext.ui.editor.reconciler.XtextDocumentReconcileStrategy.reconcile(
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.doRun(
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler.access$3(
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(
	at org.eclipse.xtext.ui.editor.reconciler.XtextReconciler$1.process(
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(
	at org.eclipse.xtext.resource.OutdatedStateManager.exec(
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.modify(
	at org.eclipse.xtext.ui.editor.model.XtextDocument.internalModify(

My OCL file looks like this

import 'model.uml#packageid'

The editor error looks like this

Multiple markers at this line
- The required feature 'pivot::Import::importedNamespace' of
   'null : «null»' must be set
- Unresolved import 'model.uml#packageid' :
   org.eclipse.ocl.pivot.utilities.ParserException: Failed to load
   : null

My questions are

  • Should I specify another path type like a URI or something other?
  • What is a *.uml.oclas file?

I use Papyrus for UML 4.1.0, OCL All-in-One SDK 6.7.0

Thank you for your help!

Best Regards

Re: NPE while loading OCL file [message #1806315 is a reply to message #1805858] Tue, 07 May 2019 16:17 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7665
Registered: July 2009
Senior Member

You appear to have written on 25-Apr-2019. Apologies. Somehow your message has only just propagated through the feeds. Raising a Bugzilla would avoid the flaky response times of the Forums.

"model.uml#packageid" looks strange to me. I would expect to see some more after the #.

Internally the Eclipse UML variant of the OMG UML model is normalized to an OCL Pivot Model. The "AbstractCompletePackages.didRemovePackage" is an indication that the OCL Pivot Model is tracking the removal of a UML Package. But your comment does not seem to suggest you were deleting.

A common problem is that UML Packages do not have URIs which may lead to multiple packages sharing the same blank/null URI allowing creation of one to 'delete' another. However I thought I had fixed sufficient bugs in this respect to make it no longer a problem.

Whatever. Clearly you do have a problem, so something, albeit perhaps just a diagnostic, should be better. I need a full repro, at least *.uml and *.ocl and human actions to reproduce. Preferably a zipped project.

The *.uml.oclas is the normal OCL Abstract Syntax Pivot model auto-generated from *..uml. (Similarly *.ecore.oclas). You should not be aware of the *.uml.oclas so a precise sequence of your tool activations and key strokes would be helpful.

Checking through my UML + OCL test suite I see:

import myumlmodel : 'Bug404882.uml#/'
import 'Bug423905.uml'
import 'Bug446007.profile.uml'
import uml : ''

variously identified the whole Model implicitly without a fragment or implicitly with a root fragment.

Changing to an xmi:id fragment such as

import myumlmodel : 'Bug404882.uml#_3OZ-0Km6EeG6cMdGet4Yrg'

Are you sure that "model.uml#packageid" is a valid element reference?

If I type a bad reference such as

import myumlmodel : 'Bug404882.uml#packageid'

I see similar editor errors but no stack trace,


Ed Willink
Previous Topic:Safe OCL
Next Topic:OCL editor exception in eclipse
Goto Forum:

Current Time: Mon Jul 22 14:26:10 GMT 2024

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

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

Back to the top