TIBCOSoftware / bw6-plugin-maven

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

java.lang.ClassCastException: com.sun.xml.internal.stream.XMLInputFactoryImpl cannot be cast to javax.xml.stream.XMLInputFactory. Processing of the bundle is finished. #510

Closed bibhuduttaGitHub closed 4 years ago

bibhuduttaGitHub commented 4 years ago

Maven Plugin version: 2.72.4

Maven version:.3.6.4

Product : TIBCO Businessworks Container edition

Product version: 2.5.4

Component: Either of Maven Eclipse Plugin or Maven build plugin

Steps to reproduce the issue:

  1. Add some java code which uses packages from rt.jar that shipped with BWCE. 2.Add dependency to the rt.jar in the POM. 3.Build the code using TIBCO maven plugin 2.7.0 and deploy to a container.
  2. Then you'll see classcast exception during startup. Details of the steps and artifacts are available in the case# 01900075. Additional environment details if any:

Describe the results you received: startup has class cast exceptions.

Describe the results you expected: Clean startup logs when deployed to container.

Additional information you deem important (e.g. issue happens only occasionally): If we export the ear out of studio and use the ear to build the image and deploy to container, it works fine.

vpawar-tibco commented 4 years ago

@bibhuduttaGitHub The rt.jar is JRE library. Did you try without adding it as POM dependency?

bibhuduttaGitHub commented 4 years ago

@vpawar-ai : if we don't add rt.jar, then mvn build is getting failed due to compilation error.

vpawar-tibco commented 4 years ago

@bibhuduttaGitHub Please remove rt.jar and other additional dependencies and add javax.mail dependency. example -

<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4</version>
</dependency>

Attaching logs. maven_logs_510.txt

bibhuduttaGitHub commented 4 years ago

@vpawar-ai : Did you do any code change also apart from abobe POM changes? After removing the existing dependency from POM and adding the javax.mail dependency. The code is failing with compilation error.

image

vpawar-tibco commented 4 years ago

@bibhuduttaGitHub No code was changed except the pom file changes suggested in earlier response. Please check your JAVA_HOME environment variable. It should point to <tibco-home>\tibcojre64\1.8.0

bibhuduttaGitHub commented 4 years ago

@vpawar-ai : Are you talking about JAVA_HOME environment variable on the machine where studio runs? TIBCO BWCE comes packaged with JRE only. ideally we should not point to tibco-home/tibcojre64. We should be pointing to a jdk installed version , which i am pointing currently to a standalone jdk installation.

Let me know your input.

bibhuduttaGitHub commented 4 years ago

@vpawar-ai : Appreciate, if you can respond to this thread today. Please note, we are building the ear on a jenkins server where maven plugin is installed.JAVA_HOME is set to "11.0.7" version of a standalone openjdk installation on the jenkins server.

vpawar-tibco commented 4 years ago

@bibhuduttaGitHub Sorry, I was on sick leave. Did you try pointing JAVA_HOME to JDK\JRE 1.8.0? It is about compatibility between JDK\JRE version and javax.mail lib used in custom Java Code. With reference to attached logs earlier, it worked fine with 1.8.0.

bibhuduttaGitHub commented 4 years ago

@vpawar-ai : you mean on jenkin server?

bibhuduttaGitHub commented 4 years ago

@vpawar-ai : I tried and encountered the same error as above. Attached the log to the case #01900075

bibhuduttaGitHub commented 4 years ago

@vpawar-ai : Did you get a chance to check the build logs?

vpawar-tibco commented 4 years ago

@bibhuduttaGitHub I couldn't reproduce the issue when using Java 1.8. Did you try running it outside jenkins? Please check JAVA_HOME environment variable before you run it.