| Andrew Cooke | Contents | Latest | RSS | Twitter | Previous | Next

C[omp]ute

Welcome to my blog, which was once a mailing list of the same name and is still generated by mail. Please reply via the "comment" links.

Always interested in offers/projects/new ideas. Eclectic experience in fields like: numerical computing; Python web; Java enterprise; functional languages; GPGPU; SQL databases; etc. Based in Santiago, Chile; telecommute worldwide. CV; email.

Personal Projects

Lepl parser for Python.

Colorless Green.

Photography around Santiago.

SVG experiment.

Professional Portfolio

Calibration of seismometers.

Data access via web services.

Cache rewrite.

Extending OpenSSH.

C-ORM: docs, API.

Last 100 entries

An Outsider's Guide To Julia Packages; Nobody gives a shit; Lepton Decay Irregularity; An Easier Way; Julia's BinDeps (aka How To Install Cairo); Good Example Of Good Police Work (And Anonymity Being Hard); Best Santiago Burgers; Also; Michael Emmerich (Vibrator Translator) Interview (Japanese Books); Clarice Lispector (Brazillian Writer); Books On Evolution; Looks like Ara (Modular Phone) is dead; Index - Translations From Chile; More Emotion in Chilean Wines; Week 7; Aeon Magazine (Science-ish); QM, Deutsch, Constructor Theory; Interesting Talk Transcripts; Interesting Suggestion Of Election Fraud; "Hard" Books; Articles or Papers on depolarizing the US; Textbook for "QM as complex probabilities"; SFO Get Libor Trader (14 years); Why Are There Still So Many Jobs?; Navier Stokes Incomplete; More on Benford; FBI Claimed Vandalism; Architectural Tessellation; Also: Go, Blake's 7; Delusions of Gender (book); Crypto AG DID work with NSA / GCHQ; UNUMS (Universal Number Format); MOOCs (Massive Open Online Courses); Interesting Looking Game; Euler's Theorem for Polynomials; Weeks 3-6; Reddit Comment; Differential Cryptanalysis For Dummies; Japanese Graphic Design; Books To Be Re-Read; And Today I Learned Bugs Need Clear Examples; Factoring a 67 bit prime in your head; Islamic Geometric Art; Useful Julia Backtraces from Tasks; Nothing, however, is lost with less discomfort than that which, when lost, cannot be missed; Article on Didion; Cost of Living by City; British Slavery; Derrida on Metaphor; African SciFi; Traits in Julia; Alternative Japanese Lit; Pulic Key as Address (Snow); Why Information Grows; The Blindness Of The Chilean Elite; Some Victoriagate Links; This Is Why I Left StackOverflow; New TLS Implementation; Maths for Physicists; How I Am 8; 1000 Word Philosophy; Cyberpunk Reading List; Detailed Discussion of Message Dispatch in ParserCombinator Library for Julia; FizzBuzz in Julia w Dependent Types; kokko - Design Shop in Osaka; Summary of Greece, Currently; LLVM and GPUs; See Also; Schoolgirl Groyps (Maths); Japanese Lit; Another Example - Modular Arithmetic; Music from United; Python 2 and 3 compatible alternative.; Read Agatha Christie for the Plot; A Constructive Look at TempleOS; Music Thread w Many Recommendations; Fixed Version; A Useful Julia Macro To Define Equality And Hash; k3b cdrom access, OpenSuse 13.1; Week 2; From outside, the UK looks less than stellar; Huge Fonts in VirtualBox; Keen - Complex Emergencies; The Fallen of World War II; Some Spanish Fiction; Calling C From Fortran 95; Bjork DJ Set; Z3 Example With Python; Week 1; Useful Guide To Starting With IJulia; UK Election + Media; Review: Reinventing Organizations; Inline Assembly With Julia / LLVM; Against the definition of types; Dumb Crypto Paper; The Search For Quasi-Periodicity...; Is There An Alternative To Processing?; CARDIAC (CARDboard Illustrative Aid to Computation); The Bolivian Case Against Chile At The Hague; Clear, Cogent Economic Arguments For Immigration; A Program To Say If I Am Working

© 2006-2015 Andrew Cooke (site) / post authors (content).

Java XML dependencies, Deployment, Building etc

From: "andrew cooke" <andrew@...>

Date: Fri, 17 Mar 2006 12:33:33 -0400 (CLT)

[This from an email I just sent at work]

This is probably going to be a fairly common problem, and is something
that could affect deployment.

Java famously has a problem when different (and incompatible) versions of
jars exist on the classpath (google "Java Jar Hell").  This is
particularly true for XML libraries, which have to track rapidly evolving
standards.

