title: User failed to be authenticated in WebLogic
body: <p>I'm having problem with authenticating my weblogic server, i assigned correct username and password, what went wrong with my project? Is there any configuration that i need to be configure with my web logic server that causes this error  authentication and what it would be? I already added wlfullclient.jar file.</p>
  
  <pre><code>Exception in thread "main" javax.naming.AuthenticationException [Root exception is java.lang.SecurityException: User: webogic, failed to be authenticated.]
      at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:42)
      at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:808)
      at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:697)
      at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:485)
      at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:373)
      at weblogic.jndi.Environment.getContext(Environment.java:319)
      at weblogic.jndi.Environment.getContext(Environment.java:288)
      at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
      at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
      at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
      at javax.naming.InitialContext.init(Unknown Source)
      at javax.naming.InitialContext.&lt;init&gt;(Unknown Source)
      at com.rest.client.Type4Conn.main(Type4Conn.java:23)
  Caused by: java.lang.SecurityException: User: webogic, failed to be authenticated.
      at weblogic.common.internal.RMIBootServiceImpl.authenticate(RMIBootServiceImpl.java:116)
      at weblogic.common.internal.RMIBootServiceImpl_WLSkel.invoke(Unknown Source)
      at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:693)
      at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:519)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
      at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:515)
      at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code> public static void main(String ar[])throws Exception{
          String username="weblogic";
          String password="weblogic";
  
          Properties p=new Properties();
          p.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
          p.put(Context.PROVIDER_URL,"t3://192.168.1.188:7001");        
          p.put(Context.SECURITY_PRINCIPAL, username);        
          p.put(Context.SECURITY_CREDENTIALS, password);        
          InitialContext ctx=new InitialContext(p);
          DataSource ds=(DataSource)ctx.lookup("ds_orclmrcos");    
          System.out.println(ds);
          Connection con=ds.getConnection();
          Statement st=con.createStatement();
  
          st.executeUpdate("insert into TBL_CUSTOMER(CUST_ID, CUST_FNAME, CUST_MNAME, CUST_LNAME,CUST_ADDRESS,CUST_STATUS)"+
          "VALUES('C-002', 'ALVIN', 'C.','TEST','MANILA', 'PERMANENT')");
  
          System.out.println(" records inserted");
  
  
      }
  </code></pre>