karaf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cristiano Costantini <cristiano.costant...@gmail.com>
Subject Problems due to the endorsed java.lang.Exception
Date Fri, 18 Mar 2016 16:14:57 GMT
Hello all,

it is some days I was having troubles using CXF services on ServiceMix (and
it is some days I spam on the mailing list of ServiceMix, Camel and CXF :-D
) and I've finally come to the source of my issues which are due to the
"endorsed" java.lang.Exception which is used by Karaf:

https://github.com/apache/karaf/blob/master/exception/src/main/java/java/lang/Exception.java

My problem is due to the fact that this class has a public property,
public Class[] getClassContext() {
    return classContext;
}
which is seen by JaxB at runtime inside Karaf which cause it to marshall
the Exception in SOAP services with a wrong XML, an XML which include
<classContext> tags.

The class in Karaf has not changed since committed by Guillaume Nodet in
2010, so this issue with CXF has probably always been there.

In my opinion, this getter should be private or protected as I guess it is
only used on the nested class method's getThrowableContext (it is a
replacement for the JRE's class, I don't think there are external project
using this modification of the Exception class).


To confirm my thesis, I've hacked the org.apache.karaf.exception-2.4.0.jar
inside the lib/endorsed folder with a class compiled by myself where I've
changed the method to
private Class[] getClassContext() {
    return classContext;
}
and with this hack, Karaf has continued to work (and my CXF service now
works properly).

Do you think there are potential side effects in this fix?
Do you need me to open an issue on Jira to handle the problem?
If it is confirmed that the fix of making this method private, do you think
it could be included soon on the next Karaf Release?

Thank you very much to all,
Cristiano

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message