FS#33151 - [tomcat7] Incompatibility with latest eclipse-ecj package

Attached to Project: Arch Linux
Opened by Aleksey Ilyin (darkgin) - Friday, 21 December 2012, 14:20 GMT
Last edited by Guillaume ALAUX (galaux) - Saturday, 12 January 2013, 12:33 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Guillaume ALAUX (galaux)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 6
Private No

Details

Description:


Additional info:
* package version(s)
* config and/or log files etc.


Steps to reproduce:

after installing tomcat7 7.0.34 i get this on the root page:

HTTP Status 500 - java.lang.IllegalStateException: No output folder

type Exception report

message java.lang.IllegalStateException: No output folder

description The server encountered an internal error that prevented it from fulfilling this request.

exception
org.apache.jasper.JasperException: java.lang.IllegalStateException: No output folder
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:585)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:391)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


root cause
java.lang.IllegalStateException: No output folder
org.apache.jasper.JspCompilationContext.createOutputDir(JspCompilationContext.java:738)
org.apache.jasper.JspCompilationContext.getOutputDir(JspCompilationContext.java:196)
org.apache.jasper.JspCompilationContext.getClassFileName(JspCompilationContext.java:581)
org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:461)
org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:425)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:639)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.
Apache Tomcat/7.0.34

/var/tmp/tomcat7/work/Catalina/localhost/_ doesn't have permissions for 'tomcat' to write.

as a result:

HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

type Exception report

message java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

description The server encountered an internal error that prevented it from fulfilling this request.

exception
org.apache.jasper.JasperException: java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:177)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


root cause
java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
java.net.URLClassLoader$1.run(URLClassLoader.java:366)
java.net.URLClassLoader$1.run(URLClassLoader.java:355)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(URLClassLoader.java:354)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:132)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:172)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.
Apache Tomcat/7.0.34

It's is not the creates problem.
After allowing writing for tomcat user I am getting this exception:

HTTP Status 500 - java.lang.ExceptionInInitializerError

type Exception report

message java.lang.ExceptionInInitializerError

description The server encountered an internal error that prevented it from fulfilling this request.

exception
javax.servlet.ServletException: java.lang.ExceptionInInitializerError
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:343)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


root cause
java.lang.ExceptionInInitializerError
org.eclipse.jdt.internal.compiler.Compiler.initializeParser(Unknown Source)
org.eclipse.jdt.internal.compiler.Compiler.<init>(Unknown Source)
org.eclipse.jdt.internal.compiler.Compiler.<init>(Unknown Source)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:453)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


root cause
java.lang.NullPointerException
java.util.Properties$LineReader.readLine(Properties.java:434)
java.util.Properties.load0(Properties.java:353)
java.util.Properties.load(Properties.java:341)
org.eclipse.jdt.internal.compiler.parser.Parser.readReadableNameTable(Unknown Source)
org.eclipse.jdt.internal.compiler.parser.Parser.initTables(Unknown Source)
org.eclipse.jdt.internal.compiler.parser.Parser.<clinit>(Unknown Source)
org.eclipse.jdt.internal.compiler.Compiler.initializeParser(Unknown Source)
org.eclipse.jdt.internal.compiler.Compiler.<init>(Unknown Source)
org.eclipse.jdt.internal.compiler.Compiler.<init>(Unknown Source)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:453)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.

And as I can see now index_jsp.java created, but no .class file generated.

Refreshing page again result in:

type Exception report

message java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jdt.internal.compiler.parser.Parser

description The server encountered an internal error that prevented it from fulfilling this request.

exception
javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jdt.internal.compiler.parser.Parser
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:343)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


root cause
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jdt.internal.compiler.parser.Parser
org.eclipse.jdt.internal.compiler.Compiler.initializeParser(Unknown Source)
org.eclipse.jdt.internal.compiler.Compiler.<init>(Unknown Source)
org.eclipse.jdt.internal.compiler.Compiler.<init>(Unknown Source)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:453)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:646)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:728)


