Forums Register Login

Starting with Maven

+Pie Number of slices to send: Send
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?
+Pie Number of slices to send: Send
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
1
+Pie Number of slices to send: Send
On second thought, I moved this thread to the EJBs forum, since it's not really likely to be an Eclipse problem, either.
+Pie Number of slices to send: Send
Have you created any EJB or the project is empty?
+Pie Number of slices to send: Send
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.

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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.
We can walk to school together. And we can both read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 4179 times.
Similar Threads
Problem with mi EJB module..
eclipse ejb ?
"jndi:ejb not bound" error while deploying EJB
how to convert ejb2.0 to ejb2.1
Problem compiling Web Service EJB endpoint
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:39:30.