Commits

Anonymous committed d867514

Patch from USER-60

Comments (0)

Files changed (2)

lib/build/weblogic-management-security-7-stub.jar

Binary file modified.

src/java/com/opensymphony/user/provider/weblogic/WeblogicProvider.java

 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import weblogic.jndi.Environment;
+
 import weblogic.management.MBeanHome;
 
 import weblogic.management.security.authentication.AuthenticationProviderMBean;
 import java.util.List;
 import java.util.Properties;
 
+import javax.naming.Context;
+
 
 /*
  * @author Dave Brondsema
     }
 
     protected void findHome() {
-        home = weblogic.management.Helper.getAdminMBeanHome(originalProperties.getProperty("username"), originalProperties.getProperty("password"), originalProperties.getProperty("serverurl"));
+        //        home = weblogic.management.Helper.getAdminMBeanHome(originalProperties.getProperty("username"), originalProperties.getProperty("password"), originalProperties.getProperty("serverurl"));
+        Environment env = new Environment();
+        env.setProviderUrl(originalProperties.getProperty("serverurl"));
+        env.setSecurityPrincipal(originalProperties.getProperty("username"));
+        env.setSecurityCredentials(originalProperties.getProperty("password"));
+
+        try {
+            Context ctx = env.getInitialContext();
+            home = (MBeanHome) ctx.lookup(MBeanHome.ADMIN_JNDI_NAME);
+        } catch (javax.naming.NamingException e) {
+            log.error("error getting home: ", e);
+        }
     }
 
     private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {