Bug 203710 - "Crete Beans.xml" warning appears when a beans.xml exists
"Crete Beans.xml" warning appears when a beans.xml exists
Status: RESOLVED FIXED
Product: javaee
Classification: Unclassified
Component: CDI
7.2
PC Windows 7
: P2 with 3 votes (vote)
: 7.2
Assigned To: Sergey Petrov
issues@javaee
71patch1-verified
: REGRESSION
: 207356 207485 207623 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-14 11:28 UTC by rveldpau
Modified: 2013-07-22 04:48 UTC (History)
8 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rveldpau 2011-10-14 11:28:15 UTC
Product Version = NetBeans IDE 7.1 Beta (Build 201109252201)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) 64-Bit Server VM 19.1-b02

The error message "Crete Beans.xml" appears even if you have beans.xml in your built application. The default location that the beans.xml is created is in your src/main/java folder under META-INF. Since this is not really java, I put it in src/main/resources in a folder named META-INF. Both are valid, but Netbeans complains that a beans.xml doesn't exist if you have it in my location.

Also, I have not found a way to turn this message off in "Option/Editor/Hints"

Oh, and as a final note... it should probably be "Create" and not "Crete"
Comment 1 Jan Lahoda 2011-10-17 07:56:52 UTC
A quick search over built NB reveals that this hint is provided by web.beans module, which maps to javaee/code.
Comment 2 Martin Janicek 2011-10-21 09:21:59 UTC
I think that this is CDI related --> reassigning
Comment 3 Denis Anisimov 2011-10-21 12:03:13 UTC
First of all you are talking about Maven project, right ?
The second observation is manual "beans.xml" creation. 
There is a wizard which creates "beans.xml" be default in the "src/main/java" folder.
Comment 4 Denis Anisimov 2011-10-21 12:52:35 UTC
web-main#3df808adc3fa
Comment 5 Quality Engineering 2011-10-24 14:06:28 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/3df808adc3fa
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#203710 - "Crete Beans.xml" warning appears when a beans.xml exists.
Comment 6 Kenneth Ganfield 2011-12-21 18:43:38 UTC
I am still seeing this when I create a Maven web app.

If I create a Maven web app and then inject a resource in a servlet, I see the hint in the editor to create beans.xml. If I invoke the hint the IDE will create beans.xml in src/main/java/META-INF. I am not sure but I think that for a WAR the beans.xml should usually be in WEB-INF. When I tried to deploy the WAR to GF and the beans.xml file was in META-INF there was a server error.

If I create a Maven web app and then create beans.xml using the wizard, the IDE creates beans.xml in the default WEB-INF directory. However, when I inject the resource in the servlet I see the hint prompting me to create beans.xml, but beans.xml already exists in WEB-INF. If I invoke the hint the IDE creates beans.xml in META-INF and the application now has two beans.xml files.
Comment 7 Denis Anisimov 2011-12-21 19:44:16 UTC
This is regression introduced with fix for issue #204445.
Comment 8 dwuysan 2011-12-22 06:21:31 UTC
Netbeans should be adding beans.xml under WEB-INF folder and not complaining/giving warning
Comment 9 Denis Anisimov 2011-12-22 06:44:46 UTC
web-main#b3d8c20dc4ca
Comment 10 Quality Engineering 2011-12-23 08:32:38 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/b3d8c20dc4ca
User: Denis Anisimov <ads@netbeans.org>
Log: Fix for BZ#203710 - "Crete Beans.xml" warning appears when a beans.xml exists
Comment 11 Denis Anisimov 2012-01-16 16:39:31 UTC
*** Bug 207356 has been marked as a duplicate of this bug. ***
Comment 12 Denis Anisimov 2012-01-19 05:15:06 UTC
*** Bug 207485 has been marked as a duplicate of this bug. ***
Comment 13 Denis Anisimov 2012-01-23 14:04:25 UTC
*** Bug 207623 has been marked as a duplicate of this bug. ***
Comment 14 Kenneth Ganfield 2012-02-09 16:33:13 UTC
I am still seeing this issue:

Product Version: NetBeans IDE Dev (Build 201202080400)
Java: 1.6.0_29; Java HotSpot(TM) 64-Bit Server VM 20.4-b02-402
System: Mac OS X version 10.6.8 running on x86_64; MacRoman; en_US (nb)

For example, the Embedded Glassfish sample included with the IDE shows the following error in each of the servlets when the persistence manager is injected.

CDI artifact is found bu there is no beans.xml file
Comment 15 Jiri Skrivanek 2012-02-17 14:23:02 UTC
For me the following scenario works in patched 7.1 build:

