WebLogic Server Command Reference
DDInit is a utility for generating deployment descriptors for applications to be deployed on WebLogic Server. Target a module's archive or folder and DDInit uses information from the module's class files to create appropriate deployment descriptor files.
WebLogic Builder, the graphical user interface for generating and editing deployment descriptors, runs DDInit to generate deployment descriptors. See WebLogic Builder for more information.
In its command-line version, unlike in WebLogic Builder, DDInit
writes new files that overwrite existing descriptor files. If META-INF
(for EAR
or EJB)
, or WEB-INF
(for Web Applications), does not exist, DDInit
creates it.
Specify the type of J2EE deployable for which you want deployment descriptors generated by using the DDInit
command specific to the type, as described below.
Target a JAR file or a folder containing files that you intend to archive as a JAR file, and EJBInit will generate the ejb-jar.xml and the weblogic-ejb-jar.xml files for the module.
java weblogic.marathon.ddinit.EJBInit <module>
EJBInit looks in folders under the target and finds EJBs (bean class, local or remote home, remote or local interface). Matches interfaces with beans, and determines from that match which home belongs to which bean. In the bean itself it looks for CMP fields. then for relationships between entity beans. From information gathered in this way, EJBInit writes the deployment descriptors.
DDInit
supports EJB 2.0. DDInit will provide accurate results for session beans from 1.1, but is not likely to work for EJB 1.1 entity beans.
Target a WAR
file or a folder containing files that you intend to archive as a WAR
file, and WebInit
will create web.xml
and weblogic.xml
files for the module.
java weblogic.marathon.ddinit.WebInit <module>
Generate an application.xml
and a weblogic-application.xml
file for an EAR
using this command. Target an existing EAR
or a folder containing JAR
or WAR
files you intend to archive into an EAR
file.
java weblogic.marathon.ddinit.EarInit <module>
In WebLogic Builder, EarInit looks
recursively at the entire tree under the targeted module. On the command line, you need to already have descriptors for the modules contained in the EAR
. application.xml
will account for the modules. The generated weblogic-application.xml
will be an empty placeholder.
This output from this example describes building deployment descriptor files for ejb_st.jar
.
D:\dev\smarticket5\smarticket\bin>java weblogic.marathon.ddinit.EJBInit ejb_st.jar
Found 4 classes that implement the EnterpriseBean interface
Discovered module type for D:\dev\smarticket5\smarticket\bin\ejb_st.jar
Found EJB components. Initializing descriptors
Creating desc for bean com.sun.j2ee.blueprints.smarticket.ejb.customer.CustomerEJB
*** found remote home: com.sun.j2ee.blueprints.smarticket.ejb.customer.CustomerHome
*** found remote interface: com.sun.j2ee.blueprints.smarticket.ejb.customer.Customer
Setting prim-key-class to 'java.lang.String'
Adding Entity bean 'CustomerEJB'
Creating desc for bean com.sun.j2ee.blueprints.smarticket.ejb.localeinfo.LocaleInfoEJB
*** found remote home: com.sun.j2ee.blueprints.smarticket.ejb.localeinfo.LocaleInfoHome
*** found remote interface: com.sun.j2ee.blueprints.smarticket.ejb.localeinfo.LocaleInfo
LocaleInfoEJB is a Stateless Session bean
Adding Session bean 'LocaleInfoEJB'
Creating desc for bean com.sun.j2ee.blueprints.smarticket.ejb.movieinfo.MovieInfoEJB
*** found remote home: com.sun.j2ee.blueprints.smarticket.ejb.movieinfo.MovieInfoHome
*** found remote interface: com.sun.j2ee.blueprints.smarticket.ejb.movieinfo.MovieInfo
MovieInfoEJB is a Stateless Session bean
Adding Session bean 'MovieInfoEJB'
Creating desc for bean com.sun.j2ee.blueprints.smarticket.ejb.ticketsales.TicketSalesEJB
*** found remote home: com.sun.j2ee.blueprints.smarticket.ejb.ticketsales.TicketSalesHome
*** found remote interface: com.sun.j2ee.blueprints.smarticket.ejb.ticketsales.TicketSales
TicketSalesEJB is a Stateful Session bean
Adding Session bean 'TicketSalesEJB'