Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7892333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:50:38+00:00 2026-06-03T06:50:38+00:00

I deploy a WAR file in Tomcat. In addition I have a JAR file.

  • 0

I deploy a WAR file in Tomcat. In addition I have a JAR file.

Is it possible to make the classes in the JAR file available to services in the WAR file without changing the WAR file, or does it have be added to the WAR’s WEB-INF/lib?

I’ve tried adding the JAR to lib/, but it doesn’t work. Spring fails with org.springframework.beans.factory.BeanCreationException » java.lang.NoClassDefFoundError upon startup.

EDIT

I realized that I might have made myself an unsolvable and architectually ugly problem. Here’s the thing:

  • The WAR has a reference <bean id="warService" class="com.war.Service" />
  • My JAR has a class com.mystuff.MyService that extends com.war.Service
  • I have replaced the bean reference with <bean id="warService" class="com.mystuff.MyService" />
  • Spring fails with java.lang.NoClassDefFoundError: com.war.Service
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:50:40+00:00Added an answer on June 3, 2026 at 6:50 am

    Or you could put it(your jar file) in your Tomcat root directory under lib folder. Chk this out :

    http://tomcat.apache.org/tomcat-6.0-doc/class-loader-howto.html

    Per your edit

    1. Something is wrong with your jar
    2. You have mistaken the fully qualified class name in your application context

    I’ve happen to have mysql-connector-java-5.0.8-bin jar in my lib folder. And just for test I’ve put this in my application context :

    <bean id="driver" class="com.mysql.jdbc.Driver" />
    

    Worked as charm, check those two cases above

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to deploy a remote war file automatically when my tomcat (6)
When I deploy my war file in tomcat, the SEVERE errors thrown by Catalina
I'm trying to deploy a war file onto my server which is tomcat 6
I have Apache Geronimo installed with Tomcat. I am building a war file and
I am trying to deploy a war file to tomcat 6.0.27. This war file
If I deploy a war file to Tomcat, called for example foo-bar-1.1.2.war , how
I have copied the sample.war file into the webapps directory of Tomcat, and I
When I try to deploy and run the war file on tomcat 7 I
Is there a way to deploy a given war file on Tomcat server? I
I have a web application (WAR file). When I deploy it through Eclipse 3.5

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.