users@glassfish.java.net

Re: Multiple Applications Question

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Fri, 06 Mar 2009 15:09:23 -0800

I don't think you need to split your application to get the desired behavior. To
  get a good start on EJB you might want to look into Java EE 5 Tutorial:
http://java.sun.com/javaee/5/docs/tutorial/doc/

Regards,
-marina

glassfish_at_javadesktop.org wrote:
> I am writing a web application using GlassFish, EJB, JSF and Facelets. This is my first application using these technologies. Currently, I have one EJB jar and one WAR which are contained inside an EAR. I am authenticating using methods that I wrote myself that authenticate off of a user/password list in a database. Everything is working great.
>
> Next up is to create an administrative interface for the app. A group of administrators should be able to login, respond to feedback from users, view orders, etc. An administrator can also be a user, so I figured I would just use the same custom authentication mechanism. I figured that I would create a separate app and WAR file for the administrator interface to keep the two separate, organized, and secure from one another.
>
> I broke the EJB.jar and the customer app WAR out of the EAR file. I then created an additional WAR file for the administrator app. I found out that with GlassFish, in order for both apps to access the same EJBs, the EJBs would need to have Remote interfaces (before they were all Local) even if they are running on the same JVM. I converted all of my EJBs so that they had Remote interfaces. At that point I started getting java.rmi.MarshalException when I tried to call the methods in my Remote EJBs. I have determined that this is being caused when I pass User entity objects as parameters to the methods. I am guessing this is because my User entities are quite large (they have multiple one-to-many and many to many relationships defined in them) and marshaling them is overloading the system. If I replace the User object with a userId of type Long, the Remote EJB methods work. Using the userId works fine for retrieving the user's orders or something but it won't work if t
he user wants to update their address or other parts of their User entry. What should I do? I've started reading about transient and @Transient. Would either of these solve my problem? Should I just put the admin interface in the same app with the customer interfaces and pick up speed and simplicity by going back to Local interfaces?
>
> Thanks for any input.
> [Message sent by forum member 'ckrawll' (ckrawll)]
>
> http://forums.java.net/jive/thread.jspa?messageID=335390
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>