Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi module Gradle application failed to deploy into liberty server #766

Open
jagraj opened this issue Jun 24, 2022 · 13 comments
Open

Multi module Gradle application failed to deploy into liberty server #766

jagraj opened this issue Jun 24, 2022 · 13 comments

Comments

@jagraj
Copy link

jagraj commented Jun 24, 2022

I am trying to deploy multi module Gradle application into Liberty server and it is failing to deploy into apps folder.
I followed this documentation and I could not deploy into liberty server.

apply plugin: 'liberty'

dependencies {
    libertyApp 'example:app:1.0'
}

I tried both looseApplication=false and true options and it did not work. Here is my gradle.build file below.

apply plugin: 'liberty'

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = 'Sonatype Nexus Snapshots'
            url = 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
    }
    dependencies {
        classpath 'io.openliberty.tools:liberty-gradle-plugin:3.3.1'
    }
}

description = 'GarageSaleRuntime'
def libertyInstallDir = "C:\\MyData\\LibertyInstalls\\wlp"

dependencies {
  libertyApp project(':GarageSaleLibertyEAR')
  libertyRuntime group: 'com.ibm.websphere.appserver.runtime', name: 'wlp-jakartaee9', version: '22.0.0.5'
}

liberty {
    installDir="${libertyInstallDir}"
    server {
        name = "garageSaleServer"
        serverXmlFile = file('publish/servers/server.xml')
        jvmOptionsFile = file('publish/files/jvm.options')
        configDirectory = file('publish/config')
        looseApplication = false
        stripVersion = true
        stripVersion = true
        	features {
            	name = ["${projectDir}/publish/files/WASPersonaWebServicesHandlerFeature_1.0.0.202110181027.esa"]
            	acceptLicense = true
        	}
    }
}

task copyDB2Jars(type: Copy) {
    from 'publish/databaseDrivers/db2V9Drivers'
    into "${buildDir}/wlp/usr/shared/resources/db2drivers"
} 

task copyJaxRSThirdPartyJars(type: Copy) {
    from 'publish/jaxrsThirdPartyJars'
    into "${buildDir}/wlp/usr/shared/resources/jaxrsThirdPartyJars"
}

task copyMyEAR(type: Copy) {
	from '../GarageSaleLibertyEAR/build/libs/GarageSaleLibertyEAR.ear'
	into "${buildDir}/wlp/usr/servers/garageSaleServer/apps"
}

//libertyCreate.finalizedBy 'copyMyEAR', 'copyDB2Jars', 'copyJaxRSThirdPartyJars'
libertyCreate.finalizedBy 'copyDB2Jars', 'copyJaxRSThirdPartyJars'
build.dependsOn 'deploy'

@mattbsox
Copy link
Member

I did some testing with this project and it seems that there were a couple more pieces needed to get the ear file deployed.

  • Specifying the configuration to use for the libertyApp dependency ->
    libertyApp project(path: ':GarageSaleLibertyEAR', configuration: 'archives')
  • Binding the ear task from GarageSaleLibertyEAR to deploy -> deploy.dependsOn ':GarageSaleLibertyEAR:ear'

@cherylking
Copy link
Member

@jagraj Is this resolved? Can we close the issue?

@jagraj
Copy link
Author

jagraj commented Aug 3, 2022

@cherylking
I got the application deployed with the above changes recommended by Matt. I would like to verify looseApplication=true scenario with multi module projects and this is not working. I was able to verify with liberty maven plugin but I am not able to get it working with Gradle plugin.

@cherylking
Copy link
Member

cherylking commented Aug 3, 2022

@jagraj Multi module support has not been added to the Gradle plugin for dev mode. Issue #625 is open for that. But your scenario does not involve dev mode correct?

@jagraj
Copy link
Author

jagraj commented Jan 9, 2023

@cherylking
Yes, my scenario is not involved with dev mode. My application was working fine with old version of liberty plugin liberty-gradle-plugin:2.1.1-SNAPSHOT and the same app fails to deploy with the latest version of gradle plugin liberty-gradle-plugin:3.3.1 after migrating my application for Jakarta EE9 development.

@cherylking
Copy link
Member

@jagraj We have made some fixes around loose application deployment in recent releases. Would you mind trying our most recent 3.6 version of the plugin and see if it resolves the problem you were seeing?

