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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:16:01+00:00 2026-05-28T06:16:01+00:00

I have a project A that depends on project B that depends on project

  • 0

I have a project A that depends on project B that depends on project C. Project C depends on Hibernate (more precisely org.hibernate:hibernate-core:3.6.8.Final). Project B doesn’t depend on the hibernate artifact. But, project A depends on this artifact but only for unit tests, so I use test scope. When I try to build A, projects C and B are correctly built and installed but I get the following error during A compilation:

Failure executing javac, but could not parse the error:
myPackage\MyClass.class(myPackage:MyClass.class): warning: Cannot find
annotation method ‘value()’ in type
‘org.hibernate.annotations.Cascade’: class file for
org.hibernate.annotations.Cascade not found An exception has occurred
in the compiler (1.6.0_27). Please file a bug at the Java Developer
Connection (http://java.sun.com/webapps/bugreport) after checking the
Bug Parade for duplicates. Include your program and the following
diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for
org.hibernate.annotations.CascadeType not found

I precise that MyClass belongs to project C and imports org.hibernate.annotations.Cascade. And C compiles successfully so it can find the said class.
But here, it seems that the class file cannot be found during A compilation. I thought that maybe the test-scoped dependency on Hibernate may cancel the Hibernate dependency of C? But, I have no idea.

Also, if I change the scope of the dependency in project A from test to compile, the problem disappears.

Thanks for your help

  • 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-05-28T06:16:02+00:00Added an answer on May 28, 2026 at 6:16 am

    It’s both a compiler bug and a bug in your code.

    On your side:

    You’re overriding the scope of the transient hibernate dependency so it isn’t available at compile time, only at test time.

    The annotations being used in MyClass in project C are available at runtime (otherwise hibernate wouldn’t be able to reference them when running your project). This means that when you compile, javac needs to be able to load those annotations but it can’t find them.

    On the compiler’s side side:

    This should technically just be spit out with any other compiler generated errors/warnings. However, somebody missed something on the compiler’s side so the compiler is crashing instead of appending to the list of warnings. I would recommend updating to the latest JDK, try again, and if it still doesn’t work report a bug.

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

Sidebar

Related Questions

I have a project that depends upon some other binaries to be downloaded from
Suppose, I have an opensource project that depends on some library, that must be
I have a project that I'm currently working on but it currently only supports
I have a project that I thought was going to be relatively easy, but
I have an Android project that depends on an android library (apklib) project. The
I have java project that depends from other java projects. These projects are maven
I have a project that depends on a library that is only easily available
I am using Qt Creator and have a Qt GUI project that depends on
I have a project that needs to disable/enable some NSToolbarItem s depends on different
I have an F# library project that depends on a C# class library project,

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.