Re: Resend: SSL portability and Coyote

2002-04-29 Thread Nick Betteridge

Eric Rescorla wrote:
 
 Nick Betteridge [EMAIL PROTECTED] writes:
  Eric Rescorla wrote:
  
   This didn't make it out the first time so I'm resending...
  
   I'm looking at what needs to be done to make the 3.3 SSL portablity
   stuff work properly with Coyote. For the most part, this work has been
   done--if you set the SSLImplementation appropriately and the correct
   factory gets invoked. However, there appear to be some issues with
   CoyoteServerSocketFactory and it's handling of configuration
   directives:
  
   (1) CoyoteServerSocketFactory appears to be willing to handle a
   socketFactoryName. AFAICT, this is supplanted by SSLImplementation
   and none of the other code does anything with it. Any reason not to
   remove support for this directive entirely?
  
   (2) JSSE uses one keyfile (the keystore). PureTLS uses three, the
   keyfile, the CA file, and the random file. I need to add new
   directives to ServerSocketFactory to propagate those.
  
 
  Erik - any chance of implementing this with a generic certificate/key
  factory so that the SocketFactory doesn't just rely on the default
  keystore?
 I'm not sure exactly what you're looking for here. Can you provide
 an example of how you'd like things to look?
 

I'm currently using a simple factory to get around having to rely on the
keystore file - all of my certificates are held in a jdo repository -
below is the interface I'm using - if you need more, please mail and
I'll send it on

Rgds Nick

public interface PureTLSCertificateFactoryInterface {


public String getKeyAlias();
public void setKeyAlias(String alias);

public String getKeyPassword();
public void setKeyPassword(String password);

// Keys from files

public String getKeyStoreFile();
public void setKeyStoreFile(String keyStoreFile);

public String getRootFile();
public void setRootFile(String rootFile);

public String getRandomFile();
public void setRandomFile(String randomFile);

// Keys from streams

public InputStream getKeyStoreStream();
public void setKeyStoreStream(InputStream keyStoreFile);

public InputStream getRootStream();
public void setRootStream(InputStream rootFile);

}

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Resend: SSL portability and Coyote

2002-04-29 Thread Nick Betteridge

Erik

This is what I'm currently using for Catalina as  a
SSLServerSocketFactory - some of it may look familiar!

rgds



import java.io.InputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

import COM.claymoresystems.ptls.SSLContext;
import COM.claymoresystems.ptls.SSLContext;
import COM.claymoresystems.ptls.SSLSocket;
import COM.claymoresystems.ptls.SSLServerSocket;
import COM.claymoresystems.sslg.SSLPolicyInt;

/**
 * SSL server socket factory--wraps PureTLS
 *
 * @author Eric Rescorla
 *
 * some sections of this file cribbed from SSLSocketFactory
 * (the JSSE socket factory)
 *
 */

 
