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 8429483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:21:07+00:00 2026-06-10T05:21:07+00:00

I have built an ear with this structure (not all files shown here): myapp.ear/

  • 0

I have built an ear with this structure (not all files shown here):

myapp.ear/
    myapp-ejb.jar
    myapp-web.war
    META-INF/
        application.xml
    lib
        myapp-common.jar

The problem is, when code in the war tries to reference classes in myapp-common.jar, it throws java.lang.ClassNotFoundException.

Note the contents of META-INF/application.xml:

<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                                 http://java.sun.com/xml/ns/javaee/application_6.xsd"
             version="6">
  <display-name>pncr-portal-ear</display-name>
  <module>
    <web>
      <web-uri>myapp-web.war</web-uri>
      <context-root>/</context-root>
    </web>
  </module>
  <module>
    <ejb>myapp-ejb.jar</ejb>
  </module>
  <library-directory>/lib</library-directory>
</application>

The library directory is defined here as being in the /lib directory relative to the root of the ear, which is exactly where it is, yet it is not loaded into the classpath despite the Java EE 5 (and presumably 6) spec saying that it should be loaded into the classpath.

  • 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-10T05:21:09+00:00Added an answer on June 10, 2026 at 5:21 am

    As it turns out, I was referencing a class in a slightly different package than the one I thought. The package no longer existed, yet Maven was compiling it without complaining. So I blew away my local repository and tried again. I still got the error. Then I found the problem: In myapp.taglib.xml, I am still referencing an old version of a class in myapp-common.jar that is now in a different package.

    So the lesson is: If you see ClassNotFoundException, also look in your taglib.xml file(s).

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

Sidebar

Related Questions

I have make jar war EAR using ant and Hudson and store all files
I have a Ear, war and 2 jar projects in my eclipse. I want
I have the following folder structure: project.ear lib folder ProjectEJBClient.jar META-INF folder projectEJB.jar My
I have built a game in HTML5 and a web form posts data to
I currently have a project built with maven-archetype-webapp artifact. The default packaging for this
We are building our EAR & EJB projects with maven. It will build all
We use Hudson, Maven2 and maven-ear-plugin. Is it possible to have the built EAR
I have a very creative requirement - I am not sure if this is
I have an EAR file built by maven and currently I have a commons
I have a project with several applications. I have one war and one EAR

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.