Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

GWT Spring Integration.

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello i am trying to integrate GWT with spring,when ever i run the code it shows following error.

Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.login.client.GreetingService.login(java.lang.String,java.lang.String)' threw an unexpected exception: java.lang.NullPointerException




LoginDao.java



LoginDaoImpl.java


web.xml


applicationContext.xml

when ever i use following code


its working well but i want to use logindao(Autowired) instance to access the method directly to access dao.

Thank you in Advance.
 
Sheriff
Posts: 9679
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are two instance of GreetingServiceImpl. One instance gets the auto-wired LoginDao instance through Spring. The second instance is registered as a Servlet in your web.xml file. As a quick hack you can try to make the LoginDao property in GreetingServiceImpl static. You can also try following this tutorial or use spring4gwt...
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi There,

I would suggest you go for this library

https://code.google.com/p/gwtrpc-spring/

It is very easy to use. You just need to follow couple of steps

1) Add the Library into your Project.

2) Add the below mentioned entry in web.xml

<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.gwtrpcspring.RemoteServiceDispatcher</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>*.rpc</url-pattern>
</servlet-mapping>

3) Define below in your applicationContext.xml for your RPC classes

<context:component-scan base-package=

4) Mark your Remove Service with Below mentioned Annotation

@RemoteServiceRelativePath("somegoodname.rpc")

5) Make sure that your RPC implementation is marked with below mentioned annotation. Also they should purely implement RemoteServiceInterface. Nothing else.

@Component



Let me know if this helps.

Thanks,



 
I am displeased. You are no longer allowed to read this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic