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

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 opened this issue Sep 23, 2020 · 17 comments

Comments

@bibhuduttaGitHub
Copy link

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
Copy link
Collaborator

Hi @bibhuduttaGitHub

  • Please check if the dependency jars are present in local m2 repository.
  • Review the groupId, artifactId and version for all pom dependencies. Example - groupId for poi is "org.apache.poi". https://mvnrepository.com/artifact/org.apache.poi/poi/3.7
  • Please share the debug logs of the mvn command output.

@bibhuduttaGitHub
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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

@bibhuduttaGitHub
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Author

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

@vpawar-tibco
Copy link
Collaborator

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
Copy link
Author

Case #01895887 . Please check.

@vpawar-tibco
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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

@bibhuduttaGitHub
Copy link
Author

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link

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

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

No branches or pull requests

3 participants