Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within BEA/Weblogic
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Tim Cooke
Ron McLeod
paul wheaton
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Devaka Cooray
Saloon Keepers:
Tim Holloway
Roland Mueller
Himai Minh
Bartenders:
Forum:
BEA/Weblogic
Change password for user in WebLogic 8.1 with Java
Peter Denev
Greenhorn
Posts: 1
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I need some help. I have the logic below to reset password for an user in WebLogic 8.1.
String url = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort(); Environment env = new Environment(); env.setProviderUrl(url); Context ctx = env.getInitialContext(); System.out.println("ctx: "+ctx);//DebugLog MBeanHome mbeanHome = (MBeanHome) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME); System.out.println("mbeanHome: "+mbeanHome);//DebugLog DomainMBean domain = mbeanHome.getActiveDomain(); System.out.println("domain: "+domain); //DebugLog SecurityConfigurationMBean secConf = domain.getSecurityConfiguration(); RealmMBean realm = secConf.findDefaultRealm(); AuthenticationProviderMBean authenticators[] = realm.getAuthenticationProviders(); boolean changed = false; String lastErr = ""; UserPasswordEditorMBean passwordEditorMBean = null; for (int i=0; i<authenticators.length; i++) { if (authenticators[i] instanceof UserPasswordEditorMBean) { passwordEditorMBean = (UserPasswordEditorMBean) authenticators[i]; try { passwordEditorMBean.resetUserPassword(userName, newPass); changed = true; } catch (Throwable exc) { exc.printStackTrace(); lastErr = exc.toString(); } } }
Sometimes it crashes with this error:
<Password not changed due to an error. java.lang.Throwable at weblogic.rjvm.RJVMManager.findExisting(Ljava/net/InetAddress;ILweblogic/protocol/Protocol;)Lweblogic/rjvm/RJVM;(RJVMManager.java:322) at weblogic.rjvm.RJVMManager.findOrCreateRemoteInternal(Ljava/net/InetAddress;ILjava/lang/String;)Lweblogic/rjvm/RJVM;(RJVMManager.java:206) at weblogic.rjvm.RJVMManager.findOrCreate(Ljava/net/InetAddress;ILjava/lang/String;)Lweblogic/rjvm/RJVM;(RJVMManager.java:180) at weblogic.rjvm.RJVMFinder.findOrCreateRemoteServer(Ljava/net/InetAddress;I)Lweblogic/rjvm/RJVM;(RJVMFinder.java:223) at weblogic.rjvm.RJVMFinder.findOrCreate(Z)Lweblogic/rjvm/RJVM;(RJVMFinder.java:188) at weblogic.rjvm.ServerURL.findOrCreateRJVM(Z)Lweblogic/rjvm/RJVM;(ServerURL.java:125) at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(Lweblogic/jndi/Environment;Ljava/lang/String;)Ljavax/naming/Context;(WLInitialContextFactoryDelegate.java:296) at weblogic.jndi.Environment.getContext(Ljava/lang/String;)Ljavax/naming/Context;(Environment.java:166) at weblogic.jndi.Environment.getInitialContext()Ljavax/naming/Context;(Environment.java:145) at jsp_servlet.__changepassword._jspService(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V(__changepassword.java:243) at weblogic.servlet.jsp.JspBase.service(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(Optimized Method) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run()Ljava/lang/Object;(Optimized Method) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Optimized Method) at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Optimized Method) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;Lweblogic/servlet/internal/FilterChainImpl;)V(Optimized Method) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(Ljavax/servlet/ServletRequest;Ljavax/servlet/ServletResponse;)V(Optimized Method) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run()Ljava/lang/Object;(Optimized Method) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic/security/subject/AbstractSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Optimized Method) at weblogic.security.service.SecurityManager.runAs(Lweblogic/security/acl/internal/AuthenticatedSubject;Lweblogic/security/acl/internal/AuthenticatedSubject;Ljava/security/PrivilegedAction;)Ljava/lang/Object;(Optimized Method) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(Lweblogic/servlet/internal/ServletRequestImpl;Lweblogic/servlet/internal/ServletResponseImpl;)V(Optimized Method) at weblogic.servlet.internal.ServletRequestImpl.execute(Lweblogic/kernel/ExecuteThread;)V(Optimized Method) at weblogic.kernel.ExecuteThread.execute(Lweblogic/kernel/ExecuteRequest;)V(Optimized Method) at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:183) at java.lang.Thread.startThreadFromVM(Ljava/lang/Thread;)V(Unknown Source) >
If someone know something, please write. Thanks!
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Application running fine on Tomcat 5.0 but failing in the weblogic 8.1
java.lang.NullPointerException
Testing IBM MQ on BEA Weblogic Server
Struts application. Environment variables Problem it seems!
weblogic integration 8.1 urgent
More...