how to run a jython script - missing modules

Hi there,

I have a problem running a jython script with the buildin python modules socket and pickle.

In the shell the script works fine and connects to the daemon on another server. So the modules are installed:

The script lies under [...]/confluence-data/script/ and can be executed via confluence with this command

{jython:output=wiki|script=#script.py}
{jython}

For a testing "Hello World" this works fine to call the script, but when I want to use the mentioned modules, they can't be found.

Traceback (innermost last):
File "<string>", line 2, in ?
ImportError: no module named socket

Does anyone has a clue how to get it working, how to explicit import the modules in confluence?! It would be nice to have this functionality in confluence.


Cheers
Erik

1 answer

See SCRP-119 comments for instance. I think you need to install whatever libraries you want to use in WEB-INF/lib.

Ok, thx I will try that for the next change.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

95 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you