Re: tomcat 5.5 and jndi context naming error
I've been trying out many different avenues to make this work and finally found the following bug, hopefully this will save other people some time: http://www.mail-archive.com/tomcat-dev@jakarta.apache.org/msg64410.html which says: And finally i find the solution,that is to remove all Naming-*.jar out from /%myapp_home%/WEB-INF/lib.I firmly think there's some disorder with tomcat classloader.In other words,ClassLoader may not check which class to be loader first and which to be loaded second and which have already be loaded! -Ken From: Ken Hall Sent: Thursday, December 16, 2004 3:41 PM To: '[EMAIL PROTECTED]' Subject: tomcat 5.5 and jndi context naming error Since downloading the new version of Tomcat 5.5.4, I have been experiencing problems with jndi resources within my web app. I am porting over from an existing server where that resource is working. The error is listed at the bottom. I saw in the release notes that naming-common.jar (JNDI Context implementation) is one of the required files but it does not appear to be included in the download. When I include it from a previous release, it appears to not like it. When I leave it out, it can not find the jndi context either. java.lang.NoSuchMethodError: org.apache.naming.NamingContextBindingsEnumeration. init(Ljava/util/Iterator;)V at org.apache.naming.resources.FileDirContext.listBindings(FileDirContex t.java:335) at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirCont ext.java:515) at org.apache.catalina.util.ExtensionValidator.validateApplication(Exten sionValidator.java:178) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3 934) Here is my set up. Any help is greatly appreciated. I can't do anything with this release till this is solved. Thanks! -Ken Hall According to the docs, the preferred method is not messing with the server.xml but creating an application.xml. I've tried both name value pairs and resource parameters. This is done and placed in the conf\Catalina\localhost directory: ?xml version='1.0' encoding='utf-8'? Context docBase=c:/jakarta-tomcat-5.5/webapps/myapp path=/myapp workDir=work\Catalina\localhost\myapp Resource auth=Container name=jdbc/myapp type=javax.sql.DataSource/ ResourceParams name=jdbc/myapp parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value6/value /parameter parameter nameusername/name valuexx/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namepassword/name valuexx/value /parameter parameter nameurl/name valuejdbc:jtds:sqlserver://server:1433/myapp/value /parameter parameter namedriverClassName/name valuenet.sourceforge.jtds.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /Context In my app's web.xml I have: /servlet-mapping resource-ref res-ref-namejdbc/myapp/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref welcome-file-list My application is referencing the context like this: InitialContext initContext = new javax.naming.InitialContext(); Context envContext=(Context)initContext.lookup(java:comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/myapp); //Error upon calling context SEVERE: Null component Catalina:type=DataSource,path=/myapp,host=localhost,class=javax.sql.Data Source,name=jdbc/myapp Unable to connect to myapp database. Class Not Found.Name java:comp is not bound in this Context javax.naming.NameNotFoundException: Name java:comp is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:768) at org.apache.naming.NamingContext.lookup(NamingContext.java:151) at javax.naming.InitialContext.lookup(InitialContext.java:351) at my.load.servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1053) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:886) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3817) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4079 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:755) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525
tomcat 5.5 and jndi context naming error
Since downloading the new version of Tomcat 5.5.4, I have been experiencing problems with jndi resources within my web app. I am porting over from an existing server where that resource is working. The error is listed at the bottom. I saw in the release notes that naming-common.jar (JNDI Context implementation) is one of the required files but it does not appear to be included in the download. When I include it from a previous release, it appears to not like it. When I leave it out, it can not find the jndi context either. java.lang.NoSuchMethodError: org.apache.naming.NamingContextBindingsEnumeration. init(Ljava/util/Iterator;)V at org.apache.naming.resources.FileDirContext.listBindings(FileDirContex t.java:335) at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirCont ext.java:515) at org.apache.catalina.util.ExtensionValidator.validateApplication(Exten sionValidator.java:178) at org.apache.catalina.core.StandardContext.start(StandardContext.java:3 934) Here is my set up. Any help is greatly appreciated. I can't do anything with this release till this is solved. Thanks! -Ken Hall According to the docs, the preferred method is not messing with the server.xml but creating an application.xml. I've tried both name value pairs and resource parameters. This is done and placed in the conf\Catalina\localhost directory: ?xml version='1.0' encoding='utf-8'? Context docBase=c:/jakarta-tomcat-5.5/webapps/myapp path=/myapp workDir=work\Catalina\localhost\myapp Resource auth=Container name=jdbc/myapp type=javax.sql.DataSource/ ResourceParams name=jdbc/myapp parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value6/value /parameter parameter nameusername/name valuexx/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter namepassword/name valuexx/value /parameter parameter nameurl/name valuejdbc:jtds:sqlserver://server:1433/myapp/value /parameter parameter namedriverClassName/name valuenet.sourceforge.jtds.jdbc.Driver/value /parameter parameter namemaxIdle/name value2/value /parameter /ResourceParams /Context In my app's web.xml I have: /servlet-mapping resource-ref res-ref-namejdbc/myapp/res-ref-name res-typejavax.sql.DataSource/res-type res-authContainer/res-auth /resource-ref welcome-file-list My application is referencing the context like this: InitialContext initContext = new javax.naming.InitialContext(); Context envContext=(Context)initContext.lookup(java:comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/myapp); //Error upon calling context SEVERE: Null component Catalina:type=DataSource,path=/myapp,host=localhost,class=javax.sql.Data Source,name=jdbc/myapp Unable to connect to myapp database. Class Not Found.Name java:comp is not bound in this Context javax.naming.NameNotFoundException: Name java:comp is not bound in this Context at org.apache.naming.NamingContext.lookup(NamingContext.java:768) at org.apache.naming.NamingContext.lookup(NamingContext.java:151) at javax.naming.InitialContext.lookup(InitialContext.java:351) at my.load.servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.jav a:1053) at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:886) at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.j ava:3817) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4079 ) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.ja va:755) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:777) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:672) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1079) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:31 0) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu pport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1011) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1003
Tomcat 5 IIS 5 Integration
I am running Tomcat 5.0.25 and IIS 5.0 in tandem and am getting some strange configuration errors from the JK2 connector. It seems to lose connection between Tomcat and IIS and I can't seem to correct it. It appears to be random and happen at different times during the day. If I get 500 hits on the server, there will be about 5 cases, where Tomcat and IIS become disconnected and the session data is lost. Any help would be greatly appreciated. Here is from the Windows event viewer. Error: [jk_worker_ajp13.c (648)]: ajp13.service() Error forwarding ajp13:localhost:8009 1 0 Error: [jk_worker_ajp13.c (546)]: ajp13.service() ajpGetReply recoverable error 3 Error: [jk_handler_response.c (140)]: handler.response() Error sending response Error: [jk_service_iis.c (126)]: jk_ws_service_t::head, ServerSupportFunction failed Error: [jk_worker_ajp13.c (546)]: ajp13.service() ajpGetReply recoverable error 3 Error: [jk_service_iis.c (260)]: jk_ws_service_t::write, WriteClient failed -Ken Ken Hall The Reeher Group 370 Selby Avenue Saint Paul, MN 55102 t 651.292.0642 m 651.214.0005 e [EMAIL PROTECTED] blocked::mailto:[EMAIL PROTECTED] w www.reehergroup.com blocked::http://www.reehergroup.com/