Ian
I *hate* null pointer exceptions... its always very hard to figure out
the actual cause and its usually (in my case anyway) because of a
really silly mistake.
Try:
* checking your pool name is correct
* displaying raw XML without any stylesheet
* checking your table name (mySQL is case sensitive)
Derek
PS FWIW, I copied this XSP "as is" and only chnaged the tablename
and pool name to ones on my system... and it ran fine using:
<map:match pattern="test-db">
<map:generate type="serverpages" src="test-db.xsp"/>
<map:serialize type="xml" />
</map:match>
>>> [EMAIL PROTECTED] 2004/03/15 01:25:04 PM >>>
Hey
Im trying to connect to a MS SQL database. Im pretty sure the driver is
fine
and the URL, username and password for the database is correct, yet im
unable to bring up any info from the databsae. This is the sample page
im
using to bring up some info.
<xsp:page
language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp-request="http://apache.org/xsp/request/2.0">
<user_info>
<esql:connection>
<esql:pool>ldd</esql:pool>
<esql:execute-query>
<esql:query>
select * from dbo_episode
</esql:query>
<esql:results>
<hello>HELLO</hello>
</esql:results>
<esql:no-results>
<user_not_present>
<user_present>
<episode_no>Not present</episode_no>
</user_present>
</user_not_present>
</esql:no-results>
<esql:error-results>
<esql:get-message/>
<esql:get-stacktrace/>
<esql:to-string/>
</esql:error-results>
</esql:execute-query>
</esql:connection>
</user_info>
</xsp:page>
============================================================
This is what i get on the page.
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error
and
then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
The following tags were not closed: user_info. Error processing
resource
'http://localhost:13001/icdb/test.html'.
=============================================================
I checked the error logs and this is what is present.
java.lang.NullPointerException
at
org.apache.cocoon.components.language.markup.xsp.EsqlQuery.<init>(EsqlQuery.java:99)
at org.apache.cocoon.www.xsp.sample_xsp.generate(E:\Infection
Control
Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon-files\org/apache/cocoon/www/xsp\sample_xsp.java:341)
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenerator.java:258)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:250)
at
org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:395)
at org.apache.cocoon.www.sitemap_xmap.matchN400076(E:\Infection
Control
Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:1199)
at org.apache.cocoon.www.sitemap_xmap.process(E:\Infection
Control
Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:835)
at org.apache.cocoon.www.sitemap_xmap.process(E:\Infection
Control
Database\jakarta-tomcat-4.1.18\work\Standalone\localhost\icdb\cocoon-files\org/apache/cocoon/www\sitemap_xmap.java:781)
at org.apache.cocoon.sitemap.Handler.process(Handler.java:227)
at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:173)
at
org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:152)
at org.apache.cocoon.Cocoon.process(Cocoon.java:579)
at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1043)
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:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
at java.lang.Thread.run(Thread.java:536)
=============================================================
I checked sample_xsp.java........line 341
338 if (_esql_query != null) {
339 _esql_queries.push(_esql_query);
340 }
341 _esql_query = new EsqlQuery( _esql_connection, String.valueOf(
342 ""
+ " select *"
+ " from dbo_episode"
+ " "
) );
Does anyone see any problems with this??
Any help would be greatly appreciated.
Thanks for ur time
Ian.
_________________________________________________________________
Personalise your mobile chart ringtones and polyphonics. Go to
http://ringtones.com.au/ninemsn/control?page=/ninemsn/main.jsp
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]