Code Macro Requirements


#18

It happens when loading org.python.core. In org.python.core.imp.import_module_level() the first package part (= org) is tried to be loaded. A bit weird, but usually no problem. It fails only because of the Tomcat8 bug.


#19

i have exactly the same problem as bjoerne. I am also stuck now with the code macro with the “String index out of range: 3” error message after adding the line in tomcat8 file as suggested by bjoerne.


#20

See https://bugs.launchpad.net/ubuntu/+source/tomcat8/+bug/1644144 for Ubuntu side bug. https://jira.xwiki.org/browse/XWIKI-14924 has been create to follow progress on this issue.

The following ppa is supposed to contain a fixed version of Tomcat 8: https://launchpad.net/~nacc/+archive/ubuntu/tomcat8v2. Would be great if someone could test it.


#21

I’ve got the same situation on the ubuntu.

But I found a simple solution but a little dirty. I manually upgraded tomcat to version 8.0.38 (by downloading debs for debian from internet) and downgraded jython to version 2.7.0. Now everything is ok, macros are fully functional.


#22

So nobody wants to try https://launchpad.net/~nacc/+archive/ubuntu/tomcat8v2 ? I’m sure they would be happy on https://bugs.launchpad.net/ubuntu/+source/tomcat8/+bug/1644144 to have to validation if it’s working well so that they can apply it :slight_smile:


#23

Hi. My Solution (Ubuntu LTS 16.04 with xwiki on TomCat 8 MySQL DB via DEB) was to download latest Tomcat 8 Release (tar.gz) and overwrite existing TomCat installation (i know its dirty :wink: )

service tomcat8 stop 
tar xvfz apache-tomcat-8.0.48.tar.gz
cd apache-tomcat-8.0.48
cp * /var/lib/tomcat8/ -Rv
service tomcat8 start

you should do a snapshot or a copy of the tomcat8 directory


#24

It works!!!

sudo add-apt-repository ppa:nacc/tomcat8v2
sudo apt-get update
sudo apt-get install tomcat8=8.0.32-1ubuntu1.3~ppa2
sudo apt-get install tomcat8-common=8.0.32-1ubuntu1.3~ppa2
sudo apt-get install libtomcat8-java=8.0.32-1ubuntu1.3~ppa2
sudo service tomcat8 restart

Thank a lot for your help, @tmortagne !


#25

Thanks for the testing @bjoerne :slight_smile:

I added a note in http://www.xwiki.org/xwiki/bin/view/Documentation/AdminGuide/Installation/InstallationViaAPT/#HTomcat.


#26

Works only for code macro but python macro doesn’t


#27

That’s weird since the code macro essentially do the same than the python macro (it’s executing a python script using the exact same code that the python macro to use Pygments behind the scene).


#28

There is a bug in jython 2.7.1
Downgrading to 2.7.0 solves the problem. I’d like to try 2.7.2a1 but cannot find a standalone version.


#29

@silver-alx any details related to the bug you are referring to ? I did not noticed much issue in the context of XWiki (but I’m not doing much python).


#30

This one - http://bugs.jython.org/issue2632

Discussion with some details - https://github.com/jythontools/jython/issues/90


#31

This looks very specific to CSV tool and the issue does not indicate it’s a regression only present in 2.7.1.


#32

Anyway i’ve got this error and resolved it by downgrading ))


#33

With XWiki 10.1 Tomcat 7 doesn’t seem to be an option any more. I used the instructions on DigitalOcean to install Tomcat 8.5.28 bypassing the Advanced Packaging Tool. Works fine for me.


#34

Hmm indeed there seems to be an issue on Tomcat 7 because of el-api. We need to look at it since it’s not really expected…

Will release a 10.1.1 shortly with a fix.


#35

I just got bit by this one. Ubuntu 16, Tomcat 8.

I followed the instructions bjoerne listed, namely

sudo add-apt-repository ppa:nacc/tomcat8v2
sudo apt-get update
sudo apt-get install tomcat8=8.0.32-1ubuntu1.3~ppa2
sudo apt-get install tomcat8-common=8.0.32-1ubuntu1.3~ppa2
sudo apt-get install libtomcat8-java=8.0.32-1ubuntu1.3~ppa2
sudo service tomcat8 restart

and ignored the errors about downgrading my tomcat installation.

I did not change my JAVA_OPTS line.

After one restart, it’s working correctly for me.

Does anyone know if this will this cause a problem with future tomcat8 updates?

Thanks for posting your solution.


#36

Hmm indeed it’s the first time I notice the patched version has a lower version than the standard one. Looks like a few patches were applied after this one in the standard repository, really a pity this one was not included… Might help if as many people as possible click “This bug affects me” on https://bugs.launchpad.net/ubuntu/+source/tomcat8/+bug/1644144.


#37

I’ve marked it as affecting me.