Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot convert python object for java.util.Properties #414

Open
donzeno23 opened this issue Apr 12, 2019 · 0 comments
Open

Cannot convert python object for java.util.Properties #414

donzeno23 opened this issue Apr 12, 2019 · 0 comments

Comments

@donzeno23
Copy link

donzeno23 commented Apr 12, 2019

There seems to be an issue using a JavaClass that uses java.util.Properties as one of it's arguments.

For example, the java class is:

import java.util.Properties

public class Tester {
  public Tester(String x, String y, Properties p) {
    this.x = x;
    this.y = y;
    Properties props = new Properties();

In my python code I am doing the following:

from jnius import autoclass
Properties = autoclass('java.util.Properties')
props = Properties()

x = 'test 1'
y = 'result'
tester = Tester(x, y, props)

And the exception I am getting is:

JavaException: Invalid python object for this argument. Want 'java/util/Properties', got <java.util.Properties at 0x2b6851d19fb0 jclass=java/util/Properties jself=<LocalRef obj=0x42ef348 at 0x2b68752f8630>>

Is this because jnius does not support conversion to java.util.Properties. And if that is the case, can this please be implemented?

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

No branches or pull requests

2 participants