ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Heyse <Maarten.He...@alcatel-lucent.com>
Subject Exception in thread "main" java.lang.NoClassDefFoundError: com/jcraft/jsch/JSchException when using Ivy standalone with ssh resolver
Date Fri, 23 Nov 2012 10:36:48 GMT
I get the NoClassDefFoundError when using a ssh resolver in standalone ivy.

Environment and setup:

- OS:
CentOs 5
$ uname -a
Linux xxx 2.6.18-308.11.1.el5 #1 SMP Tue Jul 10 08:48:43 EDT 2012 x86_64 
x86_64 x86_64 GNU/Linux

- downloaded and untarred Ivy-2.3.0-rc2 with deps from site.
[mheyse@xxx /repo/mheyse/ivy/apache-ivy-2.3.0-rc2]$ ls ..
apache-ivy-2.3.0-rc1  apache-ivy-2.3.0-rc2 
apache-ivy-2.3.0-rc2-bin.tar.gz 
apache-ivy-2.3.0-rc2-bin-with-deps.tar.gz  Ivy-test  Ivy-test.tar.gz
[mheyse@xxx /repo/mheyse/ivy/apache-ivy-2.3.0-rc2]$ ls
CHANGES.txt  doc  ivy-2.3.0-rc2.jar  ivy.xml  ivy.xsd  lib  LICENSE 
NOTICE  README  RELEASE_NOTES  src
[mheyse@xxx /repo/mheyse/ivy/apache-ivy-2.3.0-rc2]$ ls lib
commons-codec-1.2.jar  commons-httpclient-3.0.jar 
commons-logging-1.0.4.jar  commons-vfs-1.0.jar  jsch-0.1.31.jar 
oro-2.0.8.jar

- ivy settings files:
[mheyse@xxx /repo/mheyse/ivy/apache-ivy-2.3.0-rc2]$ cat 
/repo/mheyse/ivy/Ivy-test/ivysettings.xml
<ivysettings>
<!--  <classpath 
file="/repo/mheyse/ivy/apache-ivy-2.3.0-rc2/lib/jsch-0.1.31.jar"/> -->
   <property name="ivy.common.ivy.user.dir" 
value="${ivy.settings.dir}/ivy-repository" override="false"/>
   <property name="ivy.default.ivy.pattern" 
value="[module]/[revision]/[artifact].[ext]" override="false"/>
   <property name="ivy.default.artifact.pattern" 
value="[module]/[revision]/[artifact].[ext]" override="false"/>
   <settings defaultResolver="default"/>
   <caches defaultCacheDir="${ivy.settings.dir}/ivy-cache"/>
<!--  <include 
url="${ivy.default.settings.dir}/ivysettings-public.xml"/> -->
   <include url="ivysettings-public.xml"/>
   <include url="${ivy.default.settings.dir}/ivysettings-shared.xml"/>
<!--  <include url="${ivy.default.settings.dir}/ivysettings-local.xml"/> -->
   <include url="ivysettings-local.xml"/>
   <include url="${ivy.default.settings.dir}/ivysettings-main-chain.xml"/>
   <include 
url="${ivy.default.settings.dir}/ivysettings-default-chain.xml"/>
</ivysettings>

[mheyse@xxx /repo/mheyse/ivy/apache-ivy-2.3.0-rc2]$ cat 
/repo/mheyse/ivy/Ivy-test/ivysettings-public.xml
<ivysettings>
   <property name="ivy.public.default.root" 
value="${ivy.common.ivy.user.dir}/public" override="false"/>
   <property name="ivy.public.default.ivy.pattern" 
value="${ivy.default.ivy.pattern}" override="false"/>
   <property name="ivy.public.default.artifact.pattern" 
value="${ivy.default.artifact.pattern}" override="false"/>
   <resolvers>
     <ssh name="public" user="mheyse" host="xxx">
       <ivy 
pattern="${ivy.public.default.root}/${ivy.public.default.ivy.pattern}" />
       <artifact 
pattern="${ivy.public.default.root}/${ivy.public.default.artifact.pattern}" 
/>
     </ssh>
<!--    <filesystem name="public">
       <ivy 
pattern="${ivy.public.default.root}/${ivy.public.default.ivy.pattern}" />
       <artifact 
pattern="${ivy.public.default.root}/${ivy.public.default.artifact.pattern}" 
/>
     </filesystem> -->
   </resolvers>
</ivysettings>

