This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi! I have a code for an Enterprise application. It contains files for a web application and an ejb mixed. I had to run it. So what I did was that I separated the files of the ejb, web and the enterprise application. Then I created projects using netBeans for all of these three. Then I build the EJB project so it generated a .jar file for the project. Then the web application was using the EJBs so I gave the path of the .jar file of the ejb project i.e. the final distributable file of the ejb project. Then I added these modules into the enterprise application and deployed it.
I gave the above information as there might be a problem in the above process. Now ehen one of the web pages uses InitialContext.lookup, a correct object is being returned i.e. the actual bean object. But when I convert the object to it's interface type, I get a ClassCastException: $Proxy430. This number after Proxy changes whenever I rebuild my project. So basically I think this is related to version of the files. So by the above information, can you figure what I am doing wrong.
I would be really thankful to anyone who could help (I am still thankful to Jaikiran who helped me here)
Hi Jaikiran. I don't have the classes and interfaces in my web application. I checked the page that you gave and tried what was told on the page. I am only getting 1 instance of the ejb so that doesn't seem to be the problem. Here is the output of the jmx console when I did what was given on the page that you provided
It was a matter with another ejb which I was also using. Actually in Netbeans there is an option to add a project (lets say project1) as a library to another project (lets say project2) for compiling the files in the second project (i.e. project2). When I did that my netbeans got hang. So instead of the project, I added the .jar file of the project (i.e. project1) into the second project (i.e. project2). This was creating the problem.
THANK YOU SO MUCH JAIKIRAN. You are my HERO (You would have been more happy if my name was Ankita )