note The full stack trace of the root cause is available in the Apache Tomcat/7.0.34 logs.

I had tried to reinstall tomcat7 with all dependencies - no result. The problem is seems to appear after updating to 7.0.34 from 7.0.33.
I found no way to make it working, so installed tomcat6 which works fine.

This task depends upon

Closed by  Guillaume ALAUX (galaux)
Saturday, 12 January 2013, 12:33 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in eclipse-ecj-4.2.1-2
Comment by Aleksey Ilyin (darkgin) - Friday, 21 December 2012, 17:22 GMT
Errors shown above are from default ROOT site.

wget http://arm.konnichi.com/extra/os/x86_64/eclipse-ecj-3.7.1-1-any.pkg.tar.xz
pacman -U /var/cache/pacman/pkg/eclipse-ecj-3.7.1-1-any.pkg.tar.xz
solved the problem.

Then I tried to upgrade again to eclipse-ecj-4.2.1-1 - worked fine before I deleted .class files from /var/tmp/.... After deletion - see before.
So, rolled back to 3.7.1.1.
Comment by Nick Spassoff (codingrobot) - Sunday, 23 December 2012, 13:00 GMT
I had similar problems when I tried to install tomcat7. The official tomcat7 distribution worked perfectly.
Then I compared the folders of the arch package and the official distribution and found out that eclipse-ecj-4.2.1.jar has a smaller file size (1212352 instead of 1796326).
Replacing that file fixed the problem!

