Skip to content

BUG: AttributeError: Java package 'net' has no attribute 'sf' #38

Closed

Description

@Austinthemighty

when running ork2json --filepath RocketPyTest.ork --ork_jar ../OpenRocket-24.12.jar --verbose True on Mac this error is reported:

2026-03-20 15:24:33,483 - WARNING - [ork2json] Output folder not specified. Using '.' instead.
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.jpype.JPypeContext in an unnamed module (file:/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/org.jpype.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.14/bin/ork2json", line 7, in <module>
    sys.exit(ork2json())
             ~~~~~~~~^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/click/core.py", line 1485, in __call__
    return self.main(*args, **kwargs)
           ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/click/core.py", line 1406, in main
    rv = self.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/rocketserializer/cli.py", line 167, in ork2json
    with orhelper.OpenRocketInstance(ork_jar, log_level="OFF") as instance:
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.14/lib/python3.14/site-packages/orhelper/_orhelper.py", line 53, in __enter__
    self.openrocket = jpype.JPackage("net").sf.openrocket
                      ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: Java package 'net' has no attribute 'sf'

Activity

  1. Gui-FernandesBR commented on Mar 22, 2026

    @Gui-FernandesBR
    Member

    seems like this issue is not related to the serializer itself.

    I will investigate it and try to solve asap.

  2. changed the title [-]BUG:[/-] [+]BUG: AttributeError: Java package 'net' has no attribute 'sf'[/+] on Mar 28, 2026
  3. Austinthemighty commented on Mar 28, 2026

    @Austinthemighty
    Author

    I also noted that if a the output directory has a space in it, it throws an error

  4. Gui-FernandesBR commented on Mar 29, 2026

    @Gui-FernandesBR
    Member

    Hi @Austinthemighty, thank you for the detailed report and for flagging the spaces issue too!

    Both problems should now be fixed in the latest push (merged via #39):

    AttributeError: Java package 'net' has no attribute 'sf'
    This was caused by a breaking change in OpenRocket 24.12, which moved its Java package from net.sf.openrocket to info.openrocket. We replaced the orhelper dependency with a custom OpenRocketSession class that automatically handles both package paths, so it should work with older and newer OpenRocket versions alike.

    Spaces in the output directory path
    This should also be resolved — the output path is now handled through Python Path objects and passed as a list of arguments (not a shell string), which correctly handles paths with spaces.

    Note on Python 3.14: We currently test against Python 3.9 and 3.11. Python 3.14 is still in development and may have stricter JVM restrictions (as seen in the warnings about --enable-native-access). We recommend using Python 3.11 for the best compatibility (for now).

    Please upgrade to the latest version of our master branch and let us know if the issue persists!

  5. Austinthemighty commented on Mar 31, 2026

    @Austinthemighty
    Author

    Hi @Gui-FernandesBR Thank you for you help in fixing this, I will give it a test in the morning. for testing the master branch what should I run to test it?

  6. Gui-FernandesBR commented on Mar 31, 2026

    @Gui-FernandesBR
    Member

    Hi! To test the master branch fix, you can install directly from GitHub using pip:

    pip install git+https://github.com/RocketPy-Team/RocketSerializer.git@master
    

    If you're in a virtual environment, make sure it's activated first. If you had a previous version installed, add --force-reinstall to make sure you get the latest:

    pip install --force-reinstall git+https://github.com/RocketPy-Team/RocketSerializer.git@master
    

    Also, as mentioned, if you're on Python 3.14 you may still see JVM warnings — switching to Python 3.11 is recommended for the smoothest experience right now.

    Let us know how it goes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions