You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nikola Milutinovic <Ni...@ev.co.yu> on 2002/03/18 20:43:18 UTC

JDBC/JNDI problem, continued

Hi all.

PostgreSQL 7.2
PostgreSQL JDBC 7.2
Tomcat 4.0.1

Problem: When I try to lookup a resource regularely (I think) defined, I get 
"null". The JDBC resource is defined as per Tomcat docs and general advice on 
this list.

I have made some test, I can lookup the following:

java:comp
java:comp/env
java:comp/env/jdbc

But when I try "java:jdbc/env/jdbc/AddressBookDB" I get "null". The resource in 
question should be OK.

Is there a way to see what goes on in Tomcat's JNDI tree? Some sort of JNDI browser?

Nix.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Does CGIServlet work with POST?

Posted by August Detlefsen <au...@yahoo.com>.
I setup the CGIServlet for one of my customers using a perl CGI. After
much debugging and delving into perl code, we tried switching the
form's POST method to GET and it worked fine after that. 

Does CGIServlet not support POST? 

-August

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: 4.0.2: Element type "tlib-version" must be declared.

Posted by Christopher Cobb <cc...@phtek.com>.
I knew it would be something easy!  Thanks.

cc

"Craig R. McClanahan" wrote:

> On Mon, 18 Mar 2002, Christopher Cobb wrote:
>
> > Date: Mon, 18 Mar 2002 15:44:16 -0500
> > From: Christopher Cobb <cc...@phtek.com>
> > Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> > To: Tomcat Users List <to...@jakarta.apache.org>
> > Subject: 4.0.2: Element type "tlib-version" must be declared.
> >
> > When I try to use a JSP 1.2 style taglib definition file, I get an exception
> > JasperException: XML parsing error on file /WEB-INF/tabtags.tld, Element type
> > "tlib-version" must be declared.  My file validates against this dtd:
> > http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd.  Is there some switch somewhere to
> > turn on JSP 1.2 dtds?
> >
>
> What does the entire DOCTYPE element of your TLD say?  Tomcat matches on
> the public identifier first, and if that says to use the JSP 1.1 version,
> it will.
>
> > cc
> >
>
> Craig
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: 4.0.2: Element type "tlib-version" must be declared.

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 18 Mar 2002, Christopher Cobb wrote:

> Date: Mon, 18 Mar 2002 15:44:16 -0500
> From: Christopher Cobb <cc...@phtek.com>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: 4.0.2: Element type "tlib-version" must be declared.
>
> When I try to use a JSP 1.2 style taglib definition file, I get an exception
> JasperException: XML parsing error on file /WEB-INF/tabtags.tld, Element type
> "tlib-version" must be declared.  My file validates against this dtd:
> http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd.  Is there some switch somewhere to
> turn on JSP 1.2 dtds?
>

What does the entire DOCTYPE element of your TLD say?  Tomcat matches on
the public identifier first, and if that says to use the JSP 1.1 version,
it will.

> cc
>

Craig


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


4.0.2: Element type "tlib-version" must be declared.

Posted by Christopher Cobb <cc...@phtek.com>.
When I try to use a JSP 1.2 style taglib definition file, I get an exception
JasperException: XML parsing error on file /WEB-INF/tabtags.tld, Element type
"tlib-version" must be declared.  My file validates against this dtd:
http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd.  Is there some switch somewhere to
turn on JSP 1.2 dtds?

cc

org.apache.jasper.JasperException: XML parsing error on file /WEB-INF/tabtags.tld:
(line 11, col 17): Element type "tlib-version" must be declared.
 at org.apache.jasper.parser.ParserUtils.parseXMLDocument(ParserUtils.java:218)
 at org.apache.jasper.compiler.TagLibraryInfoImpl.parseTLD(TagLibraryInfoImpl.java:283)

 at org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:219)
 at
