TIBCOSoftware / bw6-plugin-maven

Plug-in Code for Apache Maven and TIBCO ActiveMatrix BusinessWorks™
Other
65 stars 78 forks source link

Failed to execute goal com.tibco.plugins:bw6-maven-plugin:2.7.0:bwmodule (default-bwmodule) on project <>: Execution default-bwmodule of goal com.tibco.plugins:bw6-maven-plugin:2.7.0:bwmodule failed.: NullPointerException #502

Closed bibhuduttaGitHub closed 3 years ago

bibhuduttaGitHub commented 4 years ago

Maven Plugin version: 2.7.0

Maven version:3.6.3

Product : Either of TIBCO ActiveMatrix Businessworks 6 OR TIBCO Businessworks Container edition

Product version:TIBCO Businessworks Container edition 2.5.4

Component: Either of Maven Eclipse Plugin or Maven build plugin

Steps to reproduce the issue:

  1. Project has 2 dependent jars (poi3.7.jar and plugin.jar)and mysql java connector jar and sqljdbc.jar in classpath
  2. All the 4 above jars are declared as dependency to the BW module's pom.xml.
  3. During mvn --f .application.parent/pom.xml -X -e clean package pom_xml

Additional environment details if any:

Describe the results you received: [INFO] Reactor Summary for <>.application.parent 1.0.12-SNAPSHOT: [INFO] [INFO] <>.application.parent ........... SUCCESS [ 0.946 s] [INFO] <>.............................. FAILURE [ 23.219 s] [INFO] <>.application .................. SKIPPED [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 01:52 min [INFO] Finished at: 2020-09-22T10:52:06-07:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.tibco.plugins:bw6-maven-plugin:2.7.0:bwmodule (default-bwmodule) on project <>: Execution default-bwmodule of goal com.tibco.plugins:bw6-maven-plugin:2.7.0:bwmodule failed.: NullPointerException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.tibco.plugins:bw6-maven-plugin:2.7.0:bwmodule (default-bwmodule) on project

Describe the results you expected: it should ideally build the package.

Additional information you deem important (e.g. issue happens only occasionally):

vpawar-tibco commented 4 years ago

Hi @bibhuduttaGitHub

bibhuduttaGitHub commented 4 years ago

HI Vishal, Thanks for the response. I am using JFrog as my central maven. So the "groupid" and 'artifactid" that you see in the POM, is autogenerated by JFrog upon uploading the jar to JFrog. I am copying the same dependency snippet from JFrog and adding to my POM. I could see the same jars are available in my m2 home as well. I have attached the debug log of the mvn clean package to check further. mvn_build_error.txt Poi

vpawar-tibco commented 4 years ago

Hi @bibhuduttaGitHub, Thanks for sharing debug logs. It seems the maven plugin was unable to parse MANIFEST.MF for one of the dependency jar file. Could you inspect those jars?

bibhuduttaGitHub commented 4 years ago

Any specific thing i need to look for? Any pointers will be helpful.

bibhuduttaGitHub commented 4 years ago

HI Vishal, Appreciate your response on this. As these jars were used in the BW 5.x and we never had issues. Just wondering how we mvn is finding issues with respect to MANIFEST.MF.. Is there any tool where we can validate the MANIFEST file? Even if it validates how do we ensure it does the validation correctly.

vpawar-tibco commented 3 years ago

Hi @bibhuduttaGitHub, Maven plugin reads Manifest.mf file from each dependency jar to understand if it is a shared module or other library. Based on the debug logs shared by you, It was able to parse the manifest and add it as dependency for sqljdbc4.jar file, but failed for the next one.

[DEBUG] Dependency added with name /usr2/<>/.m2/repository/sqljdbc4/sqljdbc4/sqljdbc4/sqljdbc4-sqljdbc4.jar

You can check if jar file is not corrupted. Unzip the jars in a temporary folder and check if the manifest.mf file is located at META-INF\MANIFEST.MF. Open the MANIFEST.MF file and check its contents. Also please share more details on plugins.jar. Thanks.

bibhuduttaGitHub commented 3 years ago

HI Vishal, i could find the MANIFEST.MF file in the correct folder structure in the jar. However, i am not sure if anything wrng with the manifet file. I don't think jar is corrupted, because i can unzip the jar and it explodes correctly. I have attached all the 4 manifest. Please take a look and let me know if anything wrong. FYI: i .ve renamed them as .log. MANIFEST.log MANIFEST.log MANIFEST.log MANIFEST.log

bibhuduttaGitHub commented 3 years ago

HI Vishal, Did you get a chance to verify the manifest.

vpawar-tibco commented 3 years ago

Hi @bibhuduttaGitHub, Please share the project and dependency jars to reproduce the issue. You can share the artifacts via TIBCO support case and mention the support case number here.

bibhuduttaGitHub commented 3 years ago

Case #01895887 . Please check.

vpawar-tibco commented 3 years ago

Hi @bibhuduttaGitHub , The plugins.jar has issues. You can verify the same by executing the command -

jar tf plugins.jar.

The META-INF/MANIFEST.MF is the last entry in the output. The JarInputStream.getManifest() expects the Manifest file entry at first or second line in the ouput. It returns null otherwise. Please refer below links for more details -

JDK Issue - JDK-4338238 JarInputStream.java (Line no. 79)

Please regenerate the plugins.jar. Thanks.

bibhuduttaGitHub commented 3 years ago

HI Vishal, thanks for the update. How i can make the Manifest entry to be the first/2nd entry? we don't build this jar. We get it from migration, we are not sure who created and how. Can you help.

vpawar-tibco commented 3 years ago

Hi @bibhuduttaGitHub, This link may help. But it is always recommended to fix the issue while exporting the jar.

bibhuduttaGitHub commented 3 years ago

Thanks Vishal, I was able to resolve the issue after rebuilding the jar and packaging MANIFEST.MF as a first file to package. BTW, should it be reported as a BUG? As its not mandatory to include the MANIFEST.MF file as a first/second file in your jar packaging.

vpawar-tibco commented 3 years ago

Hi @bibhuduttaGitHub, From the reference links shared in my earlier responses, MANIFEST.MF entry on first/second line is constraint required from JDK while packaging the jar. It is not an issue with bw6 maven plugin.

bibhuduttaGitHub commented 3 years ago

So, what is the way to identify which jar has the issue? Do we have to manually do a jar tf for each jar and see the output to identify the null pointer exception? The bw maven plugin output does not give much info at which its failing though.

rillo-carrillo commented 2 years ago

Hi tibco team,

I'm having the same issue with a jar from maven repository, based on the description shared on this issue, seems the jar was not generated as per the JDK constraints hence the META-INF/MANIFEST.MF file is not comming on th first/second entry.

How can I fix this is the jar used I did not build it and it comes from the apache foundation pulsar project.

org.apache.pulsar pulsar-client 2.9.1