For example, Java 1.5 includes Xerces 2.6.2 (same classes, renamed to
com.sun), but Apache Commmons Pool (which several 3rd party packages
depend on) depends on Xerces 2.0.2.  Having both Xerces jars in the same
classpath causes problems.

To work around this:
- we need to exclude certain dependncies in Maven
- we need to be aware fo possible problems during deployment

I have solved (I believe) my immediate problems by blocking Xerces
dependencies in Maven.  In the POM I define dependencies like:

    <dependency>
      <groupId>some.group</groupId>
      <artifactId>some.artifact</artifactId>
      <version>version</version>
      <exclusions>
        <exclusion>
          <groupId>xerces</groupId>
          <artifactId>xerces</artifactId>
        </exclusion>
      </exclusions>
    </dependency>

For deployment this may be insufficient.  Xerces may already be present in
JBoss, for example.

Andrew

More Details: AbstractMethodError (Xerces 2.6.2 with 2.0.2)

From: "andrew cooke" <andrew@...>

Date: Fri, 17 Mar 2006 12:35:50 -0400 (CLT)

[From an email sent to the Xerces mailing list]

I have code with the line:
  element.setIdAttribute(ID, true);
where element is an instance of org.w3c.dom.NodeList and the base document
was created via javax.xml.parsers.DocumentBuilderFactory.newInstance() \
.newDocumentBuilder().newDocument()

This gives the error:
  java.lang.AbstractMethodError:
    org.apache.xerces.dom.ElementImpl.setIdAttribute(Ljava/lang/String;Z)V

I am using Java 1.5.0_04-b05 (JAXP 1.3; Xerces-J 2.6.2) on Suse 9.3.

After some investigation it seems that this only happens when Xerces 2.0.2
appears on the classpath.  This is true even if I explcitly include (in
addition to 2.0.2) Xerces 2.6.2 (rather than relying on JAXP) and use
  -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=
    org.apache.xerces.parsers.StandardParserConfiguration

Questions:
- Is there any way to avoid this error *without* cleaning old versions of
Xerces out of the claspath?
- And is cleaning old versions of Xerces out of the classpath guaranteed
to fix this?

Doesn't Carry Across to Eclipse via mvn eclipse:eclipse

From: "andrew cooke" <andrew@...>

Date: Fri, 17 Mar 2006 13:36:43 -0400 (CLT)

Unfortunately this doesn't carry across to Eclipse.  When the test runs in
Eclipse it still fails with the same error.  This is because the
dependency comes via other projects in eclipse; Eclipse's dependency
handling doesn't "know about" Mule's exclusion.

To fix this, you need to delete Xerces from the projects on which the root
project depends within Eclipse.  To see the list, use "Configure Build
Path" in the root project.  Then use the same dialogue in each sub-project
to remove Xerces.  This probably has to be repeated after each run of mvn
eclipse:eclipse.

Specifying an External/Later Xerces/Xalan

From: "andrew cooke" <andrew@...>

Date: Sat, 18 Mar 2006 09:07:37 -0400 (CLT)

To specify a later, external release of Xerces/Xalan you need to follow
the instructions here:

http://xerces.apache.org/xerces2-j/faq-dom.html#faq-7
http://xml.apache.org/xalan-j/faq.html#jdk14
http://java.sun.com/j2se/1.4.2/docs/guide/standards/

Basically, you grab the xalan tarball and place the jars in jre/lib/endorsed.

Once that is done, Java uses those implementations by default.  You can
test this by writing code as described at
http://xml.apache.org/xalan-j/faq.html#faq-N10064

HOWEVER... while this works from the command line, or in Maven, it does
not work for code executed inside Eclipse.  At least, when running junit
tests in Eclipse 3.1.0 the diagnostics reported the internal JAXP (instead
of the endorsed libraries) in the following cases:

- with the libraries deployed as above
- as above plus a "vmarg" to eclipse defining the directory
- as above plus appearing in the build path for the project
- as above plus appearing in the Java VM libraries (as defined in Eclipse)

Simple works!

From: "andrew cooke" <andrew@...>

Date: Sun, 28 May 2006 11:05:21 -0400 (CLT)

Whoa.  Whatever I was doing earlier (above) was way too complex.

I don't know what happened, but I ended up with things broken again.  So I
cleaned out everything (Eclipse config, Maven pom, Java) and started from
zero.

All that was necessary was:

- exclude xerces from any dependnecy in the pom.  This stops 2.0 being
pulled in, which messes everything up.

- declare xercesImpl 2.6.2 as a dependency

That's it.  Everything just works.  Duh.

Comment on this post