Xerces and Jena incompatibilities

206 views
Skip to first unread message

Greg S

unread,
Aug 15, 2016, 1:56:05 PM8/15/16
to cytoscape-app-dev
Hello all,
I am having incompatibilities with the included version of Xerces and Apache Jena in my Cytoscape app. When I remove xerces (from framework/lib/endorsed/xercesImpl-2.11.0.jar), Jena uses its own Xerces library, and there is no exception. I cannot figure out (without removing the included xerces jar) how to get Jena to not use the included Cytoscape's version of Xerces (because they both have the same version number, but cytoscape's for some reason does not work). Please help, thanks in advance.

(I've tried with and without xerces listed)
Here for another reference of the same issue: https://github.com/sgtp/SemScape/issues/6

konigmatt

unread,
Aug 18, 2016, 7:31:06 AM8/18/16
to cytoscape-app-dev
Just run in the same issue and trying to fix this for 2 days now. Could not find any workaround for this.
At least 3 apps affected in this moment.

I need the jena robundle to support Research Objects and Combine Archives.

See also
https://github.com/matthiaskoenig/cy3sbml/issues/176

Excluding xerces from taverna

<exclusion>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
</exclusion>
 

results in

java.lang.NoClassDefFoundError: org/apache/xerces/util/XMLChar
    at org.apache.jena.rdf.model.impl.Util.notNameChar(Util.java:119)
    at org.apache.jena.rdf.model.impl.Util.splitNamespaceXML(Util.java:77)
    at org.apache.jena.graph.Node_URI.getLocalName(Node_URI.java:80)
    at org.apache.jena.rdf.model.impl.ResourceImpl.getLocalName(ResourceImpl.java:152)
    at org.apache.jena.rdf.model.impl.PropertyImpl.checkLocalName(PropertyImpl.java:64)
    at org.apache.jena.rdf.model.impl.PropertyImpl.<init>(PropertyImpl.java:72)
    at org.apache.jena.rdf.model.ResourceFactory$Impl.createProperty(ResourceFactory.java:335)
    at org.apache.jena.rdf.model.ResourceFactory.createProperty(ResourceFactory.java:180)
    at org.apache.jena.vocabulary.RDF.property(RDF.java:51)
    at org.apache.jena.vocabulary.RDF.<clinit>(RDF.java:64)
    at org.apache.jena.system.InitJenaCore.init(InitJenaCore.java:57)
    at org.apache.jena.system.InitJenaCore.start(InitJenaCore.java:31)
    at org.apache.jena.system.JenaSystem.lambda$init$1(JenaSystem.java:111)
    at java.util.ArrayList.forEach(ArrayList.java:1249)
    at org.apache.jena.system.JenaSystem.forEach(JenaSystem.java:186)


Including xerces results in conflicting classes

java.lang.ClassCastException: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl cannot be cast to javax.xml.parsers.DocumentBuilderFactory
    at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)

The endorsed and included xerces have conflicts.
 

Deleting the framework/lib/endorsed/xercesImpl-2.11.0.jar crashes the JDK with:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f8ada37fa34, pid=10745, tid=0x00007f8968bbd700
#
# JRE version: Java(TM) SE Runtime Environment (8.0_101-b13) (build 1.8.0_101-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.101-b13 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.so+0x6d9a34]  get_method_id(JNIEnv_*, _jclass*, char const*, char const*, bool, Thread*)+0x84
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /home/mkoenig/hs_err_pid10745.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

Matthias

konigmatt

unread,
Aug 18, 2016, 7:44:11 AM8/18/16
to cytoscape-app-dev
Here more information.
At least 4 apps have the problems. Same issue
https://groups.google.com/forum/#!topic/cytoscape-discuss/J1kG8hEYLBU

konigmatt

unread,
Aug 18, 2016, 9:07:55 AM8/18/16
to cytoscape-app-dev
The one thing I really don't understand is why I get a


java.lang.NoClassDefFoundError: org/apache/xerces/util/XMLChar
    at org.apache.jena.rdf.model.impl.Util.notNameChar(Util.java:119)

exception when I exclude the xerces from jena-core in my maven pom.

<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-core</artifactId>
<version>3.1.0</version>
<exclusions>
<!-- from core we can exclude xerces -->
        <exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
    </exclusions>
