Hi, Actually this brings up a valuable point.
I see on a lot of message boards and discussions the following kind of post, "I understand I can not do ........ in an EJB but I put a wrapper class around it so I am not doing it from within the actual EJB" I cringe every time I see this kind of remark. Wrapper classes like EJBs run within the J2EE container environment. Therefore doing something illegal in a wrapper class is generally just as bad as doing it from within an actual EJB. David --- Marco Wang <[EMAIL PROTECTED]> wrote: > You may check EJB specification: > > "A enterprise bean must not attempt to load a native > library. > This function is reserved for the EJB Container. > Allowing the enterprise bean to load native code > would > create a security hole." > > Either a native library wrapped by Java classes or a > pure native library are same thing. > > > Cheers Marco > > > -----Original Message----- > From: Xie, Jinpeng [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 10, 2002 1:44 PM > To: [EMAIL PROTECTED] > Subject: Re: how to load native library to ejb > container > > > Actually, I want to use a third party java library > that wraps native c++ > library in a session bean. > > I used it in servlets that deployed in IBM Websphere > Application Server > 3.5.3. > In the servlet, I used > System.loadLibrary("SWEOJNI"). It works. > > I search it online. Somebody suggested the > permession in server.policy file > can be changed to loadLibrary. > I tried a couple of times. It failed because I don't > know how? > > Any suggestion? > > > Jim > > -----Original Message----- > From: Marco Wang [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 10, 2002 10:03 AM > To: [EMAIL PROTECTED] > Subject: Re: how to load native library to ejb > container > > > To do it in session bean is not allowed by EJB spec. > > -Marco > > > -----Original Message----- > From: Xie, Jinpeng [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 10, 2002 9:59 AM > To: [EMAIL PROTECTED] > Subject: how to load native library to ejb container > > > In a stateless session bean, I need to load native > library by using > System.loadLibrary("SWEOJNI") in setSessionContext. > I got the following > error: > > Could not create stateless EJB: > java.security.AccessControlException: access > denied (java.lang.RuntimePermission > loadLibrary.SWEOJNI) at > com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(Stateles > sSessionContainer.java:358) > at > com.sun.ejb.containers.StatelessSessionContainer.getContext(StatelessSession > Container.java:285) at > com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:365) > at > fsu.ais.jstew.ejb.ItemListGatewayBean_EJBObjectImpl.prepareForLogin(ItemList > GatewayBean_EJBObjectImpl.java:230) > ------------------------------------------ > > How do I set up permission to allow container to > load native libraries? Any > help is highly appriciated. > > > Jim > > =========================================================================== > 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". > > ==========================================================================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". > ===== David J. Jones, <[EMAIL PROTECTED]>, Virgin Mobile USA, 8th Floor, 22 Fourth Street, San Francisco, CA, 94103, Work: 415 932 5470. USA. Fax: 415 358 4999. =========================================================================== 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".
