Calling Java Value objects from Jython - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Calling Java Value objects from Jython

rmvprasadrmvprasad Posts: 1Member
I need to pass Java POJO's as parameter to the java class I would be calling from Jython. I declared a java project and created a pojo, under the package com.pojo.util and the pojo name is User. I created an python project and wrote the following code

from com.pojo.util import User
class PojoTest:
user = User();
user.setFname("Prasad");
user.setLname("regula");
print user.getFname(), user.getLname()


It is saying
Traceback (innermost last):
File "__init__.py", line 1, in ?
ImportError: no module named pojo

I am not sure how to call the java class existing in a different project from a Jython project. If I try to create a java class in the jython project it is saying this is jython project can't create a java class. Could you guide me how to proceed. My main target is "Passing of pojo's as parameters to Jython functions".
Sign In or Register to comment.