</dependency>
<!-- now xerces is back in, but maven knows it is provided by cytoscape -->
<dependency>
    <groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
    <version>2.11.0</version>
<scope>provided</scope>
</dependency>

I understood that Cytoscape is packing xerces 2.11.0 and makes the classes available via
framework/etc/config.properties
So I should be able to exclude them and to rely on everything being available due to

org.osgi.framework.system.packages.extra= \
 org.apache.karaf.branding, \
 org.apache.html.dom; version="2.11.0", \
 org.apache.wml.dom; version="2.11.0", \
 org.apache.wml; version="2.11.0", \
 org.apache.xerces.parsers; version="2.11.0", \
 org.apache.xerces.impl.dtd.models; version="2.11.0", \
 org.apache.xerces.xni.parser; version="2.11.0", \
 org.apache.xerces.impl.dv.xs; version="2.11.0", \
 org.apache.xerces.impl.xs.traversers; version="2.11.0", \
 org.apache.xerces.util; version="2.11.0", \
...

This includes the util classes of xerces. But on runtime I get an ClassNotFound
java.lang.NoClassDefFoundError: org/apache/xerces/util/XMLChar
Why is this?

Tim Hull

unread,
Aug 18, 2016, 8:41:36 PM8/18/16
to konigmatt, stu...@gmail.com, cytoscape-app-dev
Do you have a version of your apps (with source code) that exhibits the problem? I tried building WikiDataScape from the source on GitHub, but never saw the Xerces error. 

I did see it when installing SemScape, however. In that case, I was able to work around the problem in that case by editing framework/etc/config.properties (in the Cytoscape install directory) and removing xerces packages from org.osgi.framework.bootdelegation - once I did that, SemScape worked perfectly. 

However, that really doesn't help as far as currently-installed versions of Cytoscape - not everyone has the permissions to modify the Cytoscape install directory. We could make the change in 3.5, though there should be a way to work around this in the app itself (though I'll need source code demonstrating this problem to actually figure out how). 

Tim

P.S. There is an open issue on the Karaf bug tracker relating to xerces entries in bootDelegation that may be related to this issue:



--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-dev+unsubscribe@googlegroups.com.
To post to this group, send email to cytoscape-app-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-app-dev/569dbb0f-9d9e-417c-bce2-a9f39bba88f2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Marc Hadfield

unread,
Aug 18, 2016, 8:53:23 PM8/18/16
to Tim Hull, konigmatt, stu...@gmail.com, cytoscape-app-dev

You can get a hint about using jena within cytoscape via the pom here:


which is the source for the cytoscape app here: http://apps.cytoscape.org/apps/vitalaigraphvisualization


which is where xerces is relocated.

-- Marc Hadfield




On Thu, Aug 18, 2016 at 8:41 PM, Tim Hull <tmh...@eng.ucsd.edu> wrote:
Do you have a version of your apps (with source code) that exhibits the problem? I tried building WikiDataScape from the source on GitHub, but never saw the Xerces error. 

I did see it when installing SemScape, however. In that case, I was able to work around the problem in that case by editing framework/etc/config.properties (in the Cytoscape install directory) and removing xerces packages from org.osgi.framework.bootdelegation - once I did that, SemScape worked perfectly. 

However, that really doesn't help as far as currently-installed versions of Cytoscape - not everyone has the permissions to modify the Cytoscape install directory. We could make the change in 3.5, though there should be a way to work around this in the app itself (though I'll need source code demonstrating this problem to actually figure out how). 

Tim

P.S. There is an open issue on the Karaf bug tracker relating to xerces entries in bootDelegation that may be related to this issue:


Greg S

unread,
Aug 19, 2016, 12:09:01 AM8/19/16
to cytoscape-app-dev, tmh...@eng.ucsd.edu, koni...@googlemail.com, stu...@gmail.com
Thanks! I think it is working now.
I added the following to my pom.xml

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.4.3</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <relocations>
                                <relocation>
                                    <pattern>org.apache.xerces</pattern>
                                    <shadedPattern>org.shaded.apache.xerces</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.

konigmatt

unread,
Aug 19, 2016, 4:33:31 AM8/19/16
to cytoscape-app-dev, tmh...@eng.ucsd.edu, koni...@googlemail.com, stu...@gmail.com
Hi all,
unfortunately, none of the proposed solutions works for me

