Java AttributeError associated with Abstract Analytical Propagator

Hi, Orekit forum!

I’m a new user of the orekit, I don’t know much about the orekit. I’m here to ask for your help.
I don’t know the reason for the unknown orekit error, It’s maybe about Propagation.
I compile using Python 3.7 with Pycharm.

The portion of the code that causes the error and the package you imported are as:


import math
import logging
import orekit
from import RecordAndContinue
from import PythonEventHandler
from import DateDetector
from org.orekit.frames import FramesFactory
from org.orekit.time import AbsoluteDate
from org.orekit.time import TimeScalesFactory
from import Action


    def propagate(self, start, end, steps, mode=1, factor=2):
        self.setup_timesampler(start, end, steps, mode, factor)

        if end is None:

        elif None not in (start, end):
            # TODO: check value of shift, technically 1s should be enough
            shifted_start = start.shiftedBy(-60.0)
            shifted_end = end.shiftedBy(60.0)

            self.propagator.propagate(shifted_start, shifted_end)

            raise CelestialBodyError("Invalid arguments for propagation.")

for your information, setup_timesampler is as:

    def setup_timesampler(self, start, end, steps, mode=1, factor=2):
        """Create and attach TimeSampler to propagator."""
        self.time_sampler = TimeSampler(start, end, steps, mode, factor).withHandler(

The error is printed as:

  File "C:\space\", line 103, in propagate
    self.propagator.propagate(shifted_start, shifted_end)
orekit.JavaError: <super: <class 'JavaError'>, <JavaError object>>
    Java stacktrace:
java.lang.RuntimeException: AttributeError
	at Method)
	at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(

I can provide you with more code if necessary. Please, would you mind help me?
Many thanks.


Hey there,

The problem seems to lie with your home made detector.
Could you provide us with its implementation?
What version of Orekit are you using? I would suggest using the latest i.e. 11.3.2.


Thank you for answer @Serrof
My orekit version is 11.2.
The code for implementing time detector is as:

class TimeSampler(DateDetector):
    """TimeSampler implementation."""

    def __init__(self, start, end, steps, mode=1, factor=2):
        start = AbsoluteDate(2009,1,1,TimeScalesFactory.getUTC())
        duration = end.durationFrom(start)
        dtime = duration / (steps - 1)
        dtout = dtime
        self.times = []
        time = 0.0
        self.recorder = RecordAndContinue()

        if mode == 1:
            for _ in range(0, steps):
                time += dtime

        elif mode == 2:
            halfdur = duration / 2.0

            for _ in range(0, steps):
                time2 = (halfdur + math.sinh(
                    (time - halfdur) * factor / halfdur
                    ) * halfdur / math.sinh(factor))
                time += dtime
            dtout = duration * math.sinh(factor / steps) / math.sinh(factor)

        DateDetector.__init__(self, dtout / 2.0, 1.0, self.times)

Many thanks for the reply!

I found a person who came to the same error than looking at the forum.
My symptoms are completely the same.

My EventHandler code:

class TimingEvent(PythonEventHandler):
    """TimingEvent handler."""

    def __init__(self):
        """Initialise a TimingEvent handler."""
        self.date_history = []
        self.pos_history = []
        self.vel_history = []
        self.rot_history = [] = 0

    def eventOccurred(self, s, detector, increasing):
        """Handle occured event.""" += 1
        if % 1 == 0:
            logger.debug(f"{s.getDate()} : event {}")

        return Action.CONTINUE

    def resetState(self, detector, oldState):
        """Reset TimingEvent handler to given state."""
        return oldState

I’d appreciate it if anyone could see and help me.
Many thanks.