AndyJ
AndyJ

Reputation: 1314

AppDeploymentException while deploying hand-rolled Websphere EAR

I am trying to compile and deploy an EAR file to a WebSphere 6.1 app server (WAS) -- without Rational Application Developer (RAD) or Liberty. I'm in the initial stage of trying to move the compile and deploy to a build server. I have no problems at all with the compile. However, when I attempt to deploy the EAR I get an AppDeploymentException:

The EAR file could be corrupt and/or incomplete. Make sure that the application is at a compatible Java 2 Platform, Enterprise Edition (J2EE) Level for WebSphere Application Server.

I read somewhere (can't find the link now) that WAS files must be compiled using the IBM JDK. So I installed that and recompiled with it but got the same problem.

The major version of the class files (from javap) is correct but I'm still mystified about this error because it seems that the only difference between "working" and "not" is the byte code itself. Is there some other inherent mojo that requires these files to be built by RAD?

This question suggests that web.xml schema must be 2.4 for WebSphere 6.1 but this had no impact for me. In fact, if I take a working EAR (created via RAD) and from that copy only the class files into the EAR that was created by the raw JDK/gradle process, it will work.

Sorry I'm not that familiar with WebSphere to include more information about the error. I checked the activity.log file for that profile and couldn't even find the error that was reported in the console output. The dmgr log only says:

[7/8/14 12:46:56:886 PDT] 0000073b ApplicationDe I ApplicationDeploymentController perform ApplicationDeploymentControll
er: performing appcontexts refresh
[7/8/14 12:47:00:416 PDT] 0000073b WebApp        A   SRVE0180I: [isclite#isclite.war] [/ibm/console] [Servlet.LOG]: action: ApplicationDeploymentDetailForm was null.Creating new form bean and storing in session
[7/8/14 12:48:25:273 PDT] 0000062d wtp           W org.eclipse.jst.j2ee.commonarchivecore.internal.impl.ModuleRefImpl in
itModuleFileFromEAR Ignoring FileNotFoundException [ mbepepWeb.war ]
[7/8/14 12:48:25:279 PDT] 0000062d wtp           E   org.eclipse.jst.j2ee.application.internal.impl.WebModuleImpl incomp
atible with org.eclipse.jst.j2ee.commonarchivecore.internal.ModuleFile

I'm not sure how relevant that is. The mentioned war file is at the root of the EAR file.

Hope someone has a suggestion!

Upvotes: 1

Views: 591

Answers (2)

AndyJ
AndyJ

Reputation: 1314

I had a working EAR file exported from RAD and my non-working EAR from the basic build process. I replaced the WEB-INF/class directory with the custom built code and it worked. I continued expanding the selection of code from the custom process, replacing the corresponding pieces in the RAD EAR file until I found what was breaking it.

Seems the culprit was that my MANIFEST.MF file in the webapp did not have a CLASSPATH attribute while the RAD generated manifest had a blank CLASSPATH attribute. One file was 50 bytes, one was 25. What a difference a few bytes make.

Upvotes: 0

Gas
Gas

Reputation: 18020

WebSphere v6.1 requires Java EE 1.4 application. Ensure that your app:

  • is compiled with at most Java 1.5 compatibility
  • you have application.xml file in META-INF directory in ear, and its correctly referencing web module.
  • you have web.xml in your war file in WEB-INF folder

Check the schema for both descriptors:

application.xml should be:

<application xmlns="http://java.sun.com/xml/ns/j2ee" id="Application_ID" version="1.4" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">

web.xml should be:

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

How you are deploying your application?

Upvotes: 1

Related Questions