1. removing the xerces entries from bootdelegation in config.properties does not solve the
java.lang.ClassNotFoundException: org.apache.xerces.util.XMLChar not found
and resulted in crash of JDK on occasions (before never happened)

2. including the maven-shade-plugin does not solve the
java.lang.ClassNotFoundException: org.apache.xerces.util.XMLChar not found
and results in maven builds which take >1 min instead of 20 seconds

3. just deleting the xerces.jar crashes the JDK

I created a minimal example app at
https://github.com/matthiaskoenig/cy3robundle
showing the problem.

I can run the ROBundle.main() without problems without Cytoscape OSGI, so it is clearly a Cytoscape Karaf problem.
org.apache.xerces.util.XMLChar is part of xerces.jar, so there is some problem with the Karaf container.

Matthias

Matthias

Matthias König

unread,
Aug 19, 2016, 5:48:24 AM8/19/16
to cytoscape-app-dev
Hi Tim,

if you could make changes so it works in the 3.5 nightly build this would be great.
Than I will just develop against the 3.5-SNAPSHOT version (especially because the netscape.javascript issue is already fixed there, which is also holding me back).

The only downside is that I have to wait with our publication a few month until 3.5 is released, but I prefer that to not being able to implement the features I want or having the user to change configuration files.
Matthias

--
Matthias König
Junior Group Leader LiSym - Systems Medicine of the Liver
Humboldt-University Berlin, Institute for Theoretical Biology
  https://www.livermetabolism.com
koni...@googlemail.com

Tel: +49 30 20938450
Tel: +49 176 81168480

Barry Demchak

unread,
Aug 19, 2016, 10:15:30 AM8/19/16
to cytoscape-app-dev
Hi, Matthias --

Thanks for your help with this thread. It's certainly a puzzler.

I think I must have missed some information ... from what I can see, GregS found something that worked, but his solution and two others did not seem to work for you.

We're eager to get Karaf configured for important use cases, but I'm not sure which solution is on the table. I can imagine this being solved for v3.5, but I don't have a picture of the particular solution. Would you mind articulating the leading candidate??

(I think Tim will engage more fully after he finishes up other issues on his plate, which should be pretty soon.)

Matthias König

unread,
Aug 19, 2016, 11:44:14 AM8/19/16
to Barry Demchak, cytoscape-app-dev
I am no expert in OSGI and classloading, but here is how it feels in my words.

There is a problem with the classloader of the OSGI somewhere, namely that it was forgotten to export org.apache.xerces.util. So it is not available from within Cytoscape despite xerces being hardwired with the framework.
There is no way for me to overwrite the hardwiring, because if I try to remove it my JDK crashes when starting Cytoscape (also this is not a solution which is viable, because users have to modify/delete the Cytoscape installation).
All the others were lucky that there pom dependencies which require xerces do not use anything from org.apache.xerces.util (or they did not try to instantiate anything which relies on it, at last than their code will fail on runtime).

It feels like Cytoscape packs the complete xerces in the framework, but not all packages/classes are exported or accessible afterwards.
So I looked where you expose xerces and I understand this is via org.osgi.framework.bootdelegation.

So I started adding to it:
org.osgi.framework.bootdelegation=org.apache.karaf.jaas.boot,org.apache.karaf.jaas.boot.principal,org.apache.karaf.management.boot,sun.*,com.sun.*,javax.transaction,javax.transaction.*,javax.xml.crypto,javax.xml.crypto.*,org.apache.xerces.jaxp.datatype,org.apache.xerces.stax,org.apache.xerces.parsers,org.apache.xerces.jaxp,org.apache.xerces.jaxp.validation,org.apache.xerces.dom,org.apache.xerces.util,org.apache.xerces.xs,org.apache.xerces.impl.dv,org.apache.xerces.impl.dv.xs,org.apache.xerces.impl.validation
With every added package I get a new class which is missing from xerces in Cytoscape, so it seems quit a lot of xerces is not exposed.

org.apache.xerces.util,
org.apache.xerces.xs,
org.apache.xerces.impl.dv,
org.apache.xerces.impl.dv.xs,
org.apache.xerces.impl.validation
...

