I found the solution.
JBoss AS 7 Configuration, Deployment and Administration, Francesco Marchioni:
Therefore, applications that are packaged as top-level archives (such as WAR, JAR,
and SAR) are assigned the following module name:
deployment.[archive name]
For example, a web application named WebExample1.war will be deployed as the
following module name:
deployment.WebExample1.war
On the other hand, on applications that contain nested modules (such as the
EAR archive), every single archive will be assigned a module name using this
classification:
deployment.[ear archive name].[sub deployment archive name]
So, the same web application, if contained in the archive EnterpriseApp.ear,
will be deployed with the following name:
deployment.EnterpriseApp.ear.WebExample1.war
My ear-project contains application.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
version="6"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd">
<display-name>MyCompanyName</display-name>
<description>EAR generated by Middlegen</description>
<module>
<ejb>com.mycompany-ejb.jar</ejb>
</module>
</application>
In the war-project I added WebConten/META-INF/MANIFEST.MF file:
Manifest-Version: 1.0
Class-Path:
Dependencies: deployment.mycompany.ear.com.mycompany-ejb.jar
Dependencies are the module names.(Here from application.xml).
Class-Path would contain the name of the JAR-File.
Solution for 5.1 is missing, but not relevant for me at moment.