WebSphere Application Server & Liberty

 View Only
  • 1.  Failed to publish Enterprise Application due to missing .EAR file

    Posted Fri December 01, 2023 12:01 PM
      |   view attached

    Hello, I'm maintaining a legacy Enterprise Application which unfortunately runs on IBM WebSphere Application Server v. 7.0.0.45. The IDE is IBM RAD and the application consists of two projects: the first one is the web module and the second one the EAR container.

    The issue I'm facing is that whenever I make any change in the web app and then save the source file, RAD first rebuilds the web app and then tries to re-publish the .EAR file to WAS, but the deployment always fails with the error: "Failed to open C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR/MyApplicationEAR.ear", where the shown path is the local git repository for the EAR project, so the project within RAD's workspace points to that source folder. The EAR project actually contains the deployment descriptor (application.xml), so no .EAR file is really generated on the file system within the workspace.

    [28/11/23 11.06.58:301 CET] 0000001c CompositionUn E   WSVR0194E: Composition unit WebSphere:cuname=MyApplicationEAR in BLA WebSphere:blaname=MyApplicationEAR failed to start.
    [28/11/23 11.06.58:703 CET] 0000001c StartDeployme W   Start failed.  ApplicationManager MBean: WebSphere:name=ApplicationManager,process=server1,platform=proxy,node=MYUSERNode03,version=7.0.0.45,type=ApplicationManager,mbeanIdentifier=ApplicationManager,cell=MYUSERNode03Cell,spec=1.0, operation: startApplication, params: [MyApplicationEAR]
    [28/11/23 11.06.58:825 CET] 0000001c AppBinaryProc I   ADMA7021I: Distribution of application MyApplicationEAR completed successfully.
    [28/11/23 11.06.58:701 CET] 0000001c FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files (x86)\IBM\SDP\runtimes\base_v7\profiles\AppSrv03\logs\ffdc\server1_5a085a08_23.11.28_11.06.58.3265338834176421115024.txt com.ibm.ws.management.AdminServiceImpl.invoke 679
    [28/11/23 11.06.58:812 CET] 0000001c FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files (x86)\IBM\SDP\runtimes\base_v7\profiles\AppSrv03\logs\ffdc\server1_5a085a08_23.11.28_11.06.58.7225642279798212295583.txt com.ibm.ws.management.application.sync.StartDeploymentTask.startDeployment 256
    [28/11/23 11.06.58:856 CET] 0000001c FileRepositor A   ADMR0009I: Document cells/MYUSERNode03Cell/applications/MyApplicationEAR.ear/deltas/MyApplicationEAR/delta-1701166016643 is created.
    [28/11/23 11.06.58:864 CET] 00000005 TreeBuilder   W   ODCF0002E: Exception: IWAE0037E Could not open C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR/MyApplicationEAR.ear.
    [28/11/23 11.06.58:871 CET] 0000001c FileRepositor A   ADMR0010I: Document cells/MYUSERNode03Cell/applications/MyApplicationEAR.ear/deployments/MyApplicationEAR/META-INF/ibm-application-runtime.props is modified.
    [28/11/23 11.06.58:877 CET] 0000001c FileRepositor A   ADMR0010I: Document cells/MYUSERNode03Cell/applications/MyApplicationEAR.ear/deployments/MyApplicationEAR/deployment.xml is modified.
    [28/11/23 11.06.59:141 CET] 00000005 FfdcProvider  W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on C:\Program Files (x86)\IBM\SDP\runtimes\base_v7\profiles\AppSrv03\logs\ffdc\server1_552f552f_23.11.28_11.06.58.8782013313554722235215.txt com.ibm.ws.odc.cell.TreeBuilder Removing: /cell/MYUSERNode03Cell/application/MyApplicationEAR<<com.ibm.ws.odc.ODCNodeImpl@1cf21cf2>>
    [28/11/23 11.07.14:292 CET] 00000016 AdminHelper   A   ADMN1009I: An attempt is made to start the MyApplicationEAR application.
    [28/11/23 11.07.14:533 CET] 00000016 CompositionUn A   WSVR0190I: Starting composition unit WebSphere:cuname=MyApplicationEAR in BLA WebSphere:blaname=MyApplicationEAR.
    [28/11/23 11.07.14:560 CET] 00000016 ApplicationMg W   WSVR0100W: An error occurred initializing, MyApplicationEAR
    com.ibm.ws.exception.ConfigurationWarning: Failed to open C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR/MyApplicationEAR.ear
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:580)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:420)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.initializeApplication(ApplicationMgrImpl.java:385)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2073)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:434)
        at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:377)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:648)
        at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.startCompositionUnit(CompositionUnitMgrImpl.java:610)
        at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1203)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:69)
        at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
        at java.lang.reflect.Method.invoke(Method.java:611)
        at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:272)
        at javax.management.modelmbean.RequiredModelMBean$4.run(RequiredModelMBean.java:1152)
        at java.security.AccessController.doPrivileged(AccessController.java:384)
        at com.ibm.oti.security.CheckedAccessControlContext.securityCheck(CheckedAccessControlContext.java:30)
        at sun.misc.JavaSecurityAccessWrapper.doIntersectionPrivilege(JavaSecurityAccessWrapper.java:41)
        at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1146)
        at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:999)
        at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:847)
        at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:783)
        at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:1346)
        at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
        at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:1239)
        at com.ibm.ws.management.connector.AdminServiceDelegator.invoke(AdminServiceDelegator.java:181)
        at com.ibm.ws.management.connector.ipc.CallRouter.route(CallRouter.java:242)
        at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink.doWork(IPCConnectorInboundLink.java:353)
        at com.ibm.ws.management.connector.ipc.IPCConnectorInboundLink$IPCConnectorReadCallback.complete(IPCConnectorInboundLink.java:595)
        at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
        at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
        at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
        at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
        at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
        at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
        at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1662)
    Caused by: org.eclipse.jst.j2ee.commonarchivecore.internal.exception.OpenFailureException: IWAE0037E Could not open C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR/MyApplicationEAR.ear
        at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.primOpenArchive(CommonarchiveFactoryImpl.java:1625)
        at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.openEARFile(CommonarchiveFactoryImpl.java:1204)
        at com.ibm.etools.commonarchive.impl.CommonarchiveFactoryImpl.openEARFile(CommonarchiveFactoryImpl.java:612)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl$MappableContentsArchive.open(DeployedApplicationImpl.java:1707)
        at com.ibm.ws.runtime.component.DeployedApplicationImpl.initialize(DeployedApplicationImpl.java:577)
        ... 41 more
    Caused by: java.io.FileNotFoundException: IWAE0036E URI Name: C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR/MyApplicationEAR.ear; File name: C:\Path_to_Application\xxx_w1_MyApplication\MyApplicationEAR\MyApplicationEAR.ear
        at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.createLoadStrategy(CommonarchiveFactoryImpl.java:514)
        at org.eclipse.jst.j2ee.commonarchivecore.internal.impl.CommonarchiveFactoryImpl.primOpenArchive(CommonarchiveFactoryImpl.java:1619)
        ... 45 more

    No errors are shown in the "Problems" tab, only a number of warnings. Neither are there in the log/console tab, but the FileNotFoundException shown above.

    Both projects were imported from our customer's repository as they are. The application is expected to be successfully redeployed locally, after each change in the source code.

    Enclosed is a screenshot of WAS publishing settings.

    I'm trying to figure out what is missing or misconfigured. Any help would be highly appreciated.



    ------------------------------
    Jack O.
    ------------------------------


  • 2.  RE: Failed to publish Enterprise Application due to missing .EAR file

    Posted Fri December 01, 2023 01:26 PM

    Hi,

    I don't know what exactly could have happened, but maybe I can help.

    First, I'm wondering what type of project import you're doing.  

    When you say:

    >  the shown path is the local git repository for the EAR project, so the project within RAD's workspace points to that source folder. 

    I'm guessing you're using  Import -> General -> Existing Projects Into Workspace  and that the .project file itself is probably committed to source control (Git).   Is that correct?   

    Next, can you show the contents of your deployment.xml  ?  In particular I'm interested in the was.loose.config property.   E.g. I deployed a sample app to WAS V9 and mine looks like:

    $ cat ./DESKTOP-T7KIDCLNode03Cell/applications/HW3.ear/deployments/HW3/deployment.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1701454071651">
        ...
        <properties xmi:id="Property_1701454071651" name="was.loose.config" value="file:/C:/Users/ScottKurz/eclipse-workspace/27e22rad2/.metadata/.plugins/com.ibm.etools.wrd.websphere.v9/looseconfigurations/WebSphereApplicationServertraditionalV9.0atlocalhost/HW3/looseconfig.xmi"/>

    From there can you show the contents of the .../looseconfig.xmi file?

    I think it's normal not to have an .ear file unless you specifically exported one, so not sure why the deployment would be assuming one.  Maybe that could help point in the right direction. 



    ------------------------------
    Scott Kurz
    ------------------------------



  • 3.  RE: Failed to publish Enterprise Application due to missing .EAR file

    Posted Fri December 01, 2023 02:10 PM

    Hi, thank you for your quick reply.

    I'm guessing you're using  Import -> General -> Existing Projects Into Workspace  and that the .project file itself is probably committed to source control (Git).   Is that correct?

    Correct.

    Here is my deployment.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <appdeployment:Deployment xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:appdeployment="http://www.ibm.com/websphere/appserver/schemas/5.0/appdeployment.xmi" xmi:id="Deployment_1701274599737">
      <deployedObject xmi:type="appdeployment:ApplicationDeployment" xmi:id="ApplicationDeployment_1701274599737" deploymentId="0" startingWeight="1" binariesURL="C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR/MyApplicationEAR.ear" useMetadataFromBinaries="true" enableDistribution="false" createMBeansForResources="true" reloadEnabled="false" zeroBinaryCopy="true" appContextIDForSecurity="href:MYUSERNode03Cell/MyApplicationEAR" filePermission=".*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755" allowDispatchRemoteInclude="false" allowServiceRemoteInclude="false" asyncRequestDispatchType="DISABLED">
        <targetMappings xmi:id="DeploymentTargetMapping_1701274599739" enable="true" target="ServerTarget_1701274599739"/>
        <classloader xmi:id="Classloader_1701274599739" mode="PARENT_FIRST">
          <libraries xmi:id="LibraryRef_1701274662995" libraryName="java_libs_app" sharedClassloader="true"/>
        </classloader>
        <modules xmi:type="appdeployment:WebModuleDeployment" xmi:id="WebModuleDeployment_1701274599739" deploymentId="1" startingWeight="10000" uri="MyApplicationWEB.war">
          <targetMappings xmi:id="DeploymentTargetMapping_1701274599740" target="ServerTarget_1701274599739"/>
          <classloader xmi:id="Classloader_1701274599740"/>
        </modules>
        <properties xmi:id="Property_1701274599740" name="metadata.complete" value="true"/>
        <properties xmi:id="Property_1701278072016" name="was.loose.config" value="file:/C:/Path_to_Application/xxx_w1_MyApplication/.metadata/.plugins/com.ibm.etools.wrd.websphere.v7/looseconfigurations/WebSphereApplicationServerv7.0sulocalhost(2)/MyApplicationEAR/looseconfig.xmi"/>
      </deployedObject>
      <deploymentTargets xmi:type="appdeployment:ServerTarget" xmi:id="ServerTarget_1701274599739" name="server1" nodeName="MYUSERNode03"/>
    </appdeployment:Deployment>

    and here is the looseconfig.xmi file:

    <?xml version="1.0" encoding="UTF-8"?>
    <org.eclipse.jst.j2ee.commonarchivecore.looseconfig:LooseApplication xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.eclipse.jst.j2ee.commonarchivecore.looseconfig="commonarchive.looseconfig.xmi" uri="C:\Path_to_Application\xxx_w1_MyApplication\MyApplicationEAR" binariesPath="C:\Path_to_Application\xxx_w1_MyApplication\MyApplicationEAR" resourcesPath="C:\Path_to_Application\xxx_w1_MyApplication\MyApplicationEAR">
      <looseArchives xsi:type="org.eclipse.jst.j2ee.commonarchivecore.looseconfig:LooseWARFile" uri="MyApplicationWEB.war" binariesPath="C:\Path_to_Application\xxx_w1_MyApplication\MyApplicationWEB\WebContent" resourcesPath="C:\Path_to_Application\xxx_w1_MyApplication\MyApplicationWEB\WebContent"/>
    </org.eclipse.jst.j2ee.commonarchivecore.looseconfig:LooseApplication>
    

    Many thanks!



    ------------------------------
    Jack O.
    ------------------------------



  • 4.  RE: Failed to publish Enterprise Application due to missing .EAR file

    Posted Fri December 01, 2023 04:05 PM
    Edited by Scott Kurz Fri December 01, 2023 04:31 PM

    Hmm..so the deployment.xml

    binariesURL="C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR/MyApplicationEAR.ear"

    while the looseconfig.xmi shows:

    binariesPath="C:\Path_to_Application\xxx_w1_MyApplication\MyApplicationEAR" 

    I would've expected these two to have the same value, which would be the latter value from looseconfig.xmi.  

    I still can't really think of what could have gone wrong though, whether it could be some non-default option you've chosen, some other relevant action I didn't think to ask about, or even a bug in RAD or even the app server itself.

    From the location of your looseconfig.xmi, (in the same dir as the app source), I'm guessing you might have done either a "copy" upon import or else created your RAD/Eclipse workspace in the same dir as the app project source.   Still, I can't see why that would matter..just observing.

    Generally you shouldn't be editing deployment.xml, since it's owned by the runtime (as tempting as it might sound to try just doing a hack and editing it yourself). 

    Let me ask you this:  is the process or operation of creating a WebSphere server in Eclipse/RAD something you've done before and are familiar with?  I.e. you generally know how to do it but it isn't working for this one project?



    ------------------------------
    Scott Kurz
    ------------------------------



  • 5.  RE: Failed to publish Enterprise Application due to missing .EAR file

    Posted Sat December 02, 2023 11:58 AM

    Admittedly, I had never worked on a WebSphere server before being assigned to this legacy project, just a few months ago. I do have a rather extensive experience in web development, though I've always worked with other application servers. Unfortunately, my colleagues have no clue about this issue either, since this is a very old "inherited" project and the original devs have quitted long ago...



    ------------------------------
    Jack O.
    ------------------------------



  • 6.  RE: Failed to publish Enterprise Application due to missing .EAR file

    Posted Mon December 04, 2023 03:23 PM

    So by answering that you're experienced in web development I'm assuming you generally have experience in working with Java/Jakarta EE applications in the Eclipse IDE, and are basically familiar with the Servers view, and things like the "Add and Remove..." and/or the Publish operations.   I was only asking wondering if there could be some beginner's mistake you might be tripping over.

    So, I don't know what's going on.   Besides the idea of enlisting RAD support, if you can, I can maybe offer a few ideas to keep you moving

    1.  Try to find some other way to create/import an Eclipse/RAD project with the equivalent contents. 

     I am just guessing here.  You likely could come up with guesses as good as mine on your own.  Perhaps export as an EAR, and them re-import as an EAR without the target runtime?  Maybe delete the .classpath and .settings dir and then import the project with just the .project file into a new workspace??

    Again, I don't know exactly what I'm suggesting here other than to try various things hoping you might stumble upon something that will happen to work around whatever the problem is here.

    2. Switch to the "run resources on Server" setting, i.e. don't use the "loose application" deployment.

    You seem to have used the default publish option "Run server with resources within the workspace" (the English description).    You could try the other option.   It will generally be slower since the tooling will have to zip up the updated classes and make a wsadmin call.   But it's still a lot more convenient than having to export the EAR file and run wsadmin or use the admin console yourself.      Perhaps it's decent enough for you.

    3.   With caveats:  you could try hacking (editing) the deployment.xml to match what I thought the value should be... 

    binariesURL="C:/Path_to_Application/xxx_w1_MyApplication/MyApplicationEAR"

    I should probably warn you that this is generally not something you should be doing in WAS.   This file is managed by the runtime and is not designed to be edited.  The edits can be lost unexpectedly.   There's also some level of risk that by not allowing the tool to manage the deployment as it sees fit you're not allowing it to provide the fidelity to the ultimate production environment that it thinks it's providing... i.e. you might be negating your testing to some small degree.

    Still, I don't see this as a huge concern in this case.  This dev tooling deployment is going to be irrelevant once you deploy to production.   I might not recommend it but will mention it.

    Hope some of that helps.



    ------------------------------
    Scott Kurz
    ------------------------------



  • 7.  RE: Failed to publish Enterprise Application due to missing .EAR file

    Posted Wed December 06, 2023 05:07 AM

    Thank you so much for your support. Regarding your suggestions, actually I've already tried option 2, since it looks closer to the kind of configuration they have in our customer's production environment, but later discarded it due to performance issues (the server was very slow, as you pointed out).

    I also tried to delete and re-import the project several times, but the issue persisted. Maybe I'll give it another try and leave option 3 as a last resort, since I agree that messing with internal configuration files should be generally avoided.



    ------------------------------
    Jack O.
    ------------------------------