Not much to work with here as no stack trace or what environment your working on but i guess your trying to deploy on jboss as, and your persistence.xml has a data source called SeamSampleDatasource
<persistence-unit name="SeamSample"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <jta-data-source>SeamSampleDatasource</jta-data-source>
which means you should have a -ds.xml file deployed on jboss with the same datasource name
<local-tx-datasource> <jndi-name>SeamSampleDatasource</jndi-name> <use-java-context>false</use-java-context> ........ </local-tx-datasource>
Thank you Shane, you are right, after copying the resources/SeamSample-ds.xml to jboss default deploy directory and restarting, jboss gets up.
It is my lack of EE knowledge to solve this problem, but I think it's not logic: the -ds is only corresponded to some project, why the -ds is not packed into that war/ear and leave a clean file structure with JBoss itself?
No worries Nessus.
part of seam setup is inside IDE eclipse, when you build the seam project if your jboss home dir is setup correctly in build.properties ant will deploy exploded ear and ds.xml to jboss automatically.
other servers such as weblogic/websphere you setup datasource via admin console.
You can read up on this from seam documentation:
A data source is a Java Naming and Directory Interface (JNDI) object used to obtain a connection from a connection pool to a database. In order to create a DataSource (so that you can use JDBC connectivity) you need to create a file ending with -ds.xml under the
deploydirectory of your server.
In order to use a datasource you need to put the jdbc driver in jBoss's server's lib directory.
My deepest gratitude, Shane. Now I know exactly what a data source is and how to locate and configure it in the overwhelming conventions and configurations.
My experience with Java is mainly about SE, and a bit confused by how to glue so many frameworks together for a seemingly simple task. But I found I was wrong. I couldnt bypass them. So I think Seam is the one for all and would like to be an expert in it.
From now on I have to think in EE and in Seam.