Article View: comp.lang.java.programmer
Article #163Programmatically adding user to Sun J2EESDK 1.3.1
From: Alexander
Date: Wed, 31 Jul 2002 10:12
Date: Wed, 31 Jul 2002 10:12
29 lines
1739 bytes
1739 bytes
Hi,
Does anyone know how to programmatically add a user (to the default realm)
using Sun J2EESDK 1.3.1 ? I tried the following in one of my session beans,
but got a "no file permission" exception.
import com.sun.enterprise.tools.admin.RealmTool;
...
public void createUser(String userName,
String password, String groups) throws Exception
{
String[] args = { "-add", userName,
password, groups };
// Call RealmTool's main() method, as if
// from shell prompt
RealmTool.main( args );
}
I know that RealmTool works from the shell prompt, so why doesn't my code
work? Does anyone know how to make it work?
Thanks in advance.
Alexander Yap
Melbourne, Australia
Technical Details
Message-ID:
<Xns925CD19AD99BEalexycyapbigpondcom@139.134.5.33>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!newsfeed.mathworks.com!intgwlon.nntp.telstra.net!news.telstra.net!newsfeeds.bigpond.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,1167b010195cbc19,start X-Google-Attributes: gid10d6db,public X-Google-Thread: 10a146,1167b010195cbc19,start X-Google-Attributes: gid10a146,public X-Google-ArrivalTime: 2002-07-31 03:19:50 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!newsfeed.mathworks.com!intgwlon.nntp.telstra.net!news.telstra.net!newsfeeds.bigpond.com!not-for-mail Newsgroups: comp.lang.java.programmer,aus.computers.java Subject: Programmatically adding user to Sun J2EESDK 1.3.1 From: Alexander <alexycyap@hotmail.com> Message-ID: <Xns925CD19AD99BEalexycyapbigpondcom@139.134.5.33> User-Agent: Xnews/L5 Lines: 34 Date: Wed, 31 Jul 2002 10:12:30 GMT NNTP-Posting-Host: 203.54.18.101 X-Trace: newsfeeds.bigpond.com 1028110350 203.54.18.101 (Wed, 31 Jul 2002 20:12:30 EST) NNTP-Posting-Date: Wed, 31 Jul 2002 20:12:30 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com)