Open AntonBikineev opened 7 years ago
Hi Anton,
That looks like a bug; thanks for reporting it. I'll investigate it this weekend when I have time.
Would you please give this a try when you have a chance?
https://github.com/ReadyTalk/avian/pull/538
It's been a long time since I tried to run Tomcat with Avian, so there may be other issues besides this one. I'm currently running low on disk space on my laptop, so I can't test Tomcat myself right now, but the above PR should fix the StackOverflowError, at least.
Hi Joel, Yeah, your patch fixes the problem! And the simple tomcat application runs fine. However, I've noticed a couple of other problems: 1) There is no log in stdout/stderr that I can observe; 2) I can run tomcat under hotspot using the following command line:
java -cp bin/bootstrap.jar:bin/tomcat-juli.jar org.apache.catalina.startup.Bootstrap start
I don't understand how hotspot recognizes that it needs to load jars from the lib directory (I couldn't find corresponding "Class-Path" lines in manifest files). If I run avian using the same arguments, it just returns with 0 error code. 3) With hotspot I can specify wildcards in '-cp' argument, whereas avian again returns with 0 return code. It also seems to speed up class loading in hotspot. So the only way I found to run tomcat using avian is by specifying all jars in command line, e.g.:
~/git/avian-openjdk-2/build/linux-x86_64-openjdk-src/avian -cp bin/bootstrap.jar:bin/tomcat-juli.jar:lib/annotations-api.jar:lib/catalina-ant.jar:lib/catalina-ha.jar:lib/catalina.jar:lib/catalina-storeconfig.jar:lib/catalina-tribes.jar:lib/ecj-4.6.3.jar:lib/el-api.jar:lib/jasper-el.jar:lib/jasper.jar:lib/jaspic-api.jar:lib/jsp-api.jar:lib/servlet-api.jar:lib/tomcat-api.jar:lib/tomcat-coyote.jar:lib/tomcat-dbcp.jar:lib/tomcat-i18n-es.jar:lib/tomcat-jdbc.jar:lib/tomcat-jni.jar:lib/tomcat-util.jar:lib/tomcat-util-scan.jar:lib/tomcat-websocket.jar:lib/websocket-api.jar org.apache.catalina.startup.Bootstrap start
I just downloaded Tomcat 9 and tried running it with Avian. The output is at the end of this post.
It looks like there are several problems, the most serious of which is that the VM seems to be aborting due to an assertion failure when handling a lambda expression. That's not a big surprise, since lambdas are still a work in progress on Avian, as you can see in https://github.com/ReadyTalk/avian/pull/539.
I'm not sure why you're not getting any stdout/stderr output, though. Which version of Tomcat are you using?
I'll look more closely at this when I have time this weekend.
$ ~/p/avian/build/linux-x86_64-debug-openjdk/avian-dynamic -cp bin/bootstrap.jar:bin/tomcat-juli.jar org.apache.catalina.startup.Bootstrap start
Jul 05, 2017 7:47:30 AM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:377)
at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:145)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:923)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1435)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.execute(MbeansDescriptorsDigesterSource.java:169)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.loadDescriptors(MbeansDescriptorsDigesterSource.java:148)
at org.apache.tomcat.util.modeler.Registry.load(Registry.java:589)
at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:667)
at org.apache.catalina.mbeans.MBeanUtils.createRegistry(MBeanUtils.java:545)
at org.apache.catalina.mbeans.MBeanUtils.
Jul 05, 2017 7:47:31 AM org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource execute
SEVERE: Error digesting Registry data
org.xml.sax.SAXParseException; lineNumber: 43; columnNumber: 17; Error at (43, 17) : null
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:1854)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:1886)
at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:926)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2967)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1435)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.execute(MbeansDescriptorsDigesterSource.java:169)
at org.apache.tomcat.util.modeler.modules.MbeansDescriptorsDigesterSource.loadDescriptors(MbeansDescriptorsDigesterSource.java:148)
at org.apache.tomcat.util.modeler.Registry.load(Registry.java:589)
at org.apache.tomcat.util.modeler.Registry.loadDescriptors(Registry.java:667)
at org.apache.catalina.mbeans.MBeanUtils.createRegistry(MBeanUtils.java:545)
at org.apache.catalina.mbeans.MBeanUtils.
Jul 05, 2017 7:47:31 AM org.apache.tomcat.util.modeler.Registry loadDescriptors SEVERE: Error loading jar:file:/home/dicej/trash/apache-tomcat-9.0.0.M22/lib/catalina.jar!/org/apache/catalina/mbeans/mbeans-descriptors.xml Aborted
Tomcat 9 is working for me as of this commit: https://github.com/ReadyTalk/avian/commit/a329416f4f37840d2a5d7976874585413cd4c6af
I run it like this:
~/p/avian/build/linux-x86_64-debug-openjdk/avian-dynamic -cp bin/bootstrap.jar:bin/tomcat-juli.jar org.apache.catalina.startup.Bootstrap start
Please let me know if you're still having trouble with the latest code.
Hi, I've run into an error trying to run tomcat under avian-openjdk. The error is stackoverflow and it seems it is caused by a recursive call to ClassLoader.definePackage:
Does anybody know why this happens? The command to run jvm is as follows:
I've enumerated all jars in the classpath option because it seems like avian doesn't support wildcards yet.