@jagraj
Copy link
Author

jagraj commented May 24, 2023

@cherylking
Sure, I will rerun my scenario early next week and get back to you. I have been working on other releases this week. Thanks for the fixes.

@jagraj
Copy link
Author

jagraj commented Sep 17, 2024

I built my application with io.openliberty.tools:liberty-gradle-plugin:3.8.3 version to see if I can get my application working with the looseApplication=true which is a default option. I don't see application is deployed in apps folder with the .xml file how we deploy for maven plugin case. I do see improvements for deploying liberty user features in the latest plugin.

liberty-gradle-lugin deployment.
image

liberty-maven-plugin deployment.
image

@cherylking
Copy link
Member

@jagraj What messages are in the terminal/console from the Liberty Gradle plugin when trying to deploy this app using looseApplication=true?

@jagraj
Copy link
Author

jagraj commented Sep 17, 2024

@cherylking
Here is the information from the console when I execute deploy libertyTask.

Working Directory: C:\MyData\MyLibertyToolsWorkspaces\GarageSale\garageSale-ee
Gradle user home: C:\Users\Administrator\.gradle
Gradle Distribution: Gradle wrapper from target build
Gradle Version: 7.6.4
Java Home: C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: deploy

> Task :CreditCardDBJPA:compileJava UP-TO-DATE
> Task :CreditCardDBJPA:processResources UP-TO-DATE
> Task :CreditCardDBJPA:classes UP-TO-DATE
> Task :CreditCardDBJPA:jar UP-TO-DATE
> Task :CreditCardEJB:compileJava UP-TO-DATE
> Task :CreditCardEJB:processResources UP-TO-DATE
> Task :CreditCardEJB:classes UP-TO-DATE
> Task :CreditCardEJB:jar UP-TO-DATE
> Task :GarageSaleDBJPA:compileJava UP-TO-DATE
> Task :GarageSaleDBJPA:processResources UP-TO-DATE
> Task :GarageSaleDBJPA:classes UP-TO-DATE
> Task :GarageSaleDBJPA:jar UP-TO-DATE
> Task :GarageSaleWSClient:compileJava UP-TO-DATE
> Task :GarageSaleWSClient:processResources UP-TO-DATE
> Task :GarageSaleWSClient:classes UP-TO-DATE
> Task :GarageSaleWSClient:jar UP-TO-DATE
> Task :WSBankDBJPA:compileJava UP-TO-DATE
> Task :WSBankDBJPA:processResources UP-TO-DATE
> Task :WSBankDBJPA:classes UP-TO-DATE
> Task :WSBankDBJPA:jar UP-TO-DATE
> Task :WSBankEJB:compileJava UP-TO-DATE
> Task :WSBankEJB:processResources UP-TO-DATE
> Task :WSBankEJB:classes UP-TO-DATE
> Task :WSBankEJB:jar UP-TO-DATE
> Task :GarageSaleEJB:compileJava UP-TO-DATE
> Task :GarageSaleEJB:processResources UP-TO-DATE
> Task :GarageSaleEJB:classes UP-TO-DATE
> Task :GarageSaleEJB:jar UP-TO-DATE
> Task :GarageSaleLibertyEAR:compileJava NO-SOURCE
> Task :GarageSaleLibertyEAR:processResources NO-SOURCE
> Task :GarageSaleLibertyEAR:classes UP-TO-DATE
> Task :GarageSaleCDIExtensions:compileJava UP-TO-DATE
> Task :GarageSaleCDIExtensions:processResources UP-TO-DATE
> Task :GarageSaleCDIExtensions:classes UP-TO-DATE
> Task :GarageSaleCDIExtensions:jar UP-TO-DATE
> Task :ProdReviewTaxShipRateEJB:compileJava UP-TO-DATE
> Task :ProdReviewTaxShipRateEJB:processResources UP-TO-DATE
> Task :ProdReviewTaxShipRateEJB:classes UP-TO-DATE
> Task :ProdReviewTaxShipRateEJB:jar UP-TO-DATE
> Task :GSjsf40LibertyWeb:compileJava UP-TO-DATE
> Task :GSjsf40LibertyWeb:processResources NO-SOURCE
> Task :GSjsf40LibertyWeb:classes UP-TO-DATE
> Task :GSjsf40LibertyWeb:war UP-TO-DATE
> Task :WASPersonaWebServicesHandlerAPI:compileJava UP-TO-DATE
> Task :WASPersonaWebServicesHandlerAPI:processResources NO-SOURCE
> Task :WASPersonaWebServicesHandlerAPI:classes UP-TO-DATE
> Task :WASPersonaWebServicesHandlerAPI:jar UP-TO-DATE
> Task :WASPersonaWebServicesPMIWeb:compileJava UP-TO-DATE
> Task :WASPersonaWebServicesPMIWeb:processResources NO-SOURCE
> Task :WASPersonaWebServicesPMIWeb:classes UP-TO-DATE
> Task :WASPersonaWebServicesPMIWeb:war UP-TO-DATE
> Task :GarageSaleLibertyEAR:ear UP-TO-DATE
> Task :GarageSaleRuntimeUtil:installLiberty UP-TO-DATE
> Task :GarageSaleRuntimeUtil:libertyCreate UP-TO-DATE
> Task :GarageSaleRuntimeUtil:installFeature
> Task :GarageSaleRuntimeUtil:copyJaxRSThirdPartyJars UP-TO-DATE
> Task :GarageSaleRuntimeUtil:copyDB2Jars UP-TO-DATE

