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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:27:01+00:00 2026-06-13T11:27:01+00:00

I am using Weld as CDI implementation. My integration test, that tries to assemble

  • 0

I am using Weld as CDI implementation. My integration test, that tries to assemble object graph instantiating Weld container works well, when I have empty beans.xml in src/test/java/META-INF/beans.xml. Here is that simple test:

public class WeldIntegrationTest {
    @Test
    public void testInjector() {
        new Weld().initialize();
        // shouldn't throw exception
    }
}

Now when I run mvn clean install, I always get: Missing beans.xml file in META-INF!

My root folders are “src” and “web” which contains WEB-INF folder, but I also tried to use default maven structure and renamed “web” to “webapp” and moved it to src/main. I tried all the reasonable locations I could thought of:

 - src/main/java/META-INF/beans.xml
 - src/test/java/META-INF/beans.xml
 - web/WEB-INF/beans.xml
 - src/main/webapp/WEB-INF/beans.xml
 - src/main/webapp/META-INF/beans.xml
 - src/main/webapp/META-INF/(empty) and src/main/webapp/WEB-INF/beans.xml

Nothing works so far :/

  • 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-13T11:27:02+00:00Added an answer on June 13, 2026 at 11:27 am

    For EJB and JAR packaging you should place the beans.xml in src/main/resources/META-INF/.

    For WAR packaging you should place the beans.xml in src/main/webapp/WEB-INF/.

    Remember that only .java files should be put in the src/main/java and src/test/java directories. Resources like .xml files should be in src/main/resources.

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

Sidebar

Related Questions

I'd like to test some CDI classes. Today, I'm using Arquillian to do that
I am using Weld implementation of CDI 1.0 and I cannot find way how
I'm using JBoss6.1.Final, JSF 2.0 (Mojarra), Weld CDI, MyFaces CODI 1.0.5 (for view-access-scoped) I'm
I'm having trouble using dependency injection (with CDI/Weld) within libraries used in a war
I was using JBoss 7 with JSF 2.0 (Mojarra) and Weld as CDI. Everything
I'm trying junit test with CDI/Weld and JEEUnit. I get this message on startup:
I'm using CDI (Weld) and I've faced a problem, hope you can help. I
[My Setup: Java EE 6 application, with EJB3.1, CDI/Weld, JSF2 running on Glassfish 3.0.1]
JSR-299 (CDI) introduces the (unfortunately named) concept of a resource: http://docs.jboss.org/weld/reference/1.0.0/en-US/html/resources.html#d0e4373 You can think
I do not plan on using Weld, but still would like to have custom

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.