james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Frank Herrmann <herrmann.fr...@gmx.de>
Subject James mailet+JCE
Date Mon, 02 Sep 2002 21:59:04 GMT
Hello!

I'd like to use JCE (Java Cryptography Extension) inside a mailet. When I try 
to start James (run.sh) it throws the following exception: 

java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE

AFAIK this only happens if the provider class is not in the classpath.
(for me it is /usr/lib/java/jre/lib/ext/sunjce_provider.jar)

When I compile (and run) the code snippet in a separate ("normal") java file 
it works like a charm. 

So the question is: How can I tell James where to find the sunjce_provider.jar 
file ? 

What I already tried: added classpath in /dist/bin/run.sh - no difference.

$JAVA_HOME/bin/java -classpath /usr/lib/java/jre/lib/ext/sunjce_provider.jar 
$JVM_OPTS -jar $PHOENIX_HOME/bin/phoenix-loader.jar $*

Greetings,
Frank

-------------------------------little code sample---------------------
 	   try {

            if (_DEBUG_CRYPTO) {
                // display providers we have available:
                secProviders = Security.getProviders();
                System.out.println(secProviders.length);
                for (int i = 0; i < secProviders.length; i++)
                    {
                        System.out.println(secProviders[i].getInfo());
                    }
            }

	     /* select provider SunJCE */
            secProvider = new com.sun.crypto.provider.SunJCE();
            Security.addProvider(secProvider);

       }
        catch (Exception e) {}
--------------------------------------------------------------------

------------------------the full exception output--------------------

James 2.0a3
There was an uncaught exception:
---------------------------------------------------------
--- Message ---
Failed to initialize application james.
--- Stack Trace ---
org.apache.avalon.phoenix.interfaces.DeploymentException: Failed to initialize 
application james.
        at 
org.apache.avalon.phoenix.components.deployer.DefaultDeployer.deploy(DefaultDeployer.java:183)
        at 
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:467)
        at 
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFile(DefaultEmbeddor.java:461)
        at 
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployFiles(DefaultEmbeddor.java:449)
        at 
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.deployDefaultApplications(DefaultEmbeddor.java:439)
        at 
org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.execute(DefaultEmbeddor.java:182)
        at org.apache.avalon.phoenix.frontends.CLIMain.run(CLIMain.java:115)
        at 
org.apache.avalon.phoenix.frontends.CLIMain.execute(CLIMain.java:101)
        at org.apache.avalon.phoenix.frontends.CLIMain.main(CLIMain.java:67)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at org.apache.avalon.phoenix.launcher.Main.startup(Main.java:88)
        at org.apache.avalon.phoenix.launcher.Main.main(Main.java:51)
Caused by: org.apache.avalon.framework.CascadingException: Failed to 
initialize application james.
        at 
org.apache.avalon.phoenix.components.kernel.DefaultKernel.startup(DefaultKernel.java:134)
        at 
org.apache.avalon.phoenix.components.kernel.DefaultKernel.addApplication(DefaultKernel.java:169)
        at 
org.apache.avalon.phoenix.components.deployer.DefaultDeployer.deploy(DefaultDeployer.java:166)
        ... 14 more
Caused by: org.apache.avalon.framework.CascadingException: Block named 
"spoolmanager" failed to pass through the Initialization stage. (Reason: 
java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE).
        at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.fail(LifecycleHelper.java:417)
        at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.startup(LifecycleHelper.java:220)
        at 
org.apache.avalon.phoenix.components.application.DefaultApplication.runPhase(DefaultApplication.java:176)
        at 
org.apache.avalon.phoenix.components.application.DefaultApplication.start(DefaultApplication.java:88)
        at 
org.apache.avalon.phoenix.components.kernel.DefaultKernel.startup(DefaultKernel.java:122)
        ... 16 more
Caused by: java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:130)
        at 
org.apache.james.transport.MailetLoader.getMailet(MailetLoader.java:57)
        at 
org.apache.james.transport.JamesSpoolManager.initialize(JamesSpoolManager.java:151)
        at 
org.apache.avalon.phoenix.components.application.LifecycleHelper.startup(LifecycleHelper.java:199)
        ... 19 more
---------------------------------------------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message