this is no good idea, because you would break the validaty your XML documents.
What is your use case which forces you to do such things?
I agree with you on the thought that it is always better to have a schema validation in place.
Here is some more info on what I am trying to do:
The app I am working on is basically a web app. We might add EJBs in the future.
I had previously tried with JBoss 4.2.x, and had deployed an exploded form of a standard EAR directory structure inside the 'default' deployment. Inside the EAR directory(default.ear), along with a WAR directory (default.war), I had created a 'default-ejb.jar' directory and related meta data file which I left blank. This would deploy without complaining in JBoss 4.2.x
This same approach does not work for JBoss 5.1.0, since now, it complains about an EJB not being defined in the metadata file (for the EJB).
I could see two possible paths:
1) Try to switch off a validation flag (if there is such a thing) and continue using the default deployment configuration.
2) Use the 'Web' deployment configuration.
And hence, put my question as to whether there is a switch for validation within some JBoss configuration file.
On the other hand, I was also trying to find some information on the merits/limitations of using a 'web' deployment configuration.
Any/all suggestions welcome.
I think the JavaEE standard forbids ejb jars without any EJBs ;-).
Assume an EJB jar without deployment descriptor, which only uses annotations. Now assume that this one contains no classes. So, JBoss cannot identify it as an EJB jar. So, it is consistent that an ejb-jar.xml must contain at least one bean and cannot be "empty".
So, if your deployment does not require an EJB jar, do not include one ;-). IDEs like Eclipse allow adding of an EJB jar to an existing EAR project.
Actually the xsd allows you to have an empty ejb-jar element:
<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_0.xsd" version="3.0"> </ejb-jar>
so that you can set the ejb-jar "version" and other attributes of the ejb-jar deployment.
Ooops... my bad...