Closed rlmf82 closed 3 years ago
@rlmf82 it seems to me that the content of your hibernate.cfg.xml is wrong but I can't be sure. Can you please compare your file with various examples of such file? I found one here: https://dzone.com/articles/hibernate-5-xml-configuration-example . Also, the http://vibur.org docs have an example snippet: http://www.vibur.org/#vibur-and-hibernate . Try to work from these example to figure out what exactly is misconfigured or your end. If you can't figure it out, post here your complete hibernate.cfg.xml and I'll try to help.
Hi Simeon,
Thanks for your attention. Firstly, my application is already working with Vibur, but my connection information are all together at hibernate.cfg.xml, like showed in the articles that you sent to me.
`
@rlmf82 sorry for my slow reply way too many things are happening at the moment. Based on this line in the stacktrace at org.vibur.dbcp.integration.ViburDBCPConnectionProvider.configure(ViburDBCPConnectionProvider.java:63)
I believe you're using one of the old vibur-dbcp-hibernate5
artefacts to integrate Hibernate and Vibur. Can you please switch to hibernate-vibur
artefact that is part of the standard Hibernate distribution? See here http://www.vibur.org/#hibernate-integration-artifacts . Possibly upgrade to latest Hibernate 5.4.x version, too.
For the Tomcat->Hibernate->JNDI configuration check docs like https://docs.jboss.org/hibernate/orm/5.4/userguide/html_single/Hibernate_User_Guide.html#jndi or this or this. I haven't tried to follow these examples, I cannot tell how good they are.
Closing due to inactivity.
Hi guys,
`org.postgresql.Driver
After execute my Tomcat 8.5 server a exception is returned like below:
org.vibur.dbcp.ViburDBCPException: Unexpected type for configuration property externalDataSource/java:comp/env/jdbc/myDatasource at org.vibur.dbcp.ViburDBCPDataSource.configureFromProperties(ViburDBCPDataSource.java:198) at org.vibur.dbcp.ViburDBCPDataSource.<init>(ViburDBCPDataSource.java:125) at org.vibur.dbcp.integration.ViburDBCPConnectionProvider.configure(ViburDBCPConnectionProvider.java:63) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:241) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:209) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.buildJdbcConnectionAccess(JdbcEnvironmentInitiator.java:145) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:66) at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:88) at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:258) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:232) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:209) at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:51) at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:94) at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:241) at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:209) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.handleTypes(MetadataBuildingProcess.java:356) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:112) at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.build(MetadataBuildingProcess.java:84) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:470) at org.hibernate.boot.internal.MetadataBuilderImpl.build(MetadataBuilderImpl.java:91) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:691) at util.HibernateUtil.buildSessionFactory(HibernateUtil.java:22) at util.HibernateUtil.<clinit>(HibernateUtil.java:11) at empresa.ControladorEmpresa.<init>(ControladorEmpresa.java:44) at empresa.ControladorEmpresa.getInstance(ControladorEmpresa.java:38) at util.fachadas.Fachada.recuperarUrlCompletaEmpresa(Fachada.java:1085) at util.web.FiltroAcesso.doFilter(FiltroAcesso.java:38) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:660) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:798) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:808) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
My Context.xml is configured like:
<Resource auth="Container" driverClassName="org.postgresql.Driver" global="jdbc/myDatasource" maxIdle="10" maxTotal="20" maxWaitMillis="-1" name="jdbc/myDatasource" username="postgres" password="123456" type="javax.sql.DataSource" url="jdbc:postgresql://localhost:5432/Database"/>
anyone could you help me with this problem? Or say how to define an externalDataSource for vibur?