james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: James mailet+JCE
Date Tue, 03 Sep 2002 02:47:55 GMT
Removing jre/lib/ext from the classpath seems like an error.  That is
explicitly where shared libraries are supposed to go.  Separation of
classpath's shouldn't apply.

It would only make sense if the goal was to make SAR files self-contained,
except for Phoenix.

	--- Noel

-----Original Message-----
From: Danny Angus [mailto:danny@apache.org]
Sent: Monday, September 02, 2002 18:41
To: James Developers List
Subject: RE: James mailet+JCE


Frank,
the mailet classpath is controlled by Avalon Phoenix
http://jakarta.apache/org/avalon
If you're not familiar with avalon it provides james (I expect the Avaloon
guys will "correct" me robustly when i get this wrong!) with a runtime
platform "Phoenix", several services, and a lifecycle framework.

Phoenix ensures classpath separation amongst apps its hosting, which is
fine, but also (probably for good reasons) omits
jre/lib/ext from the classpath it provides its "blocks" with. if you're
using james 1.2a1-xx you could try putting the crypto provider in phoenix
own common lib dirs, which I think would be either james/lib or james/ext

I know one of these (can't remember which offhand) works for JDBC drivers,
check my JDBC related comments in the config file to find out what I used to
know ;-).

As far as telling Phoenix to include jre/lib/ext in the classpath it
provides, I'm not sure what to do, (if you are a *nix user I'd try linking
Phoenix /ext/ to jre/lib/ext, but thats not a portable answer).

You may get further by asking this same question on the avalon lists.
If you get a better answer anywhere let us know.

d.

> -----Original Message-----
> From: Frank Herrmann [mailto:herrmann.frank@gmx.de]
> Sent: 02 September 2002 22:59
> To: James developer list
> Subject: James mailet+JCE
>
>
> 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.depl
> oy(DefaultDeployer.java:183)
>         at
> org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.depl
> oyFile(DefaultEmbeddor.java:467)
>         at
> org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.depl
> oyFile(DefaultEmbeddor.java:461)
>         at
> org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.depl
> oyFiles(DefaultEmbeddor.java:449)
>         at
> org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.depl
> oyDefaultApplications(DefaultEmbeddor.java:439)
>         at
> org.apache.avalon.phoenix.components.embeddor.DefaultEmbeddor.exec
> ute(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(NativeMethodAccessorIm
> pl.java:39)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAc
> cessorImpl.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.addAppli
> cation(DefaultKernel.java:169)
>         at
> org.apache.avalon.phoenix.components.deployer.DefaultDeployer.depl
> oy(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.f
> ail(LifecycleHelper.java:417)
>         at
> org.apache.avalon.phoenix.components.application.LifecycleHelper.s
> tartup(LifecycleHelper.java:220)
>         at
> org.apache.avalon.phoenix.components.application.DefaultApplicatio
> n.runPhase(DefaultApplication.java:176)
>         at
> org.apache.avalon.phoenix.components.application.DefaultApplicatio
> n.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(JamesSpool
> Manager.java:151)
>         at
> org.apache.avalon.phoenix.components.application.LifecycleHelper.s
> tartup(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>


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


--
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