org.apache.jasper.compiler.JspParseEventListener.processTaglibDirective(JspParseEventListener.java:1164)

 at
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:758)

 at
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingListener.java:121)

 at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java:255)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1145)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1103)
 at org.apache.jasper.compiler.Parser.parse(Parser.java:1099)
 at org.apache.jasper.compiler.ParserController.parse(ParserController.java:213)
 at org.apache.jasper.compiler.Compiler.compile(Compiler.java:210)
 at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:552)
 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:177)

 at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:189)

 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)

 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)

 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)

 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
 at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
 at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
 at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
 at java.lang.Thread.run(Thread.java:536)



--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JDBC/JNDI problem, continued - PUZZLED

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
> > > Do your log files have any interesting messages?
> > 
> > Nothing. Clean as a whistle. The problem is not related to PostgreSQL or JDBC driver. I can establish a connection via regular mechanism:
> > 
> > Class.forName( "org.postgresql.Driver" );
> > Connection conn = DriverManager.getConnection( "jdbc:postgresql://test.ev.co.yu/test", "test", "test_pass" );
> 
> This is problem in JSDK 1.4, I think. But under JSDK 1.3.1 everything
> ok.

I'm using JDK 1.3.0-2 on Tru64 UNIX.

Nix.

Re: JDBC/JNDI problem, continued - PUZZLED

Posted by REAL <re...@kemsu.ru>.
Hello!

Nikola Milutinovic wrote:
> > Do your log files have any interesting messages?
> 
> Nothing. Clean as a whistle. The problem is not related to PostgreSQL or JDBC driver. I can establish a connection via regular mechanism:
> 
> Class.forName( "org.postgresql.Driver" );
> Connection conn = DriverManager.getConnection( "jdbc:postgresql://test.ev.co.yu/test", "test", "test_pass" );

This is problem in JSDK 1.4, I think. But under JSDK 1.3.1 everything
ok.

-- 

REAL aka Евгений Ростовцев
http://xtotem.hell.ru/

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JDBC/JNDI problem, continued - PUZZLED

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
> Do your log files have any interesting messages?

Nothing. Clean as a whistle. The problem is not related to PostgreSQL or JDBC driver. I can establish a connection via regular mechanism:

Class.forName( "org.postgresql.Driver" );
Connection conn = DriverManager.getConnection( "jdbc:postgresql://test.ev.co.yu/test", "test", "test_pass" );

One of the users suggested that the reason I'm getting "null" is because Tyrex is having problems openning connection. And frankly, there were some posts on PostgreSQL and Tyrex incompatibility, but I thought that was resolved in the latest version.

postgresql.jar is in $CATALINA_HOME/common/lib

Nix.

Re: JDBC/JNDI problem, continued - PUZZLED

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Do your log files have any interesting messages?

Craig


On Mon, 18 Mar 2002, Nikola Milutinovic wrote:

> Date: Mon, 18 Mar 2002 21:21:36 +0100
> From: Nikola Milutinovic <Ni...@ev.co.yu>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>
> To: Tomcat Users List <to...@jakarta.apache.org>
> Subject: Re: JDBC/JNDI problem, continued - PUZZLED
>
> Nikola Milutinovic wrote:
>
> > Hi all.
> >
> > PostgreSQL 7.2
> > PostgreSQL JDBC 7.2
> > Tomcat 4.0.1
> >
> > Problem: When I try to lookup a resource regularely (I think) defined, I
> > get "null". The JDBC resource is defined as per Tomcat docs and general
> > advice on this list.
> >
> > I have made some test, I can lookup the following:
> >
> > java:comp
> > java:comp/env
> > java:comp/env/jdbc
> >
> > But when I try "java:jdbc/env/jdbc/AddressBookDB" I get "null". The
> > resource in question should be OK.
> >
> > Is there a way to see what goes on in Tomcat's JNDI tree? Some sort of
> > JNDI browser?
>
> So, I decided to write my own JNDI browser, after all, I have Java, JSP and JNDI
> in Tomcat. :-)
>
> Relatively simple code:
>
> <p>Context looked up: <strong><%= contextPath %></strong></p>
> <%
> InitialContext initCtx;
> Context envCtx;
>
> initCtx = new InitialContext();
> NamingEnumeration enum = initCtx.listBindings( contextPath );
> int i = 1;
> %>
> <table width="100%" border="0" cellspacing="0" cellpadding="3">
> <%
>    while( enum.hasMore() ) {
> %>
>    <tr>
>      <td><%= i %></td>
>      <td><%= ((Binding)enum.next()).toString() %></td>
>    </tr>
> <%
>    }
> %>
> </table>
>
> This is what I get when I set context to "java:comp/env/jdbc":
>
> ----------------------------------------------
> Context looked up: java:comp/env/jdbc
>
> 1 AddressBookDB: org.apache.naming.ResourceRef:Reference Class Name:
> javax.sql.DataSource Type: scope Content: Shareable Type: auth Content: Container
> ----------------------------------------------
>
> So, it is there. Why does "lookup()" on that particular resource return "null"?
>
> Nix.
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: JDBC/JNDI problem, continued - PUZZLED

