alots_ssa 24 de abr. de 2006
A excessao eh a seguinte:
SEVERE : Cannot create JDBC driver of class '' for connect URL 'null'
org . hibernate . exception . GenericJDBCException : Cannot open connection
at org . hibernate . exception . SQLStateConverter . handledNonSpecificException
( SQLStateConverter . java : 82 )
at org . hibernate . exception . SQLStateConverter . convert ( SQLStateConverter . j
ava : 70 )
at org . hibernate . exception . JDBCExceptionHelper . convert ( JDBCExceptionHelp
er . java : 43 )
at org . hibernate . exception . JDBCExceptionHelper . convert ( JDBCExceptionHelp
er . java : 29 )
at org . hibernate . jdbc . AbstractBatcher . openConnection ( AbstractBatcher . jav
a : 419 )
at org . hibernate . jdbc . JDBCContext . connect ( JDBCContext . java : 145 )
at org . hibernate . jdbc . JDBCContext . connection ( JDBCContext . java : 91 )
at org . hibernate . jdbc . AbstractBatcher . prepareQueryStatement ( AbstractBatc
her . java : 86 )
at org . hibernate . loader . Loader . prepareQueryStatement ( Loader . java : 1096 )
at org . hibernate . loader . Loader . doQuery ( Loader . java : 367 )
at org . hibernate . loader . Loader . doQueryAndInitializeNonLazyCollections ( Lo
ader . java : 208 )
at org . hibernate . loader . Loader . doList ( Loader . java : 1522 )
at org . hibernate . loader . Loader . list ( Loader . java : 1505 )
at org . hibernate . loader . criteria . CriteriaLoader . list ( CriteriaLoader . java
: 111 )
at org . hibernate . impl . SessionImpl . list ( SessionImpl . java : 1256 )
at org . hibernate . impl . CriteriaImpl . list ( CriteriaImpl . java : 299 )
at br . com . locaweb . qbex1 . model . dao . impl . GenericDAO . listar ( GenericDAO . java
: 198 )
at br . com . locaweb . qbex1 . model . dao . impl . GenericDAO . listar ( GenericDAO . java
: 191 )
at br . com . locaweb . qbex1 . negocio . AcessorioBO . listar ( AcessorioBO . java : 18 )
at br . com . locaweb . qbex1 . web . actions . AcessorioBasicoAction . listar ( Acessor
ioBasicoAction . java : 82 )
at br . com . locaweb . qbex1 . web . actions . AcessorioBasicoAction . noAction ( Acess
orioBasicoAction . java : 73 )
at sun . reflect . NativeMethodAccessorImpl . invoke0 ( Native Method )
at sun . reflect . NativeMethodAccessorImpl . invoke ( NativeMethodAccessorImpl .
java : 39 )
at sun . reflect . DelegatingMethodAccessorImpl . invoke ( DelegatingMethodAcces
sorImpl . java : 25 )
at java . lang . reflect . Method . invoke ( Method . java : 585 )
at org . apache . struts . actions . DispatchAction . dispatchMethod ( DispatchActio
n . java : 274 )
at br . com . locaweb . qbex1 . web . actions . MeuDispatchAction . execute ( MeuDispatc
hAction . java : 53 )
at org . apache . struts . action . RequestProcessor . processActionPerform ( Reques
tProcessor . java : 419 )
at org . apache . struts . action . RequestProcessor . process ( RequestProcessor . ja
va : 224 )
at org . apache . struts . action . ActionServlet . process ( ActionServlet . java : 119
6 )
at org . apache . struts . action . ActionServlet . doGet ( ActionServlet . java : 414 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 689 )
at javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
at org . apache . catalina . core . ApplicationFilterChain . internalDoFilter ( Appl
icationFilterChain . java : 252 )
at org . apache . catalina . core . ApplicationFilterChain . doFilter ( ApplicationF
ilterChain . java : 173 )
at org . apache . catalina . core . StandardWrapperValve . invoke ( StandardWrapperV
alve . java : 213 )
at org . apache . catalina . core . StandardContextValve . invoke ( StandardContextV
alve . java : 178 )
at org . apache . catalina . core . StandardHostValve . invoke ( StandardHostValve . j
ava : 126 )
at org . apache . catalina . valves . ErrorReportValve . invoke ( ErrorReportValve . j
ava : 105 )
at org . apache . catalina . core . StandardEngineValve . invoke ( StandardEngineVal
ve . java : 107 )
at org . apache . catalina . connector . CoyoteAdapter . service ( CoyoteAdapter . jav
a : 148 )
at org . apache . coyote . http11 . Http11Processor . process ( Http11Processor . java
: 856 )
at org . apache . coyote . http11 . Http11Protocol $ Http11ConnectionHandler . proce
ssConnection ( Http11Protocol . java : 744 )
at org . apache . tomcat . util . net . PoolTcpEndpoint . processSocket ( PoolTcpEndpo
int . java : 527 )
at org . apache . tomcat . util . net . LeaderFollowerWorkerThread . runIt ( LeaderFol
lowerWorkerThread . java : 80 )
at org . apache . tomcat . util . threads . ThreadPool $ ControlRunnable . run ( ThreadP
ool . java : 684 )
at java . lang . Thread . run ( Thread . java : 595 )
Caused by : org . apache . tomcat . dbcp . dbcp . SQLNestedException : Cannot create JDBC dr
iver of class '' for connect URL 'null'
at org . apache . tomcat . dbcp . dbcp . BasicDataSource . createDataSource ( BasicDat
aSource . java : 780 )
at org . apache . tomcat . dbcp . dbcp . BasicDataSource . getConnection ( BasicDataSo
urce . java : 540 )
at org . hibernate . connection . DatasourceConnectionProvider . getConnection ( D
atasourceConnectionProvider . java : 59 )
at org . hibernate . jdbc . AbstractBatcher . openConnection ( AbstractBatcher . jav
a : 416 )
... 42 more
Caused by : java . sql . SQLException : No suitable driver
at java . sql . DriverManager . getDriver ( DriverManager . java : 243 )
at org . apache . tomcat . dbcp . dbcp . BasicDataSource . createDataSource ( BasicDat
aSource . java : 773 )
... 45 more
O commons dbcp ta no meu classpath e no lib , ja testei .
Alberto
thadeurc 24 de abr. de 2006
tem alguns artigos na net sobre isso, mas segue uma dica. Nao use direto pelo hibernate… crie o data source no tomcat e quanto vc for criar o session factory, passe a conexão q vc mesmo pega no tomcat
Tem alguns problemas em deixar direto. vc tem q implementar umas coisas meio tensas… da uma googada… no assunto que vc acha.
[]´s
alots_ssa 24 de abr. de 2006
Galera, tentei acessar esse datasource normalmente sem o hibernate e ele me retorna a mesma excessao dizendo que o driver e null e etc. O que deve ta errado?
Alberto
Mauricio_Linhares 24 de abr. de 2006
Provavelmente a sua configuração do DataSource.
No Tomcat 5.5 se configura assim -> http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html