Re: tomcat 5.5 and jndi context naming error

2004-12-22 Thread Jacob Kjome

There should be away around this type of issue.  I believe Tomcat already
actively avoids loading java, javax, org.xml, org.w3c.dom, org.apache.xerces
packages from WEB-INF/lib (I hope my memory isn't failing me here).  Given
this, maybe Tomcat should "endorse" certain core libraries so that they won't
be accidentally loaded from WEB-INF/lib, thus avoiding this issue altogether?

Jake

Quoting Ken Hall <[EMAIL PROTECTED]>:

> 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.
> (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:
>
>
>
> 
>
>  workDir="work\Catalina\localhost\myapp">
>
>  type="javax.sql.DataSource"/>
>
> 
>
>   
>
> maxWait
>
> 5000
>
>   
>
>   
>
> maxActive
>
> 6
>
>   
>
>   
>
> username
>
> xx
>
>   
>
>   
>
> removeAbandoned
>
> true
>
>   
>
>   
>
> password
>
> xx
>
>   
>
>   
>
> url
>
> jdbc:jtds:sqlserver://server:1433/myapp
>
>   
>
>   
>
> driverClassName
>
> net.sourceforge.jtds.jdbc.Driver
>
>   
>
>   
>
> maxIdle
>
> 2
>
>   
>
> 
>
> 
>
>
>
>
>
> In my app's web.xml I have:
>
>
>
> 
>
>
>
>   
>
> jdbc/myapp
>
> javax.sql.DataSource
>
> Container
>
>   
>
>
>
> 
>
>
>
>
>
>
>
> 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
> Contex

Re: tomcat 5.5 and jndi context naming error

2004-12-22 Thread Ken Hall
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.
(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:

 









  

maxWait

5000

  

  

maxActive

6

  

  

username

xx

  

  

removeAbandoned

true



  

password

xx



  

url

jdbc:jtds:sqlserver://server:1433/myapp

  

  

driverClassName

net.sourceforge.jtds.jdbc.Driver

  

  

maxIdle

2

  

  



 

 

In my app's web.xml I have:

 

 

 

   

jdbc/myapp

javax.sql.DataSource

Container

  

 



 

 

 

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

Re: tomcat 5.5 and jndi context naming error

2004-12-17 Thread Román Pena

- Original Message - 
From: "Ken Hall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 16, 2004 10:41 PM
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.

I think you shoud change your config. From 5.0 to 5.5, the context xml
files have changed. Now, instead of using resource params, you should
use attributes in the Resource tag. Change this:




  
maxWait
5000
  
  (...)
  

To this:

 

 

I had the same problem, but it took me some time and headaches to
notice the documentation had changed. Maybe the docs for 5.5
should have reflected the changes with BIG RED LETTERS or so.
I'd want the people at the Jakarta project to think of it:
If you save half an hour to each developer or admin who migrates
to 5.5, maybe you are saving 2 or 3 lives a month :D
--Steve jobs way of thinking ;)


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



tomcat 5.5 and jndi context naming error

2004-12-16 Thread Ken Hall
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.
(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:

 









  

maxWait

5000

  

  

maxActive

6

  

  

username

xx

  

  

removeAbandoned

true



  

password

xx



  

url

jdbc:jtds:sqlserver://server:1433/myapp

  

  

driverClassName

net.sourceforge.jtds.jdbc.Driver

  

  

maxIdle

2

  

  



 

 

In my app's web.xml I have:

 

 

 

   

jdbc/myapp

javax.sql.DataSource

Container

  

 



 

 

 

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)

  at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:437)

  at
org.apache.catalina.core.StandardService.start(StandardService.java:450)

  at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2010)

  at org.apache.catalina.startup.Catalina.start(Catalina.java:537)

  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

  at java.lang.reflect.Method.invoke(Method.java:585)

  at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)

  at org.apache