Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Problems developing a plugin based on SSE (ModelHandler Error?!)
Problems developing a plugin based on SSE (ModelHandler Error?!) [message #201115] Wed, 03 October 2007 14:35 Go to next message
Eclipse User
Originally posted by: uh5d.rz.uni-karlsruhe.de

This is a multi-part message in MIME format.

------=_NextPart_000_000C_01C805DB.6BD02940
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi,

i am trying to develop a Plugin (Projectname iswarmide) based on the =
eclipse XML-editor with proprietary content assist ( eclipse 3.3 with =
WST 2.0 ).

To do so, i first extended the content types, so that the sse-xml editor =
gets invoked when opening my own ".mdle2 " xml-fileformat:

<plugin>=20
<extension point=3D"org.eclipse.core.runtime.contentTypes">
<content-type
priority=3D"high"
name=3D"MDLE2 Content Type"
id=3D"mdle2source"=20
base-type=3D"org.eclipse.core.runtime.xml"
default-charset=3D"UTF-8">
<describer =
class=3D" org.eclipse.wst.xml.core.internal.contenttype.ContentDescrib erFo=
rXML" />
</content-type>
</extension>
<extension point=3D"org.eclipse.core.runtime.contentTypes">
<file-association=20
content-type=3D"iswarmide.mdle2source"=20
file-extensions=3D"mdle2"
/>
</extension>
.......
</plugin>=20
This works quite well for me - when i click on a ".mdle2" - file it =
get's opened via the xml editor, no errors occurred up to this point.

Then i proceeded by including my own Model Handler as descibed in =
http://help.eclipse.org/help31/index.jsp?topic=3D/org.eclips e.wst.doc.isv=
/reference/api/overview-summary.html

<extension point=3D"org.eclipse.wst.sse.core.modelHandler">
<modelHandler
default=3D"false"
class=3D"iswarmide.ModelHandlerForMDLE"
=
associatedContentTypeId=3D"iswarmide.mdle2source"
id=3D"mdle2sourcehandler">
</modelHandler>
</extension>=20

I derived the class ModelHandlerForMDLE from AbstractModelHandler =
implementing IModelHandler.
I contributed the following strings in that class:

static String AssociatedContentTypeID =3D "iswarmide.mdle2source"; =
=20
private static String ModelHandlerID =3D =
"iswarm.mdle2sourcehandler"; =20

and implemented getEncodingDetector(), getDocumentLoader(), =
getModelLoader() as done in ModelHandlerForXML.java ( WST class ).

Then i opened my .mdle2 file again, at first everything seems ok - it =
gets opened in the xml editor.
The .mdle2 file has the following content:

<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<BEHAVIOUR name=3D"ddd" >=20
blabla
</BEHAVIOUR>

Now the Problem:

when I click on "blabla" with my mousepointer a =
Java.lang.NullPointerException occurs.
There are no additional error messages in the problem view or on the =
error log.

What could cause this exception, how could i debug this exception?

Regards=20

A.Gallus











------=_NextPart_000_000C_01C805DB.6BD02940
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>i am trying to develop a Plugin =
(Projectname=20
iswarmide) based on the eclipse XML-editor with proprietary content =
assist (=20
</FONT><FONT face=3DArial size=3D2>eclipse 3.3 with WST 2.0 =
).</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>To do so, i first extended the content =
types, so=20
that the sse-xml editor gets invoked when opening my own ".mdle2 "=20
xml-fileformat:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV dir=3Dltr><FONT face=3DArial =
size=3D2>&lt;plugin&gt;&nbsp;</FONT></DIV>
<DIV dir=3Dltr><FONT face=3DArial =
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;=20
&lt;extension =
point=3D"org.eclipse.core.runtime.contentTypes"&gt;</FONT ></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &lt;content-type</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
priority=3D"high"</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; name=3D"MDLE2 =
Content=20
Type"</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p=
;&nbsp;id=3D"mdle2source"=20
</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p=
;&nbsp;base-type=3D"org.eclipse.core.runtime.xml"</FONT ></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
default-charset=3D"UTF-8"&gt;</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;describer=20
class=3D" org.eclipse.wst.xml.core.internal.contenttype.ContentDescrib erFo=
rXML"=20
/&gt;</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
&nbsp;&nbsp;&nbsp; &lt;/content-type&gt;</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&lt;/extension&gt;</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;extension=20
point=3D"org.eclipse.core.runtime.contentTypes"&gt;</FONT ></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &lt;file-association </FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
content-type=3D"iswarmide.mdle2source" </FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
file-extensions=3D"mdle2"</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px" align=3Dleft><FONT =
face=3DArial=20
size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; /&gt;</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&lt;/extension&g=
t;</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial=20
size=3D2>......</FONT></DIV>
<DIV dir=3Dltr style=3D"MARGIN-RIGHT: 0px"><FONT face=3DArial =
size=3D2>&lt;/plugin&gt;=20
</FONT></DIV>
<P><FONT face=3DArial size=3D2>This works quite well for me - when i =
click on a=20
".mdle2" - file it get's opened via the xml editor, no errors =
occurred&nbsp;up=20
to&nbsp;this point.</FONT></P>
<P><FONT face=3DArial size=3D2>Then i proceeded by including my own =
Model Handler as=20
descibed in <A=20
href=3D" http://help.eclipse.org/help31/index.jsp?topic=3D/org.eclips e.wst=
..doc.isv/reference/api/overview-summary.html">http://help.eclipse.org/hel=
p31/index.jsp?topic=3D/org.eclipse.wst.doc.isv/reference/api /overview-sum=
mary.html</A></FONT></P>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&lt;extension=20
point=3D"org.eclipse.wst.sse.core.modelHandler"&gt;</FONT ></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;modelHandler</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
default=3D"false"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
class=3D"iswarmide.ModelHandlerForMDLE"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
associatedContentTypeId=3D"iswarmide.mdle2source"</FONT></DIV >
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
id=3D"mdle2sourcehandler"&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/modelHandler&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&lt;/extension&gt;</FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I&nbsp;derived the class =
ModelHandlerForMDLE=20
&nbsp;from AbstractModelHandler implementing IModelHandler.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I contributed the following strings in =
that=20
class:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>static&nbsp;&nbsp;String =
AssociatedContentTypeID =3D=20
"iswarmide.mdle2source" ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp; </FONT>=
</DIV>
<DIV><FONT face=3DArial size=3D2>private static String=20
ModelHandlerID&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;=3D=20
"iswarm.mdle2sourcehandler";&nbsp;&nbsp;</FONT></DIV >
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>and implemented <FONT =
size=3D2>getEncodingDetector(),=20
<FONT size=3D2>getDocumentLoader(), <FONT size=3D2>getModelLoader() as =
done in <FONT=20
size=3D2>ModelHandlerForXML.java ( WST class=20
).</FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Then i opened my .mdle2 file again, at =
first=20
everything seems ok -&nbsp;it gets opened in the xml =
editor.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The .mdle2 file has the following=20
content:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&lt;?xml version=3D"1.0"=20
encoding=3D"UTF-8"?&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &lt;BEHAVIOUR =
name=3D"ddd"=20
&gt;</FONT> </DIV>
<DIV><FONT face=3DArial=20
size=3D2> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;blabla </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; =
&lt;/BEHAVIOUR&gt;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Now the Problem:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>when&nbsp;I click on "blabla" with my =
mousepointer=20
a Java.lang.NullPointerException occurs.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>There are no additional error messages =
in the=20
problem view or on the error log.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>What could cause this exception, how =
could i debug=20
this exception?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>A.Gallus</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; =
</FONT></DIV></BODY></HTML>

------=_NextPart_000_000C_01C805DB.6BD02940--
Re: Problems developing a plugin based on SSE (ModelHandler Error?!) [message #201159 is a reply to message #201115] Wed, 03 October 2007 23:28 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2282
Registered: July 2009
Senior Member
A.G. wrote:
> What could cause this exception, how could i debug this exception?

Enable the debug trace flag option
org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields in the
org.eclipse.wst.see.ui plug-in. Assuming that the editor still
opens, you'll see an extra field in the status bar which, when
double-clicked on, should open a dialog. The dialog might help
determine what's amiss between editing your content type and when
the editor is editing the regular XML content type.

--
Nitin Dahyabhai
Structured Source Editing


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Problems developing a plugin based on SSE (ModelHandler Error?!) [message #201210 is a reply to message #201159] Thu, 04 October 2007 14:02 Go to previous messageGo to next message
Eclipse User
Originally posted by: uh5d.rz.uni-karlsruhe.de

Can you please clarify in which file i can find this flag?

I only found
org.eclipse.wst.sse.ui/internal/ActionContributor._showDebug Status.

There was no file/class/subfolder eclipse.wst.sse.ui/action.

Thx

Axel


"Nitin Dahyabhai" <nitind@us.ibm.com> wrote in message
news:fe18mf$jsu$1@build.eclipse.org...
> A.G. wrote:
>> What could cause this exception, how could i debug this exception?
>
> Enable the debug trace flag option
> org.eclipse.wst.sse.ui/actioncontributor/debugstatusfields in the
> org.eclipse.wst.see.ui plug-in. Assuming that the editor still opens,
> you'll see an extra field in the status bar which, when double-clicked on,
> should open a dialog. The dialog might help determine what's amiss
> between editing your content type and when the editor is editing the
> regular XML content type.
>
> --
> Nitin Dahyabhai
> Structured Source Editing
Re: Problems developing a plugin based on SSE (ModelHandler Error?!) [message #201262 is a reply to message #201210] Thu, 04 October 2007 17:12 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2282
Registered: July 2009
Senior Member
A. Gallus wrote:
> Can you please clarify in which file i can find this flag?
>
> I only found
> org.eclipse.wst.sse.ui/internal/ActionContributor._showDebug Status.
>
> There was no file/class/subfolder eclipse.wst.sse.ui/action.

It's supplied as a tracing option. Both tracing for the plug-in
overall and the specific actioncontributor/debugstatusfields setting
need to be enabled.

See
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. pde.doc.user/guide/tools/launchers/tracing.htm
for how this is done in the launch configuration dialog.

--
Nitin Dahyabhai
Structured Source Editing


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Problems developing a plugin based on SSE (ModelHandler Error?!) [message #201269 is a reply to message #201262] Thu, 04 October 2007 17:16 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2282
Registered: July 2009
Senior Member
Adding an exception breakpoint for NullPointerException would also
be helpful in finding where the failure is. You can examine (and
copy a text representation of) the stack from the Debug view once it
is triggered.

http://help.eclipse.org/help33/topic/org.eclipse.jdt.doc.use r/tasks/task-catching_exceptions.htm

--
Nitin Dahyabhai
Structured Source Editing


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:Run on Server for Servlet
Next Topic:Add XML Tag Template to XML Editor
Goto Forum:
  


Current Time: Wed Oct 01 08:20:26 GMT 2014

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

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