public class PureTLSSocketFactory 
implements org.apache.catalina.net.ServerSocketFactory
{
static String defaultProtocol = TLS;
static boolean defaultClientAuth = false;
static String pureTLSCertificateFactoryName =
com.syntactics.server.net.PureTLSCertificateFactory;
private PureTLSCertificateFactoryInterface pureTLSCertificateFactory
= null;

private SSLContext context=null;

public PureTLSSocketFactory() {
}

/**
 * Should we require client authentication?
 */
private boolean clientAuth = false;

public boolean getClientAuth() {
return (this.clientAuth);
}

public void setClientAuth(boolean clientAuth) {
this.clientAuth = clientAuth;
}

public String getPureTLSCertificateFactory() {
return pureTLSCertificateFactoryName;
}

public void setPureTLSCertificateFactory(String
pureTLSCertificateFactory) {
this.pureTLSCertificateFactoryName = pureTLSCertificateFactory;
}

public ServerSocket createSocket(int port)
throws IOException
{
init();
return new SSLServerSocket(context,port);
}

public ServerSocket createSocket(int port, int backlog)
throws IOException
{
init();
ServerSocket tmp;

try {
tmp=new SSLServerSocket(context,port,backlog);
}
catch (IOException e){
throw e;
}
return tmp;
}

public ServerSocket createSocket(int port, int backlog,
 InetAddress ifAddress)
throws IOException
{
init();
return new SSLServerSocket(context,port,backlog,ifAddress);
}

private void init()
throws IOException//, ClassNotFoundException, IllegalAccessException,
InstantiationException
{
try {
pureTLSCertificateFactory =
(PureTLSCertificateFactoryInterface)Class.forName(pureTLSCertificateFactoryName).newInstance();
} catch (ClassNotFoundException cnfe) {
throw new
IOException(cnfe.getMessage());//ClassNotFoundException(cnfe.getMessage());
} catch (IllegalAccessException iae) {
throw new
IOException(iae.getMessage());//IllegalAccessException(iae.getMessage());
} catch (InstantiationException ie) {
throw new
IOException(ie.getMessage());//InstantiationException(ie.getMessage());
}

if(context!=null)
return;

try {
String keyStoreFile=null;
if(keyStoreFile==null)
keyStoreFile=pureTLSCertificateFactory.getKeyStoreFile();
InputStream keyStoreStream =
pureTLSCertificateFactory.getKeyStoreStream();

String keyPass=null;
if(keyPass==null)
keyPass=pureTLSCertificateFactory.getKeyPassword();

String rootFile=null;
if(rootFile==null)
rootFile=pureTLSCertificateFactory.getRootFile();
InputStream rootStream =
pureTLSCertificateFactory.getRootStream();

String randomFile=null;
if(randomFile==null)
randomFile=pureTLSCertificateFactory.getRandomFile();

String protocol=defaultProtocol;

SSLContext tmpContext=new SSLContext();
if(clientAuth){
if (rootStream == null)
tmpContext.loadRootCertificates(rootFile);
else
tmpContext.loadRootCertificates(rootStream);
}
if (keyStoreStream == null)
tmpContext.loadEAYKeyFile(keyStoreFile,keyPass);
else
tmpContext.loadEAYKeyFile(keyStoreStream,keyPass);
tmpContext.useRandomnessFile(randomFile,keyPass);

if (rootStream!=null) rootStream.close();
if (keyStoreStream!=null) keyStoreStream.close();

SSLPolicyInt policy=new SSLPolicyInt();
policy.requireClientAuth(clientAuth);
policy.handshakeOnConnect(false);
policy.waitOnClose(false);
tmpContext.setPolicy(policy);
context=tmpContext;
} catch (Exception e){
throw new IOException(e.getMessage());
}
}

public void handshake(Socket sock)
  

Re: Resend: SSL portability and Coyote

2002-04-26 Thread Nick Betteridge

Eric Rescorla wrote:
 
 This didn't make it out the first time so I'm resending...
 
 I'm looking at what needs to be done to make the 3.3 SSL portablity
 stuff work properly with Coyote. For the most part, this work has been
 done--if you set the SSLImplementation appropriately and the correct
 factory gets invoked. However, there appear to be some issues with
 CoyoteServerSocketFactory and it's handling of configuration
 directives:
 
 (1) CoyoteServerSocketFactory appears to be willing to handle a
 socketFactoryName. AFAICT, this is supplanted by SSLImplementation
 and none of the other code does anything with it. Any reason not to
 remove support for this directive entirely?
 
 (2) JSSE uses one keyfile (the keystore). PureTLS uses three, the
 keyfile, the CA file, and the random file. I need to add new
 directives to ServerSocketFactory to propagate those.
 

Erik - any chance of implementing this with a generic certificate/key
factory so that the SocketFactory doesn't just rely on the default
keystore?

 Does anyone object to these changes?
 
 -Ekr
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Using InstallAnywhere for Tomcat installer

2002-04-24 Thread Nick Betteridge

Good/free advertising for zerog if installanywhere is used!

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Tomcat 4.0.4 Beta 2 Released - Is the catalina.jar the correct one?

2002-03-27 Thread Nick Betteridge

I've just downloaded the 4.0.4-b2 bin release and when building against
the catalina.jar I find that there is no
org.apache.catalina.loader.StandardClassLoader class, even though there
is in the src and Bootstrap also refers to it.

Cheers
Nick

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Tomcat 4.0.4 Beta 2 Released - Is the catalina.jar the correct one?

2002-03-27 Thread Nick Betteridge

I've just downloaded the 4.0.4-b2 bin release and when building against
the catalina.jar I find that there is no
org.apache.catalina.loader.StandardClassLoader class, even though there
is in the src and Bootstrap also refers to it.

Cheers
Nick

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Tomcat 4.0.4 Beta 2 Released - Is the catalina.jar the correctone?

2002-03-27 Thread Nick Betteridge

Thanks

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: pluggable security implementations

2002-03-11 Thread Nick Betteridge

I've written the TLS socket but haven't been able to get around to
testing it yet - swamped.

The socket also has a certificate factory to enable certificates to be
read from a variety of sources.

I hope that the following server.xml snip correctly describes the
inclusion!



Connector
className=org.apache.catalina.connector.http.HttpConnector
   port=8443 minProcessors=5 maxProcessors=75
   enableLookups=true
   acceptCount=10 debug=0 scheme=https secure=true
  Factory
className=com.syntactics.server.net.PureTLSSocketFactory
 

pureTLSCertificateFactory=com.syntactics.server.net.PureTLSTestCertificateFactory
   clientAuth=false protocol=TLS/
/Connector

If any anyone wants to repackage and test, they are most welcome. The
com.syntactics.server.net.PureTLSTestCertificateFactory is the
user-supplied class for digging out the certificate from the appropriate
location.

If nobody else has time, I should be able to do this over the next 4
weeks or so.


package com.syntactics.server.net;

import java.io.InputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

import COM.claymoresystems.ptls.SSLContext;
import COM.claymoresystems.ptls.SSLContext;
import COM.claymoresystems.ptls.SSLSocket;
import COM.claymoresystems.ptls.SSLServerSocket;
import COM.claymoresystems.sslg.SSLPolicyInt;

/**
 * SSL server socket factory--wraps PureTLS
 *
 * @author Eric Rescorla
 *
 * some sections of this file cribbed from SSLSocketFactory
 * (the JSSE socket factory)
 *
 */

 
public class PureTLSSocketFactory 
implements org.apache.catalina.net.ServerSocketFactory
{
static String defaultProtocol = TLS;
static boolean defaultClientAuth = false;
static String pureTLSCertificateFactoryName = 
com.syntactics.server.net.PureTLSCertificateFactory;
private PureTLSCertificateFactoryInterface pureTLSCertificateFactory = null;

private SSLContext context=null;

public PureTLSSocketFactory() {
}

/**
 * Should we require client authentication?
 */
private boolean clientAuth = false;

public boolean getClientAuth() {
return (this.clientAuth);
}

public void setClientAuth(boolean clientAuth) {
this.clientAuth = clientAuth;
}

public String getPureTLSCertificateFactory() {
return pureTLSCertificateFactoryName;
}

public void setPureTLSCertificateFactory(String pureTLSCertificateFactory) {
this.pureTLSCertificateFactoryName = pureTLSCertificateFactory;
}

public ServerSocket createSocket(int port)
throws IOException
{
init();
return new SSLServerSocket(context,port);
}

public ServerSocket createSocket(int port, int backlog)
throws IOException
{
init();
ServerSocket tmp;

try {
tmp=new SSLServerSocket(context,port,backlog);
}
catch (IOException e){
throw e;
}
return tmp;
}

public ServerSocket createSocket(int port, int backlog,
 InetAddress ifAddress)
throws IOException
{
init();
return new SSLServerSocket(context,port,backlog,ifAddress);
}

private void init()
throws IOException//, ClassNotFoundException, IllegalAccessException, 
InstantiationException
{
try {
pureTLSCertificateFactory = 
(PureTLSCertificateFactoryInterface)Class.forName(pureTLSCertificateFactoryName).newInstance();
} catch (ClassNotFoundException cnfe) {
throw new 
IOException(cnfe.getMessage());//ClassNotFoundException(cnfe.getMessage());
} catch (IllegalAccessException iae) {
throw new 
IOException(iae.getMessage());//IllegalAccessException(iae.getMessage());
} catch (InstantiationException ie) {
throw new 
IOException(ie.getMessage());//InstantiationException(ie.getMessage());
}

if(context!=null)
return;

try {
String keyStoreFile=null;
if(keyStoreFile==null) 
keyStoreFile=pureTLSCertificateFactory.getKeyStoreFile();
InputStream keyStoreStream = pureTLSCertificateFactory.getKeyStoreStream();

String keyPass=null;
if(keyPass==null) keyPass=pureTLSCertificateFactory.getKeyPassword();

String rootFile=null;
if(rootFile==null) rootFile=pureTLSCertificateFactory.getRootFile();
InputStream rootStream = pureTLSCertificateFactory.getRootStream();

String randomFile=null;
if(randomFile==null) randomFile=pureTLSCertificateFactory.getRandomFile();

String protocol=defaultProtocol;

SSLContext tmpContext=new SSLContext();
if(clientAuth){
if (rootStream == null)
   

Re: [Daemon] New commons component

2002-02-18 Thread Nick Betteridge

Patrick Luby wrote:
 
 Remy,
 
 This is great news!
 
 I scanned through the Unix code and noticed that it uses the chmod'ing
 executables with setuid bits instead of performing a JNI call to the setuid()
 and seteuid() C functions before and after binding of a ServerSocket (i.e. the
 place you should need root access if you are binding to ports 1 through 1024).
 This type of approach eliminates the need for a controller and slave process.
 
 If there is interest out there, I can work up a proposal for implementing this
 type of setuid functionality. I has been a year or two since I did my last JNI
 coding, but I should be able to dig up some setuid code that I have done in the past.
 

There is interest out there!

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Retry: PureTLS/Cryptix RPM at Apache ????

2002-02-15 Thread Nick Betteridge

JXTA holds puretls and cryptix jars on jxta.org - so it shouldn't be a
problem on jakarta.

Incidently, tls is not ssl, although there are many similarities.

Just one question - are tls socket factories available for tomcat?


GOMEZ Henri wrote:
 
 I still didn't receive replies on the hosting of
 PureTLS/Cryptix stuff on Apache.org ?
 
 Should I ask to Cryptix.org  PureTLS, to
 host the rpms for Cryptix and PureTLS ?
 
 Starting from Tomcat 3.3.1-B1 we could use this stuff
 to have a 100% OSS Java SSL solution and good alternative
 to JSSE
 
 -
 Henri Gomez ___[_]
 EMAIL : [EMAIL PROTECTED](. .)
 PGP KEY : 697ECEDD...oOOo..(_)..oOOo...
 PGP Fingerprint : 9DF8 1EA8 ED53 2F39 DC9B 904A 364F 80E6
 
  TC 4.0.2 rpms are available at :
 
 The new RPM packaging looks much cleaner, and this time it should be
 compliant with the official standard, right ?
 
 Yes, and I hope to see other jakarta/xml projects use these kind of
 packaging.
 
 BTW, openjmx RPM is ready, and also puretls, cryptix, cryptix-asn1
 which could be used now on Tomcat 3.3.1-dev.
 
 Question :
 
 Could we host these CRYPTO rpms at apache.org since they give
 users a 100% OSS SSL implementation for TC 3.3 now and may be
 soon TC 4.0 ?
 
 PureTLS and Cryptix are both BSD so licence is not a problem.
 
 If it's impossible to host these files on apache.org, could
 cryptix.org and rtfm.com hosts them ?
 
 Regards

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Retry: PureTLS/Cryptix RPM at Apache ????

2002-02-15 Thread Nick Betteridge

GOMEZ Henri wrote:
 
 JXTA holds puretls and cryptix jars on jxta.org - so it shouldn't be a
 problem on jakarta.
 
 Incidently, tls is not ssl, although there are many similarities.
 
 Just one question - are tls socket factories available for tomcat?
 
 You means TLSSocket instead of SSLSocket ?

Uhm  sounds like it! - I'm familiar with Catalina but not any of the
3.x code. It would be nice to have it in 4.x

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Superb OSS Java IDE

2001-12-05 Thread Nick Betteridge

Ever tried Netbeans? http://www.netbeans.org

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Javascript in JSP.

2001-11-26 Thread Nick Betteridge

As a user, I would welcome this.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Security Manager, Embedded and Class Loading

2001-09-04 Thread Nick Betteridge

I've a problem that I don't really understand.

I'm in the process of getting the security manager to work with an
Embedded setup and the bootstrap is virtually the same as Catalina's.

If I create, for example, a (Standard)Server and (Standard)Service, I
get objects generated. If I attempt to create an engine, the classloader
(catalinaLoader) finds the (Standard)Engine class, but is unable to
create a newInstance.

ie ...



/**
 * Create a new server instance.
 */
public void serverCreate() {
try {
Class serverClass =
catalinaClassLoader.loadClass(org.apache.catalina.core.StandardServer);
Object server = serverClass.newInstance();
} catch (Exception ex) {
}
}

... will create a : org.apache.catalina.core.StandardServer@5d56d5


but a 



public void engineCreate() {
try {
Class engineClass =
catalinaClassLoader.loadClass(org.apache.catalina.core.StandardEngine);
Object engine = engineClass.newInstance();
} catch (Exception ex) {
}
}


will give a : StandardEngine[null]


. note that the full package name is missing and that engineClass is
found.


If anybody can shed any light on this, I'd be very grateful for comment

nick



Re: Catalina 4.0-b7 - StandardWrapper.load() - bug?

2001-08-30 Thread Nick Betteridge

I suspect that I may be opening a can of worms on this one as I see that
the 'embedded' option in the 'catalina.sh' doesn't have a '-security'
option.

I guess that the only sensible way to proceed is to try and mimic the
embedded functionality with a mapper type approach as used with the
standalone implementation.

If nobody hears from me within a week, send in the dogs.

Nick



Nick Betteridge wrote:
 
 Hi Craig
 
 Thanks for your reply and apologies for the late reply. The goalposts
 have changed slightly but the problem appears to be the same.
 
 I've set up the MBean server environment to create the two classloaders
 (a la Bootstrap) and when I fire up the server with a Security Manager,
 I find that the (catalina) loader can find the javax.servlet.Servlet
 class but the Container Base cannot.
 
 servlet.jar is not in any CLASSPATH (save the classloaders).
 
 For the simple example ..
 
 
 System.out.println(CatalinaClassLoaders.getCatalinaClassLoader());
 System.out.println(CatalinaClassLoaders.getSharedClassLoader());
 
 try {
 
System.out.println(Thread.currentThread().getContextClassLoader().loadClass(javax.servlet.Servlet));
 } catch (Exception ex) {
 ex.printStackTrace();
 }
 
 Embedded embedded = new Embedded();
 Engine engine = embedded.createEngine();
 
 . I get the following output showing the classloaders (including
 the servlet.jar), the 'javax.servlet.Servlet' interface and then the
 stacktrace with NoClassDefFoundError: javax/servlet/Servlet Exception
 ...
 
 StandardClassLoader
   available:
   delegate: false
   repositories:
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/jakarta-regex
 p-1.2.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/crimson.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/catalina.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/warp.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/jaxp.jar
   required:
 -- Parent Classloader:
 StandardClassLoader
   available:
   delegate: false
   repositories:
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/servlet.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/naming.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/resources.jar
   required:
 -- Parent Classloader:
 sun.misc.Launcher$AppClassLoader@2c3c08
 
 StandardClassLoader
   available:
   delegate: false
   repositories:
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/lib/namingfactory.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/lib/jasper-runtime.jar
   required:
 -- Parent Classloader:
 StandardClassLoader
   available:
   delegate: false
   repositories:
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/servlet.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/naming.jar
 
 file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/resources.jar
   required:
 -- Parent Classloader:
 sun.misc.Launcher$AppClassLoader@2c3c08
 
 interface javax.servlet.Servlet
 Exception in thread main java.lang.NoClassDefFoundError:
 javax/servlet/Servlet
 Exception
 at
 org.apache.catalina.core.ContainerBase.init(ContainerBase.java:254)
 at
 org.apache.catalina.core.StandardEngine.init(StandardEngine.java:10
 4)
 at
 org.apache.catalina.startup.Embedded.createEngine(Embedded.java:577)
 at
 com.syntactics.server.management.catalina.Bootstrap.init(Bootstrap.
 java:191)
 at
 com.syntactics.server.management.catalina.Bootstrap$1.run(Bootstrap.j
 ava:61)
 at java.security.AccessController.doPrivileged(Native Method)
 at
 com.syntactics.server.management.catalina.Bootstrap.main(Bootstrap.ja
 va:58)
 
  this code is running in class driven by a PrivilegedAction.
 
 Getting this to work with MBeans and a Security Manager is turning out
 to be quite tricky!
 
 Cheers
 
 Nick
 
 On Wed, 22 Aug 2001, Nick Betteridge wrote:
 
 
  javax.servlet.ServletException: Class
  org.apache.jasper.servlet.JspServlet is not a Servlet
 
 The only time I've seen this kind of thing happen is when servlet.jar is
 loaded from the wrong class loader -- it needs to be visible to both
 Catalina internal classes *and* web apps.  In the usual stand-alone
 configuration, this is accomplished by putting servlet.jar into the
 $CATALINA_HOME/common/lib directory.  Also, make sure servlet.jar is *not*
 in your Java system extensions directory ($JAVA_HOME/jre/lib/ext) or on
 the CLASSPATH.
 
 Could you double check to see if any of those issues might be the problem?
 
  Nick
 
 Craig



Re: Catalina 4.0-b7 - StandardWrapper.load() - bug?

2001-08-28 Thread Nick Betteridge

Hi Craig

Thanks for your reply and apologies for the late reply. The goalposts
have changed slightly but the problem appears to be the same.

I've set up the MBean server environment to create the two classloaders
(a la Bootstrap) and when I fire up the server with a Security Manager,
I find that the (catalina) loader can find the javax.servlet.Servlet
class but the Container Base cannot.

servlet.jar is not in any CLASSPATH (save the classloaders).

For the simple example ..



System.out.println(CatalinaClassLoaders.getCatalinaClassLoader());
System.out.println(CatalinaClassLoaders.getSharedClassLoader());

try {
System.out.println(Thread.currentThread().getContextClassLoader().loadClass(javax.servlet.Servlet));
} catch (Exception ex) {
ex.printStackTrace();
}

Embedded embedded = new Embedded();
Engine engine = embedded.createEngine();


. I get the following output showing the classloaders (including
the servlet.jar), the 'javax.servlet.Servlet' interface and then the
stacktrace with NoClassDefFoundError: javax/servlet/Servlet Exception
...


StandardClassLoader
  available:
  delegate: false
  repositories:
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/jakarta-regex
p-1.2.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/crimson.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/catalina.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/warp.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/server/lib/jaxp.jar
  required:
-- Parent Classloader:
StandardClassLoader
  available:
  delegate: false
  repositories:
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/servlet.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/naming.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/resources.jar
  required:
-- Parent Classloader:
sun.misc.Launcher$AppClassLoader@2c3c08


StandardClassLoader
  available:
  delegate: false
  repositories:
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/lib/namingfactory.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/lib/jasper-runtime.jar
  required:
-- Parent Classloader:
StandardClassLoader
  available:
  delegate: false
  repositories:
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/servlet.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/naming.jar
   
file:/export/home/servers/web/jakarta-tomcat-4.0-b7/common/lib/resources.jar
  required:
-- Parent Classloader:
sun.misc.Launcher$AppClassLoader@2c3c08


interface javax.servlet.Servlet
Exception in thread main java.lang.NoClassDefFoundError:
javax/servlet/Servlet
Exception
at
org.apache.catalina.core.ContainerBase.init(ContainerBase.java:254)
at
org.apache.catalina.core.StandardEngine.init(StandardEngine.java:10
4)
at
org.apache.catalina.startup.Embedded.createEngine(Embedded.java:577)
at
com.syntactics.server.management.catalina.Bootstrap.init(Bootstrap.
java:191)
at
com.syntactics.server.management.catalina.Bootstrap$1.run(Bootstrap.j
ava:61)
at java.security.AccessController.doPrivileged(Native Method)
at
com.syntactics.server.management.catalina.Bootstrap.main(Bootstrap.ja
va:58)


 this code is running in class driven by a PrivilegedAction.

Getting this to work with MBeans and a Security Manager is turning out
to be quite tricky!

Cheers


Nick


On Wed, 22 Aug 2001, Nick Betteridge wrote:


 javax.servlet.ServletException: Class
 org.apache.jasper.servlet.JspServlet is not a Servlet

The only time I've seen this kind of thing happen is when servlet.jar is
loaded from the wrong class loader -- it needs to be visible to both
Catalina internal classes *and* web apps.  In the usual stand-alone
configuration, this is accomplished by putting servlet.jar into the
$CATALINA_HOME/common/lib directory.  Also, make sure servlet.jar is *not*
in your Java system extensions directory ($JAVA_HOME/jre/lib/ext) or on
the CLASSPATH.

Could you double check to see if any of those issues might be the problem?

 Nick

Craig



Embedded 4.0.b6 - standard 'catalina.sh embedded' gives error

2001-08-01 Thread Nick Betteridge

I've just downloaded b6 and ran 'catalina.sh embedded' and 'catalina.sh
embedded -security' and both failed.

Have I omitted anything, or is there a bug?

Solaris 8, jdk 1.3.1, tomcat b6

--

snip

XmlMapper: Debug level: 3
XmlMapper: Validating = true
ContextConfig[]: Scanning web.xml tag libraries
ContextConfig[]: Scanning library JAR files
ContextConfig[]: Pipline Configuration:
ContextConfig[]:   org.apache.catalina.core.StandardContextValve/1.0
ContextConfig[]: ==
StandardContext[]: Configuring application event listeners
StandardContext[]: Sending application start events
StandardContext[]: Starting filters
StandardContext[]: Posting standard context attributes
StandardWrapper[:default]: Loading container servlet default
default: init
StandardWrapper[:invoker]: Loading container servlet invoker
invoker: init
StandardWrapper[:jsp]: Using Jasper classloader for servlet jsp
StandardWrapper[:jsp]: Marking servlet jsp as unavailable
StandardContext[]: Servlet  threw load() exception
javax.servlet.ServletException: Error instantiating servlet class
org.apache.jasper.servlet.JspServlet
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:842)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3196)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3299)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at
org.apache.catalina.startup.Embedded.addEngine(Embedded.java:465)
at org.apache.catalina.startup.Embedded.main(Embedded.java:1043)
- Root Cause -
java.lang.NoClassDefFoundError: org/apache/jasper/JasperException
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:825)
at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3196)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3299)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at
org.apache.catalina.startup.Embedded.addEngine(Embedded.java:465)
at org.apache.catalina.startup.Embedded.main(Embedded.java:1043)

StandardWrapper[:ssi]: Loading container servlet ssi
ssi: init
StandardWrapper[:cgi]: Loading container servlet cgi
cgi: init
cgi: init: loglevel set to 6
StandardContext[]: Starting completed

/snip