exclamation-circle Modelio 3, problem with jython import

6 years 4 months ago #2230 by jmfavre
Hi,

it seems that they are still some problem with the jython installation embedded in modelio 3. Just try this in a fresh script window:
from xml.dom.minidom import parse

With modelio 2, this is perfectly fine, one can have a lot of fun parsing xml files and creating uml objects to do some kind of reverse engineering.

With modelio 3, this import gives the following message:
TypeError: object of type 'NoneType' has no len() in <script> at line number 1
Traceback (most recent call last):
  File "<script>", line 1, in <module>
  File "__pyclasspath__/Lib/xml/dom/__init__.py", line 226, in <module>
  File "__pyclasspath__/Lib/xml/dom/MessageSource.py", line 19, in <module>
  File "__pyclasspath__/Lib/xml/FtCore.py", line 38, in <module>
  File "__pyclasspath__/Lib/xml/FtCore.py", line 38, in <module>
  File "__pyclasspath__/Lib/gettext.py", line 59, in <module>
  File "__pyclasspath__/Lib/ntpath.py", line 96, in join
TypeError: object of type 'NoneType' has no len()

Less fun. bouhhhhouhhouh. :S

Please Log in or Create an account to join the conversation.

6 years 4 months ago #2243 by chm
Hi jmfavre,

looks like sys.prefix is empty, which means some initialization might be missing in the engine...

As a workaround, you should try filling the variable in your script with something like
sys.prefix = "$ModelioCoreWorkspace/script.engine/lib/jython2.7/jython.jar"

($ModelioCoreWorkspace beeing the workspace your have to build modelio itself)

Hope this helps,


chm
The following user(s) said Thank You: jmfavre

Please Log in or Create an account to join the conversation.

6 years 4 months ago #2245 by phv
Hi,

The following workaround is recommended and works perfectly:

sys.prefix = "."


Of course this fix will be included in future versions of Modelio 3.

PhV
The following user(s) said Thank You: jmfavre

Please Log in or Create an account to join the conversation.

Moderators: chmcma
Time to create page: 0.037 seconds
^ Back to Top