SQL Transformer after XSL with copy-of
Hi, I have a problem with SQL transformer and XSL copy-of tag. I already read something similar in the mail archive but I didn't understand if the problem has a solution. I set up a simple test case for the problem, this is the recipe: you need an xml source file (copy.xml) like this: - myQuery select * from actor /myQuery and an xsl file (copy.xsl): --- xsl:template match=myQuery page xmlns:sql=http://apache.org/cocoon/SQL/2.0; xsl:copy-of select=./ execute-query xmlns=http://apache.org/cocoon/SQL/2.0; query isstoredprocedure=false xsl:value-of select=./ /query /execute-query /page /xsl:template /xsl:stylesheet -- and the match element in sitemap.xmap: --- map:match pattern=copy map:generate src=path-to-copy/copy.xml/ map:transform src=path-to-copy/copy.xsl/ map:transform type=sql map:parameter name=use-connection value=personnel/ /map:transform map:serialize type=xml/ /map:match --- Of course you need also the correct configuration for the datasource and a table actor on your db. Now, if I access the cocoon/copy url on my system (w2k+tomcat3.3+cocoon2.0.1+mysql) I get a very long exception (you can find it below). If I comment out the sql transformer step in sitemap I get in the browser a correct xml document. If I comment out the copy-of tag in the xsl, cocoon returns me the correct query result. So, seems that the problem is in the some strange conflict between copy-of/sqlt... Can someone confirm my supposition? Is this problem solved? (If yes sorry for the time wasted!) Thanks, Vittorio Original exception : java.lang.RuntimeException: java.lang.NullPointerException at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:) at org.apache.cocoon.components.parser.JaxpParser.parse(JaxpParser.java:182) at org.apache.cocoon.components.source.URLSource.toSAX(URLSource.java:331) at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:109) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.process(Abstract EventPipeline.java:118) at org.apache.cocoon.components.pipeline.AbstractStreamPipeline.process(Abstrac tStreamPipeline.java:149) at org.apache.cocoon.www.sitemap_xmap.matchN104AD(sitemap_xmap.java:6282) at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:3019) at org.apache.cocoon.www.sitemap_xmap.process(sitemap_xmap.java:2444) at org.apache.cocoon.sitemap.Handler.process(Handler.java:180) at org.apache.cocoon.sitemap.Manager.invoke(Manager.java:127) at org.apache.cocoon.sitemap.SitemapManager.process(SitemapManager.java:144) at org.apache.cocoon.Cocoon.process(Cocoon.java:582) at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:797) at javax.servlet.http.HttpServlet.service(HttpServlet.java) at org.apache.tomcat.facade.ServletHandler.doService(Unknown Source) at org.apache.tomcat.core.Handler.invoke(Unknown Source) at org.apache.tomcat.core.Handler.service(Unknown Source) at org.apache.tomcat.facade.ServletHandler.service(Unknown Source) at org.apache.tomcat.core.ContextManager.internalService(Unknown Source) at org.apache.tomcat.core.ContextManager.service(Unknown Source) at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Unknown Source) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Unknown Source) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Unknown Source) at java.lang.Thread.run(Thread.java:484) Original exception : java.lang.RuntimeException: java.lang.NullPointerException at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3174) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerH andlerImpl.java:433) at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:49) at org.apache.xerces.parsers.SAXParser.endDocument(SAXParser.java:1230) at org.apache.xerces.validators.common.XMLValidator.callEndDocument(XMLValidato r.java:1146) at org.apache.xerces.framework.XMLDocumentScanner$EndOfInputDispatcher.dispatch (XMLDocumentScanner.java:1499) at org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner. java:381) at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1098) at org.apache.cocoon.components.parser.JaxpParser.parse(JaxpParser.java:182) at org.apache.cocoon.components.source.URLSource.toSAX(URLSource.java:331) at org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:109) at org.apache.cocoon.components.pipeline.AbstractEventPipeline.process(Abstract EventPipeline.java:118) at
Design question with DB
Hi All! Can anyone help me with this problem? I'm developing a little piece of a B2B application that deal with DB updating. This is what I want to do: My input is an XML document like this: rowSet row id=1 elfield1/elelfield2/elelfield3/elelfield4/el /row row id=2 elaaa/elelbbb/elelccc/elelddd/el /row row id=3 el1/elel2/elel3/elel4/el /row /rowSet With this input file I want to update a DB. Now suppose that the update with the 2nd row id=2 element fails due to incorrect data. What I want is: 1) the DB updated with the correct rows (row id=1 row id=3) 2) an output document like this: rowSet row id=1 elfield1/elelfield2/elelfield3/elelfield4/el /row row id=2 note=DBError sympthom=.. elaaa/elelbbb/elelccc/elelddd/el /row row id=3 el1/elel2/elel3/elel4/el /row /rowSet I think I should use the SQL transformer (is this the right way?) but I'm not able to imagine how to handle the DB error and how to produce the output document. Any idea? Thanks billions, Vittorio - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Newbie: help!
Hi Zvika, in this newsgroup you can find a lot of messages from desperate people that try to run cocoon2+tomcat4+jdk1.3 or 1.4. I also tried and I failed. In my opinion the point is that Tomcat 4 implements Servlet 2.3 spec and cocoon is developed on tomcat 3 servlet 2.2 spec. If you are a newbie and you don't have the constraint to use Tomcat 4 I think that the right starting point for you is: cocoon+TOMCAT 3 + jdk1.3 Good luck, V -Original Message- From: Zvika Markfeld [mailto:[EMAIL PROTECTED]] Sent: Friday, March 01, 2002 12:33 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Newbie: help! Although a cocoon newbie, also a human being in need for help getting this thing started: I am trying to install c2.01 on Tomcat4.02, Win2k, JDK1.3. I installed the cocoon war file but when trying to access the main page (localhost:8080/cocoon) it generates the following exception: * javax.servlet.ServletException: Servlet.init() for servlet Cocoon2 threw exception * blah blah blah... * root cause * java.lang.NoClassDefFoundError: javax/xml/transform/URIResolver * blah blah blah... So I bundled all the javax.xml.transform classes from Sun's XML Pack Winter Release(JAXP) and put them in Tomcat's common lib, which gave me the following exception: * The sitemap handler's sitemap is not available. Please check logs for the exact error. Importing the entire JAXP package made no difference. same error message. I checked installation online docs, with no luck. zm. -Original Message- From: Colin Hall [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 7:06 PM To: [EMAIL PROTECTED] Subject: RE: Uninterruptable Sleep Sorry, I've been out of town for a few days. -Original Message- From: Gerhard Froehlich [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 8:37 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Uninterruptable Sleep Colin, I am using a source distribution I downloaded from from the apache dist site at the end of January. Must be 2.01, or? Yes, it's 2.01 Some further information that might be of interest: - My testing environment did NOT exhibited this behaviour even after I bombarded it for a full hour using jmeter running 30+ threads. Ahh jmeter on the same machine? I made very negative experience with that tool. For stressing my applications, I use the Microsoft Webapplication Stress tool: http://www.microsoft.com/technet/treeview/default.asp?url=/Tec hNet/itsolutions/intranet/downloads/w ebstres.asp Thanks, I'll try it out. It's from MS spit, but it's (ahem) good. - The production server went into this state within 2 minutes of running a scaled back version (6 threads) of the same jmeter test. Try it without JMeter again... Production is RedHat 6.1 (2.2.12-20) jdk1.3.1_01 Test is SuSe 6.4 (2.2.14) jdk1.3.0 both are tomcat 3.2.3 My config is: Tomcat: -Xmx 256M -Xms 128M StoreJanitor: parameter name=freememory value=6400/ parameter name=heapsize value=25600/ After reading the links you've provided, I see that I may have to re-consider these settings. Indeed: How many RAM has your machine? This is another strange thing. There is 512M, but top only shows 64M...I think that I should update top - Don't set the -Xms parameter, I read that somewhere in a performace article. I have to update the Cocoon docs. - Don't set the -Xmx == RAM you have. Your machine needs some memory, too. - Set the heapsize always lower as the -Xmx paramter, otherwise your JVM can run out of Memory. - Don't set free memory that high, I think 10megs should be enough. Consider, this formel: if ((JVM totalMemory heapsize AND JVM freeMemory() freememory) == true) then the cleanup thread kicks in. Wrong settings can cause to many thread iteration. OK, I'll use this config. Are you aware of any kernel or JDK version issues that may cause problems? Nope, unfortunately it's always the code ;-). Thanks for the information! No problem, you're welcome. BTW: can you try the latest CVS, just for comparing? I will try it out. Thanks again! ~Gerhard I just found the last bug... - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Please check that your question has not already been answered in the FAQ before posting. http://xml.apache.org/cocoon/faqs.html To