Grails : No domain class found for name domain-class-name . Please try again and enter a valid domain class name

Sometimes, even if you create domain objects in grails you get the error that No domain class found.
I am not sure why this happens because I am new to Grails and still learning. But the following steps work for me

i) Stop all the running grails app ctrl+C
ii) grails clean
iii) Now try grails generate-all domain-class-name

This generally works for me. I will update this post if I find the root cause of the problemSom

Building Web Apps with Spring 3.0 – Meeting notes

This presentation and notes are from the May 2009 Java User group meeting in Twin Cities. You can view the details and download the code from http://www.intertech.com/UserGroups/JUGPresentation.aspx?TopicID=135 It was an excellent presentation. Bob has discussed about new cool features in Spring 3 and how it simplifies the Spring MVC development. These presentation slides are created by him and all rights lies with him.

  • DispatcherServlet is the central servlet handling requests
  • See slide 7. The request handling takes place in the following order
    1. HTTP Request is first handled by Dispatcher Servlet
    2. DispatcherServlet refers HandlerMapping find the controller which will handle the request
    3. DispatcherServlet sends the request to the Controller. Controller returns view and/or model.
    4. DispatcherServlet refers to ViewResolver to determine the view page based on logical view name
    5. View is rendered
  • Controller hierarchy is deprecated in Spring 3.Just annotation is enough. No need to implement life-cycle methods
  • Flexible method arguments. Flexible return types.
  • Annotations like
    @RequestParam
    @ModelAttribute
    @RequestMapping
    @SessionAttribute
    @InitBinder
    and WebBindingInitializer
  • Convention verses configuration
  • ControllerClassNameHandlerMapping
  • Model and ModelMap
  • Rest SupportStateless, cacheable, scalable, communication protocol
    HTTP Methods – GET, POST, PUT(Idempotent), DELETE(Idempotent), HEAD, OPTIONS
  • Spring 3.0 has REST support

GWT exception : Deferred binding result type should not be abstract Or Rebind result must be a class

In GWT, when you get this error in hosted mode
Deferred binding result type should not be abstract
or
The following error while compiling
Rebind result must be a class

most likely you have forgot to extend your business interface from RemoteService. Therefore GWT engine is trying to instantiate the interface itself. That is , instead of

@RemoteServiceRelativePath("relativeServicePath")
    public interface BusinessInterface extends RemoteService

you have written

@RemoteServiceRelativePath("relativeServicePath")
    public interface BusinessInterface

Beginning Groovy and Grails

      No Comments on Beginning Groovy and Grails

In the last session on April 13, 2009 on Jazz and Rational Team Concert at TCJUG , I have won the book Beginning Groovy and Grails: From Novice to Professional (Beginning from Novice to Professional) in the lucky draw.

Beginning Groovy and Grails

This is happening second time in the row that I have attended JUG meeting with Groovy message. In my last meeting the topic of discussion itself was groovy and this time around, it is the book. The message is loud and clear. Looks like everyone has started taking Groovy seriously. People consider it as gen-next Java language. After all, Groovy is not something which poises itself to compete with Java language. In fact it builds itself over the Java language. You run groovy programs on JVM. While relieving developers of many of the pains which comes with java, groovy provides many powerful features, missing and long sought in Java.
Having said that, I am still a doubtful thomas, when it comes to new technology. To build a secure, scalable, robust application, I would not put my bets on Grails. At least for now.

By the way the presentation slides for Jazz are not there yet on TCJUG website. Check http://jazz.net/ for more details.
Jazz is also a wonderful framework address the concerns of the entire life-cycle of project development. From requirement analysis to design and development; from testing to maintenance; from project management to project change management; it is built on the vision to provide one -stop- shop for all the needs.
Rational Team Concert is the product built on Jazz framework. The speaker has demonstrated many cool features of RTC. It integrates IDE, testing environment, team collaboration, version and cofiguration management, quality management in the other words absolutely every tool we use daily during the software lifecycle. It integrates all these tools at one place. PM will have the clear and accurate picture what is going on with the status and updates of each and every developer, tester will now what fixes developers are working on etc etc. Worth checking out. As far as I remember, the speaker said that this product is relatively new but it has achieved record sales in its category in IBM.

Rules within an Enterprise and their management with a BRMS, focus on JRules

I have attended a very nice session at TCJUG back in November 2008( I know I am very late in reporting that).

The speaker DJ Des Jardins made a very strong case for JRules. While there are many open source rule engines available in the market like Drools, JRules stands apart from all those because of its capabilities. If you see the presentation available at the site you can judge by yourself that JRules is simply superior compared to other rule engines when it comes to customization, options and flexibility. Check that out.

However, the slides are not very elaborate. To appreciate the full capabilities of JRules you may want to try it once.

Groovy – Hype or Hope?

      No Comments on Groovy – Hype or Hope?

groovy
Last week I have attended a Java User Group meeting in Bloomington, MN. The speaker Mark Rausch made a solid case for Groovy as the gen-next application.
He talked about how Java Scripting recognizes the “pain points” of the Java Developer community.
Learning Groovy and using is not difficult at all. Unlike other languages which force you to learn new syntax or think Class and objects differently, Groovy is Java. In fact, you have been writing Groovy all along. If you rename .java file to .groovy, it is a compilable groovy program.
Learning it and using it is very easy because of the smooth learning curve. It is worth trying. I will soon write (Really Simple) steps to write your first groovy program.

Hibernate Query Cache

      1 Comment on Hibernate Query Cache

Hibernate provides sophisticated caching mechanisms to improve the performance. Apart from
First-level, Second-Level and query cache, Hibernate can be configured to make use of some open source cache solutions like EHCache or JBoss Cache etc.

If your Hibernate query yields huge but similar results every time it is executed, it is a good idea to cache the results in hibernate to improve the performance. This could be achieved by first enable the hibernate query cache in the hibernate configuration
in properties file

hibernate.cache.use_query_cache true

or xml configuration file like

<property name="hibernate.cache.use_query_cache">true</property>

and while executing the query specify the cacheability like this

sess.createQuery("from.......")
    .setCacheable(true)
    .list();