Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Error with the ejb client program  RSS feed

 
udhaya kanagaraj
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • 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
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!