Seam on tomcat connection problem using EJB
statelessbean Jul 27, 2007 2:01 PMHi,
I try to configure my app to run on tomcat.
I configured all files like in booking example.
First question:
For what reason is mc-conf.jar file, should I configure some special in this file?
When I deploy app on tomcat i get this error:
19:56:16,026 INFO [InjectedDataSourceConnectionProvider] Using provided datasource 19:56:16,230 WARN [LocalTxDataSource] Throwable while attempting to get a new connection: null org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres") at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:177) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:579) at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:247) at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:540) at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:339) at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:301) at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:392) at org.jboss.resource.adapter.jdbc.local.LocalTxDataSource$ConnectionManagerDelegate.allocateConnection(LocalTxDataSource.java:78) at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88) at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:69) at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:73) at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1928) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1211) at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:631) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:760) at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:350) at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:119) at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:264) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source)
i thinks this is authentication problem but I use same authentication for jboss and this works fine!!
<datasources>
<local-tx-datasource>
<jndi-name>CenturionDatasource</jndi-name>
<connection-url>jdbc:postgresql://127.0.0.1:5432/Centurion</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<user-name>postgres</user-name>
<password>root</password>
<blocking-timeout-millis>50000</blocking-timeout-millis>
<metadata>
<type-mapping>PostgreSQL 8.2</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
Here is my JBoss-beans.xml
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd"
xmlns="urn:jboss:bean-deployer">
<bean name="CenturionDatasourceBootstrap" class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
<property name="driverClass">org.postgresql.Driver</property>
<property name="connectionURL">jdbc:postgresql://localhost:5432/Centurion</property>
<property name="userName">postgres</property>
<property name="jndiName">java:/CenturionDatasource</property>
<property name="minSize">0</property>
<property name="maxSize">10</property>
<property name="blockingTimeout">1000</property>
<property name="idleTimeout">100000</property>
<property name="transactionManager"><inject bean="TransactionManager"/></property>
<property name="cachedConnectionManager"><inject bean="CachedConnectionManager"/></property>
<property name="initialContextProperties"><inject bean="InitialContextProperties"/></property>
</bean>
<bean name="CenturionDatasource" class="java.lang.Object">
<constructor factoryMethod="getDatasource">
<factory bean="CenturionDatasourceBootstrap"/>
</constructor>
</bean>
</deployment>