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 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.
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.