bndtools / workspace

A starter Bnd workspace with plain OSGi dependencies and a Bnd Gradle build.
http://bndtools.org
Apache License 2.0
7 stars 13 forks source link

Felix Web Console issue #14

Closed wilcowijbrandi closed 3 years ago

wilcowijbrandi commented 3 years ago

Hi,

I'm trying to upgrade an older OSGi application to a newer version of OSGi and bnd. I want to base my new version on this workspace, but I run into problems with the Felix Web Console. The problem is a bit hard for me to pin down, so I thought I'll ask for help here.

The application relies heavily on Configuration Admin and Metatype, and I always use the Felix Web Console. But when I go to the Configuration page (http://localhost:8080/system/console/configMgr), I get a Javascript error: Uncaught TypeError: parsers is undefined. The weird thing is... even if I downgrade the webconsole bundles to the versions that I have been using without problems for years, I get the same error. The cause of the problem somehow doesn't seem to be in the web console implementation itself.

Below you can find the contents of my bndrun file:

-runfw: org.eclipse.osgi;version='[3.13.100.v20180827-1536,3.13.100.v20180827-1536]'
-runprovidedcapabilities: ${native_capability}

-resolve.effective: active

-runproperties: \
    org.osgi.service.http.port=8080,\
    osgi.console=,\
    osgi.console.enable.builtin=false

-runrequires: \
    bnd.identity;id='com.example',\
    bnd.identity;id='org.apache.felix.webconsole',\
    bnd.identity;id='org.apache.felix.webconsole.plugins.ds',\
    bnd.identity;id='org.apache.felix.configadmin',\
    bnd.identity;id='org.apache.felix.http.jetty',\
    bnd.identity;id='org.osgi.service.metatype',\
    bnd.identity;id='org.apache.felix.scr'

-runee: JavaSE-14

-runbundles: \
    com.example;version=snapshot,\
    org.apache.commons.fileupload;version='[1.3.3,1.3.4)',\
    org.apache.commons.io;version='[2.6.0,2.6.1)',\
    org.apache.felix.configadmin;version='[1.9.8,1.9.9)',\
    org.apache.felix.http.jetty;version='[4.0.6,4.0.7)',\
    org.apache.felix.http.servlet-api;version='[1.1.2,1.1.3)',\
    org.apache.felix.inventory;version='[1.0.4,1.0.5)',\
    org.apache.felix.scr;version='[2.1.10,2.1.11)',\
    org.apache.felix.webconsole;version='[4.3.4,4.3.5)',\
    org.apache.felix.webconsole.plugins.ds;version='[2.0.8,2.0.9)',\
    org.osgi.service.log;version='[1.4.0,1.4.1)',\
    org.osgi.service.metatype;version='[1.4.0,1.4.1)',\
    org.osgi.util.function;version='[1.1.0,1.1.1)',\
    org.osgi.util.promise;version='[1.1.0,1.1.1)',\
    org.osgi.util.pushstream;version='[1.0.0,1.0.1)'

I used this repository as my workspace, and only added an empty component project and this file.

I understand this might not be the right place to post this issue, but any help would be much appriated!

Wilco

njbartlett commented 3 years ago

I think the best place to ask about this is in the Felix mailing list. Although I agree with you that the problem might not ultimately be in Web Console, it is Web Console where the error is being reported and that's your best place to start looking for the cause.

The error message "Uncaught TypeError: parsers is undefined" doesn't help much. You might want to see if there is anything in the OSGi log... turn on DEBUG level logging and view the log (you should be able to do this in Web Console, unless the log tab is also broken!). Post any information you can in your query to the Felix mailing list.

Other things that spring to mind: Java 14 isn't widely supported, try running on Java 11? It sounds like you are making changes to your application, build system and runtime platform in a Big Bang approach... try changing just one thing at a time and making it stable before moving onto the next thing?

wilcowijbrandi commented 3 years ago

Thanks for the help @njbartlett!

Fortunately we were able to figure it out: we were missing the metatype implementation bundle. Apparently the Felix Web Console doesn't handle the missing runtime dependency in a pretty way, which then manifests in JavaScript errors. I consider this a Felix Web Console bug.

If I add the org.apache.felix.metatype or the org.eclipse.equinox.metatype bundle to my bndrun file, the Configuration Admin page in de the Felix Web Console works just fine.