> Task :GarageSaleRuntimeUtil:deploy
Application GarageSaleLibertyEAR.ear was installed as a file as specified. To install as a loose application, specify the plugin or task generating the archive. 

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6.4/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 9s
40 actionable tasks: 2 executed, 38 up-to-date

@cherylking
Copy link
Member

cherylking commented Sep 17, 2024

@jagraj I think you spoke to Matt about this already, but this part of the console messages is key:

Task :GarageSaleRuntimeUtil:deploy
Application GarageSaleLibertyEAR.ear was installed as a file as specified. To install as a loose application, specify the plugin or task generating the archive.

If the ear application is not built by the project that our plugin is run on, it cannot build/install as a loose application.

@jagraj
Copy link
Author

jagraj commented Sep 20, 2024

I tried my application to deploy with the looseApplication = true option with the following workaround recommended by @mattbsox from GarageSaleRuntimeUtil project where I have all the server configuration files defined.

liberty {
    //installDir="${libertyInstallDir}"
    server {
        name = "garageSaleServer"
        serverXmlFile = file('publish/servers/server.xml')
        jvmOptionsFile = file('publish/files/dev/jvm.options')
        configDirectory = file('publish/config')
        deploy {
            //assuming ear application is already configured in the server.xml
            apps = [tasks.getByPath(':GarageSaleLibertyEAR:ear')]
        }        
        looseApplication = true
        stripVersion = true
        	features {
            	name = ["${projectDir}/publish/files/WASPersonaWebServicesHandlerFeature-1.0.0-SNAPSHOT.esa"]
            	acceptLicense = true
        	}
    }
}

After the application is deployed then I started liberty server, I am getting following class loader problems.

------Start of DE processing------ = [9/19/24, 8:56:55:040 EDT]
Exception = java.lang.NoClassDefFoundError
Source = com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredFields
probeid = 249
Stack Dump = java.lang.NoClassDefFoundError: com/ibm/websphere/svt/gs/gsdb/jaxws/client/GarageSaleStoreManagerLocal
	at java.base/java.lang.Class.getDeclaredFields0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3297)
	at java.base/java.lang.Class.getDeclaredFields(Class.java:2371)
	at com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredFields(InjectionProcessorManager.java:392)
	at com.ibm.ws.injectionengine.InjectionProcessorManager.processAnnotations(InjectionProcessorManager.java:217)
	at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMetaData(AbstractInjectionEngine.java:482)
	at com.ibm.ws.injectionengine.osgi.internal.OSGiInjectionEngineImpl.processInjectionMetaData(OSGiInjectionEngineImpl.java:242)
	at com.ibm.ws.injectionengine.ReferenceContextImpl.processImpl(ReferenceContextImpl.java:590)
	at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceContextImpl.java:289)
	at com.ibm.ws.injectionengine.osgi.internal.OSGiReferenceContextImpl.process(OSGiReferenceContextImpl.java:32)
	at com.ibm.ws.cdi.impl.weld.WebSphereCDIDeploymentImpl.initializeInjectionServices(WebSphereCDIDeploymentImpl.java:666)
	at com.ibm.ws.cdi.impl.CDIContainerImpl.startInitialization(CDIContainerImpl.java:153)
	at com.ibm.ws.cdi.liberty.CDIRuntimeImpl.applicationStarting(CDIRuntimeImpl.java:479)
	at com.ibm.ws.container.service.state.internal.ApplicationStateManager.fireStarting(ApplicationStateManager.java:53)
	at com.ibm.ws.container.service.state.internal.StateChangeServiceImpl.fireApplicationStarting(StateChangeServiceImpl.java:52)
	at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.preDeployApp(SimpleDeployedAppInfoBase.java:550)
	at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.installApp(SimpleDeployedAppInfoBase.java:511)
	at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:625)
	at com.ibm.ws.app.manager.ear.internal.EARApplicationHandlerImpl.install(EARApplicationHandlerImpl.java:79)
	at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:199)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1369)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:912)
	at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:298)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.svt.gs.gsdb.jaxws.client.GarageSaleStoreManagerLocal
	at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:751)
	at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:327)
	at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:705)
	at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:584)
	at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:553)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 26 more

