Bug 32680 - jakarta-tomcat-connectors has SUN specific code causes problem in Kaffe
jakarta-tomcat-connectors has SUN specific code causes problem in Kaffe
Status: RESOLVED FIXED
Product: Tomcat 5
Classification: Unclassified
Component: Connector:HTTP
Unknown
All Windows XP
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
http://brutus.apache.org/gump/kaffe/j...
:
: 32679 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2004-12-14 03:29 UTC by Davanum Srinivas
Modified: 2004-12-13 23:58 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davanum Srinivas 2004-12-14 03:29:09 UTC
For example,
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/jsse/JSSE13SocketFactory.java

has the following lines:
69: Security.addProvider (new sun.security.provider.Sun());
70: Security.addProvider (new com.sun.net.ssl.internal.ssl.Provider());

Can we please do this via reflection? Folks using Kaffe are facing problems.
This problem was uncovered by Kaffe/Gump:
http://brutus.apache.org/gump/kaffe/jakarta-tomcat-connectors/jakarta-tomcat-util/gump_work/build_jakarta-tomcat-connectors_jakarta-tomcat-util.html

Thanks,
dims
Comment 1 Dalibor Topic 2004-12-14 03:36:27 UTC
*** Bug 32679 has been marked as a duplicate of this bug. ***
Comment 2 william.barker 2004-12-14 05:56:56 UTC
To compile with a non-Sun JVM, you need to have the JSSE 1.0.x jars 
available.  These are in the CLASSPATH on the Gump page, and in the 
<classpath> entry under the <javac> in the build.xml file.  This points to the 
problem being with Kaffe, or with ant's integration with Kaffe.
Comment 3 Dalibor Topic 2004-12-14 07:44:06 UTC
Actually ... it is a bug in tomcat-connector because the class that jikes
complains about, sun.security.provider.Sun is *not* part of JSSE, afaict.

See the log at
http://brutus.apache.org/gump/kaffe/jakarta-tomcat-connectors/jakarta-tomcat-util/gump_work/build_jakarta-tomcat-connectors_jakarta-tomcat-util.html

For your convenience, I'll provide the relevant excerpt here:

    [javac]     69.             Security.addProvider (new
sun.security.provider.Sun());
    [javac]                                               ^-^
    [javac] *** Semantic Error: You need to modify your classpath, sourcepath,
bootclasspath, and/or extdirs setup. Jikes could not find package "sun" in: 
    [javac]                
/usr/local/gump/kaffe/workspace/xml-xerces2/java/build/xercesImpl.jar
    [javac]                 /usr/local/gump-kaffe/jre/lib/rt.jar
    [javac]                 /usr/local/gump-kaffe/lib/kjc.jar
    [javac]                 /usr/local/gump-kaffe/lib/gjdoc.jar
    [javac]                
/home/gump/workspaces2/kaffe/workspace/jakarta-tomcat-connectors/util/build/classes
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-stylebook.jar
    [javac]                 /usr/local/gump/kaffe/workspace/ant/dist/lib/ant-jmf.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-swing.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-trax.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-junit.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-launcher.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-nodeps.jar
    [javac]                 /usr/local/gump/kaffe/workspace/ant/dist/lib/ant.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jcert.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jnet.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jsse.jar
    [javac]                 /usr/local/gump/packages/jmx-1_2-ri/lib/jmxri.jar
    [javac]                
/usr/local/gump/kaffe/workspace/jakarta-commons/logging/dist/commons-logging.jar
    [javac]                
/home/gump/workspaces2/kaffe/workspace/jakarta-tomcat-connectors/util/java
    [javac]                
/usr/local/gump/kaffe/workspace/xml-xerces2/java/tools/resolver.jar
    [javac]                 .



    [javac]     69.             Security.addProvider (new
sun.security.provider.Sun());
    [javac]                                                   ^------^
    [javac] *** Semantic Error: You need to modify your classpath, sourcepath,
bootclasspath, and/or extdirs setup. Jikes could not find package "sun.security"
in: 
    [javac]                
