View previous topic :: View next topic |
Author |
Message |
ShinyDoofy n00b
Joined: 22 Jul 2006 Posts: 73
|
Posted: Mon Aug 20, 2012 7:35 pm Post subject: [solved] www-servers/tomcat-7.0.29-r1 with Eclipse WST |
|
|
Hi there,
quite some time ago, I updated to tomcat 7.0.29-r1, which, according to the ChangeLog file, was a complete rewrite ebuild-wise. Both 7.0.29 and 7.0.29-r1 work just fine when manually started from bash. However, I can't get -r1 working within Eclipse, as it can't seem to find critical classes anymore when booting:
Code: | SEVERE: Begin event threw error
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
[...]
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
[...] |
Diff'ing the two installed ebuilds, I noticed that -r1 doesn't have servlet-api.jar in its lib directory anymore. However, there's still /usr/share/tomcat-servlet-api-3.0/lib/servlet-api.jar and a few others from package dev-java/tomcat-servlet-api. Trying to include these files needed to successfully boot tomcat, I've added /usr/share/tomcat-servlet-api-3.0/lib/ in tomcat's launch configuration inside Eclipse - still it's the very same error message popping up with no change whatsoever. Also, some of my classes complain about missing classes (like HttpServletRequest usually contained in servlet-api.jar). Installing 7.0.29 again (without -r1) fixes things, but it's a rather ugly workaround imho.
So, has anyone managed to get tomcat-7.0.29-r1 running from within Eclipse? Are there any special options I need to set after updating tomcat?
Frankly, I'm both out of ideas and things to look for, any input is more than welcome.
Closing information: Eclipse 4.2 (wasn't different in 3.7) installed locally in my user's $HOME, ~amd64 system, current Oracle JDK and JRE 7. If you need more info, please ping.
Last edited by ShinyDoofy on Sat Sep 01, 2012 8:06 pm; edited 1 time in total |
|
Back to top |
|
|
ShinyDoofy n00b
Joined: 22 Jul 2006 Posts: 73
|
Posted: Sat Sep 01, 2012 8:06 pm Post subject: |
|
|
Bumping with some hack that got it running for me again.
Go to /usr/share/tomcat-7/lib and run these commands:
Code: | ln -s /usr/share/eclipse-ecj-3.7/lib/ecj.jar
ln -s /usr/share/tomcat-servlet-api-3.0/lib/el-api.jar
ln -s /usr/share/tomcat-servlet-api-3.0/lib/jsp-api.jar
ln -s /usr/share/tomcat-servlet-api-3.0/lib/servlet-api.jar |
Granted, that's not a perfect way to fix things and it's prone to errors in case of updates, but oh well. Will mark this solved for now. If anybody else has a proper solution for this, I'm all ears. |
|
Back to top |
|
|
nileshgr n00b
Joined: 29 Dec 2012 Posts: 7 Location: Pune. IN
|
Posted: Thu Jan 23, 2014 5:49 pm Post subject: |
|
|
Sorry for bumping a rather old thread, but this issue is still there and not fixed means there's gotta be a valid reason. Does anybody know? _________________ Nilesh Govindrajan
http://nileshgr.com |
|
Back to top |
|
|
lordalbert l33t
Joined: 26 Nov 2006 Posts: 840 Location: Italy
|
Posted: Tue May 26, 2015 9:12 am Post subject: |
|
|
I had same problem! Solved with "ln -s" but it seems to be only a workaround.
Is there a better fix for the problem? |
|
Back to top |
|
|
ShinyDoofy n00b
Joined: 22 Jul 2006 Posts: 73
|
Posted: Sat Jun 06, 2015 3:51 pm Post subject: |
|
|
I haven't been able to find a proper solution for this since. By now, I've uninstalled the system-wide eclipse and tomcat installations and simply download them directly from their respective home pages into my user's home directory. |
|
Back to top |
|
|
tayirvadai n00b
Joined: 15 Oct 2017 Posts: 27
|
Posted: Sun Oct 15, 2017 5:27 am Post subject: [solved] www-servers/tomcat-7.0.29-r1 with Eclipse WST |
|
|
There is another way to fix this. In Catalina.sh the system uses java-config command in the option --classpath it only uses tomcat-x.y adding the option tomcat-servlet-apt-d.e will help. the command i used is as follows
Code: | java-config --classpath tomcat-x.y,tomcat-servlet-api-d.e |
_________________ Thanks
Tayirvadai |
|
Back to top |
|
|
|