Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 80146 invoked from network); 15 Dec 2005 16:37:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 15 Dec 2005 16:37:41 -0000 Received: (qmail 68767 invoked by uid 500); 15 Dec 2005 16:37:38 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 68741 invoked by uid 500); 15 Dec 2005 16:37:38 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 68730 invoked by uid 99); 15 Dec 2005 16:37:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2005 08:37:38 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [200.192.140.24] (HELO adsl.plugin.com.br) (200.192.140.24) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2005 08:37:37 -0800 Received: from [10.1.1.20] (201-3-141-230.nhoce7005.dsl.brasiltelecom.net.br [201.3.141.230] (may be forged)) (authenticated bits=0) by adsl.plugin.com.br (8.12.8/8.13.1) with ESMTP id jBFGb9dE017410 for ; Thu, 15 Dec 2005 14:37:10 -0200 Message-ID: <43A19BB4.7040400@mgrinformatica.com.br> Date: Thu, 15 Dec 2005 14:37:08 -0200 From: Edson Carlos Ericksson Richter User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: pt-br, pt MIME-Version: 1.0 To: Derby Discussion Subject: Re: ClassCastException in CountAggregator References: <4396CF07.7000508@mgrinformatica.com.br> <43974039.9080306@mgrinformatica.com.br> <4397558E.5060206@bristowhill.com> <43975C73.1000104@Sourcery.Org> <43976FD9.2060204@gmail.com> <3287.201.34.97.3.1134066794.squirrel@webmail.plugin.com.br> <43A0C6EF.7010408@gmail.com> <43A15480.5050209@mgrinformatica.com.br> <43A196CB.80902@gmail.com> In-Reply-To: <43A196CB.80902@gmail.com> Content-Type: multipart/mixed; boundary="------------010700030004090207090802" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --------------010700030004090207090802 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit In NetBeans environment, you could define your Resources under server.xml (bad option) under META-INF/context.xml file (better, project based - allow several projects in one installation without interference between projects). So I put it in META-INF/context.xml. Thanks for your attention, Edson Richter Stanley Bradbury escreveu: > Edson Carlos Ericksson Richter wrote: > >> As stated in my previous mail, the connection pool is declared >> > type="javax.sql.DataSource" username="" password="" >> driverClassName="org.apache.derby.jdbc.EmbeddedDriver" >> url="jdbc:derby:c:/projects/biblio/database;" maxActive="10" >> maxIdle="2"/> >> >> >> And in web.xml I just have a resource-ref, as required by specs: >> >> >> >> jdbc/Biblio >> javax.sql.DataSource >> Container >> >> >> >> The code running is (it's a generic code I use to test queries, so >> don't be afraid about weird coding): >> >> >> select count(*) from my_table >> >> >> >> >> >> >> >> >> >> >> >> >> >> >>
${col}
${mgr:stripClob(row[col])}
>> >> >> The error occur at , so rest of code is just here to >> illustrate usage. >> >> At last, the derby.jar and derbypt_BR.jar are in >> $NETBEANS_HOME/enterprise2/jakarta-tomcat-5.5.9/commons/lib/, so >> classes are avaliable to the pool. If I remove them, I get problems >> with connection (and plain queries stop working). >> >> >> I expect this helps... I will not have much time free help, but from >> times to times I'll check to see if there is anything I could >> contribute. >> >> Best regards, >> >> Edson Richter >> >> >> >> Stanley Bradbury escreveu: >> >>> edson.richter@mgrinformatica.com.br wrote: >>> >>>> Thank you all for the tips. >>>> >>>> Before giving up using derby, I have: 1) checked for older >>>> versions. No, there are none (in >>>> real, I tried a fresh install of Tomcat). I double checked >>>> $JAVA_HOME/jre/lib/ext, and >>>> tryied including install a new version of JDK (I was using 1.5.0_04 >>>> and made a try with >>>> 1.5.0_06 - no differences). >>>> I tryied a simple JSP that take a connection from the pool and >>>> executed a simple select >>>> count(*) from some_table and error is the same. >>>> >>>> Interesting is that I tryied Ij, and the error didn't occured. >>>> But, Ij is not using pt_BR messages, and I suspect error is related >>>> (but then I give up: I >>>> could not spent more than a couple of hours without sucess >>>> searching on the net - I searched >>>> Google, MSN, Altavista). db.apache.org was unavaliable yesterday, >>>> and I could not search >>>> mailing lists. >>>> >>>> So, without web support (even from the list), I could not defend >>>> Derby anymore in the >>>> project, and manager directed all development to a comercial >>>> database, unfortunatelly. >>>> >>>> At all, thank you... But don't forget to check what could be wrong >>>> - there is a serious >>>> erro/bugr in there. >>>> >>>> Details: >>>> >>>> - Tomcat 5.5.9 embedded in NetBeans 5.0 Beta 2 >>>> - Tomcat 5.5.7 embedded in NetBeans 4.1 >>>> - Connection obtained with 'jdbc:derby:c:/projects/biblio/database' >>>> (it's embedded) - Plain >>>> queries works fine (select * from some_table) >>>> - Aggregate count throw ClassCastException (select count(*) from >>>> some_table) >>>> >>>> Connection declaration: >>>> >>>> >>> type="javax.sql.DataSource" username="" password="" >>>> driverClassName="org.apache.derby.jdbc.EmbeddedDriver" >>>> url="jdbc:derby:c:/projects/biblio/database;" maxActive="10" >>>> maxIdle="2"/> >>>> >>>> Here is stack trace: >>>> >>>> 08/12/2005 16:29:24 org.apache.catalina.core.ApplicationDispatcher >>>> invoke >>>> SEVERE: Servlet.service() for servlet jsp threw exception >>>> ERROR 38000: A exce��o 'java.lang.ClassCastException: >>>> org.apache.derby.impl.sql.execute.CountAggregator' foi emitida ao >>>> avaliar uma express�o. >>>> at >>>> org.apache.derby.iapi.error.StandardException.newException(Unknown >>>> Source) >>>> at >>>> org.apache.derby.iapi.error.StandardException.unexpectedUserException(Unknown >>>> >>>> Source) >>>> at >>>> org.apache.derby.impl.sql.execute.GenericAggregator.getAggregatorInstance(Unknown >>>> >>>> Source) >>>> at >>>> org.apache.derby.impl.sql.execute.GenericAggregator.initialize(Unknown >>>> Source) >>>> >>>> >>> ...... SNIP ... >>> >>> Hi Edson - >>> >>> Could you help me setup a test case for this problem? It would be >>> great if you could provide a test case for the problem and file a >>> JIRA entry with the test case attached (please let me know if you >>> can do this). It sounds, however, that you are working to a tight >>> timeframe so I am willing to attempt to create a test case but need >>> some additional information. >>> I have not used NetBeans but know a bit about JSPs with Tomcat. >>> Could you post the information I will need to perform the test you >>> describe as: >>> >>> ".. I tryied a simple JSP that take a connection from the pool and >>> executed a simple select count(*) from some_table and error is the >>> same .." >>> >>> Here are the things I can think of that will be very helpful: + >>> Having the JSP code would be very helpful - would you post it? >>> + I need to know how the connection pool was defined (what entries >>> were placed in server.xml, the application deployment XML file and >>> the web.xml file). + If there any other settings needed to setup >>> the connection pool in the Tomcat/NetBeans environment please >>> include those also. >>> I have located another report of this stack trace when performing >>> 'select count(*)' in a different server that did not seem to relate >>> to codesets so I am hoping that pt_BR is not required to debug this >>> problem. >>> >>> Thanks in advance >>> >>> >>> >> > Hi Edson - > > Thanks for the reply - I certainly understand being busy and > appreciate your time to respond to my questions. My newbie-academic > understanding of Tomcat is that the pool can be defined in a couple of > places but most commonly is declared in the server.xml file. Within > server.xml it can be declared as a element inside the > element or in the GlobalNaming space within the element. I > have always worked with datasources defined in the Global-Server space > and will setup my test in that manner. Please let me know if this not > how your system is configured and I will adjust my testing.. > > > --------------010700030004090207090802 Content-Type: text/x-vcard; charset=utf-8; name="edson.richter.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="edson.richter.vcf" begin:vcard fn:Edson Carlos Ericksson Richter n:Richter;Edson org;quoted-printable:MGR Inform=C3=A1tica Ltda;Desenvolvimento adr:Cristo Redentor;;Assis Brasil, 3257, Sala 409;Porto Alegre;RS;91010007;Brasil email;internet:edson.richter@mgrinformatica.com.br title:Diretor de Sistemas tel;work:(51)3347-0446 tel;cell:(51)9259-2993 x-mozilla-html:FALSE url:http://www.mgrinformatica.com.br version:2.1 end:vcard --------------010700030004090207090802--