Hello,
I'm posting this to dev instead of users because my best guess is that
this is a bug. But hopefully I'm wrong.
Consider the following target which runs a Java program MakeFoo.class:
<target name="foo">
<java classname="MakeFoo">
<classpath>
<pathelement location="."/>
</classpath>
<arg line="-o foo -d 'maken some foo'"/>
</java>
</target>
This generates the following exception:
$ ant foo
Buildfile: /some/path/to/build.xml
foo:
[java] java.lang.NoClassDefFoundError:
com/sun/net/ssl/internal/ssl/Provider
[java] at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
[java] at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
[java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
[java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
[java] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:597)
[java] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[java] at org.apache.tools.ant.Task.perform(Task.java:348)
[java] at org.apache.tools.ant.Target.execute(Target.java:390)
[java] at org.apache.tools.ant.Target.performTasks(Target.java:411)
[java] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[java] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[java] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[java] at
org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[java] at org.apache.tools.ant.Main.runBuild(Main.java:809)
[java] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[java] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[java] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
[java] Caused by: java.lang.NoClassDefFoundError:
com/sun/net/ssl/internal/ssl/Provider
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:247)
[java] at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:135)
[java] ... 21 more
[java] Caused by: java.lang.ClassNotFoundException:
com.sun.net.ssl.internal.ssl.Provider
[java] at
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1361)
[java] at
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
[java] at
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1070)
[java] at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
[java] ... 24 more
[java] Java Result: -1
Java and Ant versions are pretty much the latest:
$ java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
$ ant -version
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
And I know from using strace that Ant is actually using Sun's Java and
not openjdk.
If I remove the pathelement directive, the build works.
The com.sun.net.ssl.internal.ssl.Provider class is in
${JAVA_HOME}/lib/jsse.jar and that jar is present.
So it seems Ant does not load jsse.jar when using pathelement. Why?
I would appreciate it if someone has a work-around for me. I need to
specify a bunch of jars in the classpath using fileset and once I do
that I need to add '.' so that the program itself is in the classpath.
But once I do this pathement triggers the jsse.jar problem. And
obviously I don't want to add a jsse.jar dep in the build.xml. So I'm
stuck. Please help.
Mike
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]