Here are the SHA1 hashes of the both files:
1253d0a815d14f7b5b1a3cefdc4826e6e01d9231 eclipse-ecj-4.2.1.jar
9680be1121c18415e8c0d8545a3aa57c3afd4ab1 eclipse-ecj-4.2.1.jar_broken
Comment by Andrey (katoquro) - Thursday, 27 December 2012, 21:11 GMT
Thanks
jar from official tomcat7 build fixes this issue.
Comment by Chris Bannister (Zariel) - Friday, 04 January 2013, 13:04 GMT
Can confirm using the jar from official eclipse site works.
Comment by Radislav (Radic) Golubtsov (rgolubtsov) - Saturday, 05 January 2013, 21:07 GMT
Confirm too - Nick's approach to temporarily replace the JAR, mentioned above, fixes this issue. Looking forward for the official fix.
Comment by Guillaume ALAUX (galaux) - Monday, 07 January 2013, 10:56 GMT
I have had a look at it but this will need further investigation as for why the Arch eclipse-ecj won't work here.
Planning on quickly releasing a -2 tomcat package with upstream binary eclipse-ecj in the meantime.
Comment by Aleksey Ilyin (darkgin) - Monday, 07 January 2013, 14:37 GMT
And what about /var/tmp/tomcat7/* permissions?
Comment by Guillaume ALAUX (galaux) - Monday, 07 January 2013, 15:32 GMT
These files/directories are created when tomcats runs. If started through the rc script or through systemd, tomcat is started as user and group 'tomcat' so it cannot create root owned files/dirs.
Maybe you started tomcat directly using /usr/share/tomcat7/bin/startup.sh as root. Anyway, this must be due to a bad admin action. If this is not a critical app/environment/data, then just rm these files (they are temp anyway).
Comment by Guillaume ALAUX (galaux) - Thursday, 10 January 2013, 09:51 GMT
I found the issue with tomcat/ecj "incompatibility": eclipse-ecj is missing a ".props" file. Solution found on Fedora Rawhide.

I patched eclipse-ecj, pushed it to extra and also pushed the "old" tomcat that uses it. I tested *all* official "example" JSP.

Could you please confirm this bug is now fixed? Thanks!

________
@Aleksey: FYI /var/tmp/tomcat/{temp,work} are now handled by systemd which also takes care of permissions. See  FS#33163 .
Comment by Radislav (Radic) Golubtsov (rgolubtsov) - Thursday, 10 January 2013, 20:55 GMT
Hi Guillaume,

I've tested my web apps using these new packages - they worked as expected, at a glance I found no any issues. Everything compiled and executed well.

From my side I can confirm this bug is now fixed - good job! Thank you.
Comment by Aleksey Ilyin (darkgin) - Saturday, 12 January 2013, 12:27 GMT
I confirm - mentioned bug is fixed.

But I decided to stay on tomcat6, because tomcat7 is very unstable in starting service (systemd). After reboot is starts with out problems in my case 50/50... I can stop running service and then start after 3-5 attempts (systemctl start tomcat7).
Here is an example output:

[root@arch-tomcat ~]# systemctl status tomcat7
tomcat7.service - Tomcat 7 servlet container
Loaded: loaded (/usr/lib/systemd/system/tomcat7.service; enabled)
Active: active (running) since Пт, 2013-01-11 13:34:53 MSK; 1 day and 2h ago
Process: 443 ExecStop=/usr/bin/jsvc -pidfile /var/run/tomcat7.pid -stop org.apache.catalina.startup.Bootstrap (code=exited, status=0/SUCCESS)
Process: 615 ExecStart=/usr/bin/jsvc -Dcatalina.home=${CATALINA_HOME} -Dcatalina.base=${CATALINA_BASE} -Djava.io.tmpdir=/var/tmp/tomcat7/temp -cp /usr/share/java/commons-daemon.jar:/usr/share/java/eclipse-ecj.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar -user tomcat -java-home ${TOMCAT_JAVA_HOME} -wait 10 -pidfile /var/run/tomcat7.pid -errfile /var/log/tomcat7/catalina.err -outfile /var/log/tomcat7/catalina.out $CATALINA_OPTS org.apache.catalina.startup.Bootstrap (code=exited, status=0/SUCCESS)
Main PID: 619 (jsvc)
CGroup: name=systemd:/system/tomcat7.service
├─618 jsvc.exec -Dcatalina.home=/usr/share/tomcat7 -Dcatalina.base=/usr/share/tomcat7 -Djava.io.tmpdir=/var/tmp/tomcat7/temp -cp /usr/share/java/commons-daemon.jar:/usr/share/j...
└─619 jsvc.exec -Dcatalina.home=/usr/share/tomcat7 -Dcatalina.base=/usr/share/tomcat7 -Djava.io.tmpdir=/var/tmp/tomcat7/temp -cp /usr/share/java/commons-daemon.jar:/usr/share/j...

янв 11 13:34:50 arch-tomcat systemd[1]: Starting Tomcat 7 servlet container...
янв 11 13:34:53 arch-tomcat systemd[1]: Started Tomcat 7 servlet container.
[root@arch-tomcat ~]# systemctl restart tomcat7
Job for tomcat7.service failed. See 'systemctl status tomcat7.service' and 'journalctl -xn' for details.
[root@arch-tomcat ~]# systemctl status tomcat7
tomcat7.service - Tomcat 7 servlet container
Loaded: loaded (/usr/lib/systemd/system/tomcat7.service; enabled)
Active: failed (Result: exit-code) since Сб, 2013-01-12 16:12:45 MSK; 3s ago
Process: 969 ExecStop=/usr/bin/jsvc -pidfile /var/run/tomcat7.pid -stop org.apache.catalina.startup.Bootstrap (code=exited, status=0/SUCCESS)
Process: 976 ExecStart=/usr/bin/jsvc -Dcatalina.home=${CATALINA_HOME} -Dcatalina.base=${CATALINA_BASE} -Djava.io.tmpdir=/var/tmp/tomcat7/temp -cp /usr/share/java/commons-daemon.jar:/usr/share/java/eclipse-ecj.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar -user tomcat -java-home ${TOMCAT_JAVA_HOME} -wait 10 -pidfile /var/run/tomcat7.pid -errfile /var/log/tomcat7/catalina.err -outfile /var/log/tomcat7/catalina.out $CATALINA_OPTS org.apache.catalina.startup.Bootstrap (code=exited, status=1/FAILURE)
Main PID: 619
CGroup: name=systemd:/system/tomcat7.service

янв 12 16:12:25 arch-tomcat systemd[1]: Starting Tomcat 7 servlet container...
янв 12 16:12:45 arch-tomcat systemd[1]: Failed to start Tomcat 7 servlet container.
янв 12 16:12:45 arch-tomcat systemd[1]: Unit tomcat7.service entered failed state
[root@arch-tomcat ~]# systemctl restart tomcat7
Job for tomcat7.service failed. See 'systemctl status tomcat7.service' and 'journalctl -xn' for details.
[root@arch-tomcat ~]# systemctl start tomcat7
Job for tomcat7.service failed. See 'systemctl status tomcat7.service' and 'journalctl -xn' for details.
[root@arch-tomcat ~]# systemctl start tomcat7
Job for tomcat7.service failed. See 'systemctl status tomcat7.service' and 'journalctl -xn' for details.
[root@arch-tomcat ~]# systemctl start tomcat7
Job for tomcat7.service failed. See 'systemctl status tomcat7.service' and 'journalctl -xn' for details.
[root@arch-tomcat tomcat7]# systemctl start tomcat7
[root@arch-tomcat tomcat7]# systemctl status tomcat7
tomcat7.service - Tomcat 7 servlet container
Loaded: loaded (/usr/lib/systemd/system/tomcat7.service; enabled)
Active: active (running) since Сб, 2013-01-12 16:22:10 MSK; 17s ago
Process: 969 ExecStop=/usr/bin/jsvc -pidfile /var/run/tomcat7.pid -stop org.apache.catalina.startup.Bootstrap (code=exited, status=0/SUCCESS)
Process: 1244 ExecStart=/usr/bin/jsvc -Dcatalina.home=${CATALINA_HOME} -Dcatalina.base=${CATALINA_BASE} -Djava.io.tmpdir=/var/tmp/tomcat7/temp -cp /usr/share/java/commons-daemon.jar:/usr/share/java/eclipse-ecj.jar:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar -user tomcat -java-home ${TOMCAT_JAVA_HOME} -wait 10 -pidfile /var/run/tomcat7.pid -errfile /var/log/tomcat7/catalina.err -outfile /var/log/tomcat7/catalina.out $CATALINA_OPTS org.apache.catalina.startup.Bootstrap (code=exited, status=0/SUCCESS)
Main PID: 1248 (jsvc)
CGroup: name=systemd:/system/tomcat7.service
├─1247 jsvc.exec -Dcatalina.home=/usr/share/tomcat7 -Dcatalina.base=/usr/share/tomcat7 -Djava.io.tmpdir=/var/tmp/tomcat7/temp -cp /usr/share/java/commons-daemon.jar:/usr/share/...
└─1248 jsvc.exec -Dcatalina.home=/usr/share/tomcat7 -Dcatalina.base=/usr/share/tomcat7 -Djava.io.tmpdir=/var/tmp/tomcat7/temp -cp /usr/share/java/commons-daemon.jar:/usr/share/...

янв 12 16:22:07 arch-tomcat systemd[1]: Starting Tomcat 7 servlet container...
янв 12 16:22:10 arch-tomcat systemd[1]: Started Tomcat 7 servlet container.

and it finally started after few attempts.

Any one has some kind of problem?
PS: in catalina.err i have something like this(on fails):

INFO: Starting Servlet Engine: Apache Tomcat/7.0.34
янв 12, 2013 4:20:59 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/ROOT.war
янв 12, 2013 4:21:00 PM oc.cms.ContextListener contextInitialized
INFO: ContextListener::contextInitialized
Service exit with a return value of 143
Comment by Guillaume ALAUX (galaux) - Saturday, 12 January 2013, 12:31 GMT
@Aleksey: could you open a new bug report for this matter please? I'm closing this one as 'fixed'.

Loading...