Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] www-servers/tomcat-7.0.29-r1 with Eclipse WST
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ShinyDoofy
n00b
n00b


Joined: 22 Jul 2006
Posts: 73

PostPosted: Mon Aug 20, 2012 7:35 pm    Post subject: [solved] www-servers/tomcat-7.0.29-r1 with Eclipse WST Reply with quote

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
View user's profile Send private message
ShinyDoofy
n00b
n00b


Joined: 22 Jul 2006
Posts: 73

PostPosted: Sat Sep 01, 2012 8:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
nileshgr
n00b
n00b


Joined: 29 Dec 2012
Posts: 7
Location: Pune. IN

PostPosted: Thu Jan 23, 2014 5:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
lordalbert
l33t
l33t


Joined: 26 Nov 2006
Posts: 840
Location: Italy

PostPosted: Tue May 26, 2015 9:12 am    Post subject: Reply with quote

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
View user's profile Send private message
ShinyDoofy
n00b
n00b


Joined: 22 Jul 2006
Posts: 73

PostPosted: Sat Jun 06, 2015 3:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
tayirvadai
n00b
n00b


Joined: 15 Oct 2017
Posts: 27

PostPosted: Sun Oct 15, 2017 5:27 am    Post subject: [solved] www-servers/tomcat-7.0.29-r1 with Eclipse WST Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum