tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Eggers <its_toas...@yahoo.com>
Subject Re: Not supported by Basic Datasource
Date Fri, 10 Dec 2010 19:04:59 GMT
In your first message, did you post your complete hibernate configuration file?

I'm asking because of two issues.

1. You don't need the following line if you're using Tomcat's database pooling:

<property name="connection.pool_size">10</property>

2. From a quick google search on Tomcat, Hibernate, Oracle, and "Not supported 
by BasicDataSource", I find the following:

java.lang.UnsupportedOperationException: Not supported by BasicDataSource at
  org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:899)


which is caused by trying to use Datasource.getConnection(username,password). 
This is not supported.

The underlying cause for using that method signature is the following two lines 
in a hibernate configuration file (which is why I asked if you posted your 
complete configuration file):

<property name="hibernate.connection.username" value="xxxx"/>
<property name="hibernate.connection.password" value="xxxx"/>

Remove the above two lines if they exist in your hibernate configuration file. 
The user name and password exist in the META-INF/context.xml file.

. . . . hope that helps.

/mde/

----- Original Message ----
From: SOPANMISHRA <sopan.mishra@gmail.com>
To: users@tomcat.apache.org
Sent: Fri, December 10, 2010 6:51:43 AM
Subject: Re: Not supported by Basic Datasource


1.By normal jdbc process means without implementing any datasource concept in
tomcat  for my project evrything is working fine.It is just when i do
datasource config I'm facing "not supported by basic data source" against a
method that uses a stringbuilder to form a query by retrieving values from a
jsp page dynamically

if (Validation.validate(defRetrivalFields)) {
                defRetrivalFieldsArr = defRetrivalFields.split(",");
                int defRetrivalFieldsArrLen = defRetrivalFieldsArr.length;

                for (int i = 0; i < defRetrivalFieldsArrLen; i++) {

                    tempRepresentData = representorMap
                            .get(defRetrivalFieldsArr[i]);
                    if ("gaGrpCd".equalsIgnoreCase(tempRepresentData)
                            || "taCd".equalsIgnoreCase(tempRepresentData)) {
                        formedReqField.append("coalesce(M." + tempRepresentData
                                + ",'-1') AS " + tempRepresentData);
                    } else if (("pccDteCreate"
                            .equalsIgnoreCase(tempRepresentData)
                            || "pccDteUpdated"
                                    .equalsIgnoreCase(tempRepresentData) || 
("lastUpdate"
                            .equalsIgnoreCase(tempRepresentData)))) {
                        formedReqField.append("M." + tempRepresentData + " AS "
                                + tempRepresentData);
                    } else {
                        formedReqField.append("coalesce(M." + tempRepresentData
                                + ",' ') AS " + tempRepresentData);
                    }
                    orderByField.append("M." + tempRepresentData);

                    if (i != (defRetrivalFieldsArrLen - 1)) {
                        formedReqField.append(",");
                        orderByField.append(",");
                    }
                    tempRepresentData = null;
                }
            }
            retStr[0] = formedReqField.toString();
            retStr[1] = orderByField.toString();
        }
        return retStr;

2.I tried various  data source possible - <resource
type=javax.sql.DataSource/javax.sql.ConnectionPoolDataSource but to no avail

3.driverClassName="oracle.jdbc.driver.OracleDriver"/"oracle.jdbc.OracleDriver"  

4.The complete java stack trace is while processing the soap message
request:-

Dec 10, 2010 8:13:46 PM com.xxxxxxxx.care.agentevaluation.db.dao.xxxxxxxx
getAgentDetails
INFO: Query:SELECT coalesce(M.iataNo,' ') AS iataNo,coalesce(M.pcc,' ') AS
pcc FROM xxxxxxxx AS M WHERE M.pcc IN (:lst) ORDER BY M.iataNo,M.pcc
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
    at
org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:899)

    at
org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:89)

    at
org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
    at
org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
    at
org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)

    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1573)
    at org.hibernate.loader.Loader.doQuery(Loader.java:696)
    at
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)

    at org.hibernate.loader.Loader.doList(Loader.java:2228)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
    at org.hibernate.loader.Loader.list(Loader.java:2120)
    at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:312)
    at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1722)
    at
org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
    at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:175)
    at
com.xxxxxxxx.care.agentevaluation.db.dao.xxxxxxxx.getAgentDetails(xxxxxxxx.java:131)

    at
com.xxxxxxxx.care.agentevaluation.business.manager.xxxxxxxxManager.searchAgent(xxxxxxxxManager.java:64)

    at
com.xxxxxxxx.care.agentevaluation.services.service.xxxxxxxxServiceMaster.searchAgent(xxxxxxxxServiceMaster.java:79)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)
    at
com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
    at
com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)

    at
com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)

    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at
com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)

    at
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)

    at
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)

    at
com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

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

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

    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)
Dec 10, 2010 8:13:46 PM com.xxxxxxxx.care.agentevaluation.db.dao.xxxxxxxx
getAgentDetails
WARNING: Exception occured in method:getAgentDetails:Message:Not supported
by BasicDataSource
Dec 10, 2010 8:13:46 PM
com.xxxxxxxx.care.agentevaluation.business.manager.xxxxxxxxManager
searchAgent
WARNING: Exception occured in method:searchAgent:Message:Not supported by
BasicDataSource
com.xxxxxxxx.care.agentevaluation.exceptions.ApplicationException: Not
supported by BasicDataSource
    at
com.xxxxxxxx.care.agentevaluation.business.manager.xxxxxxxxManager.searchAgent(xxxxxxxxManager.java:100)

    at
com.xxxxxxxx.care.agentevaluation.services.service.xxxxxxxxServiceMaster.searchAgent(xxxxxxxxServiceMaster.java:79)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)
    at
com.sun.xml.ws.api.server.InstanceResolver$1.invoke(InstanceResolver.java:246)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:146)
    at
com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:257)

    at
com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at
com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:471)

    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at
com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)

    at
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)

    at
com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)

    at
com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

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

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

    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
    at java.lang.Thread.run(Thread.java:619)
Dec 10, 2010 8:13:46 PM
com.xxxxxxxx.care.agentevaluation.services.service.xxxxxxxxServiceMaster
searchAgent
WARNING: Exception occured in method:searchAgent:Message:Not supported by
BasicDataSource

5.I understand that datasource configuration is a separate entity and does
not depend on the SQL query i have written in my .java file that is fetched
using hibernate but still I want to enquire whether "coalesce" that i'm
using in the dynamic query creation is the culprit because the exception is
occurring when the method returning this processed query is returned as you
can see in the scriptlet

6.the <reqfieldtype,colHeaderRequired etc> and other are values saved into
session from user input page and then requested wherever required

7.I understand u are stressing on code optimization as
(stringbuilder,finally) but my main problem is the functionality that i have
to meet using data source and only after that I can stress upon code
enhancement.i have noted and will implement it.The fact is the project is in
testing environment and i have to implement the datasource and verify again
including final code optimization without which it cannot be tested and put
into production. 


      

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message