>From a quick glance it looks like you're mixing Hibernate-controlled database 
pooling with Tomcat-managed pooling.

Read this and see if that helps.

http://wiki.apache.org/tomcat/TomcatHibernate

. . . . just my two cents.

/mde/


----- Original Message ----
From: SOPANMISHRA <sopan.mis...@gmail.com>
To: users@tomcat.apache.org
Sent: Thu, December 9, 2010 9:33:02 AM
Subject: Not supported by Basic Datasource


jdk-1.6_13 Tomcat-6.0.26 Hibernate 3.2 

I'm getting the error "Not supported by BasicDataSource" while running a
project based on java-hibernate-tomcat server.
The project works fine if I use the normal jdbc process.
For configuring datasource I strictly followed the process mentioned in
Tomcat reference docs in the link:-
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html
ie I'm configuring the project specific hibernate.cfg.xml,web.xml(project
specific) and context.xml(inside tomcat/conf).

hib.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC 
"-//Hibernate/Hibernate Configuration DTD 3.0//EN" 
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd";>
<hibernate-configuration>
<session-factory>
<property
name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property
name="hibernate.connection.datasource">java:comp/env/jdbc/aardb</property>
<property name="show_sql">false</property>
<property name="connection.pool_size">10</property>
<property name="current_session_context_class">thread</property>

<mapping class="com.asas.assasa.asas." />
</session-factory>
</hibernate-configuration>



web.xml
<resource-ref>
<description>AAR DATABASE</description>
<res-ref-name>jdbc/aardb</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>


context.xml
<Resource
name="jdbc/aardb"
auth="Container"
type="javax.sql.DataSource" 
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@00.000.00.000:1521:DB1"
schema="xxxx"
username="xxxx"
password="xxx"
maxActive="10"
maxIdle="2"
maxWait="5000"
validationQuery="select 1 from dual"
/>


My StackTrace in my customized html that calls web service is as follows is
as follows:- 
STATUS: 500 
<?xml version='1.0' encoding='UTF-8'?><S:Envelope
xmlns:S="http://schemas.xmlsoap.org/soap/envelope/";><S:Body><S:Fault
xmlns:ns4="http://www.w3.org/2003/05/soap-envelope";><faultcode>S:Server</faultcode><faultstring>Not

supported by BasicDataSource</faultstring><detail><ns2:ApplicationException
xmlns:ns2="http://service.services.agentevaluation.care.xxxxxxxx.com/";><message>Not

supported by
BasicDataSource</message></ns2:ApplicationException><ns2:exception
xmlns:ns2="http://jax-ws.dev.java.net/";
class="com.xxxxxxxx.care.agentevaluation.exceptions.ApplicationException"
note="To disable this feature, set
com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system
property to false"><message>Not supported by
BasicDataSource</message><ns2:stackTrace><ns2:frame
class="com.xxxxxxxx.care.agentevaluation.business.manager.xxxxxxxx"
file="xxxxxxxx.java" line="100" method="searchAgent"/><ns2:frame
class="com.xxxxxxxx.care.agentevaluation.services.service.xxxxxxxxxxxxxxxxServiceMaster"

