• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Error with the ejb client program

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai All,
I am facing a new kind of error in my EntityBean.
Please suggest me the solution if any one of you have faced the same problem.
Thanks in advance.

I created a EntityBean and deployed it in the Jboss server.
And I tried to connect it with a client program.But I am facing a problem,which I have never faced before:

Exception is:

Exception in thread "main" java.lang.NullPointerException
at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:133)
at $Proxy0.findByPrimaryKey(Unknown Source)
at com.example.client.Client.main(Client.java:31)

And my client Program is:





Not only for the findByPrimaryKey method,I am getting the error.For All the methods including user defined methods ,I am getting the same error.
Please suggest me the solution.

Thanks in Advance.

Regards,
Udhaya
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually the issue would happen to everyone, and no one will have a solution. Because the problem is you are trying to bring down an Entity Bean to the client. You cannot do that. Entity Beans are not Serializable. So they have to remain on the server. That is why the Anti-pattern DTO was created. You have a client work through a StatelessSessionBean. That bean does the findByPK and converts the EntityBean data into a seperate object called a DTO, and the DTO is Serializable and gets passed down to the client.

Mark
reply
    Bookmark Topic Watch Topic
  • New Topic