I have created Maven project of EJB under Eclipse Environment. Basicly it works fine. Phases "package" and "install" give appropriate result in target directory. But there (in the project) is a file ejb-jar.xml which wasn't created by me but orginally delivered with the build up of archetype. Eclipse indicates an error there (small red square with white cross). It doesn't infleunce compiling of the project but it annoys me a lot. The content of that file (ejb-jar.xml) is like that:
When I open that file (in Eclipse) The Error tip generated by Eclipse says " An EJB module must contain one or more enterprise beans". How can I get rid of it?
The xsd states that the ejb-jar element is of type ejb-jarType which is a complex type comprised of xs:sequence:
and a xs:sequence by default has a minOccurs of 1 (and maxOccurs = 1). So the enterprise-beans element is expected to be present within the ejb-jar element. The xsd says it all. The ejb-jar.xml is expected to follow that schema.
to @Palak Mathur
Yes I have created EJB classes in "src/main/resources" but it was not in the way as it works for standard Eclipse EJB project where you can define beans (Session Bean, Message-Driven Bean). Here for Maven EJB project in Eclipse I have no option to add a standard bean in the menu (clicking right button of the mouse). I added my bean class and interface manually by creating them in appropriate folder. Is there a way to do it in more sophistic (better) way?
Perhaps that is why there weren't added appropriate entries in ejb-jar.xml
So, according to your replies I should write appropriate element in <ejb-jar> section. As I see in documentation it should be: <xsd:element name="ejb-jar" type="j2ee:ejb-jarType"> and it will be rather hard for me to add it manually because it comprises so many elements.