Dump of callerThis
null
==> Performing default dump from com.ibm.ws.injectionengine.ffdc.InjectionDiagnosticModule  = Thu Sep 19 08:56:55 EDT 2024
 = *** Start InjectionDiagnosticModule Dump ***
 = > InjectionDiagnosticModule: dump Object array : 2
 = 
 =    Non-Formattable :
 =       > java.lang.Class@3dbae3bf
 =            class com.ibm.websphere.svt.gs.gsjsfweb.GarageSaleJSFActions
 =       > java.lang.Class@3dbae3bf
 =            class com.ibm.websphere.svt.gs.gsjsfweb.GarageSaleJSFActions
 = < InjectionDiagnosticModule: dump Object array complete
 = 
 = *** Start InjectionEngine Dump    ---> com.ibm.ws.injectionengine.osgi.internal.OSGiInjectionEngineImpl@5f4bee32
 = 
 =    Default Factories : 
 =       Indirect    = com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupReferenceFactoryImpl@11cda62f
 =       ResIndirect = com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupReferenceFactoryImpl@63822f12
 =       ResRef      = com.ibm.ws.injectionengine.osgi.internal.ResRefReferenceFactoryImpl@a98e0a8
 =       ResAuto     = com.ibm.ws.injectionengine.osgi.internal.ResAutoLinkReferenceFactoryImpl@aa2a5b7
 =       EJBLink     = com.ibm.ws.injectionengine.osgi.internal.EJBLinkReferenceFactoryImpl@76a28612
 =       MBLink      = com.ibm.ws.injectionengine.factory.MBLinkReferenceFactoryImpl@42add6b
 = 
 =    Actual Factories : 
 =       com.ibm.ws.ejbcontainer.injection.factory.MBLinkReferenceFactoryImpl@497af0e6
 = 
 =    Registered Processors : 
 =       jakarta.inject.Inject : com.ibm.ws.cdi.impl.inject.InjectProcessorProvider@56ea6b63
 =       jakarta.xml.ws.WebServiceRef : com.ibm.ws.jaxws.client.injection.WebServiceRefProcessorProvider@349ae5ba
 =       jakarta.persistence.PersistenceContext : com.ibm.ws.jpa.container.osgi.internal.JPAPCtxtProcessorProvider@6689b7c7
 =       jakarta.persistence.PersistenceUnit : com.ibm.ws.jpa.container.osgi.internal.JPAPUnitProcessorProvider@78ea8630
 =       jakarta.ejb.EJB : com.ibm.ws.ejb.injection.processor.EJBProcessorProvider@7d5e5b3d
 =       jakarta.enterprise.concurrent.ContextServiceDefinition : io.openliberty.concurrent.internal.processor.ContextServiceDefinitionProvider@1e8ac619
 =       jakarta.enterprise.concurrent.ManagedScheduledExecutorDefinition : io.openliberty.concurrent.internal.processor.ManagedScheduledExecutorDefinitionProvider@35966d80
 =       jakarta.annotation.sql.DataSourceDefinition : com.ibm.ws.injectionengine.processor.DataSourceDefinitionProcessorProvider@19e1a604
 =       jakarta.annotation.Resource : com.ibm.ws.injectionengine.processor.ResourceProcessorProvider@166991b6
 =       jakarta.enterprise.concurrent.ManagedExecutorDefinition : io.openliberty.concurrent.internal.processor.ManagedExecutorDefinitionProvider@5e1b276c
 =       jakarta.enterprise.concurrent.ManagedThreadFactoryDefinition : io.openliberty.concurrent.internal.processor.ManagedThreadFactoryDefinitionProvider@58e7ab42
 = 
 =    Registered Object Factories : 
 = 
 =    Registered No-Override Object Factories : 
 =       jakarta.annotation.Resource
 =          com.ibm.websphere.ejbcontainer.MessageDrivenContextExtension : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@4c22e7dc[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.ejb.MessageDrivenContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@169c3bcf[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.validation.Validator : com.ibm.ws.beanvalidation.ValidatorObjectFactoryInfo@11bb4e37
 =          jakarta.enterprise.inject.spi.BeanManager : com.ibm.ws.cdi.jndi.liberty.BeanManagerObjectFactoryInfo@74e35af9
 =          jakarta.transaction.UserTransaction : com.ibm.ws.transaction.services.TransactionObjectFactoryInfo@2f244fbe
 =          com.ibm.websphere.ejbcontainer.SessionContextExtension : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@58115bd6[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.validation.ValidatorFactory : com.ibm.ws.beanvalidation.ValidatorFactoryObjectFactoryInfo@13907c15
 =          com.ibm.wsspi.uow.UOWManager : com.ibm.ws.transaction.services.UOWManagerObjectFactoryInfo@7dcac80c
 =          com.ibm.websphere.ejbcontainer.EJBContextExtension : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@701e31b4[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.ejb.TimerService : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@22831b8a[class com.ibm.ws.ejbcontainer.injection.factory.TimerServiceObjectFactory, null]
 =          jakarta.xml.ws.WebServiceContext : com.ibm.ws.jaxws.injection.WebServiceContextObjectFactoryInfo@32e3bb1b
 =          jakarta.ejb.EJBContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@19c29fe3[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.ejb.EntityContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@18d08efe[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.transaction.TransactionSynchronizationRegistry : com.ibm.ws.transaction.services.TransactionSynchronizationRegistryObjectFactoryInfo@22b59925
 =          jakarta.ejb.SessionContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@da1c50b[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 = 
 =    Registered Override Reference Factories : 
 = 
 =    Registered MetaDataListeners : 
 =       com.ibm.ws.cdi.impl.CDIContainerImpl@117edb
 =       com.ibm.ws.jaxws.support.JaxWsInjectionMetaDataListener@1c2ab759
 =       com.ibm.ws.ejbcontainer.osgi.internal.EJBRuntimeImpl@12d87948
 = 
 =    isEmbeddable    : false
 = 
 = *** InjectionEngine Dump Complete ***
 = 
 = *** InjectionDiagnosticModule Dump Complete ***
+ Data for directive [Default] obtained. = 
==> Dump complete for com.ibm.ws.injectionengine.ffdc.InjectionDiagnosticModule  = Thu Sep 19 08:56:55 EDT 2024

@jagraj
Copy link
Author

jagraj commented Sep 20, 2024

I moved all my Liberty configuration build tasks to GarageSaleLibertyEAR project where I am building my ear project, I am getting same class loader problems.

apply plugin: 'ear'
apply plugin: 'liberty'

buildscript {
    repositories {
        mavenCentral()
        maven {
            name = 'Sonatype Nexus Snapshots'
            url = 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
    }
    dependencies {
        classpath 'io.openliberty.tools:liberty-gradle-plugin:3.8.3'
    }
}

def libertyInstallDir = "C:\\MyData\\LibertyInstalls\\wlp"
def serverConfigProject = "${project.rootDir}/GarageSaleRuntimeUtil"


description = ''
dependencies {
  earlib project(path: ':CreditCardDBJPA', configuration:'archives')
  deploy project(':CreditCardEJB')
  earlib project(path: ':WSBankDBJPA', configuration:'archives')
  deploy project(':WSBankEJB')
  earlib project(path: ':GarageSaleWSClient', configuration:'archives')
  earlib project(path: ':WASPersonaWebServicesHandlerAPI', configuration:'archives')
  earlib project(path: ':GarageSaleDBJPA', configuration:'archives')
  deploy project(':GarageSaleEJB')
  //deploy project(':ProdReviewTaxShipRateEJB')
  deploy project(path:':WASPersonaWebServicesPMIWeb', configuration:'archives')
  deploy project(path:':GSjsf40LibertyWeb', configuration:'archives')
  libertyRuntime group: 'com.ibm.websphere.appserver.runtime', name: 'wlp-jakartaee10', version: '24.0.0.9'
}

archivesBaseName = 'GarageSaleLibertyEAR'

ear {
  
   manifest {
      attributes 'Implementation-Title': 'GarageSaleLibertyEAR 10'
   }
   appDirName 'src/main/app'
   libDirName 'lib'
   archiveName="$baseName.$extension"
}

liberty {
    //installDir="${libertyInstallDir}"
    server {
        name = "garageSaleServer"
        serverXmlFile = file("${serverConfigProject}/publish/servers/server.xml")
        jvmOptionsFile = file("${serverConfigProject}/publish/files/dev/jvm.options")
        configDirectory = file("${serverConfigProject}/publish/config")
        deploy {
            //assuming ear application is already configured in the server.xml
            apps = [ear]
        }        
        looseApplication = true
        stripVersion = true
        	features {
            	name = ["${serverConfigProject}/publish/files/WASPersonaWebServicesHandlerFeature-1.0.0-SNAPSHOT.esa"]
            	acceptLicense = true
        	}
    }
}


task copyDB2Jars(type: Copy) {
    from "${serverConfigProject}/publish/databaseDrivers/db2V9Drivers"
    into "${buildDir}/wlp/usr/shared/resources/db2drivers"
} 

task copyJaxRSThirdPartyJars(type: Copy) {
    from "${serverConfigProject}/publish/jaxrsThirdPartyJars"
    into "${buildDir}/wlp/usr/shared/resources/jaxrsThirdPartyJars"
}

task copyMyEAR(type: Copy) {
	from "../GarageSaleLibertyEAR/build/libs/GarageSaleLibertyEAR.ear"
	into "${buildDir}/wlp/usr/servers/garageSaleServer/apps"
}

//task debugLog { project.logger.lifecycle("${serverConfigProject}") }
//deploy.dependsOn tasks.debugLog 
//libertyCreate.finalizedBy 'copyMyEAR', 'copyDB2Jars', 'copyJaxRSThirdPartyJars'
libertyCreate.finalizedBy 'copyDB2Jars', 'copyJaxRSThirdPartyJars'
//installFeature.dependsOn 'libertyCreate'
//deploy.dependsOn ':GarageSaleLibertyEAR:ear'
deploy.dependsOn 'ear'
build.dependsOn 'deploy'

------Start of DE processing------ = [9/20/24, 11:23:01:641 EDT]
Exception = java.lang.NoClassDefFoundError
Source = com.ibm.wsspi.injectionengine.MethodMap.getAllDeclaredMethods
probeid = 106
Stack Dump = java.lang.NoClassDefFoundError: com/ibm/websphere/svt/gs/gsdb/jaxws/client/GarageSaleStoreManagerLocal
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
	at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504)
	at com.ibm.wsspi.injectionengine.MethodMap.getMethods(MethodMap.java:150)
	at com.ibm.wsspi.injectionengine.MethodMap.getAllDeclaredMethods(MethodMap.java:86)
	at com.ibm.ws.injectionengine.InjectionProcessorManager.getAllDeclaredMethods(InjectionProcessorManager.java:446)
	at com.ibm.ws.injectionengine.InjectionProcessorManager.processAnnotations(InjectionProcessorManager.java:232)
	at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMetaData(AbstractInjectionEngine.java:482)
	at com.ibm.ws.injectionengine.osgi.internal.OSGiInjectionEngineImpl.processInjectionMetaData(OSGiInjectionEngineImpl.java:242)
	at com.ibm.ws.injectionengine.ReferenceContextImpl.processImpl(ReferenceContextImpl.java:590)
	at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceContextImpl.java:289)
	at com.ibm.ws.injectionengine.osgi.internal.OSGiReferenceContextImpl.process(OSGiReferenceContextImpl.java:32)
	at com.ibm.ws.cdi.impl.weld.WebSphereCDIDeploymentImpl.initializeInjectionServices(WebSphereCDIDeploymentImpl.java:666)
	at com.ibm.ws.cdi.impl.CDIContainerImpl.startInitialization(CDIContainerImpl.java:153)
	at com.ibm.ws.cdi.liberty.CDIRuntimeImpl.applicationStarting(CDIRuntimeImpl.java:479)
	at com.ibm.ws.container.service.state.internal.ApplicationStateManager.fireStarting(ApplicationStateManager.java:53)
	at com.ibm.ws.container.service.state.internal.StateChangeServiceImpl.fireApplicationStarting(StateChangeServiceImpl.java:52)
	at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.preDeployApp(SimpleDeployedAppInfoBase.java:550)
	at com.ibm.ws.app.manager.module.internal.SimpleDeployedAppInfoBase.installApp(SimpleDeployedAppInfoBase.java:511)
	at com.ibm.ws.app.manager.module.internal.DeployedAppInfoBase.deployApp(DeployedAppInfoBase.java:625)
	at com.ibm.ws.app.manager.ear.internal.EARApplicationHandlerImpl.install(EARApplicationHandlerImpl.java:79)
	at com.ibm.ws.app.manager.internal.statemachine.StartAction.execute(StartAction.java:199)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.enterState(ApplicationStateMachineImpl.java:1369)
	at com.ibm.ws.app.manager.internal.statemachine.ApplicationStateMachineImpl.run(ApplicationStateMachineImpl.java:912)
	at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:298)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ClassNotFoundException: com.ibm.websphere.svt.gs.gsdb.jaxws.client.GarageSaleStoreManagerLocal
	at com.ibm.ws.classloading.internal.AppClassLoader.findClassCommonLibraryClassLoaders(AppClassLoader.java:751)
	at com.ibm.ws.classloading.internal.AppClassLoader.findClass(AppClassLoader.java:327)
	at com.ibm.ws.classloading.internal.AppClassLoader.findOrDelegateLoadClass(AppClassLoader.java:705)
	at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:584)
	at com.ibm.ws.classloading.internal.AppClassLoader.loadClass(AppClassLoader.java:553)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	... 28 more

Dump of callerThis
null
==> Performing default dump from com.ibm.ws.injectionengine.ffdc.InjectionDiagnosticModule  = Fri Sep 20 11:23:01 EDT 2024
 = *** Start InjectionDiagnosticModule Dump ***
 = > InjectionDiagnosticModule: dump Object array : 3
 = 
 =    Non-Formattable :
 =       > java.lang.Class@2d866882
 =            class pagecode.Index
 =       > java.lang.Class@2d866882
 =            class pagecode.Index
 =       > java.util.LinkedHashSet@31772a17
 =            []
 = < InjectionDiagnosticModule: dump Object array complete
 = 
 = *** Start InjectionEngine Dump    ---> com.ibm.ws.injectionengine.osgi.internal.OSGiInjectionEngineImpl@5f292ecd
 = 
 =    Default Factories : 
 =       Indirect    = com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupReferenceFactoryImpl@2ec1337f
 =       ResIndirect = com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupReferenceFactoryImpl@2a623f68
 =       ResRef      = com.ibm.ws.injectionengine.osgi.internal.ResRefReferenceFactoryImpl@5c490b0a
 =       ResAuto     = com.ibm.ws.injectionengine.osgi.internal.ResAutoLinkReferenceFactoryImpl@4a800908
 =       EJBLink     = com.ibm.ws.injectionengine.osgi.internal.EJBLinkReferenceFactoryImpl@6dfd91ec
 =       MBLink      = com.ibm.ws.injectionengine.factory.MBLinkReferenceFactoryImpl@565f7a44
 = 
 =    Actual Factories : 
 =       com.ibm.ws.ejbcontainer.injection.factory.MBLinkReferenceFactoryImpl@42da3ade
 = 
 =    Registered Processors : 
 =       jakarta.enterprise.concurrent.ContextServiceDefinition : io.openliberty.concurrent.internal.processor.ContextServiceDefinitionProvider@858a3c4
 =       jakarta.persistence.PersistenceUnit : com.ibm.ws.jpa.container.osgi.internal.JPAPUnitProcessorProvider@9ab31d2
 =       jakarta.xml.ws.WebServiceRef : com.ibm.ws.jaxws.client.injection.WebServiceRefProcessorProvider@248be7f9
 =       jakarta.persistence.PersistenceContext : com.ibm.ws.jpa.container.osgi.internal.JPAPCtxtProcessorProvider@3794357c
 =       jakarta.ejb.EJB : com.ibm.ws.ejb.injection.processor.EJBProcessorProvider@7a9fe6c9
 =       jakarta.annotation.Resource : com.ibm.ws.injectionengine.processor.ResourceProcessorProvider@2aea7de9
 =       jakarta.inject.Inject : com.ibm.ws.cdi.impl.inject.InjectProcessorProvider@51a5f362
 =       jakarta.enterprise.concurrent.ManagedExecutorDefinition : io.openliberty.concurrent.internal.processor.ManagedExecutorDefinitionProvider@478c13ff
 =       jakarta.enterprise.concurrent.ManagedThreadFactoryDefinition : io.openliberty.concurrent.internal.processor.ManagedThreadFactoryDefinitionProvider@42201c69
 =       jakarta.annotation.sql.DataSourceDefinition : com.ibm.ws.injectionengine.processor.DataSourceDefinitionProcessorProvider@3bdc24f1
 =       jakarta.enterprise.concurrent.ManagedScheduledExecutorDefinition : io.openliberty.concurrent.internal.processor.ManagedScheduledExecutorDefinitionProvider@459cee0b
 = 
 =    Registered Object Factories : 
 = 
 =    Registered No-Override Object Factories : 
 =       jakarta.annotation.Resource
 =          jakarta.enterprise.inject.spi.BeanManager : com.ibm.ws.cdi.jndi.liberty.BeanManagerObjectFactoryInfo@62a80eac
 =          jakarta.xml.ws.WebServiceContext : com.ibm.ws.jaxws.injection.WebServiceContextObjectFactoryInfo@202985c4
 =          jakarta.ejb.SessionContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@7a88c69c[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.ejb.EntityContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@58468370[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.ejb.EJBContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@7a392bba[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          com.ibm.wsspi.uow.UOWManager : com.ibm.ws.transaction.services.UOWManagerObjectFactoryInfo@16d2869c
 =          jakarta.transaction.TransactionSynchronizationRegistry : com.ibm.ws.transaction.services.TransactionSynchronizationRegistryObjectFactoryInfo@2ad20efc
 =          com.ibm.websphere.ejbcontainer.EJBContextExtension : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@466355d5[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.transaction.UserTransaction : com.ibm.ws.transaction.services.TransactionObjectFactoryInfo@75b4d258
 =          jakarta.ejb.MessageDrivenContext : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@77505c14[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          jakarta.ejb.TimerService : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@4d4f19ec[class com.ibm.ws.ejbcontainer.injection.factory.TimerServiceObjectFactory, null]
 =          jakarta.validation.Validator : com.ibm.ws.beanvalidation.ValidatorObjectFactoryInfo@115e306d
 =          jakarta.validation.ValidatorFactory : com.ibm.ws.beanvalidation.ValidatorFactoryObjectFactoryInfo@42ab060c
 =          com.ibm.websphere.ejbcontainer.SessionContextExtension : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@37ee52b1[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 =          com.ibm.websphere.ejbcontainer.MessageDrivenContextExtension : com.ibm.ws.injectionengine.ObjectFactoryInfoImpl@2dbadd9[class com.ibm.ws.ejbcontainer.injection.factory.EJBContextObjectFactory, null]
 = 
 =    Registered Override Reference Factories : 
 = 
 =    Registered MetaDataListeners : 
 =       com.ibm.ws.cdi.impl.CDIContainerImpl@62e638b7
 =       com.ibm.ws.jaxws.support.JaxWsInjectionMetaDataListener@78e7c981
 =       com.ibm.ws.ejbcontainer.osgi.internal.EJBRuntimeImpl@3dd977f6
 = 
 =    isEmbeddable    : false
 = 
 = *** InjectionEngine Dump Complete ***
 = 
 = *** InjectionDiagnosticModule Dump Complete ***
+ Data for directive [Default] obtained. = 
==> Dump complete for com.ibm.ws.injectionengine.ffdc.InjectionDiagnosticModule  = Fri Sep 20 11:23:01 EDT 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants