Search |
||
GlassFish Migration: WebLogic's Split Directory to EarPosted by sekhar on September 29, 2008 at 9:42 AM PDT
GlassFish Migration: WebLogic's Split Directory To EarAs I wrote in the blog on Verification Tools for Migration to GlassFish, GlassFish verifier tool is handy for verifiying the Java EE compliance of an application. Verifier is run as follows
verifier --portablity archive
at seems simple enough to run, but it does require an archive (ear/war/jar/rar). The source application server (e.g. WebLogic ) from which the application is being migrated to GlassFish will usually provide a mechnism to generate an archive file. Here, I will examine the generation of an ear file on WebLogic 9.2 when split directory development is being used. A lot of the samples in WebLogic 9.2 distribution use the split directory development model. And I ran into a problem while trying to generate an archive file for the JSP Simple Tag sample that I had migrated earlier. I will describe both the problem and the workaround. Background on Split Directory DevelopmentThe split directory development model is targeted towards iterative development. The essence of this type of development is that there are two directories:
WebLogic provides an Ant task - wlpackage - to package the src and build directory contents into a single EAR file or an archive directory in an exploded format. For e.g.
<!-- package to an ear file -->
<wlpackage srcdir="${src.dir}" destdir="${dest.dir}
toFile="${ear.file}" />
<!-- package to an exploded directory -->
<wlpackage srcdir="${src.dir}" destdir="${dest.dir}
toDir="${ear.exploded.dir}" />
Every WebLogic 9.2 server sample's build.xml contained an Ant target "package.exploded.ear" that packaged the src and build directory into an ear in exploded format. But there was no ant target for packaging into a J2EE ear. Note: The WebLogic 9.2 BuildXMLGen facility does generate a build.xml with an Ant target for building both ear file as well as a standard J2EE expoloded directory. I am not sure why the build.xml files in the samples do not have such a target. So I thought I would use wlpackage to package an ear file. The problem I ran into is that the ear file generated was not Java EE compliant. The files for the web module were packaged in an exploded format rather than being packaged into a war file first, and then packaging the war file into the ear file. Thus, the web-uri XML element in the application.xml points to an exploded directory rather than a war file, causing the verifier to fail with an exception.
<!-- Archive contents produced by wlpackage -->
<!-- Note: jspSimpleTagWar is a directory not a war file -->
META-INF/
META-INF/MANIFEST.MF
META-INF/application.xml
jspSimpleTagWar/
jspSimpleTagWar/ExamplesFooter.jsp
...
<!-- META-INF/application.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.4">
<description>JSP 1.2 Simple Tag API Example</description>
<display-name>JSP 1.2 Simple Tag API Example</display-name>
<module>
<web>
<web-uri>jspSimpleTagWar</web-uri>
<context-root>jsp_simpleTag</context-root>
</web>
</module>
</application>
I worked around the above problem as described below.
The generated ear will look like this.
Ear file format
META-INF/
META-INF/MANIFEST.MF
META-INF/application.xml
META-INF/weblogic-application.xml
jspSimpleTag.war
Summary WebLogic supports a split directory development. WebLogic
provides ant task It would be useful if the verifier tool itself could be used on
an exploded directory. But that is another topic for another
day. »
Related Topics >>
Glassfish Comments
Comments are listed in date ascending order (oldest first)
Submitted by skylab_g16 on Tue, 2008-12-23 11:23.
I have a one .war component and one META-INF folder, this folder contains the application.xml, weblogic-application.xml, MANIFEST.MF with this i have created one .ear file. While i am deploying this .ear file in weblogic 9.2 console, i am getting the following error.
Unable to access the selected application.
Exception in AppMerge flows' progression
and in server logs i can see the following message,
" element does not contain a for "controllerClass". Page Flow actions in this module may not be handled correctly.> "
Can any one of you please help me to resolve this problem. Thanks in advance.
|
||
|
|