Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packaging into EAR

 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Weblogic 8.1 on Windows XP.

I am unable to create an EAR for my web module. I tried using the Weblogic Builder and also the command line prompt using:

java weblogic.marathon.ddinit.EarInit <MyAppJAR>

No errors are detected, but the EAR is nowhere to be seen. What could I be missing out on?

Saket
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
from BEA's WebLogic Server Command Reference:


EarInit
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.

From your post it sounds like you are running the command on a jar instead of on a folder containing jar or war files (or an existing ear).
[ January 23, 2006: Message edited by: Carol Enderlin ]
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the prompt response, Carol.

I did reference the link prior to posting my message. I somehow got the impression that the ddinit would create the required deployment descriptors as well. This makes sense too, because the WebInit did create web.xml and the like.

Please let me know if I am missing out on something.

Thanks again,
Saket
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EarInit creates the descriptors for the ear, not the ear. It sounds like the same is true for WebLogic Builder.

An ear is just a jar file with a defined structure/contents. You can generate one with the jar command or with the ant "jar" or "ear" tasks.

If you ran the EarInit command on a folder, did you it a directory called META-INF containing application.xml and weblogic-application.xml inside that directory?

If not, what output did it print when you ran it? Please include details about what exactly you are running it on.

BEA seems to be pushing use of an exploded ear making the ear just a folder or directory with defined structure/contents.
[ January 24, 2006: Message edited by: Carol Enderlin ]
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried to create the EAR on a properly structured folder HelloWorldWebApp. Here is the output, Carol:



Apparently it tried to create an ear but didn't and left it at that since there are no error messages indicating otherwise.

Isn't it strange that one is not able to create an EAR using tools provided by Weblogic itself?

Saket
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not supposed to create an ear using the command you are using. It is used to create the deployment descriptors. And based on your output, it says it did that. Did you look for the xml files?

C:\projects>java weblogic.marathon.ddinit.EarInit HelloWorldWebApp

Search for EJB components in C:\projects\HelloWorldWebApp
App was not specifically an EJB app. Will try to create an ear

Search for Web components in C:\projects\HelloWorldWebApp
Found Web components. Initializing descriptors
Found Web module
C:\projects
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

And based on your output, it says it did that. Did you look for the xml files?


Yes, Carol. The XML files were created by WebInit, which I ran prior to executing EarInit. I went through the Mastering Weblogic Server book; I gather that one uses build files for getting the EAR, contrary to Sun One Application Server where one can explicitly get the EAR from the tools.

Thanks again,
Saket
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic