Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[higgins-dev] The javax.xml.namespace.QName issue in higgins code


When I run higgins.crpps code, I got this exception during runtime:

java.lang.LinkageError: loader constraints violated when linking javax/xml/namespace/QName class
        at org.eclipse.higgins.iss.cardspace.IdentityToken.toElement(IdentityToken.java:118)
        at org.eclipse.higgins.iss.cardspace.IdentityToken.getAs(IdentityToken.java:73)
        at org.eclipse.higgins.crpps.service.InfoCardModel.handleGetTokenRequest(InfoCardModel.java:108)
        at org.eclipse.higgins.crpps.service.InfoCardController.previewToken(InfoCardController.java:203)
        at org.eclipse.higgins.crpps.service.InfoCardController.sendToken(InfoCardController.java:212)
        at org.eclipse.higgins.crpps.ui.CardTaskView$12.run(CardTaskView.java:659)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)

I looked into the code, and found the QName class exists in both JRE (v 5.0) and xml-api.jar (inside dependency.redist). And in most cases the higgins plug-ins load QName class from JRE. This may cause problem.

My debugging experience tells me: if a plug-in put the "org.eclipse.core.runtime" into the "Require-Bundle" (in Menifest.MF), then all of the JRE's classes will be loaded with first priority, otherwise, the Eclipse platform try to search the class from it's own class loader delegation mechanism.

If you really depend on packages in "org.eclipse.core.runtime", you can use "Import-Package" instead of "Require-Bundle". When I use "Import-Package" in "org.eclipse.higgins.iss.cardspace", the above exception disappear.

I have not checked in this piece of code yet.

Li Tie | IBM Lotus | Eclipse committer | Tel: 86-10-82452494 | Fax: 86-10-82452887

Back to the top