Posted by Nikola Milutinovic <Ni...@ev.co.yu>.
Nikola Milutinovic wrote:

> Hi all.
> 
> PostgreSQL 7.2
> PostgreSQL JDBC 7.2
> Tomcat 4.0.1
> 
> Problem: When I try to lookup a resource regularely (I think) defined, I 
> get "null". The JDBC resource is defined as per Tomcat docs and general 
> advice on this list.
> 
> I have made some test, I can lookup the following:
> 
> java:comp
> java:comp/env
> java:comp/env/jdbc
> 
> But when I try "java:jdbc/env/jdbc/AddressBookDB" I get "null". The 
> resource in question should be OK.
> 
> Is there a way to see what goes on in Tomcat's JNDI tree? Some sort of 
> JNDI browser?

So, I decided to write my own JNDI browser, after all, I have Java, JSP and JNDI 
in Tomcat. :-)

Relatively simple code:

<p>Context looked up: <strong><%= contextPath %></strong></p>
<%
InitialContext initCtx;
Context envCtx;

initCtx = new InitialContext();
NamingEnumeration enum = initCtx.listBindings( contextPath );
int i = 1;
%>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<%
   while( enum.hasMore() ) {
%>
   <tr>
     <td><%= i %></td>
     <td><%= ((Binding)enum.next()).toString() %></td>
   </tr>
<%
   }
%>
</table>

This is what I get when I set context to "java:comp/env/jdbc":

----------------------------------------------
Context looked up: java:comp/env/jdbc

1 AddressBookDB: org.apache.naming.ResourceRef:Reference Class Name: 
javax.sql.DataSource Type: scope Content: Shareable Type: auth Content: Container
----------------------------------------------

So, it is there. Why does "lookup()" on that particular resource return "null"?

Nix.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: JDBC/JNDI problem, continued

Posted by "George M. Coles" <gc...@silverstream.com>.
Hello,
	I have had the same problem. Null returning from JNDI lookup. The very same
web.xml works in other appservers, and my server.xml is extremely
straightforward. I was using db2.

-----Original Message-----
From: Nikola Milutinovic [mailto:Nikola.Milutinovic@ev.co.yu]
Sent: Monday, March 18, 2002 2:43 PM
To: Tomcat Users List
Subject: JDBC/JNDI problem, continued


Hi all.

PostgreSQL 7.2
PostgreSQL JDBC 7.2
Tomcat 4.0.1

Problem: When I try to lookup a resource regularely (I think) defined, I get
"null". The JDBC resource is defined as per Tomcat docs and general advice
on
this list.

I have made some test, I can lookup the following:

java:comp
java:comp/env
java:comp/env/jdbc

But when I try "java:jdbc/env/jdbc/AddressBookDB" I get "null". The resource
in
question should be OK.

Is there a way to see what goes on in Tomcat's JNDI tree? Some sort of JNDI
browser?

Nix.


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>