So in the end I just added
org.apache.xerces.*
to org.osgi.framework.bootdelegation
which made all the classes accessible.

I am pretty sure there are many more such problems in the Karaf container, just looking at the libraries in framework/lib/endorsed.
netscape.javascript was a similar story.
The main problem is that this cannot be solved by any workarounds, but only via an update to the next version of Cytoscape which means month of waiting.

The solution is in summary:
If you hardwire libraries in Cytoscape you have to expose everything.
Perhaps a config file in the user directory which can update the bootdelegation variable would help, than one could update these via an app.

Matthias


--
You received this message because you are subscribed to a topic in the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cytoscape-app-dev/QpjgPR62ZK8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cytoscape-app-dev+unsubscribe@googlegroups.com.
To post to this group, send email to cytoscape-app-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-app-dev/4c1766e3-5b3c-45db-aae5-a0a504c4178a%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Barry Demchak

unread,
Aug 19, 2016, 11:57:27 AM8/19/16
to Matthias König, cytoscape-app-dev

OK … thanks, for all of the good information, Matthias.

 

I think this pretty well frames the current situation and points to where you’re hoping to end up.

 

We’ll take a look at it soon … we need to focus on what’s on our plate before moving on.

--

To unsubscribe from this group and all its topics, send an email to cytoscape-app-...@googlegroups.com.


To post to this group, send email to cytoscap...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

Matthias König

unread,
Aug 19, 2016, 1:02:17 PM8/19/16
to Barry Demchak, cytoscape-app-dev
So for anyone wanting to include jena-osgi (or anything from org.apache.taverna) here is the trick how to get it work:
1. add org.apache.xerces.* to org.osgi.framework.bootdelegation in framework/etc/config.properties (hopefully this will be part of Cytoscape 3.5)
2. split the jena-osgi package into components so xerces can be excluded/provided and some bugs fixed via component update.

So in the end one has something instead of the dependency which depends on jena-osgi:
```
<dependency>
            <groupId>org.apache.taverna.language</groupId>
            <artifactId>taverna-robundle</artifactId>
            <version>0.15.1-incubating</version>
</dependency>

```
the following maven nightmare. If anybody knows any simpler solution please let me know.
```
<dependency>
            <groupId>org.apache.taverna.language</groupId>
            <artifactId>taverna-robundle</artifactId>
            <version>0.15.1-incubating</version>
            <exclusions>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-log4j12</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.slf4j</groupId>
                    <artifactId>jcl-over-slf4j</artifactId>
                </exclusion>
                <!-- problems with newer OSGI and necessary to split in components
                     for exclusion of xerces -->
                <exclusion>
                    <groupId>org.apache.jena</groupId>
                    <artifactId>jena-osgi</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <!-- include split components -->

        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-core</artifactId>
            <version>3.1.0</version>
            <exclusions>
                <exclusion>
                <groupId>xerces</groupId>
                <artifactId>xercesImpl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>xerces</groupId>
            <artifactId>xercesImpl</artifactId>
            <version>2.11.0</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-arq</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-iri</artifactId>
            <version>3.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.jena</groupId>
            <artifactId>jena-tdb</artifactId>
            <version>3.1.0</version>
        </dependency>
        <!--
        Update dependencies to fix:
        https://issues.apache.org/jira/browse/JENA-1178
        -->
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient</artifactId>
            <version>4.5.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.httpcomponents</groupId>
            <artifactId>httpclient-cache</artifactId>
            <version>4.5.2</version>
        </dependency>
        <dependency>
            <groupId>com.github.jsonld-java</groupId>
            <artifactId>jsonld-java</artifactId>
            <version>0.8.3</version>
        </dependency>

```
Please let me know when
org.apache.xerces.* is added to org.osgi.framework.bootdelegation in the Cy3.5 nightly build, than I can test with this.
I hope this saves someone someday a lot of grey hairs.
M


--

To unsubscribe from this group and all its topics, send an email to cytoscape-app-dev+unsubscribe@googlegroups.com.
To post to this group, send email to cytoscape-app-dev@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.




--

Matthias König
Junior Group Leader LiSym - Systems Medicine of the Liver

Humboldt-University Berlin, Institute for Theoretical Biology
  https://www.livermetabolism.com
koni...@googlemail.com

