Home » Category » Java Enterprise java bean & Java EE (EJB)

Java Enterprise java bean & Java EE (EJB): XML in Session Beans

302| Wed, 16 Jul 2008 22:01:00 GMT| jamesmclean| Comments (4)
I am currently researching the design for an EJB component. One of the stipulations is that the processing of an XML document must occur on the server; however, I noticed the EJB specification forbids the inclusion of java.io.* symbols in session beans. Does anyone know of a work around?

Keywords & Tags: xml, session, beans, java, enterprise, bean, ee, ejb

URL: http://java.itags.org/java-bean-j2ee/156730/
 
«« Prev - Next »» 4 helpful answers below.
quote:
Originally posted by empyrean:
I noticed the EJB specification forbids the inclusion of java.io.* symbols in session beans. Does anyone know of a work around?

How does this pose a problem for processing XML?

chrismathews | Wed, 16 Jul 2008 22:03:00 GMT |

empyrean,

One more thing...

Thanks for joining JavaRanch, but could you take a quick look at the naming policy and edit your profile accordingly.

chrismathews | Wed, 16 Jul 2008 22:04:00 GMT |

quote:
Originally posted by Chris Mathews:

How does this pose a problem for processing XML?

Namely reading XML from a file. I probably should have stated that my problem has more to due with handling IO in session beans and less to do with the actual processing. BTW, thanks for redirecting me to the naming policy.

[ July 16, 2003: Message edited by: James McLean ]

jamesmclean | Wed, 16 Jul 2008 22:05:00 GMT |

quote:
Originally posted by James McLean:

I probably should have stated that my problem has more to due with handling IO in session beans...

Where is this file located?
You can still ask your classloader to get an InputStream of a resource (file) located in your classpath.
You can still use a Client Socket to retrieve whatever resource via network.

Using file IO directly is still possible, if the AppServer allows it. But it's considered as bad practise, because it reduces the portability of your EJB. But if you don't care about portability simply test it, it might work.
Hmm, I shouldn't propagate bad practise

peterstorch | Wed, 16 Jul 2008 22:06:00 GMT |

Java Enterprise java bean & Java EE (EJB) Hot Answers

Java Enterprise java bean & Java EE (EJB) New questions

Java Enterprise java bean & Java EE (EJB) Related Categories