Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-348

make JDK independent (e.g. also IBM JVM should work)

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.3
    • Fix Version/s: 3.0-M2
    • Component/s: James Core
    • Labels:
      None
    • Environment:
      redhat 9

      Description

      INFO 2004-10-07 17:30:21.087 [Phoenix.] (): 18 Blocks to process for phase "startup". Order of processing = [priva, dnsserver, o
      bjectstorage, database-connections, mailstore, users-store, thread-manager, connections, sockets, scheduler, James, spoolmanager, r
      emotemanager, pop3server, smtpserver, nntp-repository, nntpserver, fetchpop].
      ERROR 2004-10-07 17:30:23.285 [Phoenix.] (): Component named "sockets" failed to pass through the Initialization stage. (Reason:
      java.lang.NoClassDefFoundError: sun/security/provider/Sun).
      ERROR 2004-10-07 17:30:23.286 [Phoenix.] (): There was an error running phase "startup" for Block named "sockets". (Reason: Compo
      nent named "sockets" failed to pass through the Initialization stage. (Reason: java.lang.NoClassDefFoundError: sun/security/provide
      r/Sun).).
      org.apache.excalibur.containerkit.lifecycle.LifecycleException: Component named "sockets" failed to pass through the Initialization
      stage. (Reason: java.lang.NoClassDefFoundError: sun/security/provider/Sun).
      at org.apache.excalibur.containerkit.lifecycle.LifecycleHelper.fail(LifecycleHelper.java:289)
      at org.apache.excalibur.containerkit.lifecycle.LifecycleHelper.startup(LifecycleHelper.java:159)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.startup(DefaultApplication.java:480)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.doRunPhase(DefaultApplication.java:428)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.runPhase(DefaultApplication.java:364)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.start(DefaultApplication.java:138)
      at org.apache.avalon.framework.container.ContainerUtil.start(ContainerUtil.java:251)
      rethrown from
      java.lang.NoClassDefFoundError: sun/security/provider/Sun
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:1747)
      at java.lang.Class.getConstructor1(Class.java:2063)
      at java.lang.Class.newInstance3(Class.java:331)
      at java.lang.Class.newInstance(Class.java:305)
      at org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager.createFactory(DefaultSocketManager.java:135)
      at org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager.setupServerSocketFactory(DefaultSocketManager.java:93)
      INFO 2004-10-07 17:30:23.302 [Phoenix.] (): exception while starting:Component named "sockets" failed to pass through the Initia
      lization stage. (Reason: java.lang.NoClassDefFoundError: sun/security/provider/Sun).

      WARN 2004-10-07 17:30:23.308 [Phoenix.] (): Failed to start application james.
      org.apache.avalon.framework.CascadingException: Failed to start application james.
      at org.apache.avalon.phoenix.components.kernel.DefaultKernel.startup(DefaultKernel.java:195)
      at org.apache.avalon.phoenix.components.kernel.DefaultKernel.addApplication(DefaultKernel.java:254)
      at org.apache.avalon.phoenix.components.deployer.DefaultDeployer.deploy(DefaultDeployer.java:353)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:498)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:491)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFiles(DefaultEmbeddor.java:476)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployDefaultApplications(DefaultEmbeddor.java:466)
      rethrown from
      org.apache.avalon.phoenix.interfaces.ApplicationException: Component named "sockets" failed to pass through the Initialization stag
      e. (Reason: java.lang.NoClassDefFoundError: sun/security/provider/Sun).
      at org.apache.avalon.phoenix.components.application.DefaultApplication.start(DefaultApplication.java:144)
      at org.apache.avalon.framework.container.ContainerUtil.start(ContainerUtil.java:251)
      at org.apache.avalon.phoenix.components.kernel.DefaultKernel.startup(DefaultKernel.java:178)
      at org.apache.avalon.phoenix.components.kernel.DefaultKernel.addApplication(DefaultKernel.java:254)
      at org.apache.avalon.phoenix.components.deployer.DefaultDeployer.deploy(DefaultDeployer.java:353)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:498)
      at org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:491)
      rethrown from
      org.apache.excalibur.containerkit.lifecycle.LifecycleException: Component named "sockets" failed to pass through the Initialization
      stage. (Reason: java.lang.NoClassDefFoundError: sun/security/provider/Sun).
      at org.apache.excalibur.containerkit.lifecycle.LifecycleHelper.fail(LifecycleHelper.java:289)
      at org.apache.excalibur.containerkit.lifecycle.LifecycleHelper.startup(LifecycleHelper.java:159)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.startup(DefaultApplication.java:480)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.doRunPhase(DefaultApplication.java:428)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.runPhase(DefaultApplication.java:364)
      at org.apache.avalon.phoenix.components.application.DefaultApplication.start(DefaultApplication.java:138)
      at org.apache.avalon.framework.container.ContainerUtil.start(ContainerUtil.java:251)
      rethrown from
      java.lang.NoClassDefFoundError: sun/security/provider/Sun
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:1747)
      at java.lang.Class.getConstructor1(Class.java:2063)
      at java.lang.Class.newInstance3(Class.java:331)
      at java.lang.Class.newInstance(Class.java:305)
      at org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager.createFactory(DefaultSocketManager.java:135)
      at org.apache.avalon.cornerstone.blocks.sockets.DefaultSocketManager.setupServerSocketFactory(DefaultSocketManager.java:93)
      WARN 2004-10-07 17:30:23.371 [Phoenix.] (): Failed to stop application james as it is not initialized/started.
      [

      So, sun appears to be hard-coded even if in james-config, I set
      <sockets>
      <server-sockets>
      <factory name="plain" class="org.apache.avalon.cornerstone.blocks.sockets.DefaultServerSocketFactory"/>
      <factory name="ssl"
      class="org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory">
      <keystore>
      <file>conf/keystore</file>
      <password>asdfasfd</password>
      <type>JKS</type>
      <protocol>SSL</protocol>
      <algorithm>IbmX509</algorithm>
      ...

      Also, tried to figure out whether in the future versions of cornerstone, this is already fixed, but only found
      http://archive.apache.org/dist/avalon/cornerstone-sockets-impl/source/, but it wasn't clear, in which avalon successor, it will have its new home (http://avalon.apache.org/closed.html)

        Activity

        Hide
        hes.siemelink Hes Siemelink added a comment -

        What happens if you try a different keystore type, for example PKCS12?

        Show
        hes.siemelink Hes Siemelink added a comment - What happens if you try a different keystore type, for example PKCS12?
        Hide
        hes.siemelink Hes Siemelink added a comment -

        Hm, that will probably not work.

        I did some source code archeology on the fossilized Avalon framework and found this:

        http://svn.apache.org/repos/asf/avalon/cvs-migration-snapshot/avalon-components/cornerstone/sockets/impl/src/java/org/apache/avalon/cornerstone/blocks/sockets/SSLFactoryBuilder.java

        In this file you can find the following code:

        static

        { // Registers Sun's providers java.security.Security.addProvider( new sun.security.provider.Sun() ); java.security.Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() ); }

        So there are indeed hard-coded references to Sun classes...

        I think there is little hope that someone will patch and test and release a part of Avalon, but you can try a work around:

        Make an empty implementation of above classes that extend java.security.Provider and put them on your class path. I don't know if this will work, but it's worth a try.

        Show
        hes.siemelink Hes Siemelink added a comment - Hm, that will probably not work. I did some source code archeology on the fossilized Avalon framework and found this: http://svn.apache.org/repos/asf/avalon/cvs-migration-snapshot/avalon-components/cornerstone/sockets/impl/src/java/org/apache/avalon/cornerstone/blocks/sockets/SSLFactoryBuilder.java In this file you can find the following code: static { // Registers Sun's providers java.security.Security.addProvider( new sun.security.provider.Sun() ); java.security.Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() ); } So there are indeed hard-coded references to Sun classes... I think there is little hope that someone will patch and test and release a part of Avalon, but you can try a work around: Make an empty implementation of above classes that extend java.security.Provider and put them on your class path. I don't know if this will work, but it's worth a try.
        Hide
        ralfhauser Ralf Hauser added a comment -

        I see http://james.apache.org/usingTLS_2_1.html#Configuring%20the%20Server%20Socket%20Factory , does this mean that the dependency on cornerstone/.../socket/SSLFactoryBuilder.java is gone...

        Show
        ralfhauser Ralf Hauser added a comment - I see http://james.apache.org/usingTLS_2_1.html#Configuring%20the%20Server%20Socket%20Factory , does this mean that the dependency on cornerstone/.../socket/SSLFactoryBuilder.java is gone...
        Hide
        bago Stefano Bagnara added a comment -

        No, we still depend on org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory
        The document you linked is from the 2.1 documentation, and I don't see where it say something about not using the TLSServerSocketFactory.

        We upgraded the cornerstone sockets to the latest 2.1 release, don't know if it fix anything.

        Show
        bago Stefano Bagnara added a comment - No, we still depend on org.apache.avalon.cornerstone.blocks.sockets.TLSServerSocketFactory The document you linked is from the 2.1 documentation, and I don't see where it say something about not using the TLSServerSocketFactory. We upgraded the cornerstone sockets to the latest 2.1 release, don't know if it fix anything.
        Hide
        norman Norman Maurer added a comment -

        James now work with ibm jdk, openjdk, sun jdk (others not tested yet).

        Show
        norman Norman Maurer added a comment - James now work with ibm jdk, openjdk, sun jdk (others not tested yet).

          People

          • Assignee:
            norman Norman Maurer
            Reporter:
            ralfhauser Ralf Hauser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development