[
https://issues.apache.org/jira/browse/FELIX-5105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15021931#comment-15021931
]
Miroslav Šulc commented on FELIX-5105:
--------------------------------------
so i tried to find a way how to modify the ocd directly but it's only read-only
when retrieved from metatype service. the other way is to adjust the default
values for webconsole configuration before generating the config editing form,
though that sounds little bit hackish to me. i did not go this way yet as i'd
prefer to read from you whether that solution would be acceptable or not and
whether it might have some side-effects.
i also debugged the webconsole and metatype code to find the cause. i did not
find it, but i found one interesting thing. when i restart metatype bundle then
the configuration is not displayed. when i restart webconsole bundle, the
configuration is displayed. a difference during runtime i found in file
felix.git/metatype/src/main/java/org/apache/felix/metatype/internal/MetaTypeServiceImpl.java
at line 257 where msRefs is null when configuration will not displayed and
msRefs contains one ref when configuration will be displayed. the code is
triggered while clicking on OSGI -> Configuration in webconsole for the first
time after bundle restart.
also, what version of metatype bundle do you have?
> Web Console configuration does not appear in configurations
> -----------------------------------------------------------
>
> Key: FELIX-5105
> URL: https://issues.apache.org/jira/browse/FELIX-5105
> Project: Felix
> Issue Type: Bug
> Components: Web Console
> Affects Versions: webconsole-4.2.14
> Reporter: Miroslav Šulc
> Labels: patch
> Attachments: metatype.xml.patch
>
>
> since some time web console configuration is more and more broken it seems.
> there is for example bug related to lost localization of the configuration
> which i encountered on my installations too. in some cases it also happens
> that the web console configuration is not displayed at all. in fact i was not
> able to display it (and so edit it) at all. i tried to debug the issue but
> the only thing i found is that for some (to me) unknown reason the
> configuration from java class is not picked up.
> in version 4.2.15-SNAPSHOT and older versions the metatype provider is
> implemented as java class
> org.apache.felix.webconsole.internal.servlet.ConfigurationMetatypeSupport.
> that is probably the cause of the problem that the configuration usually does
> not load, maybe because of some synchronization issue. i noticed some
> information about attempts to fix it in previous versions of web console but
> these were just attempts as the issue persists.
> i have no idea why the metatype provider is implemented using
> ConfigurationMetatypeSupport class instead of using metatype.xml file which
> would be more transparent and easier to manage, maybe it's for historical
> reason when metatype implementation was not that capable as it is now.
> so i created metatype.xml file that defines the same configuration as is done
> using ConfigurationMetatypeSupport and it seems to work fine. i did not
> remove the ConfigurationMetatypeSupport and related code though as i guess it
> would be better done by someone who better understands the code.
> i will try to attach the patch i have if i find out how.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)