I think the spirit of the spec is not letting you access a file that
couldn't be there because you don't have any knowledge about where will
your app be deployed. But what about using
ClassLoader.getSystemResourceAsStream to read a file included with the
application? Is this also forbidden?
Regards
Jose
Kirk Pepperdine wrote:
> The spec is clear, file system access is not allowed. However, I am not
> aware of any vendor who's container enforces this. I believe part of the
> 2.0 spec is to have the containers enforce this.
> You do have choices. You could use the Connection API and construct a
> connector to get the file. Or, you could pass the document to the bean. In
> 2.0, you could use a message bean to do this. In 1.0 or 1.1, it could be a
> call to the bean. You could just parse it outside of the bean, then pass
> the results to the bean.
>
> So, there are many ways to "skin this cat". Reading directly from a file is
> not one of them.
>
> Kirk
>
> ----- Original Message -----
> From: "Alex, Prince Jacob (CTS)" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 28, 2001 3:30 AM
> Subject: Re: Using XML Parsers inside the EJB
>
>
> Hi,
>
> Yes you are right, as per the EJB specs file access from EJBs is not
> advised, but I have not found any problems in using parser from EJBs to
> parse XML files. May be it depends on the app server. But I have not
> implemented this kind of a solution in a production environment. May be
> somebody who have done extensive XML parsing using EJBs can give more
> valuable inputs.
>
>
> Regards
> Prince
>
> -----Original Message-----
> From: Anders Engström [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 28, 2001 3:10 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Using XML Parsers inside the EJB
>
>
> Hi.
>
> Is this really allowed in the specs? As far as I can remember file
> access from EJBs is not advised. Concearning the original question -
> yes, using an xml-parser should work out nicely - even though the
> method might throw an IO-exception. As long as you're not accessing a
> local file to read the XML (the XML might origin from the DB och an
> URL).
>
>
> Wednesday, March 28, 2001, 11:04:06 AM, you wrote:
>
> APJC> You can even read an XML directly from a file using EJB. I have done
> this
> APJC> using a stateless session bean to parse an XML file using an helper
> class.
> APJC> You need to use any of the standard parsers to parse the XML
>
>>> Can I use XML parsers inside EJB?
>>> The methods that I use throw IO Exception.
>>>
>>> Is it allowed inside the container?
>>>
>
> --
> Best regards,
> Anders mailto:[EMAIL PROTECTED]
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
> This e-mail and any files transmitted with it are for the sole use
> of the intended recipient(s) and may contain confidential and privileged
> information.
> If you are not the intended recipient, please contact the sender by reply
> e-mail and
> destroy all copies of the original message. Any unauthorised review, use,
> disclosure,
> dissemination, forwarding, printing or copying of this email or any action
> taken in
> reliance on this e-mail is strictly prohibited and may be unlawful...
>
> Visit us at http://www.cognizant.com
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST". For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".