tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefán Freyr Stefánsson <ste...@decode.is>
Subject EmbededTomcat problem.. this is weird!
Date Thu, 26 Oct 2000 11:46:22 GMT

Hello.

I've been trying to get EmbededTomcat to work by running it up in a small
main function in a class.  The code I'm using looks like this:

public static void main(String[] args)
{
    try
    {
        EmbededTomcat tc=new EmbededTomcat();
        tc.setWorkDir( "c:/work/com/decode/ips/webclient/tomcat/work");
        javax.servlet.ServletContext sctx;
        sctx=tc.addContext("", new URL
	            ( "file:/C:/work/com/decode/ips/webclient/webapp/ips"));
        tc.initContext( sctx );
        tc.addEndpoint( 80, null, null);
        tc.start();
    }
    catch (Throwable t )
    {
        t.printStackTrace();
    }

    while(true)
    {
        //Here I do some sleeping so that the program doesn't shut down the
webserver before it can start.
    }
}

This is not working!!!  I get the following messages:

ContextManager: Adding context Ctx(  )
cannot process configuration web service using "
/C:/work/com/decode/ips/webclient/webapp/ips_webclient"
Security init for Context
/C:/work/com/decode/ips/webclient/webapp/ips_webclient failed
java.security.AccessControlException: access denied
(java.lang.RuntimePermission createClassLoader)
 	at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:272)
 	at
java.security.AccessController.checkPermission(AccessController.java:399)
 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
 	at
java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:610)
 	at java.lang.ClassLoader.<init>(ClassLoader.java:234)
 	at
org.apache.tomcat.loader.AdaptiveClassLoader.<init>(AdaptiveClassLoader.java
:213)
 	at
org.apache.tomcat.loader.AdaptiveServletLoader.<init>(AdaptiveServletLoader.
java:88)
 	at
org.apache.tomcat.context.LoaderInterceptor.contextInit(LoaderInterceptor.ja
va:93)
 	at
org.apache.tomcat.core.ContextManager.initContext(ContextManager.java:480)
 	at
org.apache.tomcat.startup.EmbededTomcat.initContext(EmbededTomcat.java:237)
 	at com.decode.ips.webclient.Test.main(Test.java:32)
java.security.AccessControlException: access denied
(java.net.SocketPermission localhost:80 listen,resolve) 	at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
:272)
 	at
java.security.AccessController.checkPermission(AccessController.java:399)
 	at java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
 	at java.lang.SecurityManager.checkListen(SecurityManager.java:1127)
 	at java.net.ServerSocket.<init>(ServerSocket.java:163)
 	at java.net.ServerSocket.<init>(ServerSocket.java:121)
 	at
org.apache.tomcat.net.DefaultServerSocketFactory.createSocket(DefaultServerS
ocketFactory.java:97)
 	at
org.apache.tomcat.service.PoolTcpEndpoint.startEndpoint(PoolTcpEndpoint.java
:239)
 	at
org.apache.tomcat.service.PoolTcpConnector.start(PoolTcpConnector.java:188)
 	at org.apache.tomcat.core.ContextManager.start(ContextManager.java:516)
 	at org.apache.tomcat.startup.EmbededTomcat.start(EmbededTomcat.java:267)
 	at com.decode.ips.webclient.Test.main(Test.java:34)

I just tried to debug the code and it seems that a call to inf_xml.exists()
throws the first exception... which is very strange since I've checked many
times that the file DOES exist, it's not write protected or anything like
that.  I tried to create a File object with the same path used in that call
and that works just fine.  But this call (inside WebXmlReader.java line 109)
just will not work!!!
I've been stuck on this for quite some time now so I'd appreciate any help.

Thanks in advance.

Kind regards, Stefan.
--------------------------------------------
Stefan Freyr Stefansson
Software Developer
deCODE Genetics, Inc.

Phone: (+354) 570 2854
GSM:   (+354) 861 1718
Fax:   (+354) 491 3782



Mime
View raw message