Postprocessing of M2Doc Documents by Visual Basic

fromHTMLBodyString doesn’t appear anywhere in the output.

Find the generated document with the output:
template.generated.docx (21.9 KB)

Some more background:
With M2Doc 3.10 we never had issues. With 3.11 it had worked under certain conditions for certain users - not knowing what the conditions are; maybe, for those users there was something specific left over in the configuration coming from 3.10 - just a guess.

Thx, Uwe

Find also the template and genconf attached:
template.docx (22.8 KB) template.genconf (649 Bytes)

This service is initialized using this extension, so you can check if the plugin org.obeonetwork.m2doc.html.ide is started in your environment after running a generation with M2Doc.
You can also try to put a breakpoint here to see if the service is initialized.
If the plugin is not started, it’s might be possible to try to start it manually and see why it won’t start… probably a dependency issue…
You can also check the error log view or the .log file in your workspace and see if something wrong shows up regarding the feature or the plugin.

Hi Yvan,

we are able to reproduce the error: it works with m2doc 3.1.0, as it does with 3.1.1 too, but only if it is installed after 3.1.0 and as long as the Capella “p2” and “configuration” directories are not removed. As sson as they are removed, the error occurs. This seems to corroborate the hypothesis mentioned by Uwe.

To set a breakpoint means to import and build the m2doc project in Capella and debug it - that would be a last resort for us as it is more or less a development activity for the m2doc project. So first we´d like to check if org.obeonetwork.m2doc.html.ide is started. It seems it is not, as it is not present in the .trace() output attached above.
In the .metadata/.log file in my workspace there is a Runtime Exception “org.eclipse.core.runtime.CoreException: Problems occurred while resolving the target contents” thrown in org.eclipse.pde.internal.core.PluginModelManager.getExternalBundles(PluginModelManager.java:681) - pls see the atatched stack trace. This seems related to it. issue_HTMLBody2String_.log.txt (23.1 KB) . There are some Eclipse bug reports around this, e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=501393.

How could we start the plugin manually to check why it won´t start?
Br, M.

p2 is the equivalent of a package manager for Eclipse. You should probably not delete directories from Capella if you want it to work properly.

You can have a look at this page to debug bundle loading. But my advice would be to keep the files inside your Capella installation.


1417 INSTALLED org.obeonetwork.m2doc.html_3.1.1.202102191638
1418 INSTALLED org.obeonetwork.m2doc.html.ide_3.1.1.202102191638
1419 STARTING org.obeonetwork.m2doc.ide_3.1.1.202102191638
1420 STARTING org.obeonetwork.m2doc.ide.jdt_3.1.1.202102191638
1421 STARTING org.obeonetwork.m2doc.ide.ui_3.1.1.202102191638
1422 RESOLVED org.obeonetwork.m2doc.launcher_3.1.1.202102191638
1423 ACTIVE org.obeonetwork.m2doc.sirius_3.1.1.202102191638
1424 RESOLVED org.obeonetwork.m2doc.sirius.ui_3.1.1.202102191638
1425 INSTALLED org.obeonetwork.m2doc.wikitext_3.1.1.202102191638
1426 INSTALLED org.obeonetwork.m2doc.wikitext.ide_3.1.1.202102191638
1427 INSTALLED org.obeonetwork.m2doc.word.addin_3.1.1.202102191638
1428 INSTALLED org.obeonetwork.m2doc.word.addin.ide.ui_3.1.1.202102191638
osgi> diag 1417
org.obeonetwork.m2doc.html [1417]
** Unresolved requirement: Require-Bundle: org.jsoup; bundle-version="[1.8.3,1.8.4)"**
osgi> diag 1418
org.obeonetwork.m2doc.html.ide [1418]
** Unresolved requirement: Require-Bundle: org.obeonetwork.m2doc.html; bundle-version="[3.0.0,4.0.0)"**
** -> Bundle-SymbolicName: org.obeonetwork.m2doc.html; bundle-version=“3.1.1.202102191638”**
** org.obeonetwork.m2doc.html [1417]**
** Unresolved requirement: Require-Bundle: org.jsoup; bundle-version="[1.8.3,1.8.4)"**
osgi>

If we come from m2doc 3.10 without deleting the user’s p2/configuration it looks like this:
1417 RESOLVED org.obeonetwork.m2doc.html_3.1.1.202102191638
1418 RESOLVED org.obeonetwork.m2doc.html.ide_3.1.1.202102191638

It seems that there remains something in the user’s local config area, which is not installed with 3.11 in the share config area

Why is org.jsoup installed with 3.10, but not with 3.11? Where does it come from?

I made some more investigations and have a bit a different picture now.

It seems the issue is not restricted to 3.11. If I uninstall 3.11 and install 3.10, I have the same issue now.

Still it seems to be linked to “Unresolved requirement: Require-Bundle: org.jsoup”.
org.jsoup_1.8.3.v20181012-1713.jar is available in the installation in …/eclipse/plugins.

But, it is not visible in the list of installed bundles (osgi> ss) nor in the Installation Details/Installed Software.

What is missing?

The configuration of bundle is probably in the configuration folder you deleted… But jsoup is available in the M2Doc update site.

Thanks Yvan for guiding us to https://wiki.eclipse.org/Where_Is_My_Bundle. We are trying to find out why jsoup is not installed. Regarding this, we wonder why - contrary to the explanations in “OSGi Can’t See My Bundle” in the above mentioned link - there is still also present the directory configuration/ and therein org,eclipse.update/platform.xml. Actually, I would expect only p2/. It is Eclipse 4.12 - wrt Capella, is there any special reason for this that is known to you? br, M.

No, only the length of the path (256 characters limit) but I think we already checked that…
You can revert an installation in the installation history of Eclipse maybe you could reach a point where you can reinstall M2Doc or the M2Doc extensions. Or maybe you can start from a fresh install.

Obviously, the situation is complicated and may be not really well structured/designed, because after installing bare Capella + m2doc, everything is ok (jsoup is a RESOLVED bundle), but when adding the Thales dropins, it simply disappears (is not present in the list of bundeles). May be p2 garbage collection removes it. So currently we simply try to install the jsoup bundle. But on jsoup.org only the jar is available and from the m2doc update site it cannot be installed after m2doc has been installed already. Also when creating the plugin project from existing jar in Capella, the plugin has a different structure than the zip files below p/m2doc. Do you know how to create and install the jsoup bundle?

Can you have access to an update site of what you try to use via droppings ? It will probably provide information about what goes wrong. P2 is here to deal with dependencies and also compute what can or can’t be installed and even download missing dependencies.
JSoup can be found in Orbit: https://download.eclipse.org/tools/orbit/downloads/

Affirmative! Every plug-in, add-on, feature should be installed, updated etc. via p2 and p2 only. It seems however, that when we install the dropins from update sites via p2, not all of the addons actually work. Uwe, I think, will write an internal ticket wrt this. This is not related to m2doc, obviously. m2doc is most probably not the actual root cause, it is the effect of that issue that, at the end of the day, the jsoup bundle is not present and thus the m2doc HTML services do not work. Thanks for the support so far - should any progress be made on our part in resolving the issue, I will keep you posted. br, M.

1 Like

I managed now to install all Thales add-ons on from update site. Still, if I install M2Doc on top jsoup is not visible from the user area.
It is visible and working, though, If I run Capella in admin mode (i.e. -configuration is in install area).
It is somehow strange that we have the issue only for the jsoup bundle; all other M2Doc bundles work fine.
My hypotheses is that there is some interference with Thales add-on. I opened an internal Thales ticket and hope to get feedback.

Maybe one of this add-on depend on an other version of jsoup and both versions cant be installed at the sametime. But in this case you should have a warning when installing it with p2…
Let me know when you have more information.

The workaround we have now is to install M2Doc as dropin opposed to install it from update site. (Even though, it is not clear to me why this works better).

We use Capella Extensions from this site: https://s3-eu-west-1.amazonaws.com/obeo-networkaggregation-releases/capella-extensions/1.4.2/full/org.obeonetwork.capella.update.full.zip , which is M2Doc 3.10.

An dropin installation for a new version of M2Doc (3.11) does not work.

I wonder if there is any possibility to get M2Doc3.11?

I’m working on fixing this issue for M2Doc 3.2.0. There is a nightly build if you want to try your installation method:
https://s3-eu-west-1.amazonaws.com/obeo-m2doc-releases/master/nightly/repository zip

We will see if we need to backport this fix to previous versions of M2Doc and M2Doc extensions for Capella.

If I use the nightly from today (26 April) I am able to install it in the dropins way and the ‘fromHTMLBodyString’ does work.
But, then the command line feature does not work any longer. That was the reason why I used Capella extensions.

I wonder if I can combine the nightly with Capella extensions.

We the command line is specific to Capella. It was just to make sure the next release will solve your issue. There is a nightly build of the M2Doc extensions for Capella 5.1.0 (under development):
https://s3-eu-west-1.amazonaws.com/obeo-networkaggregation-releases/capella-extensions/master/nightly/full zip

But you will not be able to install it in an other version of Capella.

Pls see M2Doc technical error