Tel: +49 30 20938450
Tel: +49 176 81168480

Tim Hull

unread,
Aug 26, 2016, 12:33:09 AM8/26/16
to Matthias König, Barry Demchak, cytoscape-app-dev
One question - to clarify, what happens if you try to just embed your own version of Jena and Xerces? From what I'm hearing on the Karaf discussion forum, that should be possible (without any changes to config files)...

Tim

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-dev+unsubscribe@googlegroups.com.

To post to this group, send email to cytoscape-app-dev@googlegroups.com.

Marc Hadfield

unread,
Aug 26, 2016, 3:06:16 PM8/26/16
to Tim Hull, Matthias König, Barry Demchak, cytoscape-app-dev

That's what we do here: (include jena and xerces)
On Fri, Aug 26, 2016 at 12:33 AM, Tim Hull <tmh...@eng.ucsd.edu> wrote:
One question - to clarify, what happens if you try to just embed your own version of Jena and Xerces? From what I'm hearing on the Karaf discussion forum, that should be possible (without any changes to config files)...

Tim

Tim Hull

unread,
Aug 29, 2016, 2:14:00 PM8/29/16
to Marc Hadfield, Matthias König, Barry Demchak, cytoscape-app-dev
That actually seems to work, at least to an extent. I was a bit thrown by the use of maven-shade-plugin - have never seen it used before in a context with maven-bundle-plugin. 

If I use it with Matthias's code, I no longer get the VerifyError exception, and the app seems to go farther in the startup process. It still seems to throw exceptions, though the one's I'm seeing refer to 404 Not Found/server problems and doesn't seem related to Xerces. 

To make it work in that case, I did have to remove the "provided" scope for xercesImpl, as it is necessary to embed your own version of Xerces to do this. It also seemed to work the same (with maven-shade-plugin) if I just used jena-osgi and removed all the exclusions+multiple Jena dependencies from that POM.

Does this work for everyone? If so, I think this is probably the best solution as long as Karaf continues to export only part of Xerces. Alternatively, you may be able to use an extension bundle and export the missing Xerces packages from the system bundle that way (as I illustrated on the netscape.javascript thread), though that would be more convoluted.

Tim

konigmatt

unread,
Aug 30, 2016, 1:40:32 PM8/30/16
to cytoscape-app-dev, ma...@hadfield.org, koni...@googlemail.com, idekerlab...@gmail.com
Hi Tim,
I will try this.
A downside was for me that my maven build takes forever with the shaded plugin. Instead of ~20 seconds things take >1min with the shaded, which makes it difficult to have fast iteration cycles between coding and building the app.

The 404 things are due to some ontology resources which vanished from the web. This is some Jena issue I reported on their issue tracker and not related to xerces.
I will give feedback after I tried all the suggestions.
M



On Monday, August 29, 2016 at 8:14:00 PM UTC+2, Timothy Hull wrote:
That actually seems to work, at least to an extent. I was a bit thrown by the use of maven-shade-plugin - have never seen it used before in a context with maven-bundle-plugin. 

If I use it with Matthias's code, I no longer get the VerifyError exception, and the app seems to go farther in the startup process. It still seems to throw exceptions, though the one's I'm seeing refer to 404 Not Found/server problems and doesn't seem related to Xerces. 

To make it work in that case, I did have to remove the "provided" scope for xercesImpl, as it is necessary to embed your own version of Xerces to do this. It also seemed to work the same (with maven-shade-plugin) if I just used jena-osgi and removed all the exclusions+multiple Jena dependencies from that POM.

Does this work for everyone? If so, I think this is probably the best solution as long as Karaf continues to export only part of Xerces. Alternatively, you may be able to use an extension bundle and export the missing Xerces packages from the system bundle that way (as I illustrated on the netscape.javascript thread), though that would be more convoluted.

Tim
On Fri, Aug 26, 2016 at 8:49 AM, Marc Hadfield <ma...@hadfield.org> wrote:

That's what we do here: (include jena and xerces)

which is the source for the cytoscape app here: http://apps.cytoscape.org/apps/vitalaigraphvisualization


which is where xerces is relocated.
On Fri, Aug 26, 2016 at 12:33 AM, Tim Hull <tmh...@eng.ucsd.edu> wrote:
One question - to clarify, what happens if you try to just embed your own version of Jena and Xerces? From what I'm hearing on the Karaf discussion forum, that should be possible (without any changes to config files)...

