This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 245552 - beans.xml will not be recognized in WebApp in META-INF
Summary: beans.xml will not be recognized in WebApp in META-INF
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: CDI (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-10 13:56 UTC by tandraschko
Modified: 2016-07-07 08:56 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tandraschko 2014-07-10 13:56:17 UTC
I always get this error:
CDI artifact is found but there is no beans.xml file.

But a beans.xml is available in src/main/resources/META-INF, which is fine according to the CDI specs.
Comment 1 Sergey Petrov 2014-07-15 12:58:55 UTC
The beans.xml file must be named:

    META-INF/beans.xml , or,

    in a war, WEB-INF/beans.xml or WEB-INF/classes/META-INF/beans.xml

there is nothing about "resources.. meta-inf", what specification item do you refer?
I suppose some vendors and may be even weld support other locations but these locations are not portable.
Comment 2 tandraschko 2014-07-15 13:09:05 UTC
You are right about the TARGET locations.

src/main/resources/META-INF
src/main/webapp/WEB-INF

are the maven locations.
Maybe it's an problem with Maven Projects only when the target directory isn't fully packaged/compiled now?
Comment 3 Sergey Petrov 2014-07-15 13:12:03 UTC
I may moss smth in maven, is src/main/resources/META-INF packed in WEB-INF/classes/META-INF/ ?
Comment 4 tandraschko 2014-07-15 13:18:28 UTC
normally yes, but not if:
1) if you haven't compiled already
2) if you skip the packaging because you don't need it.
   This happens if you run your maven project via jetty from the src directory instead of the target directory. Packaging/copy to the target dir would be just an big overhead which slow down your app startup.

Therefor it would be better the check the beans.xml also from the source directories.
Would it be possible?
Comment 5 Sergey Petrov 2014-07-15 13:21:46 UTC
I'll look what can be done a bit later
Comment 6 Martin Balin 2016-07-07 08:56:51 UTC
This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue.

Thanks for your cooperation,
NetBeans IDE 8.2 Release Boss