This maven2 archetype contains a little sample web application with this Frameworks:
- Spring 3.1.0.RELEASE Framework
- Servlet-API 2.5
- JSF 2.0 (mojarra 2.1.2)
- RichFaces 4.1.0.Final
- ploinFaces 1.6
- ploinMailFactory 1.3.1
- Hibernate 3.3.0
- TestNG 5.8
- Log4J 1.2.15
- HSQLDB 1.8.0.7
The configuration is annotation-driven. It is deployed on the PLOIN Repository-Server
http://www.ploin-m2.de/nexus/content/groups/public/
you can create a project from the archetype with the following command:
mvn archetype:generate -DarchetypeGroupId=org.ploin.archetype -DarchetypeArtifactId=demoSpringRichHibernate-archetype -DarchetypeVersion=1.2 -DarchetypeRepository=http://www.ploin-m2.de/nexus/content/groups/public/ -DgroupId=com.versioneye -DartifactId=myNewWebApp
The created project is a very simple web-application with a login mask and 2 xhtml-sites. I have tested the app on a tomcat 6.0.35 and Java 1.6 on Mac OS X Lion.
On the second page there is a small demonstration of the JSF 2.0 AJAX feature. Every time you type something in into the first input field, there is a whole server roundtrip. The ManagedBean gets updated immediately.
On the same page there is a small demo for the RichFaces calendar.
After the creation the app is running with the HypersoniceSQL DBMS. But it is very easy to switch to MySQL or Oracle. I put the drivers for MySQL and Oracle as a comment in the pom.xml. So you just need to comment in the right lines in the pom.xml.
Hello Robert:
Why When I execute a mvn test – it fail?
Jose
I like your T-Shirt!
You are right. A Spring Config Bug. I will fix it!
It is fixed! Just use version 1.1 instead of 1.0. I updated the mvn command in the blog post above.
Hi Robert,
Thanks for the updated code. I tried to change the skin, but it did not work. I tried to set param in web.xml. No luck. 😦
org.richfaces.CONTROL_SKINNING_CLASSES
enable
Any valuable inputs ?
Thanks,
Baskar
Robert,
Skinning is not working in this build. But it worked charm in the other build.
https://robert-reiz.com/2011/07/13/archetype-richfaces-4-0-0-m1-spring-3-0-5-release-hibernate-3-3-0/
Did you use any specific configuration which we have to use in this build ?
Steve
Hey guys. I will take a look to that issue end of the week.
Hey Guys,
I am sorry for my late response. I was busy with some other projects. I just fixed the bug with the skinning. Just use version 1.2 of the archetype. The archetype is now using the “ruby” skin. That is something with red colors. 🙂
Enjoy! And let me know, when you have other issues.
Buenas,
¿sabéis si hay algún problema con el servidor para descargar el artifact? Es que llevo desde el jueves intentandolo descargar y no hay manera, el servidor rechaza la conexión o dice que no puede atender mas peticiones. ¿Se podría colgar en otro lado para añadirlo manualmente al repositorio local de maven?
Gracias.
I’m sorry by my last commentary. My navigator traslate the page.
I don’t access the server http://www.ploin-m2.de/nexus/content/groups/public/
¿Any ploblems with server? ¿Can I download artifact in other server?
Thanks.
I am sorry for that. I am not anymore working for PLOIN. but I have send a email to the PLOIN folks. If the server is not up in the next 24 hours, I will host the artifacts somewhere else.
I’m very grateful to you. Thanks! 🙂
It seems so that PLOIN has serious problems with the servers. I am looking for another option to host my artifacts.
Please Rober, Can you send the artifact by mail?
Thanks!
I send you the Artifact via E-Mail. Sorry for the issues with the repo server. I will deploy it on another repo server, as soon I find time for that.
Could you also send the Artifact to me?
Thanks in advance!
Hi Robert,
Could you share the artifact via my email? Thanks in advance.
Hey guys.
I am sorry for the server issues. I now that the PLOIN admins are working on a new PLOIN Maven2 Repository Server.
And I am pretty busy right now with the http://VersionEye.com project.
As soon I have time I will host my archetypes on the central maven2 repository server.
I hope I will be able to do that this week.
Thank you guys for your passion.
Hi Robert,
can you also please send me the artifact via email? I’ve checked the repo site for several times in the past couple of weeks and it was down all the time.
Or maybe the folks that have the artifact already, can you please guys share it with me? alexandru dot ionita at gmail dot com
Kind regards
Alexandru
Hey guys,
http://ploin-m2.de/nexus/ is again up and running.
Anyway I will put my archetypes into the central maven repository.
Robert
It’s working for me!
Thank you for your patience, and for all.
لك جزيل الشكر
Hi Robert,
I created the project using maven 2.2.1, then created an eclipse project with mvn eclipse:eclipse.
When I import the project as maven project (Eclipse Indigo) I get an error in UserDaoTest.java:
Multiple markers at this line
– The hierarchy of the type UserDaoTest is inconsistent
– The type org.testng.IHookable cannot be resolved. It is indirectly referenced from required .class files
– The type org.springframework.context.ApplicationContextAware cannot be resolved. It is indirectly referenced from required .class files
Any ideas?
That sounds like you have to do a recompile. Or just use the “Clean” Function in Eclipse and rebuild the project.
Hi Robert,
I managed to figure out the above errors. Seems that three of the dependencies (spring 3.1.0, testng-5.9 and hsqldb) were corrupted, I could not even open the class files in the jars with eclipse. I don’t know why, I just deleted them from .m2 and started again. Now all is okeydokey. Next step, implement the mysql instead of hsqldb…
Thanks a million for this amazing solution, first one I’ve come across which actually works
You welcome. Glad that it worked out for you.
Hi again Robert,
I changed the applicationContext.xml as follows:
<!– classpath:hibernate_hsqldb.properties –>
classpath:hibernate_mysql.properties
classpath:settings.properties
Now when I try to run it on tomcat6, I am getting an referring to:
Caused by: org.hibernate.HibernateException: Dialect class not found: com.versioneye.utils.db.PloinMySqlDialect
Where is this in the project?
You can find the library on this Maven2 Repository Server: http://ploin-m2.de/nexus/. I will talk with the ploin guys to publish the lib in the central maven repository.
Me again Robert,
Don’t worry, I found the class in the http://ploin-m2.de/nexus/
repositoritories under ploinUtils-1.6.8-sources.jar and just created a new package com.versioneye.utils.db and copied it to there. Everthing back OkeyDokey for the mo…
Glad that you found it 🙂
Good luck with your project.
Hi Robert,
I try to use <a4j:support ,but the following error is triggered :
Tag Library supports namespace: http://richfaces.org/a4j
Any ideas?
thanks.
Which IDE are you using? That looks like your IDE is not configured right for JSF.
I using SpringSource tool Suit IDE, and I have anther problem ,,many component of richface doesn’t work like
thanks.
Well. That look like it is a problem of the SpringSource IDE. The archetype itself is working fine. By the way, I am using IntelliJ IDEA. I am not used to SpringSource IDE. Maybe you are googling for SpringSource IDE & RichFaces.
After you created the archetype, you can compile it with maven. That should work without problems. If that is working you can start it on a Tomcat from Eclipse or IDEA. That works out of the box.
exactly, there are component richface working well and there’s no other. it’s like demoSpringrichface example
thank you
yess it works ,but when I add the <rich:comboBox doesn't work
it is the same problem with tomcat without any IDE
Hi Robert Thanks for the post.
I have troubles download your repository http://ploin-m2.de/nexus/, can you send me by email? thanks.
I send you the archetype as email attachement.
Hi Robert!
I´m having troubles download your project from http://ploin-m2.de/nexus/, can you send me to my email please. Thanks!!!
HI Robert,
I was trying to implement a Controller in this sample application. Below is my code.
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import com.versioneye.gui.model.Personal_Info;
@Controller
public class HelloController {
@RequestMapping(value = “/page/hello”,method = RequestMethod.GET)
public ModelAndView printWelcome() {
Personal_Info personal_Info = new Personal_Info();
personal_Info.setNumber(“121212”);
personal_Info.setName(“Smith”);
ModelAndView modelAndView = new ModelAndView(“/page/memyself/personalInfo”); //I have personalInfo.xhtml in this location
modelAndView.addObject(“info”, personal_Info);
return modelAndView;
}
}
Then, I typed in browser:
http://localhost:8080/myNewWebApp-1.0-SNAPSHOT/page/hello.jsf
But I get “ERROR 404 – Resource not found “. I am wondering if I need to implement any request mapping. Could you please point what I miss here ?
Thanks in advance.
You are trying to implement a SpringMVC Controller in JSF Application !?
Are you sure? I mean you can do that, but usually it is not a good idea to mix 2 different Web Frameworks.
If you anyway want to use a Spring Action Controller in a JSF App, then you have to customize your web.xml. You have to ensure that specific requests go the the JSF request handler and other specific requests go to the SpringMVC request handler. I did that 1 times, and it worked out. But usually you should go with 1 single Web Framework.
Well, Forgive my ignorance. 🙂 This is my idea. I want Spring MVC framework to handle my requests and to use Richfaces as just view layer. So, what am I supposed to do ?
Well. That will not work out. RichFaces is a full stack WebFramework. If you are using RichFaces UI Components you need JSF Managed Beans to handle the request. And it is not just the Managed Beans it is all about the JSF Lifecycle.
There is now way to use JSF Components without JSF Managed Beans and the JSF Lifecycle.
If you want to use SpringMVC, you should use JSPs for your view layer. You can use this Archetype for that:
https://robert-reiz.com/2011/02/21/archetype-springmvc-spring-3-0-5-release-jpa-1-0/
SpringMVC is much more lightweight than JSF. You have nice bookable URLs and full control about the HTML. But you can still use JavaScript UI Components, for example jQuery UI.
Thank you very much for you reply. In that case, I need to think about Javascript frameworks in place of Richface components. Anyway, do you think we miss many features of Spring modules(like webflow, orm, security, etc) , If we use Richfaces framework ?
So, if I understand correctly we cannot use JSF along with Spring MVC. Is that correct ? And, is there any alternative for template mechanism when we dont use JSF ?
You can not use SpringMVC and JSF on the same page. You can have an Application there some pages are completely handled by JSF and some other pages are completely handled by SpringMVC. But that is a little bit complicated. I wouldn’t recommend that.
If you go with SpringMVC you have different options for the view layer. Of course you can use pure JSP. But you can also use templating engines like sitemash, tiles or Thymeleaf. Here are some links for you:
http://www.thymeleaf.org/thvsjsp.html
http://stackoverflow.com/questions/11923575/jinja2-like-view-templating-approach-for-spring-mvc
And you can mix that with jQuery UI and other JavaScript UI Components.
Thank you very much Robert !
You welcome!
Hi robert can u send me the project zip by email, your server it´s off? it´s gilvbp@gmail.com thanks
already find at github thanks
Hi Guys. The ploin-m2.de server is still down. I am sorry for that. Unfortunately I am not anymore the owner of the PLOIN company and the ploin-m2.de server. I don’t have root access server to reboot it. I am looking for a place to host my archetypes.
But you can find the source code to this archetype also on GitHub:
https://github.com/reiz/demoSpringRichHibernate-archetype
just check it out with:
“git clone https://github.com/reiz/demoSpringRichHibernate-archetype”
and install it with “mvn install”.
Hope that will you guys.
Very useful.
Thank you ! and please keep up the good work you are doing in here 😉
Best regards,
Hi Robert, i just downloaded the archetype to play for, and i ask myself why do you need two pom.xml files, one on top folder, as usual, and one more on MYPROJECT//demoSpringRichHibernate-archetype/src/main/resources/archetype-resources/pom.xml
That question came to me because i would like to use jetty as embeded app server and i need to include on pom.xml file.
Thank you
The archetype project itself needs 2 pom.xml files. 1 pom.xml describes the archetype project itself and the 2nd pom.xml describes the project you will create out of the archetype.
Hi Robert…thanks for the maven archetype
How can I configure annotated entity classes in configuration? Could you please me on this?
I am not exactly sure what you want to configure. Can you be more specific?
Robert Reiz,
Hi ..In great need of ploinUtils-1.6.8 jar and would be awesome if you could send me.. aviinash.13@gmail. Com.. Thanks.
I don’t work for PLOIN anymore and I don’t have the jar file anymore. Contact the guys at PLOIN (info@ploin.de) and ask them to send you the jar file. Or ask them to make make their M2 Repository public. That is would fix all your issues with the jar.