Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
An important note about tomcat on gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Raptor85
Apprentice
Apprentice


Joined: 29 Dec 2007
Posts: 208

PostPosted: Tue Jul 12, 2011 7:53 am    Post subject: An important note about tomcat on gentoo Reply with quote

Short backstory: I needed tomcat for a web application I'm working on, not a big deal, it's in portage, seemed to install and work just fine, easy.

I'm using Tomcat 6, which is significantly newer than these docs here, but I skimmed them anyways to see if there was anything important, nothing stood out. http://www.gentoo.org/proj/en/java/tomcat-guide.xml

Got it working ok, got it deploying using the management console just fine, then the "bug" hit.

I started implementing the database connection, 3 days of debugging and "could not find a valid driver" messages later, which led me all the way to the point of debugging jstl itself as it seemed to be throwing the error (and you'd think something this important would be in the tomcat log file....but you'd be wrong) i finally found it to be using the file...... naming-factory-dbcp.jar, which the gentoo guide just kinda "mentions" that you don't really need in a short blurb.

All JNDI functionality seems built off the functions in this file, and throws errors that are at best red herrings if you don't have it, so none of the "proper" ways of doing authentication or database connectivity in tomcat 6 work without it. (the only way to open a connection to a database without it is to define it in the code instead of in the connection resources) The fix at the moment seems to be to take this file from a binary install of tomcat and copy it into your libs folder, did that and it clears up everything instantly.

Just thought this needed to be posted up for anyone else who runs into this, it's not a bug in your code but a nasty little bug in gentoo's build of tomcat itself.
Back to top
View user's profile Send private message
Herring42
Guru
Guru


Joined: 10 Mar 2004
Posts: 373
Location: Buckinghamshire

PostPosted: Tue Jul 12, 2011 8:02 am    Post subject: Reply with quote

Could you please raise a bug report?

:)
_________________
"The problem with quotes on the internet is that it is difficult
to determine whether or not they are genuine." -- Abraham Lincoln
Back to top
View user's profile Send private message
john.newman
Tux's lil' helper
Tux's lil' helper


Joined: 17 Oct 2009
Posts: 85

PostPosted: Sun Sep 04, 2011 7:27 am    Post subject: Reply with quote

yes the tomcat install is missing several jar files, beyond the one you mentionned. i wanted to report this a few weeks ago but forgot. i had to manually download and copy the dbcp jar myself

steps to reproduce:
emerge -v tomcat
download the same exact version from the tomcat website and extract
compare the contents of the lib folders .. /usr/share/tomcat/lib (something like that)
you'll see the vanilla install includes 6 or 7 jar files that the gentoo package does not.. it could be files besides the .jars too, i didn't check

fix
the package should include the same files as the vanilla version. I was a bit perplexed about how that could even happen.. :?:
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sun Sep 04, 2011 7:56 am    Post subject: Reply with quote

The Gentoo Tomcat Guide touches on this:
Quote:
Missing Jar - naming-factory-dbcp.jar

Currently the naming-factory-dbcp.jar is not build by default. To build that jar Tomcat robs .java source files from 3 other commons packages, collections, pool, and dbcp. There is no clean solution to compiling this jar at this time. Suggestions, patches, or any assistance on compiling that jar is greatly appreciated.

There are alternatives to this jar. You can use commons-dbcp.jar, or use the factory provided by most all jdbc drivers.

Note: For the time being anyone who needs that jar should fetch it from a binary release of Tomcat 5.0.x or 5.5.x. Just place the jar into common/lib and you will be all set.
Apparently others are missing as well. However, although it's documented, I don't think it's reasonable: components are are present in the upstream release are missing in the Portage-installed version. I believe that the ebuild should take on the dirty work and then report in the elog where it's still dirty.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
matthias_mo
n00b
n00b


Joined: 25 Jan 2012
Posts: 1

PostPosted: Wed Jan 25, 2012 8:57 pm    Post subject: Re: An important note about tomcat on gentoo Reply with quote

Raptor85 wrote:

All JNDI functionality seems built off the functions in this file, and throws errors that are at best red herrings if you don't have it, so none of the "proper" ways of doing authentication or database connectivity in tomcat 6 work without it. (the only way to open a connection to a database without it is to define it in the code instead of in the connection resources) The fix at the moment seems to be to take this file from a binary install of tomcat and copy it into your libs folder, did that and it clears up everything instantly.

Just thought this needed to be posted up for anyone else who runs into this, it's not a bug in your code but a nasty little bug in gentoo's build of tomcat itself.


This problem also hit me now. So I went looking for the naming-factory-dbcp.jar but also the vanilla binary tar.gz for 6.0.33 and 6.0.35 doesn't include this jar. What I found was this jar file from a tomcat-5.5 distribution but I suspect it's not compatible.

So can you tell me where did you find a tomcat 6.0.x version of naming-factory-dbcp.jar?

regards
matthias
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks 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