- create Maven web project with GlassFish server
- open new file wizard
- choose CDI|Qualifier Type
- finish wizard
- invoke hint about missing beans.xml
- it is correctly created in WEB-INF folder
Comment 16 Denis Anisimov 2012-02-17 14:26:40 UTC
The project mentioned in the comment #14 is incorrect. 
The issue has no any relation to the CDI support.

There are resources folder in the created project directory but it is not under
sources control.
As result SourceGroup doesn't see this folder and I assume it is not packaged 
in the deployment unit.
The "Embedded Glassfish"  sample should be corrected and this is a separate issue.
Comment 17 Kenneth Ganfield 2012-02-19 10:34:08 UTC
When you say that the Embedded Glassfish sample application should be corrected, could you explain in a little more detail what the issue is and I will submit a new issue for it. Are you saying that the structure of the project is incorrect?
Comment 18 nameless1 2012-11-05 08:37:08 UTC
I seem to have the same problem "CDI artifact is found but there is no beans.xml file", the file is in resources/META_INF, but it is not found.
Maven EJB project

Product Version: NetBeans IDE 7.2 (Build 201207171143)
Java: 1.7.0_07; Java HotSpot(TM) 64-Bit Server VM 23.3-b01
System: Windows 7 version 6.1 running on amd64; UTF-8; en_US (nb)
Comment 19 Denis Anisimov 2012-11-21 05:38:10 UTC
(In reply to comment #18)
> I seem to have the same problem "CDI artifact is found but there is no
> beans.xml file", the file is in resources/META_INF, but it is not found.
> Maven EJB project
> 
> Product Version: NetBeans IDE 7.2 (Build 201207171143)
> Java: 1.7.0_07; Java HotSpot(TM) 64-Bit Server VM 23.3-b01
> System: Windows 7 version 6.1 running on amd64; UTF-8; en_US (nb)

resources/META_INF is wrong folder for beans.xml.
The correct one is resources/META-INF and there is no editor hint if 
beans.xml is inside correct folder.
Comment 20 fedind 2013-06-19 14:10:29 UTC
reproduced in 7.3.1

Product Version = NetBeans IDE 7.3.1 (Build 201306052037)
Operating System = Windows 7 version 6.1 running on amd64
Java; VM; Vendor = 1.7.0_25
Runtime = Java HotSpot(TM) 64-Bit Server VM 23.25-b01
Comment 21 kahlon1005 2013-06-21 06:13:52 UTC
I am getting same issue in Product Version: NetBeans IDE 7.3 (Build 201306052037) after upgrade. I have bean.xml under WEB-INF folder.
Comment 22 _ avbravo 2013-06-24 16:23:30 UTC
i have same error with beans.xml for maven project
Comment 23 Duke_kz 2013-06-24 16:55:36 UTC
Seems that I have the same issue with "CDI artifact is found but there is no beans.xml file". I have an Ant cdi jpa2 project in Netbeans 7.3 update 2. I have a beans.xml file in WEB-INF folder, where it was created automatically.
Comment 24 Sergey Petrov 2013-06-26 12:00:52 UTC
this one issue was resolve din 7.2.

7.3.1 have separate issue, it's not so god to reopen this one in next or later releases as it may have completely different reasons.
issue 230730 is resolve din 7.4
Comment 25 jdbenitez 2013-06-28 21:48:29 UTC
i see this error in Product Version: NetBeans IDE 7.3 (Build 201306052037)
Comment 26 chromial 2013-07-02 15:49:06 UTC
I also have experienced this bug.

Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
User directory: C:\Users\TysonL\AppData\Roaming\NetBeans\7.3.1
Cache directory: C:\Users\TysonL\AppData\Local\NetBeans\Cache\7.3.1
Comment 27 Nicknick 2013-07-12 17:28:08 UTC
Product Version: NetBeans IDE 7.3 (Build 201306052037)
Java: 1.7.0_07; Java HotSpot(TM) 64-Bit Server VM 23.3-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_07-b10
System: Linux version 2.6.32.26-175.fc12.x86_64 running on amd64; UTF-8; en_US (nb)
Comment 28 Sergey Petrov 2013-07-12 17:58:21 UTC
fixed in 7.2
Comment 29 tmulle 2013-07-22 02:21:30 UTC
I'm still getting this in 7.3.1 and if I let the IDE create the beans.xml file it puts it in WEB-INF folder.

I have a maven project and even if i try moving the beans.xml to META-INF folder I still get the same warning about no beans.xml file.

Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.7.0_21; Java HotSpot(TM) 64-Bit Server VM 23.21-b01
Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)
Comment 30 Sergey Petrov 2013-07-22 04:47:09 UTC
see comment 24


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo