Okay, I am in this boat of having endless problems. I am not sure what I am
doing wrong, but it seams like the data source isn't even getting created.
Environment desired:
Tomcat 5.5
Embedded EJB3 container (I am using the one from seam now and not the updated
one as I had problems -- in another post)
Seam extended transaction manager
PostgreSQL managed datasouce
Heirarchy:
test-seam.war
| WEB-INF/
| web.xml
| faces-config.xml
| lib/
| test-seam.jar
| META-INF/
| log4j.properties
| persistence.xml
| classes/
| jboss-beans.xml
| seam-jndi.properties
| seam.properties
faces-config.xml:
...
| <lifecycle>
<phase-listener>org.jboss.seam.jsf.SeamExtendedManagedPersistencePhaseListener</phase-listener>
| </lifecycle>
| ...
web.xml:
<!-- Database setup -->
| <context-param>
|
<param-name>org.jboss.seam.core.init.managedPersistenceContexts</param-name>
| <param-value>entityManager</param-value>
| </context-param>
|
| <context-param>
| <param-name>entityManager.persistenceUnitJndiName</param-name>
| <param-value>java:/EntityManagerFactories/testDatabase</param-value>
| </context-param>
|
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="testDatasourceBootstrap"
|
class="org.jboss.resource.adapter.jdbc.local.LocalTxDataSource">
| <property
name="driverClass">org.postgresql.Driver</property>
| <property
name="connectionURL">jdbc:postgresql://localhost/testdb</property>
| <property name="userName">test</property>
| <property name="password">test</property>
| <property name="jndiName">java:/testDatasource</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="testDatasource" class="java.lang.Object">
| <constructor factoryMethod="getDatasource">
| <factory bean="testDatasourceBootstrap" />
| </constructor>
| </bean>
|
| </deployment>
seam-jndi.properties:
ava.naming.factory.initial org.jnp.interfaces.LocalOnlyContextFactory
| java.naming.factory.url.pkgs org.jboss.naming:org.jnp.interfaces
seam.properties is empty
persistence.xml:
<persistence>
| <persistence-unit name="testDatabase">
| <provider>org.hibernate.ejb.HibernatePersistence</provider>
| <jta-data-source>java:/testDatasource</jta-data-source>
| <properties>
| <property name="hibernate.dialect"
|
value="org.hibernate.dialect.PostgreSQLDialect" />
| <property
name="connection.release_mode">after_statement</property>
| <property
name="hibernate.default_schema">public</property>
| <property
name="hibernate.transaction.manager_lookup_class"
|
value="org.hibernate.transaction.JBossTransactionManagerLookup"/>
| <property
name="hibernate.transaction.flush_before_completion" value="true"/>
| <property name="hibernate.show_sql" value="true"/>
| <!--property
name="jboss.entity.manager.factory.jndi.name"
| value="TestEntityManager"/-->
| </properties>
| </persistence-unit>
| </persistence>
|
catalina.out:
NFO 22-01 23:12:08,552 (Ejb.java:startup:39) -starting the embedded EJB
container
| INFO 22-01 23:12:11,517 (LocalTxDataSource.java:bindConnectionFactory:117)
-Bound datasource to JNDI name 'java:/DefaultDS'
| INFO 22-01 23:12:12,488 (Initialization.java:init:92) -done initializing
Seam
|
There is one session bean in the test-seam.jar as well, and it isn't being
recognized either. Not sure what is going on, any help is appreciated as I
wasted 3 hours on this. Thanks
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3919007#3919007
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3919007
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user