]
Maciej Swiderski commented on DROOLS-1004:
------------------------------------------
David,
thanks for detailed analysis. Here are few points regarding relying on EAP modules for the
jaxb and osgi jars:
- this is EAP specific and since we have single war file per JEE spec level (EE6 and EE7)
we must include all libraries required to run within war file (WEB-INF/lib)
- jaxb impl/core are marked as private modules and thus should not be referenced from
within applications running on EAP - if you do so you'll see another warning about it
(see module.xml)
- osgi module is marked as deprecated and I believe it's scheduled to be removed (see
module.xml)
so for jaxb we can't do much about it unfortunately as there might be different
versions provided by different app servers so we need to make sure we have the right one
meaning we need to ship it with kie server war file
for osgi I believe we need to include similar as we do for workbench
classloading errors in kie-server
---------------------------------
Key: DROOLS-1004
URL:
https://issues.jboss.org/browse/DROOLS-1004
Project: Drools
Issue Type: Bug
Components: kie server
Affects Versions: 6.3.0.Final
Reporter: David Ward
Assignee: Maciej Swiderski
There appear to be some classloading errors in kie-server.war 6.3.0.Final-redhat-5 being
deployed on JBoss EAP 6.4.4.
*First, you get multiple jaxb and parser warnings like this:*
{code}
11:58:47,603 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960:
Class Path entry jaxb-api.jar in
/opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-core-2.2.11.jar does not
point to a valid jar for a Class-Path reference.
11:58:47,606 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960:
Class Path entry jaxb-core.jar in
/opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-impl-2.2.11.jar does not
point to a valid jar for a Class-Path reference.
11:58:47,644 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960:
Class Path entry jaxb-core.jar in
/opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-xjc-2.2.11.jar does not
point to a valid jar for a Class-Path reference.
11:58:47,644 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015960:
Class Path entry jaxb-impl.jar in
/opt/eap/standalone/deployments/kie-server.war/WEB-INF/lib/jaxb-xjc-2.2.11.jar does not
point to a valid jar for a Class-Path reference.
11:58:47,713 WARN [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015893:
Encountered invalid class name
'org.xmlpull.mxp1.MXParser,org.xmlpull.mxp1_serializer.MXSerializer' for service
type 'org.xmlpull.v1.XmlPullParserFactory'
{code}
The above was noticed as part of CLOUD-421. Please refer to the jira issue and note
Kev's comment, {quote}"The jaxb jars are duplicates that are unnecessary in the
EAP deployments however the upstream war file contains all dependencies. Removing the jaxb
jars from within the kie-server.war/WEB-INF/lib directory will likely work however I'm
loathed to do this since we would need to verify this through the BRMS QE team.
The warning about the parser is caused by the
kie-server.war/WEB-INF/lib/xpp3_min-1.1.4c.jar"{quote}
*Second, there can be missing osgi classes:*
If kjar model classes contain certain annotations, it seems to trigger the kie-server to
try to load osgi classes. For example, annotating kjar model classes with Position,
PropertyReactive, and Remotable as per this test case:
http://git.app.eng.bos.redhat.com/git/xpaas-qe.git/tree/test-brms/src/tes...
, you end up with errors like this in the log when the KieContainer is being installed:
{code}
Caused by: java.lang.NoClassDefFoundError:
org/osgi/util/tracker/ServiceTrackerCustomizer
at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_65]
at java.lang.ClassLoader.defineClass(ClassLoader.java:760) [rt.jar:1.8.0_65]
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:361)
[jboss-modules.jar:1.3.7.Final-redhat-1]
at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:482)
[jboss-modules.jar:1.3.7.Final-redhat-1]
... 77 more
Caused by: java.lang.ClassNotFoundException:
org.osgi.util.tracker.ServiceTrackerCustomizer from [Module
"deployment.kie-server.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
[jboss-modules.jar:1.3.7.Final-redhat-1]
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
[jboss-modules.jar:1.3.7.Final-redhat-1]
at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
[jboss-modules.jar:1.3.7.Final-redhat-1]
at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
[jboss-modules.jar:1.3.7.Final-redhat-1]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
[jboss-modules.jar:1.3.7.Final-redhat-1]
... 81 more
{code}
The above was noticed as part of CLOUD-418. To get around this issue, I had to add a
kie-server.war/WEB-INF/jboss-deployment-structure.xml like so:
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.osgi.core"/>
<module name="org.osgi.enterprise"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
{code}
The jboss-bpmsuite-6.2.0.GA-redhat-1-deployable-eap6.x.zip file (from which we extract
the kie-sever.war) is seemingly an EAP-specific build (thus the -eap6.x suffix). So
perhaps the fix would be to have the kie-server.war already come pre-configured to contain
(or better yet, depend upon the existing modules) jars in EAP for both the above problems
(incorrect jaxb/xmlpull references, and missing osgi dependencies).