Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 4.1.2
-
Fix Version/s: None
-
Component/s: Build, Infrastructure and Tests
-
Labels:
-
Difficulty:Trivial
-
Documentation:N/A
-
Documentation in Release Notes:N/A
-
Similar issues:
XWIKI-8140Upgrade to Jython 2.5.3 XWIKI-8565Rendering cache does not work on JBOSS AS7 XWIKI-7986Failed to deploy on JBoss AS7 with Taglib errors XWIKI-8667{{code}} macro fails with "java.lang.ArrayIndexOutOfBoundsException" in JBoss AS XWIKI-2615JBoss cache implementation does not call DisposableCacheValue.dispose() when value is evicted XWIKI-2645Some features (like "change password") are not available in the user profile when using some translation XWIKI-2790Jboss cache load configuration in the wrong place XWIKI-84xwiki should be agnostic to white spaces (like html) XWIKI-1027Support deployment on Jboss 4.x XWIKI-8779Importer does not match users like "XWiki Developer Team" on extensions.xwiki.org
Description
When using code marker in xwiki along with jboss 7, you end up with error.
easy fix:
- open jython-standalon jar
- extract everything in Lib/* and put this in a new jar at the root of the jar
- put the new jar inside WEB-INF/lib
error:
org.xwiki.rendering.macro.MacroExecutionException: Failed to highlight content at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:115) at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:51) at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:141) at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:53) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:190) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:135) at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:83) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:248) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:124) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:54) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:80) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:38) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:111) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:50) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:67) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:41) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:901) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:880) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:911) at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:582) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:224) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:184) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1800) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1740) at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:854) at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:224) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:184) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1800) at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:155) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:241) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:116) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:120) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) at java.lang.Thread.run(Unknown Source) Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.rendering.internal.parser.pygments.PygmentsParser] identifier by [role = [interface org.xwiki.rendering.parser.HighlightParser] hint = [default]] at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:316) at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:149) at org.xwiki.component.internal.multi.DelegateComponentManager.getInstance(DelegateComponentManager.java:83) at org.xwiki.rendering.internal.macro.code.CodeMacro.highlight(CodeMacro.java:147) at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:112) ... 101 more Caused by: Traceback (most recent call last): File "<string>", line 1, in <module> File "__pyclasspath__/pygments/__init__.py", line 37, in <module> File "__pyclasspath__/pygments/util.py", line 12, in <module> ImportError: No module named re at org.python.core.Py.ImportError(Py.java:290) at org.python.core.imp.import_first(imp.java:750) at org.python.core.imp.import_name(imp.java:834) at org.python.core.imp.importName(imp.java:884) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:903) at pygments.util$py.f$0(__pyclasspath__/pygments/util.py:232) at pygments.util$py.call_function(__pyclasspath__/pygments/util.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:386) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:513) at org.python.core.imp.find_module(imp.java:467) at org.python.core.PyModule.impAttr(PyModule.java:100) at org.python.core.imp.import_next(imp.java:715) at org.python.core.imp.import_logic(imp.java:777) at org.python.core.imp.import_name(imp.java:839) at org.python.core.imp.importName(imp.java:884) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importFromAs(imp.java:978) at org.python.core.imp.importFrom(imp.java:954) at pygments$py.f$0(__pyclasspath__/pygments/__init__.py:91) at pygments$py.call_function(__pyclasspath__/pygments/__init__.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:386) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:513) at org.python.core.imp.find_module(imp.java:467) at org.python.core.imp.import_next(imp.java:713) at org.python.core.imp.import_name(imp.java:824) at org.python.core.imp.importName(imp.java:884) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:903) at org.python.pycode._pyx0.f$0(<string>:6) at org.python.pycode._pyx0.call_function(<string>) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.Py.runCode(Py.java:1261) at org.python.core.Py.exec(Py.java:1305) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206) at org.xwiki.rendering.internal.parser.pygments.PygmentsParser.initialize(PygmentsParser.java:165) at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39) at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:291) at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346) at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:314) ... 105 more
-
Hide
- jython-lib-2.5.2-xwiki.jar
- 29/Jun/12 14:35
- 1.91 MB
- Vincent Massol
-
- META-INF/MANIFEST.MF 0.3 kB
- META-INF/.../javax.script.ScriptEngineFactory 0.0 kB
- META-INF/LICENSE 11 kB
- META-INF/NOTICE 0.9 kB
- zlib.py 6 kB
- zipfile.py 35 kB
- xmlrpclib.py 45 kB
- xmllib.py 34 kB
- xdrlib.py 7 kB
- wsgiref.egg-info 0.2 kB
- whichdb.py 3 kB
- weakref.py 10 kB
- warnings.py 9 kB
- uuid.py 20 kB
- uu.py 6 kB
- UserString.py 8 kB
- UserList.py 3 kB
- UserDict.py 6 kB
- user.py 1 kB
- urlparse.py 12 kB
- urllib2.py 46 kB
- urllib.py 54 kB
- unittest.py 29 kB
- UnicodeData.txt 944 kB
- unicodedata.py 6 kB
- types.py 2 kB
- traceback.py 11 kB
- trace.py 28 kB
- tokenize.py 13 kB
- token.py 3 kB
-
Hide
- jython-lib-2.5.3-xwiki.jar
- 08/Jan/13 16:58
- 1.92 MB
- Petr Praus
-
- aifc.py 33 kB
- anydbm.py 3 kB
- ast.py 11 kB
- asynchat.py 11 kB
- asyncore.py 17 kB
- atexit.py 2 kB
- base64.py 11 kB
- BaseHTTPServer.py 21 kB
- bdb.py 20 kB
- binhex.py 15 kB
- bisect.py 2 kB
- calendar.py 23 kB
- CGIHTTPServer.py 12 kB
- cgi.py 34 kB
- cgitb.py 12 kB
- chunk.py 5 kB
- cmd.py 15 kB
- codecs.py 33 kB
- codeop.py 5 kB
- code.py 10 kB
- collections/__init__.py 5 kB
- colorsys.py 3 kB
- commands.py 2 kB
- compileall.py 5 kB
- compiler/pycodegen.py 46 kB
- compiler/consts.py 0.4 kB
- compiler/__init__.py 0.9 kB
- compiler/visitor.py 4 kB
- compiler/symbols.py 14 kB
- compiler/misc.py 2 kB
Issue Links
- duplicates
-
XWIKI-8812
Upgrade to Jython 2.5.4RC1
-
Activity
Works well in jetty/tomcat but I have a hard time making it work during unit test (Eclipse or maven). At worst I can probably keep the jython-standalone package and add a jython-lib package so that it works in all situations. Should not be a big deal to have duplicated python files (just adding 2M).
I don't like this, looks like a big hack. I think we need to understand the real problem instead and in the meantime document this for JBoss7 users (even possibly provide a special jython jar for them but not in the main distribution).
Reopening since I don't agree about this and so that 4.2 and 4.1.3 are not released with this. Requires a discussion first
BTW Adding 2MB without understanding the problem and making sure it's really needed is pretty bad.
Is it a bug of JBoss7 that we're fixing? Is it a JBoss configuration param that needs to be configured?
if that would be a bug in jboss 7, i bet lots of webapps would be broken... I would more bet on a jython or xwiki make assumptions on classloader that are not guaranteed by J2EE specs.
If that can help, jboss 7 has completly redone it's classloader (i think using OSGI) to work with module. However war being a module, it's still a unique classloader...
@David, what I'm wondering is why it works in other app servers. I know for a fact that it works on Tomcat and Jetty and I haven't heard any issue or other app server from the mailing list. Actually I remember seeing JBoss users reporting having a working XWiki but I can't be sure that they had tested the code macro.
Some URLs that could be useful to understand the problem and find a solution:
http://hg.python.org/jython/file/e4afcd777d1b/src/org/python/jsr223
Code macro does not use JSR223.
Ok I've been able to reproduce the problem in JBoss AS7. Note that in the console we have:
12:35:04,982 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/Users/vmassol/Desktop/jboss-as-7.1.1.Final/jboss-modules.jar' 12:35:05,700 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/classes.jar' 12:35:13,389 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/ui.jar' 12:35:13,658 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/jsse.jar' 12:35:13,802 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar' 12:35:13,979 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Classes/charsets.jar' 12:35:14,259 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/Library/Java/Extensions/RXTXcomm.jar' 12:35:14,311 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/AppleScriptEngine.jar' 12:35:14,319 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/dns_sd.jar' 12:35:14,344 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/j3daudio.jar' 12:35:14,422 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/j3dcore.jar' 12:35:14,859 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/j3dutils.jar' 12:35:15,281 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/jai_codec.jar' 12:35:15,408 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/jai_core.jar' 12:35:15,881 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/mlibwrapper_jai.jar' 12:35:15,894 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/MRJToolkit.jar' 12:35:15,926 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/QTJava.zip' 12:35:16,237 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/Extensions/vecmath.jar' 12:35:16,329 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar' 12:35:16,339 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar' 12:35:16,361 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar' 12:35:16,448 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar' 12:35:16,493 ERROR [stderr] (http://localhost:8080/xwiki/bin/view/Main/WebHome) *sys-package-mgr*: processing new jar, '/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar'
FTR on Jetty I have pythonInterpreter.getSystemState().path with 4 values:
/Users/vmassol/dev/xwiki/git/xwiki-enterprise/xwiki-enterprise-distribution/xwiki-enterprise-jetty/xwiki-enterprise-jetty-hsqldb/target/xwiki-enterprise-jetty-hsqldb-4.2-SNAPSHOT/webapps/xwiki/WEB-INF/lib/Lib /Users/vmassol/dev/xwiki/git/xwiki-enterprise/xwiki-enterprise-distribution/xwiki-enterprise-jetty/xwiki-enterprise-jetty-hsqldb/target/xwiki-enterprise-jetty-hsqldb-4.2-SNAPSHOT/webapps/xwiki/WEB-INF/lib/jython-standalone-2.5.2.jar/Lib __classpath__ __pyclasspath__/
While on JBoss I have only 2 values:
__classpath__ __pyclasspath__/
Now need to understand why...
The important one is /Users/vmassol/dev/xwiki/git/xwiki-enterprise/xwiki-enterprise-distribution/xwiki-enterprise-jetty/xwiki-enterprise-jetty-hsqldb/target/xwiki-enterprise-jetty-hsqldb-4.2-SNAPSHOT/webapps/xwiki/WEB-INF/lib/jython-standalone-2.5.2.jar/Lib.
Ok the reason is because python fails to realize that it's using the standalone python jar:
/**
* @return the full name of the jar file containing this class, <code>null</code> if not available.
*/
private static String getJarFileName() {
Class<PySystemState> thisClass = PySystemState.class;
String fullClassName = thisClass.getName();
String className = fullClassName.substring(fullClassName.lastIndexOf(".") + 1);
URL url = thisClass.getResource(className + ".class");
return getJarFileNameFromURL(url);
}
protected static String getJarFileNameFromURL(URL url) {
String jarFileName = null;
if (url != null) {
try {
// escape plus signs, since the URLDecoder would turn them into spaces
final String plus = "\\+";
final String escapedPlus = "__ppluss__";
String rawUrl = url.toString();
rawUrl = rawUrl.replaceAll(plus, escapedPlus);
String urlString = URLDecoder.decode(rawUrl, "UTF-8");
urlString = urlString.replaceAll(escapedPlus, plus);
int jarSeparatorIndex = urlString.lastIndexOf(JAR_SEPARATOR);
if (urlString.startsWith(JAR_URL_PREFIX) && jarSeparatorIndex > 0) {
// jar:file:/install_dir/jython.jar!/org/python/core/PySystemState.class
jarFileName = urlString.substring(JAR_URL_PREFIX.length(), jarSeparatorIndex);
} else if (urlString.startsWith(VFSZIP_PREFIX)) {
// vfszip:/some/path/jython.jar/org/python/core/PySystemState.class
final String path = PySystemState.class.getName().replace('.', '/');
int jarIndex = urlString.indexOf(".jar/".concat(path));
if (jarIndex > 0) {
jarIndex += 4;
int start = VFSZIP_PREFIX.length();
if (Platform.IS_WINDOWS) {
// vfszip:/C:/some/path/jython.jar/org/python/core/PySystemState.class
start++;
}
jarFileName = urlString.substring(start, jarIndex);
}
}
} catch (Exception e) {}
}
return jarFileName;
}
return null and thus standalone is false in:
String jarFileName = getJarFileName();
if (jarFileName != null) {
standalone = isStandalone(jarFileName);
}
and later on in the init code the following is not executed:
if (standalone) {
// standalone jython: add the /Lib directory inside JYTHON_JAR to the path
addPaths(path, jarFileName + "/Lib");
}
Ok I know the problem...
It's because getJarFileName() returns:
vfs:/Users/vmassol/Desktop/jboss-as-7.1.1.Final/standalone/deployments/xwiki.war/WEB-INF/lib/jython-standalone-2.5.2.jar/org/python/core/PySystemState.class
And getJarFileNameFromURL() doesn't support "vfs". It supports "jar:file" and "vfszip:" only....
It's the same problem that happened on JBoss AS5: http://bugs.jython.org/issue1639
BTW this bug on JBoss AS5 was reported on the XWiki dev list and submitted to jython thanks to XWiki: http://xwiki.475771.n2.nabble.com/Deploying-on-JBoss-5-td5390212.html ![]()
The workaround (while waiting for the Jython project to fix this) is to add the attached JAR file to your WEB-INF/lib/
I tried downloading the jar, and adding it to the WEB-INF/lib folder in the $JBOSS_HOME/standalone/deployments/Xwiki.war directory. I then restarted JBoss to redeploy, but I am still getting the same error. Do I need to rename the jar to be jython-standalone-2.5.3.jar?
I followed fix instruction (created jar with contents of Lib/ and placed in xwiki.war/WEB-INF/lib) and I still get this issue on JBoss AS 7.1.3. Any ideas? I'm using XWiki Enterprise 4.3.
Are you sure you also put the files at the root of the jar and not in a Lib/ folder ?
Yes, I'm absolutely sure. I attached the jar file I made. But my error is slightly different I'm getting
Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.rendering.internal.parser.pygments.PygmentsParser]
when using the code marker instead of
ImportError: No module named re
mentioned in this issue. Perhaps I'm experiencing a different issue?
The whole stacktrace I'm getting is:
org.xwiki.rendering.macro.MacroExecutionException: Failed to highlight content at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:115) at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:51) at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:141) at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:53) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:185) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:132) at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:87) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:250) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:124) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:54) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:80) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:38) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:113) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:50) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:67) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:41) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:916) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:895) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:926) at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:603) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1765) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1705) at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:854) at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1765) at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:155) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:241) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:116) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:120) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:165) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) at java.lang.Thread.run(Thread.java:722) Caused by: org.xwiki.component.manager.ComponentLookupException: Failed to lookup component [org.xwiki.rendering.internal.parser.pygments.PygmentsParser] identifier by [role = [interface org.xwiki.rendering.parser.HighlightParser] hint = [default]] at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:348) at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:161) at org.xwiki.rendering.internal.macro.code.CodeMacro.highlight(CodeMacro.java:147) at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:112) ... 100 more Caused by: Traceback (most recent call last): File "<string>", line 1, in <module> File "__pyclasspath__/pygments/__init__.py", line 37, in <module> File "__pyclasspath__/pygments/util.py", line 12, in <module> File "__pyclasspath__/re$py.class", line 279, in <module> java.lang.ArrayIndexOutOfBoundsException: 10 at org.python.objectweb.asm.ClassReader.a(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) at org.python.core.AnnotationReader.<init>(AnnotationReader.java:44) at org.python.core.imp.readCode(imp.java:219) at org.python.core.util.importer.getModuleCode(importer.java:202) at org.python.core.util.importer.importer_load_module(importer.java:95) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.imp.import_next(imp.java:718) at org.python.core.imp.import_module_level(imp.java:827) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:936) at re$py.f$0(/home/frank/hg/jython/jython/dist/Lib/re.py:289) at re$py.call_function(/home/frank/hg/jython/jython/dist/Lib/re.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:391) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.imp.import_next(imp.java:718) at org.python.core.imp.import_first(imp.java:748) at org.python.core.imp.import_module_level(imp.java:837) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:936) at pygments.util$py.f$0(__pyclasspath__/pygments/util.py:232) at pygments.util$py.call_function(__pyclasspath__/pygments/util.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:391) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.PyModule.impAttr(PyModule.java:100) at org.python.core.imp.import_next(imp.java:720) at org.python.core.imp.import_logic(imp.java:782) at org.python.core.imp.import_module_level(imp.java:842) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importFromAs(imp.java:1011) at org.python.core.imp.importFrom(imp.java:987) at pygments$py.f$0(__pyclasspath__/pygments/__init__.py:91) at pygments$py.call_function(__pyclasspath__/pygments/__init__.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:391) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.imp.import_next(imp.java:718) at org.python.core.imp.import_module_level(imp.java:827) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:936) at org.python.pycode._pyx0.f$0(<string>:6) at org.python.pycode._pyx0.call_function(<string>) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.Py.runCode(Py.java:1275) at org.python.core.Py.exec(Py.java:1319) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206) at org.xwiki.rendering.internal.parser.pygments.PygmentsParser.initialize(PygmentsParser.java:165) at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39) at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:323) at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378) at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346) at org.xwiki.component.embed.EmbeddableComponentManager.getInstance(EmbeddableComponentManager.java:161) at org.xwiki.rendering.internal.macro.code.CodeMacro.highlight(CodeMacro.java:147) at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:112) at org.xwiki.rendering.internal.macro.code.CodeMacro.parseContent(CodeMacro.java:51) at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:141) at org.xwiki.rendering.macro.box.AbstractBoxMacro.execute(AbstractBoxMacro.java:53) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transformOnce(MacroTransformation.java:185) at org.xwiki.rendering.internal.transformation.macro.MacroTransformation.transform(MacroTransformation.java:132) at org.xwiki.rendering.internal.transformation.DefaultTransformationManager.performTransformations(DefaultTransformationManager.java:87) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:250) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:124) at org.xwiki.display.internal.DocumentContentDisplayer.display(DocumentContentDisplayer.java:54) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:80) at org.xwiki.display.internal.DefaultDocumentDisplayer.display(DefaultDocumentDisplayer.java:38) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:113) at org.xwiki.sheet.internal.SheetDocumentDisplayer.display(SheetDocumentDisplayer.java:50) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:67) at org.xwiki.display.internal.ConfiguredDocumentDisplayer.display(ConfiguredDocumentDisplayer.java:41) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:916) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:895) at com.xpn.xwiki.doc.XWikiDocument.getRenderedContent(XWikiDocument.java:926) at com.xpn.xwiki.api.Document.getRenderedContent(Document.java:603) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.value(ASTReference.java:567) at org.apache.velocity.runtime.parser.node.ASTExpression.value(ASTExpression.java:71) at org.apache.velocity.runtime.parser.node.ASTSetDirective.render(ASTSetDirective.java:142) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1765) at com.xpn.xwiki.XWiki.parseTemplate(XWiki.java:1705) at com.xpn.xwiki.api.XWiki.parseTemplate(XWiki.java:854) at sun.reflect.GeneratedMethodAccessor124.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.doInvoke(UberspectImpl.java:395) at org.apache.velocity.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:384) at org.apache.velocity.runtime.parser.node.ASTMethod.execute(ASTMethod.java:173) at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:280) at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:369) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.directive.VelocimacroProxy.render(VelocimacroProxy.java:216) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:311) at org.apache.velocity.runtime.directive.RuntimeMacro.render(RuntimeMacro.java:230) at org.apache.velocity.runtime.parser.node.ASTDirective.render(ASTDirective.java:207) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:87) at org.apache.velocity.runtime.parser.node.ASTBlock.render(ASTBlock.java:72) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.apache.velocity.runtime.parser.node.ASTIfStatement.render(ASTIfStatement.java:106) at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:342) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:228) at org.xwiki.velocity.internal.DefaultVelocityEngine.evaluate(DefaultVelocityEngine.java:187) at com.xpn.xwiki.render.XWikiVelocityRenderer.evaluate(XWikiVelocityRenderer.java:105) at com.xpn.xwiki.XWiki.evaluateTemplate(XWiki.java:1765) at com.xpn.xwiki.web.Utils.parseTemplate(Utils.java:155) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:241) at com.xpn.xwiki.web.XWikiAction.execute(XWikiAction.java:116) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at javax.servlet.http.HttpServlet.service(HttpServlet.java:734) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at com.xpn.xwiki.web.ActionFilter.doFilter(ActionFilter.java:120) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.wysiwyg.server.filter.ConversionFilter.doFilter(ConversionFilter.java:144) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at com.xpn.xwiki.plugin.webdav.XWikiDavFilter.doFilter(XWikiDavFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.container.servlet.filters.internal.SavedRequestRestorerFilter.doFilter(SavedRequestRestorerFilter.java:208) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.xwiki.container.servlet.filters.internal.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:111) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:165) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:372) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:679) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:931) at java.lang.Thread.run(Thread.java:722) java.lang.ArrayIndexOutOfBoundsException: java.lang.ArrayIndexOutOfBoundsException: 10 at org.python.core.Py.JavaError(Py.java:495) at org.python.core.PyTableCode.call(PyTableCode.java:168) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:391) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.imp.import_next(imp.java:718) at org.python.core.imp.import_first(imp.java:748) at org.python.core.imp.import_module_level(imp.java:837) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:936) at pygments.util$py.f$0(__pyclasspath__/pygments/util.py:232) at pygments.util$py.call_function(__pyclasspath__/pygments/util.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:391) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.PyModule.impAttr(PyModule.java:100) at org.python.core.imp.import_next(imp.java:720) at org.python.core.imp.import_logic(imp.java:782) at org.python.core.imp.import_module_level(imp.java:842) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importFromAs(imp.java:1011) at org.python.core.imp.importFrom(imp.java:987) at pygments$py.f$0(__pyclasspath__/pygments/__init__.py:91) at pygments$py.call_function(__pyclasspath__/pygments/__init__.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.imp.createFromCode(imp.java:391) at org.python.core.util.importer.importer_load_module(importer.java:109) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.imp.import_next(imp.java:718) at org.python.core.imp.import_module_level(imp.java:827) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:936) at org.python.pycode._pyx0.f$0(<string>:6) at org.python.pycode._pyx0.call_function(<string>) at org.python.core.PyTableCode.call(PyTableCode.java:165) at org.python.core.PyCode.call(PyCode.java:18) at org.python.core.Py.runCode(Py.java:1275) at org.python.core.Py.exec(Py.java:1319) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:206) at org.xwiki.rendering.internal.parser.pygments.PygmentsParser.initialize(PygmentsParser.java:165) at org.xwiki.component.embed.InitializableLifecycleHandler.handle(InitializableLifecycleHandler.java:39) at org.xwiki.component.embed.EmbeddableComponentManager.createInstance(EmbeddableComponentManager.java:323) at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:378) at org.xwiki.component.embed.EmbeddableComponentManager.getComponentInstance(EmbeddableComponentManager.java:346) ... 103 more Caused by: java.lang.ArrayIndexOutOfBoundsException: 10 at org.python.objectweb.asm.ClassReader.a(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) at org.python.objectweb.asm.ClassReader.accept(Unknown Source) at org.python.core.AnnotationReader.<init>(AnnotationReader.java:44) at org.python.core.imp.readCode(imp.java:219) at org.python.core.util.importer.getModuleCode(importer.java:202) at org.python.core.util.importer.importer_load_module(importer.java:95) at org.python.core.ClasspathPyImporter.ClasspathPyImporter_load_module(ClasspathPyImporter.java:63) at org.python.core.ClasspathPyImporter$ClasspathPyImporter_load_module_exposer.__call__(Unknown Source) at org.python.core.PyBuiltinMethodNarrow.__call__(PyBuiltinMethodNarrow.java:47) at org.python.core.imp.loadFromLoader(imp.java:518) at org.python.core.imp.find_module(imp.java:472) at org.python.core.imp.import_next(imp.java:718) at org.python.core.imp.import_module_level(imp.java:827) at org.python.core.imp.importName(imp.java:917) at org.python.core.ImportFunction.__call__(__builtin__.java:1220) at org.python.core.PyObject.__call__(PyObject.java:357) at org.python.core.__builtin__.__import__(__builtin__.java:1173) at org.python.core.imp.importOne(imp.java:936) at re$py.f$0(/home/frank/hg/jython/jython/dist/Lib/re.py:289) at re$py.call_function(/home/frank/hg/jython/jython/dist/Lib/re.py) at org.python.core.PyTableCode.call(PyTableCode.java:165) ... 170 more
Caused by: java.lang.ArrayIndexOutOfBoundsException
It's actually not the same issue at all, looks like you hit a Pygments or Jython bug here. Could you try a very simple content in your code macro and see if it work ? Something like
<element></element>
with language="xml".
If it's working it would be nice to create another issue with some content that reproduce the same error so that we can look at it and try to reproduce.
The content you suggested triggers the same error. But the original code was also trivial to begin with:
<html> <head>Cool!</head> </html>
I'll start a new issue.
EDIT: started http://jira.xwiki.org/browse/XWIKI-8667
FTR as of today, http://bugs.jython.org/issue1936 is still open
I'm going to do a custom package of Jython for XWiki.