tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Sojan <ilikeu...@gmx.net>
Subject URL Factory class-cast Exception while doing JNDI lookup ...
Date Wed, 16 Jan 2002 22:03:13 GMT

Hi!

I have the following in my web.xml:

----------------------------------
<listener> 
   <listener-class>com.zargon.infovis.web.common.Configurator</listener-class>

</listener> 

<env-entry>
  <env-entry-name>log4jInitFile</env-entry-name>
  <env-entry-value>conf/log4j.lcf</env-entry-value>
  <env-entry-type>java.lang.String</env-entry-type>
</env-entry>
----------------------------------

and I´m doing the following in my Configurator Class on context
startup:

----------------------------------
 try {
      InitialContext ic = new InitialContext();
      file      = (String) ic.lookup("java:comp/env/log4jInitFile");
    } catch (Exception e) {
      System.out.println("Could not resolve log4jInitFile environment parameter:" 
			 + e.toString() );
      e.printStackTrace();
    }
----------------------------------

and then I get the following:

----------------------------------
Could not resolve log4jInitFile environment parameter:javax.naming.NoInitialContextException:
Cannot instantiate class: org.apache.naming.java.javaURLContextFactory [Root exception is
java.lang.ClassCastException: org.apache.naming.java.javaURLContextFactory]
javax.naming.NoInitialContextException: Cannot instantiate class: org.apache.naming.java.javaURLContextFactory.
 Root exception is java.lang.ClassCastException: org.apache.naming.java.javaURLContextFactory
        at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:659)
        at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:250)
        at javax.naming.InitialContext.init(InitialContext.java:226)
        at javax.naming.InitialContext.<init>(InitialContext.java:182)
        at com.zargon.infovis.web.common.Configurator.contextInitialized(Configurator.java:51)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3176)
        at org.apache.catalina.core.StandardContext.reload(StandardContext.java:2446)
        at org.apache.catalina.loader.WebappContextNotifier.run(WebappLoader.java:1315)
        at java.lang.Thread.run(Thread.java:484)
----------------------------------

any hints anyone !?

Regards,
Peter


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message