Tim

--

To unsubscribe from this group and all its topics, send an email to cytoscape-app-...@googlegroups.com.


To post to this group, send email to cytoscap...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.




--

Matthias König
Junior Group Leader LiSym - Systems Medicine of the Liver

Humboldt-University Berlin, Institute for Theoretical Biology
  https://www.livermetabolism.com
koni...@googlemail.com

Tel: +49 30 20938450
Tel: +49 176 81168480




--
Matthias König
Junior Group Leader LiSym - Systems Medicine of the Liver
Humboldt-University Berlin, Institute for Theoretical Biology
  https://www.livermetabolism.com
koni...@googlemail.com

Tel: +49 30 20938450
Tel: +49 176 81168480

--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.

Tim Hull

unread,
Aug 30, 2016, 6:39:57 PM8/30/16
to konigmatt, cytoscape-app-dev
OK - I found out a little more as to why excluding Xerces and importing it manually as "provided" isn't working. It turns out that the org.osgi.framework.system.packages.extra packages in custom.properties override those in config.properties - so while all of Xerces is exported in Karaf's default configuration, it isn't on Cytoscape's default configuration. This is what happened with sun.misc on previous Cytoscape versions as well - Karaf exports it by default, but a custom property added long ago prevented it from being exported in Cytoscape.

If I take the contents of org.osgi.framework.system.packages.extra in custom.properties, add those packages to that entry in config.properties, and remove them from custom.properties everything works with the cy3robundle code you have on github at the moment (which excludes Xerces from Jena and uses the provided version). 

Given this, I think it probably makes sense to change config.properties/custom.properties to make sure all of Karaf's default package exports are available in Cytoscape for future versions. This will allow the included Xerces to be used by all apps, though it will also still be possible to use maven-shade-plugin to use your own version. 

In the meantime, the two solutions that will work without editing config files are 1) the maven-shade-plugin solution and 2) using extension bundles to expose the missing Xerces packages that are in config.properties under org.osgi.framework.system.packages.extra. 

Hope this helps...

Tim

On Tue, Aug 30, 2016 at 10:56 AM, Tim Hull <tmh...@eng.ucsd.edu> wrote:
Yes - maven-shade-plugin will extend the build process as it is going through all the code and changing all references from one class path (in this case, the default Xerces package name) to another. 

I'm not sure there's a good way around that - it seems we should be able to import the other internal Xerces packages (they are there, just not exported in boot delegation) and use those, but it isn't working for one reason. We could obviously change config.properties to export all Xerces or no Xerces  in boot delegation, though I'm not sure what the impact on Karaf will be (and your app would only work on 3.5+ in that case). 

Karaf does have an open bug related to this - KARAF-3596:


Tim

To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-dev+unsubscribe@googlegroups.com.
To post to this group, send email to cytoscape-app-dev@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-app-dev/9530b403-bced-4811-bbb4-fdb46080f6f0%40googlegroups.com.

Tim Hull

unread,
Sep 1, 2016, 11:54:57 AM9/1/16
to konigmatt, cytoscape-app-dev, cyto...@googlegroups.com
At this point, I think it makes sense to add all the packages in the org.osgi.framework.system.packages.extra entry of config.properties to the org.osgi.framework.system.packages.extra entry in custom.properties. I figure I'd do it that way since we currently don't modify config.properties, but do modify custom.properties (and I think that's the way Karaf intends it). 

Does anyone have an issue with this? If not, I'll go ahead and make this change in the develop branch (and thus for the 3.5 release). You will then be able to use the bundled Xerces in Cytoscape 3.5 (though could still use your own version by renaming the classes through maven-shade-plugin).

Tim

Tim Hull

unread,
Sep 1, 2016, 3:46:03 PM9/1/16
to konigmatt, cytoscape-app-dev, cyto...@googlegroups.com
I just added all the packages in config.properties to custom.properties (and left those in custom.properties there as well). Furthermore, I added javafx.print, which was the one JavaFX package that seemed to still be missing. This should be in the next nightly build to test...

Tim
Reply all
Reply to author
Forward
Message has been deleted
0 new messages