Made more progress!! And Thanks so much AGAIN for your help!
The code below works very well, except that I had to use "private final char[]
password =
{ 'm', 'a', 'n', 'a', 'g', 'e', 'r' };" instead to pass the compiler error.
Now got the following error. Am I getting the point where the missing
security gbeans
on
the app client blocks progress? If so, do I have to wait for the security
gbeans? Any
alternatives?
E:\geronimo-1.0-SNAPSHOT\geronimo-1.0-SNAPSHOT>java -jar bin\client.jar org/acme
/MagicGBall/Client hi
11:47:57,972 INFO [ReadOnlyRepository] Repository root is file:/E:/geronimo-1.0
-SNAPSHOT/geronimo-1.0-SNAPSHOT/repository/
11:47:58,163 INFO [LocalAttributeManager] Started LocalAttributeManager with da
ta on 10 configurations
11:47:58,263 INFO [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/acme/MagicGBall/Client"
11:47:58,273 INFO [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/apache/geronimo/ClientCorba"
11:47:58,283 INFO [LocalConfigStore:config-store] Loaded Configuration geronimo
.config:name="org/apache/geronimo/Client"
11:47:58,413 INFO [Configuration] Started configuration org/apache/geronimo/Cli
ent
11:47:58,643 INFO [Configuration] Started configuration org/apache/geronimo/Cli
entCorba
11:47:59,214 INFO [CSSBean] Started CORBA Client Security Server - SSLClientCer
t
11:47:59,234 INFO [CSSBean] Started CORBA Client Security Server - NoSecurity
11:47:59,234 INFO [CSSBean] Started CORBA Client Security Server - SSLClientPas
sword
11:47:59,284 INFO [Configuration] Started configuration org/acme/MagicGBall/Cli
ent
11:47:59,304 INFO [CommandLine] Server startup completed
java.lang.SecurityException: Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.<init>(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at javax.security.auth.login.Configuration$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.Configuration.getConfiguration(Unknown Sour
ce)
at javax.security.auth.login.LoginContext$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.login.LoginContext.init(Unknown Source)
at javax.security.auth.login.LoginContext.<init>(Unknown Source)
at org.apache.geronimo.client.AppClientContainer.main(AppClientContainer
.java:129)
at org.apache.geronimo.gbean.runtime.FastMethodInvoker.invoke(FastMethod
Invoker.java:38)
at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperatio
n.java:118)
at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.
java:795)
at org.apache.geronimo.kernel.basic.BasicKernel.invoke(BasicKernel.java:
180)
at org.apache.geronimo.system.main.CommandLine.invokeMainGBean(CommandLi
ne.java:88)
at org.apache.geronimo.system.main.ClientCommandLine.<init>(ClientComman
dLine.java:50)
at org.apache.geronimo.system.main.ClientCommandLine.main(ClientCommandL
ine.java:37)
Caused by: java.io.IOException: Unable to locate a login configuration
at com.sun.security.auth.login.ConfigFile.init(Unknown Source)
... 19 more
--- David Jencks <[EMAIL PROTECTED]> wrote:
>
> On Sep 23, 2005, at 10:55 AM, lin sun wrote:
>
> > Thanks so much for your help!! I made some progress!!:-)
> >
> > The geronimo application plan below is extremely helpful and I was
> > able to deploy the new
> > plan with only one change (org/apache/geronimo/ClientCORBA ->
> > org/apache/geronimo/ClientCorba).
> >
> > I got the following error when I tried to start the client. I think
> > it is because I
> > don't have the org.acme.UPCallbackHandler in place yet. Is there an
> > example or
> > documentation of this UPCCallbackHandler?
>
> You have to write it:-)
>
> Something like this should work, I've hardcoded the user/pw. For a
> real app you would want to get them from the user with a gui or
> something or get them from the command line.
>
> package org.acme;
>
> import java.io.FileInputStream;
> import java.io.IOException;
> import java.io.InputStream;
> import java.util.Properties;
> import javax.security.auth.callback.Callback;
> import javax.security.auth.callback.CallbackHandler;
> import javax.security.auth.callback.NameCallback;
> import javax.security.auth.callback.PasswordCallback;
> import javax.security.auth.callback.UnsupportedCallbackException;
>
> public class UPCallbackHandler implements CallbackHandler {
>
> private final String userName = "system";
> private final char[] password = "manager";
>
> public void handle(Callback[] callbacks) throws IOException,
> UnsupportedCallbackException {
> for (int i = 0; i < callbacks.length; i++) {
> if (callbacks[i] instanceof PasswordCallback) {
> ((PasswordCallback) callbacks[i]).setPassword(password);
> } else if (callbacks[i] instanceof NameCallback) {
> ((NameCallback) callbacks[i]).setName(userName);
> }
> }
> }
>
> }
>
> You are about to get the the point where the missing security gbeans on
> the app client will block progress. I have been hoping for several
> days to put a plan for these together but have not had time yet.
> Perhaps today will be the day.
>
> thanks
> david jencks
>
>
thanks,
Lin
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com