• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

not able to connect a web application to database server located on same system.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am creating a sample web application using servlet and jsp (mvc) in Eclipse Helios.
I created dynamic web app project.
Application server is Apache Tomcat.

I want to connect to database server locating on same system.
I am using mysql 6.0.
I added mysql jdbc connector jar in my project but still I am getting

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
Log In failed: An Exception has occurred! java.lang.NullPointerException

can any one please explain?
Where do I placed connector jar?
 
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Application server is Apache Tomcat.


Tomcat is not an Application Server.


java.lang.ClassNotFoundException: com.mysql.jdbc.Driver


how you are adding jar file in eclipse..?
put your mysql jar file in tomcat->lib folder as well, i solved same problem by putting jar file into lib.
Assuming you are adding jar file like this:
Project->Build Path->Add External jars.

hope it helps..
 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Punit Jain wrote:Tomcat is not an Application Server.


There is no generally agreed-upon definition of the term "application server", and Tomcat can easily serve as one. What Tomcat is not is a "JEE server", which is something that actually does have a fixed definition.
 
Punit Jain
Ranch Hand
Posts: 1143
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


There is no generally agreed-upon definition of the term "application server"


i agree.


and Tomcat can easily serve as one.


how although tomcat not supports ejb's.

here
here

although there is no specific definition so we can decide for our self, i think
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Punit Jain wrote:how although tomcat not supports ejb's.


Because an application does not require the use of EJBs. A JEE server would require all JEE APIs to be implemented, including EJB.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ha! I can out-pædant anyone here!

Tomcat is, according to generally-accepted usage, a Web Application Server.

Tomcat is - in a limited scope - a J2EE web application server. It is not, however, a full-stack web application server because it lacks several of the heavyweight capabilities (such as EJB container) that are required to be provided in order to be certifiable. Tomcat only provides the servlet/JSP support, a JNDI server, Database connection pools, security Realms, and a few odds and ends.

Despite Tomcat's limited capabilities, it has served as a prototyping platform for next-generation servlet/JSP designs. It also has been employed as the servlet/JSP subsystem services provider running embedded in full-stack J2EE/JEE web application servers such as JOnAS and JBoss,

----

So much for nit-picking. In Tomcat versions 6 and greater, the database driver JAR must be copied into the TOMCAT_HOME/lib directory. It must NOT be included as part of any application (WAR) because it's used at the container level by the connection pooler(s) and individual application classpaths are not shared as part of the server classpath. The server's classpath is part of the individual webapp classpaths, though.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic