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.
Hello ! I have a problem with an EJB module. It show me Java EE 5 because it found an ejb-jar.xml. When I remove it, my module is detected as Java EE 6 correctly. I need my ejb-jar.xml to specify the name of my ejb-module and I don't want to use specific vendors files. This different target break the hot redeploy of my application (because I'm full Java EE 6 of course). This is strange because I specified ejb 3.1 in my ejb-jar.xml. Let me show : <?xml version="1.0" encoding="UTF-8"?> <ejb-jar 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/ejb-jar_3_1.xsd" version="3.1"> <module-name>extranetexp-services</module-name> </ejb-jar>
What kind of project is it? Maven or Ant based one?
A maven one. Ear project that create ejb module and web module. I've added the ejb-jar.xml. Tha same effect on Netbean 7.4. I know there was a lot of discussion about it. But I have the conviction it sould be a good idea to let the user choose wich Java EE version to use.
Passing to the maven JavaEE area. Martin was solving such issues several times, therefore I expect that he has concept how the recognition of the JavaEE level works and should work.
Strange, it doesn't do that on my mac os at home on a little example. I'm going on work in 40 minutes. I will make a short example on windows 7 to test. Otherwise, I can send the full project.
Created attachment 145937 [details] With ejb-jar.xml
Created attachment 145939 [details] Without ejb jar xml
I made a new project from scratch. I can't reproduce on this new project. But as you can see on the screen captures, on my real life ejb project, it continue. What are the rules to detect Java EE version ? Is it documented somewhere ?
If I remember correctly, there are two rules: 1/ Check nb-configuration.xml file and if the Java EE version is specified there, then this one should be taken for the project 2/ If there is no explicit specification, NetBeans is checking ejb-jar.xml and looking for a version of that file (in case of 3.1 it should consider it as Java EE 6 project I think) 3/ If both previous checks fails then use Java EE 5 as default version ..I can take a look at it, but without reproducible test case I hardly can guess what could be the problem. Could you try to create reproducible project (e.g. based on configuration files from your real project) ? Thanks in advance
(In reply to yblazart from comment #2) > A maven one. Ear project that create ejb module and web module. I've added > the ejb-jar.xml. > > Tha same effect on Netbean 7.4. > > I know there was a lot of discussion about it. But I have the conviction it > sould be a good idea to let the user choose wich Java EE version to use. And I think you are right, but the fact is that it was implemented for Web projects only so far..
That's the nb-configuration generated when I change the target server to Glassfish 4 : <?xml version="1.0" encoding="UTF-8"?> <project-shared-configuration> <properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1"> <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>gfv3ee6</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server> </properties> </project-shared-configuration>
It's difficult to reproduce it... I will try, and send you all the needed code is a big. Well. What is the property to put in nb-configuration ?
Got it ! <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.6-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion> With this it works. Well it seem that the generation of nb-configuration is not very stable. This line was added by NB when I add a new EJB Stateless/LocalBean in my example....
Usually (or at least if you are creating project in NetBeans) it should be generated automatically during the creation. I don't know if there is anything I could improve around EE detection. It would make sense to allow to change the value in project properties (same behavior like Maven Web projects), but the recognition mechanism will be the same. Setting TM = Next for now
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