file="xxxxxxxxxxxxxxxxServiceMaster.java" line="78"
method="searchAgent"/><ns2:frame
class="sun.reflect.NativeMethodAccessorImpl"
file="NativeMethodAccessorImpl.java" line="native"
method="invoke0"/><ns2:frame class="sun.reflect.NativeMethodAccessorImpl"
file="NativeMethodAccessorImpl.java" line="39" method="invoke"/><ns2:frame
class="sun.reflect.DelegatingMethodAccessorImpl"
file="DelegatingMethodAccessorImpl.java" line="25"
method="invoke"/><ns2:frame class="java.lang.reflect.Method"
file="Method.java" line="597" method="invoke"/><ns2:frame
class="com.sun.xml.ws.api.server.InstanceResolver$1"
file="InstanceResolver.java" line="246" method="invoke"/><ns2:frame
class="com.sun.xml.ws.server.InvokerTube$2" file="InvokerTube.java"
line="146" method="invoke"/><ns2:frame
class="com.sun.xml.ws.server.sei.EndpointMethodHandler"
file="EndpointMethodHandler.java" line="257" method="invoke"/><ns2:frame
class="com.sun.xml.ws.server.sei.SEIInvokerTube" file="SEIInvokerTube.java"
line="93" method="processRequest"/><ns2:frame
class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="598"
method="__doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber"
file="Fiber.java" line="557" method="_doRun"/><ns2:frame
class="com.sun.xml.ws.api.pipe.Fiber" file="Fiber.java" line="542"
method="doRun"/><ns2:frame class="com.sun.xml.ws.api.pipe.Fiber"
file="Fiber.java" line="439" method="runSync"/><ns2:frame
class="com.sun.xml.ws.server.WSEndpointImpl$2" file="WSEndpointImpl.java"
line="243" method="process"/><ns2:frame
class="com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit"
file="HttpAdapter.java" line="471" method="handle"/><ns2:frame
class="com.sun.xml.ws.transport.http.HttpAdapter" file="HttpAdapter.java"
line="244" method="handle"/><ns2:frame
class="com.sun.xml.ws.transport.http.servlet.ServletAdapter"
file="ServletAdapter.java" line="135" method="handle"/><ns2:frame
class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate"
file="WSServletDelegate.java" line="129" method="doGet"/><ns2:frame
class="com.sun.xml.ws.transport.http.servlet.WSServletDelegate"
file="WSServletDelegate.java" line="160" method="doPost"/><ns2:frame
class="com.sun.xml.ws.transport.http.servlet.WSServlet"
file="WSServlet.java" line="75" method="doPost"/><ns2:frame
class="javax.servlet.http.HttpServlet" file="HttpServlet.java" line="637"
method="service"/><ns2:frame class="javax.servlet.http.HttpServlet"
file="HttpServlet.java" line="717" method="service"/><ns2:frame
class="org.apache.catalina.core.ApplicationFilterChain"
file="ApplicationFilterChain.java" line="290"
method="internalDoFilter"/><ns2:frame
class="org.apache.catalina.core.ApplicationFilterChain"
file="ApplicationFilterChain.java" line="206" method="doFilter"/><ns2:frame
class="org.apache.catalina.core.StandardWrapperValve"
file="StandardWrapperValve.java" line="233" method="invoke"/><ns2:frame
class="org.apache.catalina.core.StandardContextValve"
file="StandardContextValve.java" line="191" method="invoke"/><ns2:frame
class="org.apache.catalina.core.StandardHostValve"
file="StandardHostValve.java" line="128" method="invoke"/><ns2:frame
class="org.apache.catalina.valves.ErrorReportValve"
file="ErrorReportValve.java" line="102" method="invoke"/><ns2:frame
class="org.apache.catalina.core.StandardEngineValve"
file="StandardEngineValve.java" line="109" method="invoke"/><ns2:frame
class="org.apache.catalina.connector.CoyoteAdapter"
file="CoyoteAdapter.java" line="293" method="service"/><ns2:frame
class="org.apache.coyote.http11.Http11Processor" file="Http11Processor.java"
line="849" method="process"/><ns2:frame
class="org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler"
file="Http11Protocol.java" line="583" method="process"/><ns2:frame
class="org.apache.tomcat.util.net.JIoEndpoint$Worker"
file="JIoEndpoint.java" line="454" method="run"/><ns2:frame
class="java.lang.Thread" file="Thread.java" line="619"
method="run"/></ns2:stackTrace></ns2:exception></detail></S:Fault></S:Body></S:Envelope>
 

The print stack trace in tomcat catalina.log:- 
Dec 9, 2010 9:40:06 PM
com.xxxxxxxx.xxxxxxxx.agentevaluation.services.service.xxxxxxxx searchAgent 
INFO: Web Service called. 
Dec 9, 2010 9:40:06 PM
com.xxxxxxxx.xxxxxxxx.agentevaluation.services.service.xxxxxxxx searchAgent 
INFO: Translation of Service to Business object completed. 
Dec 9, 2010 9:40:06 PM com.xxxxxxxx.xxxxxxxx.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 
Dec 9, 2010 9:40:06 PM com.xxxxxxxx.xxxxxxxx.agentevaluation.db.dao.xxxxxxxx
getAgentDetails 
WARNING: Exception occured in method:getAgentDetails:Message:Not supported
by BasicDataSource 
Dec 9, 2010 9:40:07 PM
com.xxxxxxxx.xxxxxxxx.agentevaluation.business.manager.xxxxxxxxManager
searchAgent 
WARNING: Exception occured in method:searchAgent:Message:Not supported by
BasicDataSource 
Dec 9, 2010 9:40:07 PM
com.xxxxxxxx.xxxxxxxx.agentevaluation.services.service.xxxxxxxx searchAgent 
WARNING: Exception occured in method:searchAgent:Message:Not supported by
BasicDataSource 

I just want to enquire wether the coalesce query that i have written is
supported by basic data source or there is some other error 

I'm referring to the tomcat link
=http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html 

Sorry for not giving these vital info beforehand 





I used the "javax.sql.ConnectionPoolDataSource" but it is giving the error
:- 

INFO: Server startup in 2925 ms 
Dec 9, 2010 9:59:21 PM
com.xxxxxxxx.care.agentevaluation.services.service.xxxxxxxx searchAgent 
INFO: Web Service called. 
Dec 9, 2010 9:59:21 PM
com.xxxxxxxx.care.agentevaluation.services.service.xxxxxxxx searchAgent 
INFO: Translation of Service to Business object completed. 
Dec 9, 2010 9:59:22 PM
com.xxxxxxxx.care.agentevaluation.db.dao.HibernateUtil <clinit> 
WARNING: Exception building SessionFactory 
Dec 9, 2010 9:59:22 PM com.sun.xml.ws.server.sei.EndpointMethodHandler
invoke 
SEVERE: null 
java.lang.ExceptionInInitializerError 
at
com.xxxxxxxx.care.agentevaluation.db.dao.xxxxxxxx.getAgentDetails(xxxxxxxx.java:98)
 
at
com.xxxxxxxx.care.agentevaluation.business.manager.xxxxxxxx.searchAgent(xxxxxxxx.java:63)
 
at
com.xxxxxxxx.care.agentevaluation.services.service.xxxxxxxx.searchAgent(xxxxxxxx.java:78)
 
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) 
Caused by: java.lang.RuntimeException: Exception building SessionFactory:
Could not find datasource 
at
com.xxxxxxxx.care.agentevaluation.db.dao.HibernateUtil.<clinit>(HibernateUtil.java:50)
 
... 36 more 


My sriptlet 

try { 

sessionAar = HibernateUtil.currentAARSession(); 

// Forming the Array containing the Search Key Values 
str = new ArrayList<String>(); 
str.add("");// adding a default value 
str.addAll(agencyInformation.getSearchCriteria() 
.getSearchKeyValues().getSearchKeyValue()); 

// Fetching the Required Fields and Order By sequence 
retStr = formReqFieldStr(agencyInformation.getRequiredFields()); 
if (Validation.validate(retStr)) { 
// Required Fields 
reqFieldStr = retStr[0]; 

// Order By sequence 
orderByStr = retStr[1]; 
} 

// Forming the query 
searchKey =
Validation.valid(agencyInformation.getSearchCriteria().getSearchKey()); 

tempQuery = new StringBuilder(); 
tempQuery.append("SELECT " + reqFieldStr 
+ " FROM AgencyRegistrar AS M WHERE M." 
+ representorMap.get(searchKey) + " IN (:lst) ORDER BY " 
+ orderByStr); 

LOGGER.info("Query:" + tempQuery.toString()); 

query = sessionAar.createSQLQuery(tempQuery.toString()); 
query.setParameterList("lst", str); 

tempList = query.setResultTransformer( 
Transformers.aliasToBean(AgencyRegistrar.class)).list(); 

} catch (Exception ex) { 
ex.printStackTrace(); 
LOGGER.warning("Exception occured in method:getAgentDetails:Message:" 
+ ex.getMessage()); 
ApplicationException apEx = new ApplicationException(); 
apEx.setMessage(ex.getMessage()); 
throw apEx; 
} finally { 
if (Validation.validate(sessionAar)) { 
sessionAar.close(); 
} 
} 
return tempList; 
}




Thanx a lot beforehand.Hope I can get my query resolved .



-- 
View this message in context: 
http://old.nabble.com/Not-supported-by-Basic-Datasource-tp30418811p30418811.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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


      

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

Reply via email to