- output:
[mheyse@xxx /repo/mheyse/ivy/apache-ivy-2.3.0-rc2]$ java -jar 
ivy-2.3.0-rc2.jar -settings /repo/mheyse/ivy/Ivy-test/ivysettings.xml 
-ivy ivy.xml -debug
:: loading settings :: file = /repo/mheyse/ivy/Ivy-test/ivysettings.xml
setting 'ivy.settings.dir' to '/repo/mheyse/ivy/Ivy-test'
setting 'ivy.conf.dir' to '/repo/mheyse/ivy/Ivy-test'
setting 'ivy.settings.file' to '/repo/mheyse/ivy/Ivy-test/ivysettings.xml'
setting 'ivy.conf.file' to '/repo/mheyse/ivy/Ivy-test/ivysettings.xml'
setting 'ivy.settings.url' to 
'file:/repo/mheyse/ivy/Ivy-test/ivysettings.xml'
setting 'ivy.conf.url' to 'file:/repo/mheyse/ivy/Ivy-test/ivysettings.xml'
setting 'ivy.default.ivy.user.dir' to '/home/mheyse/.ivy2'
setting 'ivy.home' to '/home/mheyse/.ivy2'
no default ivy user dir defined: set to /home/mheyse/.ivy2
setting 'ivy.log.modules.in.use' to 'false'
setting 'ivy.resolver.default.check.modified' to 'false'
setting 'ivy.default.always.check.exact.revision' to 'false'
setting 'ivy.retrieve.pattern' to 
'${ivy.lib.dir}/[artifact]-[revision](-[classifier]).[ext]'
setting 'ivy.configurations' to '*'
setting 'ivy.buildlist.ivyfilepath' to 'ivy.xml'
setting 'ivy.status' to 'integration'
setting 'ivy.resolve.default.type.filter' to '*'
setting 'ivy.project.dir' to '${basedir}'
setting 'ivy.dep.file' to 'ivy.xml'
'ivy.settings.file' already set: discarding 'ivysettings.xml'
setting 'ivy.report.output.pattern' to 
'[organisation]-[module]-[conf].[ext]'
setting 'ivy.cache.ttl.default' to '10s'
setting 'ivy.publish.src.artifacts.pattern' to 
'${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]'
setting 'ivy.deliver.ivy.pattern' to 
'${ivy.distrib.dir}/[type]s/[artifact]-[revision](-[classifier]).[ext]'
setting 'ivy.build.artifacts.dir' to '${ivy.project.dir}/build/artifacts'
setting 'ivy.checksums' to 'sha1,md5'
setting 'ivy.distrib.dir' to '${ivy.project.dir}/distrib'
setting 'ivy.lib.dir' to '${ivy.project.dir}/lib'
setting 'ivy.common.ivy.user.dir' to 
'/repo/mheyse/ivy/Ivy-test/ivy-repository'
setting 'ivy.default.ivy.pattern' to '[module]/[revision]/[artifact].[ext]'
setting 'ivy.default.artifact.pattern' to 
'[module]/[revision]/[artifact].[ext]'
setting 'ivy.cache.dir' to '/repo/mheyse/ivy/Ivy-test/ivy-cache'
including url: file:/repo/mheyse/ivy/Ivy-test/ivysettings-public.xml
setting 'ivy.public.default.root' to 
'/repo/mheyse/ivy/Ivy-test/ivy-repository/public'
setting 'ivy.public.default.ivy.pattern' to 
'[module]/[revision]/[artifact].[ext]'
setting 'ivy.public.default.artifact.pattern' to 
'[module]/[revision]/[artifact].[ext]'
Exception in thread "main" java.lang.NoClassDefFoundError: 
com/jcraft/jsch/JSchException
         at 
org.apache.ivy.plugins.resolver.SshResolver.<init>(SshResolver.java:28)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
         at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
         at java.lang.Class.newInstance0(Class.java:372)
         at java.lang.Class.newInstance(Class.java:325)
         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:579)
         at 
org.apache.ivy.core.settings.XmlSettingsParser.startElement(XmlSettingsParser.java:201)
         at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1340)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
         at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
         at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
         at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
         at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
         at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:274)
         at 
org.apache.ivy.core.settings.XmlSettingsParser.doParse(XmlSettingsParser.java:160)
         at 
org.apache.ivy.core.settings.XmlSettingsParser.parse(XmlSettingsParser.java:183)
         at 
org.apache.ivy.core.settings.XmlSettingsParser.includeStarted(XmlSettingsParser.java:435)
         at 
org.apache.ivy.core.settings.XmlSettingsParser.startElement(XmlSettingsParser.java:211)
         at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504)
         at 
com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1320)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
         at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
         at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:819)
         at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:748)
         at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
         at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
         at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:392)
         at javax.xml.parsers.SAXParser.parse(SAXParser.java:274)
         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:391)
         at org.apache.ivy.Ivy.configure(Ivy.java:416)
         at org.apache.ivy.Main.initSettings(Main.java:399)
         at org.apache.ivy.Main.run(Main.java:208)
         at org.apache.ivy.Main.main(Main.java:179)
Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.JSchException
         at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
         ... 47 more

- Things already tried:
* set classpath option in java (so using following command):
java -cp /repo/mheyse/ivy/apache-ivy-2.3.0-rc2/lib/jsch-0.1.31.jar -jar 
ivy-2.3.0-rc2.jar -settings /repo/mheyse/ivy/Ivy-test/ivysettings.xml 
-ivy ivy.xml -debug
* set classpath in ivysettings file (uncomment the classpath line in 
ivysettings.xml)
But always same error.

It works with the filesystem resolver (commented in 
ivysettings-public.xml). But I need the ssh resolver.
Can someone help?

Regards,
Maarten

Mime
View raw message