Hello IvyDE developers,

I've got a Eclipse java project where I have a ivy.xml and ivy-settings.xml
added and I'm configuring a Ivy container that I'm pointing to the
ivy-settings.xml file.  The problem is that inside the ivy-settings.xml
there is an element like this:

    <signers>
        <pgp keyId="${pgp.keyname}" name="${pgp.generator}"
password="${pgp.passphrase}" />
    </signers>

When the IvyDE plugin loads the embedded Ivy runtime from the OSGi bundle
and have it parse the ivy-settings.xml file it will throw NoClassDefFound
when it hits the <pgp> element.  See attached log file for error.

I've debugged this and its because ivy-settings.xml parser is trying to
create an instance of this class:
org.apache.ivy.plugins.signer.bouncycastle.OpenPGPSignatureGenerator

This class requires several classes in the org.bouncycastle.* package,
however, the OSGi classloader from Eclipse that is creating the new
instance of OpenPGPSignatureGenerator can't find the needed classes from
org.bouncycastle on the bundle classpath.

After trying several alternatives, it seems that the only way to get this
to work is to modify the org.apache.ivy_xxx.jar OSGi bundle itself and add
the necessary "Import-Package: org.bouncycastle.*" packages and also make
them available to Eclipse OSGi runtime.

Any thoughts?

-- 
Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com
java.lang.NoClassDefFoundError: org/bouncycastle/openpgp/PGPException
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2398)
        at java.lang.Class.getConstructor0(Class.java:2708)
        at java.lang.Class.newInstance0(Class.java:328)
        at java.lang.Class.newInstance(Class.java:310)
        at org.apache.ivy.util.Configurator.addChild(Configurator.java:586)
        at 
org.apache.ivy.util.Configurator.startCreateChild(Configurator.java:503)
        at 
org.apache.ivy.core.settings.XmlSettingsParser.inConfiguratorStarted(XmlSettingsParser.java:586)
        at 
org.apache.ivy.core.settings.XmlSettingsParser.startElement(XmlSettingsParser.java:201)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown 
Source)
        at 
org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown 
Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
        at 
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown 
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown 
Source)
        at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:277)
        at 
org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:160)
        at 
org.apache.ivy.core.settings.XmlSettingsParser.parse(XmlSettingsParser.java:150)
        at org.apache.ivy.core.settings.IvySettings.load(IvySettings.java:390)
        at org.apache.ivy.Ivy.configure(Ivy.java:416)
        at 
org.apache.ivyde.eclipse.internal.CachedIvy.getIvyFromFile(CachedIvy.java:201)
        at 
org.apache.ivyde.eclipse.internal.CachedIvy.doGetIvy(CachedIvy.java:161)
        at 
org.apache.ivyde.eclipse.internal.CachedIvy.getIvy(CachedIvy.java:122)
        at 
org.apache.ivyde.eclipse.resolve.IvyResolveJob.doRun(IvyResolveJob.java:145)
        at 
org.apache.ivyde.eclipse.resolve.IvyResolveJob.run(IvyResolveJob.java:85)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.ClassNotFoundException: 
org.bouncycastle.openpgp.PGPException cannot be found by 
org.apache.ivy_2.4.0.alpha_20130728143216
        at 
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
        at 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
        at 
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
        at 
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        ... 31 more
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to