0

In the process of migrating my java applications from ANT to Gradle tool My ear application includes jar and war such as like EJB module, web module and util module. I have completed rewriting from build.xml into build.gradle and build successful. ear generated as well. But when I am trying to deploy in WebSphere I am able to deploy the application. The issue is when I start the application in WebSphere am not able to start the application. I am getting below error.

[‎1/‎6/‎2020 6:22 AM]  
[1/6/20 6:20:17:720 EST] 0000009c annotation    W com.ibm.ws.webcontainer.annotation.WASAnnotationHelper collectClasses SRVE8000W: Skipped class that failed to initialize for annotation scanning.
                                 java.lang.ClassNotFoundException: com.manulife.pension.heartbeat.servlet.HeartBeatServlet
    at java.lang.Class.forNameImpl(Native Method)
    at java.lang.Class.forName(Class.java:403)
    at com.ibm.ws.webcontainer.annotation.WASAnn 

I have declared this package com.manulife.pension.heartbeat.servlet.HeartBeatServlet as heartbeat.jar in dependencies in ejb module's build.gradle and ear module build.gradle as well:

implementation(group: 'heartbeat', name: 'heartbeat', version: '1.0')

My heartbeat.jar is added as heartbeat-1.0.jar in Gradle as we know in Maven and Gradle these dependencies are added with versions in names.

When I replace this heartbeat-1.0.jar with heartbeat.jar in deployed ear above error is vanished

Can someone please help me how we can handle these naming issues for dependencies ? should we declare somewhere because the issue is coming at runtime!!

Sandeep Kumar
  • 2,397
  • 5
  • 30
  • 37

1 Answers1

0

See this answer how you can try to determine the right version of JAR.

If you can't determine the right version add JAR to you Gradle project as a local file.

haba713
  • 2,465
  • 1
  • 24
  • 45