DSL rule execution error with TimeSeries variable JvmType.eIsProxy()

In 5.2 incl. latest, when this DSL Code line

var TimeSeries series = new TimeSeries(TimeSeries.Policy.REPLACE)

is executed, it results in

2026-05-21 18:42:13.709 [ERROR] [mation.module.script.internal.handler.AbstractScriptModuleHandler] - Script execution of rule with UID 'netz-2' failed: An error occurred during the script execution: Cannot invoke "org.eclipse.xtext.common.types.JvmType.eIsProxy()" because "type" is null in netz

It worked in 5.1.4

@lolodomo Eventually related No viable alternative at input 'between' - #2 by fibu-freak ?

Sorry, I don’t see any obvious link.

Maybe your need to add import for TimeSeries ?

For me the below rule works with import in both 5.1.4 and 5.2.0 build 5381 (latest currently). It does not work with 5.1 or 5.2 when import is skipped:

import org.openhab.core.types.TimeSeries

rule a
when
  System reached start level 100
then
  logError("S", new TimeSeries(TimeSeries.Policy.REPLACE).toString)
end

I cannot see a regression.

Good

Indeed, importing the type fixed it.
(In 5.1.4 it apparently was an implicit import).

Thanks both of you.

I think the ā€œsolvingā€ of this issue was a bit quick. Doesn’t anybody wonder why the behavior has changed? As far as I know, no implicit imports have been removed, so is there really something else that is going on? Some regression caused by all the other changes?

After some ā€œinvestigationā€ this seems likely to have been caused by the upgrade of Xtext itself. Apparently, they have made the class loading much more strict to avoid ā€œleaksā€, where classes that could be resolved ā€œvia other classesā€ would previously be resolvable. This is no more, so anything that isn’t either implicitly or explicitly imported will be rejected.

This means that 5.2.0 has the potential for a little ā€œavalancheā€ of classes that used to be resolvable, but isn’t anymore. There should probably be a notice somewhere that this can happen, and what the remedy is. In addition, I will add org.openhab.core.types to implicit imports in an existing PR, which should take care of the following classes, including TimeSeries:

When I tried the above snippet, it behaved for me in identical way in openHAB 5.1.4 and 5.2 latest snapshot. So for that particular example, which I posted above, I see no difference in behaviour of implicit imports between openHAB 5.1.4 and openHAB 5.2.

On my side, I encountered no problem with my DSL rule file when moving to recent snapshots, considering that my only imports are:

import java.util.regex.Matcher
import java.util.regex.Pattern
import org.openhab.core.model.script.ScriptServiceUtil

If there is a difference of implicit imports between 5.1 and 5.2., it would be easier to track down its cause, if it is clarified, if the difference is only in DSL Scripts, or also in DSL Rules. As DSL Scripts cannot have import section, the above means, if a code snippet was working as a DSL Script before (without import) and now the DSL Script needs full-qualified names.

Are you saying that you don’t believe that what @mstormi reports is accurate? I didn’t really consider that an alternative, and rather tries to find an explanation for why it could be.

This depends entirely on whether or not you use one of those classes that have been ā€œmagically resolvedā€ in the past by the removed ā€œclass hierarchy walkingā€. If you haven’t used any of them, you won’t notice a difference - what worries me here, is that we have no way to know what classes that is - and how widespread their use is.

The difference is in Xtext itself and how classes are resolved. In previous versions there was some kind of ā€œhierarchy walkā€ mechanism that resolved classes that were indirectly referenced, or perhaps that were parents to imported classes. I’m not sure of the details, you must dive into the changes done to Xtext to know the exact details.

They were worried about ā€œclass leaksā€, whatever that is, and removed this behavior so that only what is specifically imported (implicitly or explicitly) are resolvable. As a result, it’s very hard to know what the impact will be when 5.2.0 is released.

Is that XText upgrade already included in last milestone?

Yes, this is what I am saying.

I’m not sure, as I don’t know when the milestones were made, but it is the same upgrade that made ValidID work without my ā€œhacksā€.

Ok, that’s your right I guess - I see no reason to suspect that to be the case.

Upgrade Karaf to 4.4.11 by holgerfriedrich Ā· Pull Request #5510 Ā· openhab/openhab-core Ā· GitHub did Xtext/Xbase upgrade on 11 May. It is included in 5.2.0.M4 - Release openHAB 5.2.0.M4 Ā· openhab/openhab-distro Ā· GitHub .

At the same time, we got no other similar feedback about suddenly missing imports.

The question is if that means that there’s not a problem. How many actually upgrade to milestones? How many of those use DSL? How many of those again happen to rely on some of these ā€œmagical importsā€ that were effective because of some classpath traversal algorithm?

In my view, the remedy is to add the ā€œmost likelyā€ impacted classes, like org.openhab.core.types and others that is likely to be widely used without explicit import, and then include a notice in the release notes that this might happen and that the remedy is explicit import or using the full class path.

Also, the reported ā€œchange in resolutionā€ is very vague, and I haven’t been able to figure out what the details are. This makes it very hard to assess the potential impact. We’re also currently running a milestone of Xtext - so this might also be caused by a bug somewhere.

It is very hard to get down to ā€œfactsā€ here, I’ve tried to query Google’s ā€œAIā€ to find what has actually changed. It seems that the change isn’t in Xtext itself, but is a consequence of Xtext updating its dependencies to more recent versions of the ā€œEclipse Platformā€.

I’ll paste some of what the ā€œAIā€ reports, then everybody can make up their own mind if this is ā€œrealā€ or not:

The behavior change is entirely a side effect of Eclipse Platform / OSGi Classloading visibility isolation and dependency convergence introduced during the openHAB 5.2.0 cycle upgrade to Xtext 2.43.

The Core Culprit: ClasspathTypeProvider vs OSGi

The Cannot invoke "JvmType.eIsProxy()" because "type" is null error isn’t a new bug in Xtext. It is a generic, long-standing fallback failure in Xtext’s standard linking validation engine. Whenever Xtext completely fails to locate a type in its scope provider, it returns a null JvmType. The validation interceptor immediately calls .eIsProxy() on that object without a null-check, resulting in this exact error stack trace.

The root issue is that Xtext’s ClasspathTypeProvider (or openHAB’s custom extension of it) can no longer find org.openhab.core.types.TimeSeries.

Why it broke in 5.2.0 (but worked in 5.1.4)

When openHAB bumped its target platform to the newer Eclipse version required by Xtext 2.43 (which enforces a strict Java 17 / Eclipse 2024-03+ baseline), the way OSGi bundles expose hidden or transitive class paths changed.

  • In 5.1.4: Due to older OSGi wiring configurations or looser bundle isolation paths in the old Eclipse runtime dependencies, the bundle wrapping the Xtext parsing engine happened to have org.openhab.core.types leaked into its unmapped class loader classpath natively. Xtext could see it globally even without an explicit directive.
  • In 5.2.0: The platform upgrade enforced stricter bundle bounds. TimeSeries is contained in org.openhab.core.types, which is decoupled from the immediate runtime scope of the Rules DSL interpreter engine unless explicitly exposed or implicitly declared. Because it can no longer see the package via unmapped classloading, it returns null.