I’d like to share some recent facts about my self-improvement and DMT project. The best way is to split all news into different paragraphs: what I’ve learned and issues in NetBeans.
What I’ve learned
I ‘ve learned how to implement EJB3 in my project. Let’s start from the beginning: the are 3 types of the EJB: Session Bean (Stateful, Stateless) which is used for business logic and state maintenance, Entity Bean which is used as a representation of the database object and Message-Driven Bean mainly used in asynchronous messaging environment.
In my assignment I will not use Message-Driven and Entity Beans (I don’t need first and second I’m going to replace with JPA), however, Session Beans are widely used. I came up with a question: how I’m going to implement my MVC model? The answer is obvious – for navigation is better to use Stateless beans because container allows to serve 100′s of clients with only one EJB what can give performance enhancement.
But I found other question: what if container itself requires resources such as memory and processing time? Maybe it would be better to implement the MVC without EBJ but normal Java Beans instead without the container? Probably this solution will give the better performance in case of 1000′s of users. Not sure about that so I will try to do a research or ask programmers from the industry.
After all, I have MVC skeleton ready! Work on design now, also I think about implementing the search by tag system… if I will have a time.
Issues
One big issue. I’ve created from the beginning the Enterprise Application in the NetBeans. Basically, it is the same Web Application + EJB Module but the addition is the Ant script which puts everything into one Enterprise Archive (EAR). Unfortunately, it’s sort of bug of the GlassFish server, after I execute the program, NetBeans can’t deploy my application on server. So I’ve spent half a day trying to find the solution, but almost without good results. One suggestion that I’ve found is the problem of interpretation of the localhost on my laptop. People say that if the address looks like 127.0.0.1/Application it works but not when localhost/Application. They say that in Vista this issue occurs because the host file contains :::1 localhost and the solution is to put standard loopback address.
I’ve checked my etc/hosts but everything was just fine. I believe the problem is in the GlassFish configuration. Anyway, I don’t want to spend my time on it anymore, so I just deleted the enterprise script and going to read how to assemble it manually later.
That’s all for today, stay with us.
Filed under: DMT, Java | Leave a Comment »