Date Created: Sun 07-Sep-2008

Related Document Categories:

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/


    07-Sep-2008 19:16:27 SASRas
    WARNING: security.JSAS0631E
    07-Sep-2008 19:16:28 SASRas
    AUDIT: security.GettingConfig
    07-Sep-2008 19:16:28 SASRas
    SEVERE: security.JSAS0011E
    07-Sep-2008 19:16:28 SASRas
    SEVERE: security.JSAS0011E
    07-Sep-2008 19:16:28 SASRas
    AUDIT: security.Protocol
    07-Sep-2008 19:16:28 SASRas
    AUDIT: security.AuthTarget
    07-Sep-2008 19:16:28 SASRas
    AUDIT: security.RegisterCurrent
    07-Sep-2008 19:16:28 SASRas
    AUDIT: security.LoadSCI
    07-Sep-2008 19:16:28 SASRas
    AUDIT: security.ClientCSI




    07-Sep-2008 19:16:28 com.ibm.ws.naming.util.WsnInitCtxFactory
    WARNING: jndiUnavailCommErr
    Exception in thread "P=387188:O=0:CT" javax.naming.ServiceUnavailableException: A communication failure occurred while attempting to obtain an initial context with the provider URL: "corbaloc:iiop:localhost:2809". Make sure that any bootstrap address information in the URL is correct and that the target name server is running. A bootstrap address with no port specification defaults to port 2809. Possible causes other than an incorrect bootstrap address or unavailable name server include the network environment and workstation network configuration. Root exception is org.omg.CORBA.OBJ_ADAPTER: ORB_CONNECT_ERROR (5) - couldn't get Server Subcontract:org.omg.CORBA.INTERNAL: CREATE_LISTENER_FAILED_4 vmcid: 0x49421000 minor code: 56 completed: No vmcid: IBM minor code: B8F completed: No

    ... ...

    at javax.naming.InitialContext.lookup(InitialContext.java:361)
    at TestClient2.main(TestClient2.java:17)

    -------------------------
    Remove lines such as these from JVM

    -Dcom.ibm.CORBA.ConfigURL=${project_loc}\appClientModule\sas.client.props

    ------------------------





    -------------------------

    import java.security.PrivilegedAction;
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.security.auth.login.LoginContext;

    import com.ibm.websphere.security.auth.WSSubject;
    import com.ibm.websphere.security.auth.callback.WSCallbackHandlerImpl;


    public class TestClient2 {
    public static void main(String[] args) throws Exception {
    Hashtable env = new Hashtable();
    env.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
    env.put(Context.INITIAL_CONTEXT_FACTORY,"com.ibm.websphere.naming.WsnInitialContextFactory");
    final Context initialContext = new InitialContext(env);
    initialContext.lookup("");

    //Added Windows local user called wasdmin and used OS for global security
    LoginContext loginContext =
    new LoginContext("WSLogin",new WSCallbackHandlerImpl("wasadmin","wasadmin"));

    loginContext.login();

    javax.security.auth.Subject s = loginContext.getSubject();

    WSSubject.doAs(s, new PrivilegedAction(){
    public Object run() {
    try{
    initialContext.bind("hi", "mum");
    } catch (Exception e) {
    e.printStackTrace();
    }
    return null;
    }
    });

    System.out.println(loginContext.getSubject());

    }

    }

Get my WebSphere Application Server course here >> http://www.themiddlewareshop.com/products/

Steve Robinson - IBM Champion 2013

About Me

Steve Robinson has been working in IT for over 20 years and has provided solutions for many large-enterprise corporate companies across the world. Steve specialises in Java and Middleware.

In January 2013, I was awarded the prestigous 'IBM Champion' accolade.


Read my books?

IBM WebSphere Application Server 8.0 Administration Guide

IBM WebSphere Application Server 8.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Application Server 7.0 Administration Guide

WebSphere Categories

Other Categories