Update: Use the 0.2 version of the plugin for Seam 1.2.1 GA and JBoss AS 4.0.5 GA.
Petr Pisl of Sun has just released a first-look Seam Gen plugin for NetBeans. It allows you to generate complete Seam CRUD applications in NetBeans much the same way Red Hat Developer Studio allows you to do in Eclipse. I am extremely excited. So, here is a mini tutorial with some screen shots (taken from a Vista box — NetBeans look pretty good on Windows Vista).
Tutorial
1. Download and install the Seam module in NetBeans 5.5.1. We recommend you to install the Facelets support modules as well. Use “Tools -> Update Center -> Install Manually” to install those nbm files.
2. Install JBoss AS 4.0.5 with EJB3 support and set up a database with some existing data. Register the JBoss server and database connection in NetBeans. This is standard NetBeans stuff. If you are not familiar with that, read the Notes at the end of this post. You should see something like this in the Runtimes window after you are done.

3. Use “Files -> New Project” to create a new Seam project. You need to point it to the Seam 1.2.0 PATCH1 installation directory. You need to also specify the JBoss AS instance and the database connection registered in NetBeans.



4. The project is then created. You can open any XHTML file to see the capability of the Facelets support module (e.g., syntax highlighting, auto-completion etc.)

5. Right click on the project and select Deploy to build and deploy the project to the selected JBoss AS instance.

6. Start the JBoss AS server in the NetBeans server manager.

7. You can see the basic web page in your browser.

8. Select “New -> Files” in the project and select generate-entities to generate a complete CRUD application based on the data in the database connection.

9. Java classes and UI XHTML files are generated into the project.

10. Deploy the app and refresh your browser. You now have a complete AJAX CRUD application (see it in action here).

