Starting a new seam project in Eclipse 3.1? - help needed
andrew.rw.robinson Oct 15, 2005 6:04 PMI'm having difficulty in getting a new project running for seam under Eclipse 3.1
I have an existing project that deploys to Tomcat 5.5. Here is what it contains:
Facelets 1.0a
MyFaces 1.1.0
Hand written MyFaces facelet taglib XML
Jenia4Faces libraries & servlet
Hand written Jenia4Faces facelet taglib XML
Hibernate 3 w/ hbm.xml deployment
PostgreSQL data source configured in Server.xml for both authentication realm and application usage
web.xml/Tomcat based authentication using standard JSPs
Eclipse using 2 deployments:
Internal deployment to be able to debug (.deployables directory)
Ant script for standalone tomcat execution
Eclipse 3.1 with Exadel 3.0.4 Free plugin
I want to try to use JBoss-Seam for this project inside of Eclipse. I installed the JBoss IDE plugins into Eclipse, but there is no Seam project wizard.
I am fairly new to Eclipse and haven't ever used JBoss before now (used WebLogic ~4-5 years ago). Could someone help me through getting a new project working in Eclipse?
Here is what I would like if possible:
Data source defined once for security inside of JBoss and my application and web-site authentication & data access.
Hibernate3 used as a backend to EJB3 persistence manager
(Preferrably) Continue to use hbm.xml mapping (I am not a big fan of ORM through annotations, I don't like the class being bound to only one database)
Use Seam for all backing beans, and have them deployed as session-beans with conversation scope (right now I am using request scope, and although nice, it creates difficulties on occassions).
Full integration into Eclipse (I would like to be able to debug on the server) and deploy using an ant build script.
I got the example seam application (booking) to work fine. The problem is that I can't debug it, it uses annotations, not hbm.xml, it seems to have the data soruce defined in mutiple locations (hard to figure out how to configure), and the ant build script is hard-coded for the examples (I cannot easily just pick up and use it for my project).
I am new to ear files and fairly new to war files, so please don't assume too much for deployment (I have been working in .NET for several years, and am trying to brush up my Java skills and also build a Java site for my Church).
Has anyone accomplished this yet? Even if someone could assist me in getting a JBoss web app project (JSF with no Seam) instead of a Tomcat project working in Eclipse it would be a good start.
Here is what I have done so far to JBoss to try to get ready:
Added new myfaces and facelet jars to the lib dir:
/usr/local/jboss/server/default/deploy/jbossweb-tomcat55.sar/jsf-libs
ls -l:
-rw-rw-r-- 1 andrew developers 116K 2005-10-04 21:43 commons-beanutils.jar -rw-rw-r-- 1 andrew developers 29K 2005-10-04 21:43 commons-codec-1.2.jar -rw-rw-r-- 1 andrew developers 162K 2005-10-04 21:43 commons-collections.jar -rw-rw-r-- 1 andrew developers 165K 2005-10-04 21:43 commons-digester-1.6.jar -rw-r--r-- 1 andrew users 24K 2005-10-11 13:38 el-api.jar -rw-r--r-- 1 andrew users 98K 2005-10-11 13:38 el-ri.jar -rw-r--r-- 1 andrew users 7.1K 2005-10-11 13:38 facelets-bsh-1.0.jar -rw-r--r-- 1 andrew users 241K 2005-10-11 13:38 jsf-facelets.jar -rw-r--r-- 1 andrew developers 21K 2005-10-11 13:38 jstl.jar -rw-r--r-- 1 andrew developers 231K 2005-10-11 13:38 myfaces-api.jar -rw-r--r-- 1 andrew developers 453K 2005-10-11 13:38 myfaces-impl.jar -rw-r--r-- 1 andrew users 385K 2005-10-11 13:38 standard.jar -rw-r--r-- 1 andrew users 877K 2005-10-11 13:38 tomahawk.jar
Added my data source XML to
/usr/local/jboss/server/default/deploy/postgres-ds.xml:
<?xml version="1.0" encoding="UTF-8"?> <datasources> <local-tx-datasource> <jndi-name>xxx-postgres</jndi-name> <connection-url>jdbc:postgresql://localhost/xxx</connection-url> <driver-class>org.postgresql.Driver</driver-class> <user-name>xxx</user-name> <password>xxx</password> <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --> <metadata> <type-mapping>PostgreSQL 7.2</type-mapping> </metadata> </local-tx-datasource> </datasources>
Added the following to
/usr/local/jboss/server/default/conf/login-config.xml
<application-policy name="xxx"> <authentication> <login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required"> <module-option name="dsJndiName">java:/xxx-postgres</module-option> <module-option name="principalsQuery"> select password from users where user_name=? </module-option> <module-option name="rolesQuery"> select role_name, 'Roles' from user_roles_vw where user_name = ? </module-option> <module-option name="hashAlgorithm">MD5</module-option> </login-module> </authentication> </application-policy>
At this point, I'm getting a bit stuck without getting an eclipse project to work with.
Thanks for any help you can provide,
Andrew