/usr/local/gump/kaffe/workspace/xml-xerces2/java/build/xercesImpl.jar
    [javac]                 /usr/local/gump-kaffe/jre/lib/rt.jar
    [javac]                 /usr/local/gump-kaffe/lib/kjc.jar
    [javac]                 /usr/local/gump-kaffe/lib/gjdoc.jar
    [javac]                
/home/gump/workspaces2/kaffe/workspace/jakarta-tomcat-connectors/util/build/classes
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-stylebook.jar
    [javac]                 /usr/local/gump/kaffe/workspace/ant/dist/lib/ant-jmf.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-swing.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-trax.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-junit.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-launcher.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-nodeps.jar
    [javac]                 /usr/local/gump/kaffe/workspace/ant/dist/lib/ant.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jcert.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jnet.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jsse.jar
    [javac]                 /usr/local/gump/packages/jmx-1_2-ri/lib/jmxri.jar
    [javac]                
/usr/local/gump/kaffe/workspace/jakarta-commons/logging/dist/commons-logging.jar
    [javac]                
/home/gump/workspaces2/kaffe/workspace/jakarta-tomcat-connectors/util/java
    [javac]                
/usr/local/gump/kaffe/workspace/xml-xerces2/java/tools/resolver.jar
    [javac]                 .



    [javac]     69.             Security.addProvider (new
sun.security.provider.Sun());
    [javac]                                                            ^------^
    [javac] *** Semantic Error: You need to modify your classpath, sourcepath,
bootclasspath, and/or extdirs setup. Jikes could not find package
"sun.security.provider" in: 
    [javac]                
/usr/local/gump/kaffe/workspace/xml-xerces2/java/build/xercesImpl.jar
    [javac]                 /usr/local/gump-kaffe/jre/lib/rt.jar
    [javac]                 /usr/local/gump-kaffe/lib/kjc.jar
    [javac]                 /usr/local/gump-kaffe/lib/gjdoc.jar
    [javac]                
/home/gump/workspaces2/kaffe/workspace/jakarta-tomcat-connectors/util/build/classes
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-stylebook.jar
    [javac]                 /usr/local/gump/kaffe/workspace/ant/dist/lib/ant-jmf.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-swing.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-trax.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-junit.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-launcher.jar
    [javac]                
/usr/local/gump/kaffe/workspace/ant/dist/lib/ant-nodeps.jar
    [javac]                 /usr/local/gump/kaffe/workspace/ant/dist/lib/ant.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jcert.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jnet.jar
    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jsse.jar
    [javac]                 /usr/local/gump/packages/jmx-1_2-ri/lib/jmxri.jar
    [javac]                
/usr/local/gump/kaffe/workspace/jakarta-commons/logging/dist/commons-logging.jar
    [javac]                
/home/gump/workspaces2/kaffe/workspace/jakarta-tomcat-connectors/util/java
    [javac]                
/usr/local/gump/kaffe/workspace/xml-xerces2/java/tools/resolver.jar
    [javac]                 .



    [javac]     69.             Security.addProvider (new
sun.security.provider.Sun());
    [javac]                                                                     ^-^
    [javac] *** Semantic Error: Type "sun.security.provider.Sun" was not found.


It only complains about the "sun.security.provider.Sun" class and not about the
com.sun.net.ssl.internal.ssl.Provider (which it finds on the classpath, as you
can see in the 

    [javac]                 /usr/local/gump/packages/jsse1.0.3/lib/jsse.jar

line).

I'd suggest using 

Provider default = Security.getProvider("Sun");
if (null == sun) {
  default = Security.getProviders()[0];
}
Security.addProvider(default); 

if you specifically need Sun's crypto provider (or whetever Sun's provider's
name is), and want to have a fallback when it's not available. 

Kaffe comes with its own implementation of JSSE from JESSIE [1], on a side note.

cheers,
dalibor topic

[1] http://www.nongnu.org/jessie/
Comment 4 william.barker 2004-12-14 08:58:23 UTC
Fixed in CVS