• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Starting with Maven

 
Witold Marshal
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is more of an Eclipse problem, so I'm moving the question to the Eclipse forum.

Offhand, though, I'd say that the prototype ejb-jar is not conforming to the schema defined at http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd
 
Tim Holloway
Saloon Keeper
Posts: 18300
56
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On second thought, I moved this thread to the EJBs forum, since it's not really likely to be an Eclipse problem, either.
 
Palak Mathur
Ranch Hand
Posts: 342
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you created any EJB or the project is empty?
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, Tim already answered the question:
Tim Holloway wrote:

Offhand, though, I'd say that the prototype ejb-jar is not conforming to the schema defined at http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd


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.

 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And if you don't want to deal with the ejb-jar.xml file, just delete it! That is, if you are working with EJB3 or later.
 
Witold Marshal
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic