Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Encountered an NullPointException with StructuredModelManager
Encountered an NullPointException with StructuredModelManager [message #230471] Thu, 16 April 2009 22:16 Go to next message
Frank Du is currently offline Frank DuFriend
Messages: 91
Registered: July 2009
Member
Dear, All,

Again, we are reading/writing in-memory objects. A disk file will be
parsed into model, and the SSE editor will display a small portion of the
model.

I implemented the IStorageEditorInput and IStorage for the objects. Then
added required plug-ins to the launch settings. But I kept encountering
NullPointException when trying to open a file. The debug showed that in
the following lines, model is a null value.

Do we need to register a model? If yes, how to register a model?

//org.eclipse.wst.sse.ui.internal.StorageModelProvider
//......
// first parameter must be unique
model = StructuredModelManager.getModelManager().getModelForEdit(id,
contents, null);
model.setBaseLocation(calculateBaseLocation(input));


Supplementary:
If the program starts with all the plug-ins, the problem is gone. It seems
that some plug-in contributes models for the issue. Is there a way to
figure out the plug-in?

Thank you so much!

Have a nice day!
Frank
Re: Encountered an NullPointException with StructuredModelManager [message #230494 is a reply to message #230471] Sat, 18 April 2009 01:02 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Frank Du wrote:
> Dear, All,
>
> Again, we are reading/writing in-memory objects. A disk file will be
> parsed into model, and the SSE editor will display a small portion of
> the model.
> I implemented the IStorageEditorInput and IStorage for the objects. Then
> added required plug-ins to the launch settings. But I kept encountering
> NullPointException when trying to open a file. The debug showed that in
> the following lines, model is a null value.
> Do we need to register a model? If yes, how to register a model?
> //org.eclipse.wst.sse.ui.internal.StorageModelProvider
> //......
> // first parameter must be unique
> model = StructuredModelManager.getModelManager().getModelForEdit(id,
> contents, null);
> model.setBaseLocation(calculateBaseLocation(input));
>
>
> Supplementary:
> If the program starts with all the plug-ins, the problem is gone. It
> seems that some plug-in contributes models for the issue. Is there a way
> to figure out the plug-in?
>
> Thank you so much!

It depends on what kind of input you're using, i.e. is it XML, HTML,
CSS, etc.? You'll need to have the language-specific UI and Core
plug-ins present as well as org.eclipse.wst.sse.ui and
org.eclipse.wst.sse.core. It also helps if the ID you're passing in
looks like an expected filename for your supported content type.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Validation of XPaths in xsd?
Next Topic:Publishing static website to HTTP server fails
Goto Forum:
  


Current Time: Fri Apr 26 05:27:55 GMT 2024

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

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

Back to the top