Notes: Set up JBoss and database server
a. Install JBoss AS 4.0.5 GA from the installer and choose the EJB3 profiler when asked.
b. Register the server in NetBeans via “Runtime -> Servers -> Add Server” in context menu and select the JBoss AS installation directory.
c. Download and expand the following zip file for a HSQL database, and start the database by running the runDBServer script. Of course, if you have an existing DB running, you can skip this step.
d. Add the DB driver via “Runtime -> Databases -> Drivers ->New Driver” in context menu and select the hsqldb/lib/hsqldb.jar file. If you are using other DB servers, you need to add its JDBC driver.
e. From the context menu over the added HSQLDB driver, select “Connect Using …”
- Database URL: jdbc:hsqldb:hsql://localhost:1701
- Username: sa
- and the schema is PUBLIC
That’s it!
Michael,
I have installed this tool. When I use it with seam 1.2.0 path1, it work will. but when I changed to 1.2.1, i meet this error “D:\Java\seam\seam-gen\build.xml:813: org.hibernate.MappingException: Could not configure overrides from file: D:\E”.
ye
Great news,
I’m kind of disappointed the RHDS will be eclipse based since I think netbeans is far more on the ball nowadays.
I just wish they had a decent visual editor that didn’t take over the whole visual aspect of the project (the rave components), which when you think about it, is ironic considering the number of folks who thought the JSF spec was all about 3rd party tools and being IDE friendly.
I seem to recall seeing that there were no Seam integration plans for Netbeans 6 which is a real shame, especially since I think the only function really needed is some kind of auto-complete for beans in the xhtml editor.
I checked out the plugin, and get an error when trying to generate entities. I also get the error when I try and run the generate entities ant target :
org.hibernate.MappingException: Could not configure overrides from file: C:\C
java.io.FileNotFoundException: C:\C (The system cannot find the file specified)
The exact same error also occurs in my other seam-generated app which was done from the command line.
I’m guessing some path is not set up correctly?
DG
Oh, yeah, and I’m using 1.2.1 as well.
Nice but I still have to go back to eclipse for drools and jBPM. I wonder it that’s on the Netbeans Seam IDE roadmap.
your windows theme looks nice.
Do you use winxp?
The screen shots are taken on a windows vista box.
Very impressive! I am sure this plugin will work with Netbeans 6.0 as well! Just wondering but is there going to be a plugin for Intellij as well?
Yes, with NB 6.0, the plugin will gain more functionalities since NB 6.0 provides native support for EJB3 and annotations.
Unfortunately, there is currently no plan to developer an IntelliJ plugin — unless someone from the community to take the initiative.
i am able to generate the entities, but i get exceptions when trying to retrieve OrderDetailsList and OrderList.
The exception for OrderdeailsList is:
javax.faces.el.EvaluationException: /OrderdetailsList.xhtml @139,66 value=”#{orderdetailsList.lastFirstResult}”: Exception getting value of property lastFirstResult of base of type : MySeamApp2.model.OrderdetailsList$$EnhancerByCGLIB$$22e65590
[…] Source:First Release of Seam Plugin for NetBeans! […]
I am not able to generate entities … its gives me an exception while creation… is anyone having an idea ….
The stack trace ….
Apr 25, 2007 5:54:44 PM org.hibernate.connection.DriverManagerConnectionProvider configure
INFO: connection properties: {user=revmax, password=****}
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
WARNING: Could not obtain connection metadata
java.sql.SQLException: Null user or password not supported in THIN driver
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1160)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:195)
at oracle.jdbc.driver.OracleConnection.(OracleConnection.java:362)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:536)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:328)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:140)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:76)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:1929)
at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:38)
at org.hibernate.tool.ant.JDBCConfigurationTask.doConfiguration(JDBCConfigurationTask.java:82)
at org.hibernate.tool.ant.ConfigurationTask.getConfiguration(ConfigurationTask.java:55)
at org.hibernate.tool.ant.HibernateToolTask.getConfiguration(HibernateToolTask.java:299)
at org.hibernate.tool.ant.HibernateToolTask.getProperties(HibernateToolTask.java:315)
at org.hibernate.tool.ant.ExporterTask.configureExporter(ExporterTask.java:94)
at org.hibernate.tool.ant.Hbm2JavaExporterTask.configureExporter(Hbm2JavaExporterTask.java:34)
at org.hibernate.tool.ant.ExporterTask.execute(ExporterTask.java:39)
at org.hibernate.tool.ant.HibernateToolTask.execute(HibernateToolTask.java:183)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.Target.performTasks(Target.java:369)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:240)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:293)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:131)
Apr 25, 2007 5:54:44 PM org.hibernate.dialect.Dialect
INFO: Using dialect: org.hibernate.dialect.OracleDialect
Apr 25, 2007 5:54:44 PM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
Apr 25, 2007 5:54:44 PM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: auto
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default schema: REVMAX
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
Apr 25, 2007 5:54:44 PM org.hibernate.hql.ast.ASTQueryTranslatorFactory
INFO: Using ASTQueryTranslatorFactory
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: JPA-QL strict compliance: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.NoCacheProvider
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
Apr 25, 2007 5:54:44 PM org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
Apr 25, 2007 5:54:44 PM org.hibernate.connection.DriverManagerConnectionProvider close
INFO: cleaning up connection pool: jdbc:oracle:thin:@172.16.8.100:1521:oracle9i
An exception occurred while running exporter #2:hbm2java (Generates a set of .java files)
To get the full stack trace run ant with -verbose
org.hibernate.exception.GenericJDBCException: Getting database metadata
java.sql.SQLException: Null user or password not supported in THIN driver
/home/alokk/softwares/Seam/jboss-seam-1.2.1.GA/seam-gen/build.xml:813: org.hibernate.exception.GenericJDBCException: Getting database metadata
BUILD FAILED (total time: 0 seconds)
any suggestions …..
Hi Alok,
are you sure you have provided the password?
Using Seam 1.2.1 (same as the 1st replier)….error on build.xml (line:813) it can’t find the path to the hibernate templates because it is putting the ‘\’ character before the paths in your build.properties file. If you edit this file and take the leading ‘\’ from in front of all your directories, then this will work. I don’t know why it’s putting that character in there…will look at that later. Are you by any chance working on a Windows machine? This may be a platform dependent problem.
Back to 14….I still couldn’t get generate-entities to work within NetBeans, I had to go and use the script in the seam-gen directory. Wish I had a Linux box to try it on as I am using Windows Vista.
OK…guess there is another seam.properties that is in your \nbproject directory. If you fix the characters there, then you can run generate-entities from NetBeans as advertised.
Hi.
Following your instructions I can get to the end using hsqldb, but when I try to use postgresql, it builds and deploy fine but at run time I always get the following error:
javax.faces.el.EvaluationException: Cannot get value for expression ‘#{cantiereList.firstResult}’
Can this plugin (or seam or hibernate) work with postgresql?
Edit the ..\nbproject\seam.properties file. Remove the leading backslashes on the file specs.
I think the actual problem is not in the El resolving, but if you look at your \resources\-dev-ds.xml (and \resources\-prod-ds.xml) that is deployed to the server, you are probably missing the password and thus are not connecting propertly to your database (check the messages when you try to deploy your application to see that a connection is established).
Robi:-
One other thing…it seems that the NetBeans version of seam-gen adds an extra line to the persistance-dev.xml (as well as -prod.xml & -test.xml). Remove the following line and redeploy:-
(an empty string is not the same as null in this case)
the offending line to remove:-
the xml format doesn’t want to show on this page: just delete the hibernate.default_schema that has value=”"
Hey Judy & Will, thanks for your responses, I’ll try that out tomorrow.
It works great for me. The only one problem was to remove leading forward slashes in seam.properties as was suggested (not backward ones ). Nice example …
I am reading Michael Yuan’s excellent JBoss Seam book and on p. 67, Michael notes that it is not possible to set breakpoints in an EJB3 session bean running in Seam. This appears to be a major shortcoming in using NB to develop Seam applications, given that this is where action handlers are coded in Seam, and that is where I would expect to place most of the program logic
.
Does anyone know if this issue is being addressed by either the Seam developers or the NetBeans developers and when we might expect a resolution?
Thank you Judy. It was a silly error of mine.. now it works!
Have you tried to deploy the generated application on tomcat instead that on JBoss using the JBoss EJB3 microcontainer?
A short term solution is to use Seam POJOs instead of EJB3 session beans … You lose some functionality but for most apps, Seam POJOs are just as good as EJB3 session beans for transactional logic.
Michael, thanks for your response. I have a couple of follow-up questions if you don’t mind.
1. I got the impression from your book that Eclipse doesn’t have as good support for JSF/Facelet code completion or maybe other things that would affect building J2EE apps. Is this true, and does Eclipse have this same breakpoint problem as NB with Seam?
2. Are you aware of any efforts within the NB project to fix the breakpoint problem?
Thanks again. Very nice book. It’s got me very interested in using Seam. I find myself agreeing with almost everything you suggest about application architecture and the benefits of Seam after working on a project with JSF/Facelets without Seam.
Hi Rick,
The problem with debugging EJB3 session bean in Seam is not inherent to NB or Eclipse — it is an issue with the JVM debugger. Seam generates a proxy for the session bean, and the JVM debugger is not smart enough to recover the original bean class name at runtime. So, the breakpoint in the class are not invoked.
On the other hand, I do not really see the lack of debugger support as a show-stopper … You are supposed to unit test your bean methods rather than relying on the debugger at runtime.
I am glad that you liked the book. Would you mind post what you said here as an review on Amazon? I’d appreciate it very much.
http://www.amazon.com/JBoss-Seam-Simplicity-Power-Beyond/dp/0131347969/
cheers
Michael
Hi Michael,
I will certainly post to Amazon with a very good rating. I’d like to finish the book first — you should see my review in the next few days to a week, at most.
Thanks for explaining the debugging issue. I think debuggers make unit testing unnecessary, and when something weird is going on in the code, I find nothing comes close to using a debugger. Just a friendly difference of opinion.
Is there a solution possible? Is it possible to create a testing mode for Seam that doesn’t require proxies? Are the Seam developers banging on the Java developers to fix this?
Thanks again and regards,
Rick
No pressure. Thanks in advance.
I do not think anyone is working on a fix right now. But if debugging is absolutely essential for you, can you switch to Seam POJO+JPA instead of EJB3 session beans? Do you have a use case that require EJB3 session bean? Thanks.
cheers
Michael
Hi Michael,
Do you have a mini-tutorial that guide how to setup eclipse project or netbeans project that load all source codes and xhtml view files from your dvdstore example into the IDE environment.
I want to play with dvdstore codes inside the IDE environment (eclipse or netbeans). I want to edit some EJB classes and view files and hope the IDE support code completion. I also want to build the dvestore app inside the IDE and deploy into JBoss App server inside the IDE.
Is is possible to do all of these at this stage?
Thank you very much,
T Doan
Hi Michael,
In response to:
This is not clear, yet. The answer is probably not for this project, but I hate restricting my flexibility when developing, so I will probably use ejb session beans anyway, in spite of the debugging nuisance.
I haven’t yet posted a review to Amazon — reason is that I had to move back to another project for a week or two. As soon as I finish your book, I promise you a positive review. Thanks again.
HI, i’m try to run in NB 5.5 but
:
17:25:56,968 INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
17:25:57,000 INFO [JkMain] Jk running ID=0 time=0/79 config=null
17:25:57,062 INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 1m:38s:937ms
17:26:53,562 ERROR [MsgAjp] BAD packet signature 18245
17:26:53,562 ERROR [ChannelSocket] Error, processing connection
java.lang.IndexOutOfBoundsException
at java.io.BufferedInputStream.read(BufferedInputStream.java:310)
at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:577)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:619)
Hi Michael,
I follow the instructions and i can use Netbeans 5.5 with Seam.
The question is:
- Seam generetor creates 3 folders under the src folder. action, model and test.
When i use the seam generator to create a new entity it does 3 things:
1) Creates the entity under the src/model folder in the package specified in the setup.
2) Creates a SomethingHome.java and SomethingList.java under the src/action folder in the package specified in the setup.
3) Creates shometing.xhtml and somethingList.xhtml under the view folder.
The thing is that seam generator doesn’t setup a correct netbeans project. I think it should add each folder in src as a Source Package folder in the project’s properties. And add the jars it needs in the classpath for each src folder.
Has anyone having the same problem?
This plugin for netbeans looks great with facelets support.
What is missing is a graphical jBPM designer for workflows and pageflows.
I’m reading your new Seam book and it’s great! Congrats!
Humber
Patience, guys!
The next release of the plugin will come very soon. It will have better support for Seam 1.2.1 as well as on the Windows platform.
cheers
Michael
That’s good news - the fact that NB seems to have the best Seam support is what’s driving me towards it now. I’m pretty unimpressed with IntelliJ, and there really is no good Eclipse solution that I’ve tried that covers Seam (and the seam components - EJB3/JSF/Facelets/etc) all that well, especially on OSX where Exadel has issues. Maybe when the mythical RHDS is actually (re-)released… but since there’s no timeline provided anywhere that I can see… oh, well.
What would be really spectacular is if Eclipse/IntelliJ/NetBeans could agree on a set of common configuration files … or if sufficiently motivated individuals would write the correct plugins so that each one would keep all the other files up-to-date. I really dislike making a project IDE-specific, but these days they’re really too complex to follow the old “just check in the actual generic source,” model I used to promote.
Perfect tool for me at first sight.
Running on an iMac flat G4, with netbeans 5.5 updated via Update Center, jboss-seam-1.2.0.PATCH1, and nbfaceletssupport-0-5.
I’ve tried it with an in-progress project based on postgresql 8.2 database, which deals with capital gains/loss taxes. So, pretty much the same as your example.
What is great is that it has detected some duplicated constraints names on foreign keys, which had never been detected by any other tools. Not a drama either, since they referenced the same column on the same table, but much more cleaner.
And it has solved the problems on dates (sql/java) and big decimals, which is great for me as a java beginner.
I’ve just found that when adding a new row in a table and clicking on select foo table for referenced tables, I’m given an “Undefined Undefined” error message for the first selected table. Then all goes well. It may be on my side.
Thanks for that tool.
Hi,
First of all, thanks a lot for that great tool Michael. I tried the updated version 0.2 and the bug with the Microsoft Windows OS seems to be resolved now. But I still have a problem generating a CRUD with a PostgreSQL database (ver. 8.2). When I try to reach the “home.seam” page, I have this error (which seems to be the same as Roby (#17) had:
Cannot get value for expression ‘#{productsList.firstResult}’
Note that I have a single table ‘products’ with 3 columns inside it.
Michèle (#38) seems to make it work on a Mac. Can somebody give us a clue on how to make it work with PostgreSQL? Do we have to change some files (i.e. persistence.xml)?
Thanks
I am trying to use mysql and am getting the same error that has been reported when trying to user PostgreSQL. Namely, when going to home.seam I get:
Cannot get value for expression ‘#{ratingList.firstResult}’
I looked at the JBoss log and found this:
ObjectName: persistence.units:ear=SeamMovies.ear,unitName=SeamMovies
State: FAILED
Reason: javax.persistence.PersistenceException: org.hibernate.HibernateException: Hibernate Dialect must be explicitly set
I Depend On:
jboss.jca:service=DataSourceBinding,name=SeamMoviesDatasource
I am using NB 5.5.1, Seam 1.2.1, and JBoss 4.0.5
OK, in regards to #40. I made a silly mistake. I did not install the mysql driver in JBoss. I simply copied the jar file into %JBOSS_HOME%\server\default\lib and it started working!
Superb!
Thanks a lot Walter, I simply copied the PostgreSQL driver (jar file) into %JBOSS_HOME%\server\default\lib as you did with MySQL and it solved the problem. Now I can play with this new tool.
Thanks again.
I have just published screencast about Booking example and Eclipse IDE:
Walter,
Could you,please, let me know an exact version
of MySQL Connector/J and MySQL working successfully with Seam Plugin.
My environment was:-
1.NetBeans 5.5.1
2.Seam 1.2.1
3.Jboss 4.0.5 (tuned for MySQL connection)
4.MySQL 5.0.37
5.MySQL Connector/J 3.0 (might be 5.0 should be used).
Project in NetBeans 5.5.1 has been created OK.
Deployed apps generated facelets error different
from mentioned above in the topic , when trying
to click on horizontal ListTable link.
Sorry,
mysql-connection-java-5.0.3.zip has been used.
I am confused a bit. Please view:-
*************************************
JBoss: Hypersonic to mysql migration
*************************************
http://anaaman.blogspot.com/2007/02/jboss-hypersonic-to-mysql-migration.html
Did modification as suggested in:-
http://anaaman.blogspot.com/2007/02/jboss-hypersonic-to-mysql-migration.html
Still getting same facelets error:-
/JmsTransactionsList.xhtml @34,68 rendered=”#{empty jmsTransactionsList.resultList}”: Exception getting value of property resultList of base of type : SeamApps01.model.JmsTransactionsList_$$_javassist_22
Multiple entries into Jboss server logfile :-
22:05:48,859 ERROR [JDBCExceptionReporter] Transaction is not active: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=dualsystem/13, BranchQual=, localId=13]; - nested throwable: (javax.resource.ResourceException: Transaction is not active: tx=TransactionImpl:XidImpl[FormatId=257, GlobalId=dualsystem/13, BranchQual=, localId=13])
Boris,
I think it is a Hibernate / JDBC issue — not a Seam issue. Can you run a simple Hibernate demo app against the MySQL JDBC and see if it works?
cheers
Michael
I too am having problems generating entities. I’ve been fighting with Seam for months now, attempting to find an IDE that works. This “looked” easy, but alas, it was just another Seam deployment mess. I would REALLY love to use Seam, but I’m puzzled as to why someone would put this much effort into a Netbeans solution that does not even create a standard NB project. I found the same frustration with Seam-gen. Sure you can watch it generate a couple of cool web pages, but then you’re stuck fighting with the non-standard web structure that doesn’t work in ANY of the major IDEs (at least the 3 or 4 I tried). I sure hope the Red Hat Studio/Exadel IDE INTEGRATES Seam into the IDE, not the IDE having to Seam. If not, I’ll stick with my couple of pages of Spring beans XML.
Please, view:-
——————————————-
Deploy a JBoss Application Using Hibernate
——————————————-
http://docs.hp.com/en/5991-5569/ar01s04.html?btnNext=next%A0%BB
Article mentioned above is a Hibernate demo
working against MySQL JDBC
Thanks Dmitry. That site reminded me that I needed an Oracle data source in JBoss, and I found (like someone previously mentioned) there was no password in the nbproject/seam.properties file. Unfortunately, I’m still getting a strange error about an unexpected forward slash in the table meta data. Since there are no slashes in my table meta data, I can only guess there are more problems buried in the project configuration. I didn’t find anything obvious. I’ll wait for RHS.
Got it! I used an existing schema and still had some tables in the Oracle recycle bin. Oracle assigns purged tables some odd names with special characters that the entity generator chocked on. Finally, a working Seam deployment! My only minor gripe is that the entity generator creates a web page and XML file for EVERY table in the schema. Since I had 25 tables, I got a “bonus” of 50 files I didn’t want. If anyone knows how to avoid that behavior, I would very much appreciate an example.
Well done!
Deployment Seam Application against Oracle 10g database to Jboss 4.0.5 utilizing Seam Plugin for NetBeans 5.5.1 on CentOS 5.0
http://bderzhavets.blogspot.com/2007/06/deployment-seam-application-against.html
Deployment Seam Application against MySQL 5 database to Jboss 4.0.5 utilizing Seam Plugin for NetBeans 5.5.1
http://bderzhavets.blogspot.com/2007/06/deployment-seam-application-against_29.html
Hello!
I’m desperate
I’m following every step this guide, but the point 3 I don’t complete because last figure of this point not disappear. The project has been created, but I don’t open it with netbeans.
Thanks.
Salvo.
P.S.
Sorry for my english.
Hello
Very interesting information! Thanks!
Bye
Hi,
thanks for this nice plugin.
Do you know how to make JBoss-Seam javadoc visible in the IDE.
Thank you in advance.
Khalil
Hello
Thanks for all information
I’m developing a Web application on netbeans with seam, hibernate and glassfish. When the contact is logged, he could modify his profil. However my ContactBean doesn’nt work, the information who were modify were not update in database. I saw an exemple in the book Prentice Hall(on 4.4 page 91), I downloaded the source but i didn’t see the entity Bean.
Could you help me ?
Thank you in advance
Yohann
Hi Mike,
Thanks for this step-by-step tutorial on Seam and Netbeans. My problems are(I use winXP, NetBeans5.5.1, Seam 1.2.1, JBossAS 4.0.5 (installed with ejb3 capabilities)):
I already installed the Netbeans Facelet Support 0.5, and the Netbeans Seam generation too but whenever I try to create a new Seam project from the Seam Generator, after specifying myworkspace(project directory), seam location and configuring the database connection, selecting the ‘next’ button for code generation always results in ‘C:\Documents%20and%20Settings\ssamson\My%20Documents\WorkSpace not found.
‘ error on line 470 of the seam-gen build.xml file. Even when i changed my workspace from the above to ‘d:\NBWS’, I the same error.
Please, what could be the source of this behaviour. I want to get on with this seam thing in Netbeans since RHDS won’t be free evenntually. I need a response soon if it is not a burned please.
Once more, thank you.
Kevwe.
I am using Seam 2.0.0CR2 and JBoss 4.2.1 GA.
I installed the plugin, created a new project and deployed it.. I got a stack trace:
INFO: Added Library from: jar:file:/E:/jboss/jboss-4.2.1.GA/jboss-4.2.1.GA/server/default/deploy/SeamApplication1.ear/SeamApplication1.war/WEB-INF/lib/richfaces-ui.jar!/META-INF/richfaces.taglib.xml
11:53:55,375 ERROR [AjaxPhaseListener] Exception on get current Skin
java.lang.IllegalArgumentException: Illegal group reference
at java.util.regex.Matcher.appendReplacement(Matcher.java:706)
at java.util.regex.Matcher.replaceAll(Matcher.java:806)
at java.lang.String.replaceAll(String.java:2000)
at org.richfaces.skin.SkinFactoryImpl.loadProperties(SkinFactoryImpl.java:290)
at org.richfaces.skin.SkinFactoryImpl.buildSkin(SkinFactoryImpl.java:269)
at org.richfaces.skin.SkinFactoryImpl.getSkinByName(SkinFactoryImpl.java:120)
at org.richfaces.skin.SkinFactoryImpl.getSkin(SkinFactoryImpl.java:135)
at org.ajax4jsf.event.AjaxPhaseListener.beforePhase(AjaxPhaseListener.java:143)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:83)
at org.jboss.seam.debug.hot.HotDeployFilter.doFilter(HotDeployFilter.java:68)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.MultipartFilter.doFilter(MultipartFilter.java:85)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.ExceptionFilter.doFilter(ExceptionFilter.java:64)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.RedirectFilter.doFilter(RedirectFilter.java:44)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:58)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:150)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
That said, can i use glassflish?
I’ve tried using seam generate entities from Netbeans and it doesn’t work. I get the following error:
An exception occurred while running exporter #2:hbm2java (Generates a set of .java files)
To get the full stack trace run ant with -verbose
org.hibernate.exception.SQLGrammarException: Could not get list of suggested identity strategies from database. Probably a JDBC driver problem.
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘like ‘product'’ at line 1
I’m using mysql-connector-java-5.1.5.
Any ideas where to go from here?
(Is this project dead?) - This title of this article suggests that this tool is going to be released finally later… Any news?
My approach is even simpler and fails following what I think are the instructions in the book.
I created a very simple hello that allows me to show the default page when not logged in, and when you click login it shows the login screen, and upon logging in, a layout much like the hotel registration.
Now, I got this from seam setup using hsql only, then new-project,
and diddled with the template and stylesheets until I got what I wanted.
Now I do, seam new-entity and make the classname User and follow through. It creates a few files and tells me to seam restart, which I do.
Now the original login i.e. step1/home.seam works still, BUT
step1/userList.seam ( WHICH seam new-entity created!! ) gives me
/userList.xhtml @21,65 rendered=”#{empty userList.resultList}”: Exception getting value of property resultList of base of type : com.shoulderscorp.security.UserList_$$_javassist_145
Now note that in userList.xhtml the following is given:
userList
Id
#{user.id}
Name
So
rendered=”#{empty userList.resultList}”/>
was put there by the seam new-entity. This is a mac, it is hsql, and nothing fancy.
The userList, user, or no other class or file in the generated app for JBoss has a method or annotation with “resultList” in it.
Where is the xhtml supposed to get this userList.resultList?
Where should it be specified since new-entity obviously doesn’t put it wherever it’s supposed to go.
Any help appreciated.
Found a hint in the logs of the previous, but don’t know what to do about it.
16:25:56,798 INFO [STDOUT] Hibernate: select user0_.id as id0_, user0_.name as name0_, user0_.version as version0_ from step1.step1.User user0_
16:25:56,800 WARN [JDBCExceptionReporter] SQL Error: -226, SQLState: 22019
16:25:56,800 ERROR [JDBCExceptionReporter] Three part identifiers prohibited in statement [select user0_.id as id0_, user0_.name as name0_, user0_.version as version0_ from step1.step1.User user0_]
16:25:56,804 ERROR [STDERR] Nov 6, 2007 4:25:56 PM com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/userList.xhtml]
NOTE: Why did new-entity create these 3 part identifiers step1.step1.User?
I really think Seam seems like a good idea, but I’ve been fighting it for weeks! Other than the canned examples, it is very fragile, corrupting the JBoss server which then won’t stop or start and I have to reboot and then re-install JBoss to get out of the corruption. I’ve tried removing the corrupted ear(exploded) and xml file, but that didn’t help.
Still trying as I think the concept is great.
Help appreciated on getting past this simple case!
So this project is dead. That was sad… It looked promising.
Please provide a roadmap and better documentation on the toolset.
Where’s the seam mailing list. I can’t find it.
Thanks
Morten Matras
I got