Discussions

EJB design: How to serialize the FileWriter object ?

  1. How to serialize the FileWriter object ? (4 messages)

    Is there a way to serialize the io objects.

    Thanks
    Kavin
  2. How to serialize the FileWriter object ?[ Go to top ]

    No. Its also illegal ini EJB 1.1 to use the java.io.* package.

    Dave Wolf
    Internet Applications Division
    Sybase
  3. How to serialize the FileWriter object ?[ Go to top ]

    Dave

    What if i want to write log/errors into a file ? How can I handle exceptions in EJB comps. suppose when a JSP file access EJB comp, and the ejb comp throw some exception, how will i know what exception is ?
  4. How to serialize the FileWriter object ?[ Go to top ]

    Here is where the exception handling mechanism comes handy.
    We're using the mechanism of throwing exception from a bean

    suppose i've getBusinessMethod()
                          throws IllegalArgumentException,
                                 DatabaseException

    i'll write a jsp like

      try {
               remote.getBusinessMethod();
          }
       catch(DatabaseException e) {out.println(e.toString()};

    Regarding your question, writing log files from an ejb.. It works with some containers like weblogic, but it's not legally allowed by ejb spec. so, if you use log files, your ejb might not be portable across containers, which defeats the purpose of writing portable objects.
     
        
                                 
  5. You probably want to read the following thread about logging......

    http://theserverside.com/discussion/thread.jsp?thread_id=2194

    Thanks,

    Kiran.