Saturday, 8 November 2014

The EAR file could be corrupt and/or incomplete. Make sure that the application is at a compatible Java(TM) Platform, Enterprise Edition (Java EE) level for the current version of WebSphere(R) Application Server.

I'm seeing this: -

The EAR file could be corrupt and/or incomplete. Make sure that the application is at a compatible Java(TM) Platform, Enterprise Edition (Java EE) level for the current version of WebSphere(R) Application Server.
com.ibm.websphere.management.application.client.AppDeploymentException: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException: IWAE0069E The archive file [WEB-INF/lib/JDBCTest.jar] has an entry with a path that contains "../". File path [../com/davehay/EmployeeServlet.class] [Root exception is org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException: IWAE0069E The archive file [WEB-INF/lib/JDBCTest.jar] has an entry with a path that contains "../". File path [../com/davehay/EmployeeServlet.class]] 


with: -

...
 FFDC Exception:com.ibm.websphere.management.application.client.AppDeploymentException SourceId:com.ibm.ws.management.application.client.AppInstallHelper.createEarWrapper ProbeId:1059 Reporter:java.lang.Class@9edd8232
com.ibm.websphere.management.application.client.AppDeploymentException: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException: IWAE0069E The archive file [WEB-INF/lib/JDBCTest.jar] has an entry with a path that contains "../". File path [../com/davehay/EmployeeServlet.class] [Root exception is org.eclipse.jst.j2ee.commonarchivecore.internal.exception.ArchiveRuntimeException: IWAE0069E The archive file [WEB-INF/lib/JDBCTest.jar] has an entry with a path that contains "../". File path [../com/davehay/EmployeeServlet.class]]
...

in the FFDC logs.

I am trying to deploy a WAR file that I've hand-cranked myself using IBM Java 1.7 on the command-line ( for many reasons too boring to outline here ! ).

Guess what ?

The exception is bang on: -

/opt/IBM/WebSphere/AppServer/java/bin/jar xvf JDBCTest.jar 

  created: META-INF/
 inflated: META-INF/MANIFEST.MF
 inflated: ../com/davehay/EmployeeServlet.class

This is what I'm trying to use: -

/home/wasadmin/java/JDBCTest/WEB-INF/lib

com
com/davehay
com/davehay/EmployeeServlet.class
META-INF
META-INF/MANIFEST.MF


so I repackaged the JAR file as follows: -

/opt/IBM/WebSphere/AppServer/java/bin/jar cvf JDBCTest.jar .

added manifest
adding: com/(in = 0) (out= 0)(stored 0%)
adding: com/davehay/(in = 0) (out= 0)(stored 0%)
adding: com/davehay/EmployeeServlet.class(in = 2661) (out= 1407)(deflated 47%)
ignoring entry META-INF/
ignoring entry META-INF/MANIFEST.MF

Having fixed the JAR file, I repackaged the WAR using the following file structure: -

META-INF
META-INF/MANIFEST.MF
src
src/com
src/com/davehay
src/com/davehay/EmployeeServlet.java
WEB-INF
WEB-INF/web.xml
WEB-INF/com
WEB-INF/com/davehay
WEB-INF/com/davehay/EmployeeServlet.class
WEB-INF/lib
WEB-INF/lib/JDBCTest.jar


/opt/IBM/WebSphere/AppServer/java/bin/jar cvf JDBCTest.war .

which did the trick.

For the record, I'd normally use Eclipse ( Rational Application Developer, Rational Software Architect etc. ) to create JEE resources, but I'm using Eclipse on Mac OS X with WebSphere Application Server on Linux, and I need the IBM JDK in order to correctly compile a class for WAS ( Eclipse on Mac is using the Oracle SDK which doesn't have all the rich IBM SDK goodness ).

Simples :-)

No comments:

Reminder - installing podman and skopeo on Ubuntu 22.04

This follows on from: - Lest I forget - how to install pip on Ubuntu I had reason to install podman  and skopeo  on an Ubuntu box: - lsb_rel...