Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-core-dev] how to debug string lookup from plugin.properties?

(Apologies if this is a FAQ, but

* I posted to e.platform about this in June and got no response.
  The issue then got submerged, but is now surfacing again.

* I have searched eclipse help, the newsgroup, and googled but haven't
  found significant help.)

summary: Please inform me where/how I should break/look in order to
debug cases where some %-strings in an extension do not substitute.
(Note that the failing properties *are* present in the corresponding
plugin.properties files.)

details:

I develop plugins for Rational Developer (v6). These plugins
contribute to an extension point, provided by plugins we don't own,
that defines 2 string properties, label and description. E.g. one
plugin.xml has

> <model
>       wizard_id="com.ibm.etools.struts.ActionMappingWizard"
>       id="spfActionMappingModel">
>    <label>
>       %wizard.spf.actionmapping.generic.model.label
>    </label>
>    <description>
>       %wizard.spf.actionmapping.generic.model.description
>    </description>

and its plugin.properties has

> wizard.spf.actionmapping.generic.model.label = Struts Portlet Framework 
Action Mapping
> wizard.spf.actionmapping.generic.model.description = Generate a new 
Struts Portlet Framework action mapping

Both properties

* are unique: find/grep only gets one instance in my workspace

* unchanged since WebSphere Studio 5.1.2 (based on eclipse=2.1.3), in
  which both resolved properly

and both properties resolve correctly in very similar extensions of
the same extension point, in both this plugin and others.

Yet now, as far back as I trace (you know you're getting desperate
when you start investing in yr own Detail Formatter), only 1 of the 2
properties is getting picked up, the label, but not the description:

> [3]= Extension  (id=766780)
>   elements= IConfigurationElement[2]  (id=111882828)
>     [0]= ConfigurationElement  (id=111882856)
>     [1]= ConfigurationElement  (id=766428)
>       children= IConfigurationElement[6]  (id=111884420)
>         [0]= ConfigurationElement  (id=111884444)
>           children= null
>           name= "label"
>           parent= ConfigurationElement  (id=766428)
>           PLUGIN_ERROR= 1
>           properties= null
+           value= "Struts Portlet Framework Action Mapping"
>         [1]= ConfigurationElement  (id=111884448)
>           children= null
>           name= "description"
>           parent= ConfigurationElement  (id=766428)
>           PLUGIN_ERROR= 1
>           properties= null
-           value= "%wizard.spf.actionmapping.generic.model.description"
>         [2]= ConfigurationElement  (id=111884452)
>         [3]= ConfigurationElement  (id=111884456)
>         [4]= ConfigurationElement  (id=111884460)
>         [5]= ConfigurationElement  (id=111884464)
>       name= "model"
>       parent= Extension  (id=766780)
>       PLUGIN_ERROR= 1
>       properties= ConfigurationProperty[2]  (id=111884424)
>       value= null
>   extensionPoint= "com.ibm.etools.webtools.wizards.WebRegionModel"
>   fullyLoaded= true
>   id= null
>   name= null
>   parent= Namespace  (id=111882836)
>   subElementsCacheOffset= 0

As a result, @ runtime my UI displays

Struts Portlet Framework Action Mapping
%wizard.spf.actionmapping.generic.model.description

which annoys our TVT people :-(

Interestingly, there is at least one other similar instance in this
extension, where 1 (and only 1) %-string in an extension is not
getting looked-up:

> [14]= Extension  (id=766824)
>   elements= IConfigurationElement[1]  (id=767656)
>     [0]= ConfigurationElement  (id=767676)
>       children= IConfigurationElement[8]  (id=767680)
>         [0]= ConfigurationElement  (id=767704)
>           children= null
>           name= "label"
>           parent= ConfigurationElement  (id=767676)
>           PLUGIN_ERROR= 1
>           properties= null
-           value= "%insWiz.nestedjsp.label"
>         [1]= ConfigurationElement  (id=767708)
>           children= null
>           name= "description"
>           parent= ConfigurationElement  (id=767676)
>           PLUGIN_ERROR= 1
>           properties= null
+           value= "Generate a new JSP page template using a page 
template."
>         [2]= ConfigurationElement  (id=767712)
>         [3]= ConfigurationElement  (id=767716)
>         [4]= ConfigurationElement  (id=767720)
>         [5]= ConfigurationElement  (id=767724)
>         [6]= ConfigurationElement  (id=767728)
>         [7]= ConfigurationElement  (id=767732)
>       name= "model"
>       parent= Extension  (id=766824)
>       PLUGIN_ERROR= 1
>       properties= ConfigurationProperty[4]  (id=767684)
>       value= null
>   extensionPoint= "com.ibm.etools.webtools.wizards.WebRegionModel"
>   fullyLoaded= true
>   id= null
>   name= null
>   parent= Namespace  (id=767012)
>   subElementsCacheOffset= 0

Again,

* each property is unique and correctly referenced

* one gets substituted, one does not

but in this latter case the description property gets substituted but
not the label property, which is the reverse of the former case.

I've debugged before the registry reader for this extension gets the
IExtension[], and the bad values are already in the array, so I
believe the problem is deeper in the platform. I tried setting a BP on
PluginDescriptor.getResourceString(String) but it didn't get hit
(possibly because I enabled it too late--I didn't wanna set it long
before my UI came up, and get hit by every one of the 120x plugins in
the product).

So what I'd like to know is, where/how to set a break- or watchpoint
to debug this? I suspect I'd like to set it where the extension are
initially substituted, but I don't know where that is.

If possible please reply directly to me (as well as the list), feel
free to forward, and TIA.



Back to the top