Discussions

EJB programming & troubleshooting: Struts with EJB

  1. Struts with EJB (2 messages)

    Hi to all

    MY QUERY

    I am developing an enterprise applicatoin on Struts Framework using WSAD 5.1. The problem I got is, when I try to pass Form bean as parameter to session bean, I get no problem while EJB deployment and project building that means that there is no logical error.

    But when I try to start the server I throws me an error that

    [2/26/04 13:00:57:736 GMT+05:30] 195d3813 EJBContainerI I WSVR0207I: Preparing to start EJB jar: EXIMEJB.jar

    [2/26/04 13:00:57:830 GMT+05:30] 195d3813 BeanMetaData E CNTR0075E: The user-provided class "<null>" needed by the EnterpriseBean could not be found or loaded.

    [2/26/04 13:00:57:861 GMT+05:30] 195d3813 EJBContainerI E WSVR0209E: Unable to prepare EJB jar EXIMEJB.jar [class com.ibm.ws.runtime.component.DeployedModuleImpl], enterprise bean com.ibm.etools.ejb.impl.SessionImpl(sessionFacade) (transactionType: Container, sessionType: Stateless)

     java.lang.NoClassDefFoundError: eximweb/actionforms/ApplicationFeeForm

    My application name is EXIM and ApplicationFeeForm is the form bean that I am trying to pass to session bean.

    QUERY OVER

    REPLY

    Hi,

    You should not pass struts forms as parameters of EJB methods. Form classes have references to servlet and web session specific objects. Serialization of the forms will have an impact on performance. Plus, I'll have to include struts libraries to the path of your EJB module. It's really necessary to copy data from forms to data transfer objects

    REPLY

    This is in continuation to what I had asked before.

    I have Serialized form bean then why is it not possible access from EJB.
    Also required jars I have imported to EJB project .
    Please Help me.
    For me performance is not an issue, but want to know that am I making some mistake.

    I have read somewhere that, Forms can be serialised and on that base only I decided to pass form bean to EJB.

    So please tell me, where am I going wrang?

    Thanks

    Threaded Messages (2)

  2. Struts with EJB[ Go to top ]

    Just to get the thing working (although I would like to stress it again, form are far too heavy to pass as EJB parameters) you should add WEB-INF\classes folder to the class path of EJB container. Your eximweb.actionforms.ApplicationFeeForm class is in that directory, which is not visible for the EJB code
  3. Struts with EJB[ Go to top ]

    If you want to have a very clean separation between layers, Presentation, Business, and Persistence layer, you need to use the data objects/Value object pattern and use your data objects to pass objects between your Session beans and struts ActionForm classes. A better solution is to create a class as “Business Object” responsible to communicate with session beans and populate the ActiopnForms/Data Objects using this class.