Yes, I tried to import org.joda.time.* before but this did not Change anything.
I also don’t think that this is the Problem because the timer itself is working without any Problem. It is the cancellation of a running timer which runs into this errors.
Not true. You do have to import org.openhab.model.script.actions.* though. That will give you Timer. now is available without importing joda, though if you want to create or save now to some variable or convert DateTimes you do need to import it.
What I found out now is that it seems not to be a problem with the .cancel command itself. If I do a variable declaration like var Timer nachf within the rule no error occurs.
That means it seems that the global variable declaration does not take affect but I don’t know why and what I can do against this.
So the reason why this errors occure is only because he does not find the Timer.
If you make the declaration local to the rule but make no other changes, the else part with the cancel will never run. Every time the rule triggers nachf will be then either you create a new timer (i.e G_B_EffektWeiss.state == ON) or nachf will be null so the call to nachf.cancel never occurs. In short, unless you made other changes you are not testing the broken call at all.
Did you copy and paste your code exactly or did you retype it? Is it possible that you have a typo causing a mispelling of nachf?
The latest error that pops up once you added the if(nachf != null) clearly indicates that nachf doesn’t exist (not that it is null, it doesn’t exist at all).