Jython having issue importing weblogic modules for changing passwords

I am trying to import some WLST modules into a Jython script as outline in the documentation at http://e-docs.bea.com/wls/docs92/config_scripting/config_WLS.html#wp1019971
The strange thing is that it says it is a WLST script, but it appears to be a Jython script. I tried performing this import using WLST interactive mode, but this did not work.
I am passing the passwords as encrypted strings while using the encrypt() function
Here is the script:
import sys
from weblogic.management.security.authentication import UserPasswordEditorMBean
#To be invoked by java -cp /usr/local/bea/wlserver_10.0/common/lib/jython.jar org.python.util.jython
#usage: wlst.sh ResetWLPassword.py <current_pass> <user> <new_pass> <adminServerURL>
#{3DES}/asdfadsf== -
#{3DES}asdfafdsadsf== -
myPass = sys.argv[1]
myUser = sys.argv[2]
newPass = sys.argv[3]
adminServerURL = sys.argv[4]
#Connect
try:
connect('weblogic',myPass,adminServerURL)
except:
print "Could not connect using supplied credentials"
dumpStack()
try:
print "Changing password ..."
atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("DefaultAuthenticator")
atnr.changeUserPassword(myUser,myuser,newPass)
print "Changed password successfully"
except:
print "Password change failed"
dumpStack()
I am receiving the following error message:
java -cp /usr/local/bea/wlserver_10.0/common/lib/jython.jar org.python.util.jython /tmp/ResetWLPassword.py "{3DES}/adsfadsfadsf==" weblogic "{3DES}asdfadsfasd== " t3://localhost:7003
sys-package-mgr: can't create package cache dir, '/usr/local/bea/wlserver_10.0/common/lib/cachedir/packages'
Traceback (innermost last):
File "/tmp/ResetWLPassword.py", line 2, in ?
ImportError: No module named management

blumo wrote:
You are calling org.python.util.jython again instead of weblogic.WLST like I advised in my first post. Invoke WLST (not jython) and pass your values in cleartext. Like I said in my previous post, I was able to execute your script without issue when calling WLST and passing cleartext values (I did have to modify one line to due a bug in your script -- see my prior posts).This seems to work in terms of getting the code to run, but there is still a problem with passing the arguments to the changeUserPassword() method.
I entered the sequence of commands in the script manually into WLST and it works without issue. It even works without the import, which is strange that Oracle includes it in their documentation.
I am going to post the code here, perhaps there is something wrong syntax-wise with the way I am authenticating, but I can't put my finger on it.
import sys
from weblogic.management.security.authentication import UserPasswordEditorMBean
myPass = sys.argv[1]
myUser = sys.argv[2]
newPass = sys.argv[3]
adminServerURL = sys.argv[4]
#Connect
try:
connect(myUser,myPass,adminServerURL)
except:
print "Could not connect using supplied credentials"
dumpStack()
try:
print "Changing password ..."
atnr=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("DefaultAuthenticator")
#atnr.changeUserPassword('weblogic','weblogic','12345678')
atnr.changeUserPassword(myUser,myPass,newPass)
print "Changed password successfully"
except:
print "Password change failed"
dumpStack()
throws:
Connecting to t3://localhost:7003 with userid weblogic ...
This Exception occurred at Mon Feb 23 11:50:18 PST 2009.
javax.naming.AuthenticationException [Root exception is java.lang.SecurityException: User: weblogic, failed to be authenticated.]
     at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:42)
     at weblogic.jndi.WLInitialContextFactoryDelegate.toNamingException(WLInitialContextFactoryDelegate.java:773)
     at weblogic.jndi.WLInitialContextFactoryDelegate.pushSubject(WLInitialContextFactoryDelegate.java:670)
     at weblogic.jndi.WLInitialContextFactoryDelegate.newContext(WLInitialContextFactoryDelegate.java:466)
     at weblogic.jndi.WLInitialContextFactoryDelegate.getInitialContext(WLInitialContextFactoryDelegate.java:373)
     at weblogic.jndi.Environment.getContext(Environment.java:307)
     at weblogic.jndi.Environment.getContext(Environment.java:277)
     at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
     at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
     at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
     at javax.naming.InitialContext.init(InitialContext.java:223)
     at javax.naming.InitialContext.<init>(InitialContext.java:197)
     at weblogic.management.scripting.WLSTHelper.populateInitialContext(WLSTHelper.java:498)
     at weblogic.management.scripting.WLSTHelper.initDeprecatedConnection(WLSTHelper.java:551)
     at weblogic.management.scripting.WLSTHelper.initConnections(WLSTHelper.java:303)
     at weblogic.management.scripting.WLSTHelper.connect(WLSTHelper.java:201)
     at weblogic.management.scripting.WLScriptContext.connect(WLScriptContext.java:60)
     at weblogic.management.scripting.utils.WLSTUtil.initializeOnlineWLST(WLSTUtil.java:121)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:160)
     at org.python.core.PyMethod.__call__(PyMethod.java:96)
     at org.python.core.PyObject.__call__(PyObject.java:248)
     at org.python.core.PyObject.invoke(PyObject.java:2016)
     at org.python.pycode._pyx6.connect$1(<iostream>:16)
     at org.python.pycode._pyx6.call_function(<iostream>)
     at org.python.core.PyTableCode.call(PyTableCode.java:208)
     at org.python.core.PyTableCode.call(PyTableCode.java:404)
     at org.python.core.PyTableCode.call(PyTableCode.java:287)
     at org.python.core.PyFunction.__call__(PyFunction.java:179)
     at org.python.pycode._pyx18.f$0(/tmp/ResetWLPassword.py:20)
     at org.python.pycode._pyx18.call_function(/tmp/ResetWLPassword.py)
     at org.python.core.PyTableCode.call(PyTableCode.java:208)
     at org.python.core.PyCode.call(PyCode.java:14)
     at org.python.core.Py.runCode(Py.java:1135)
     at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:167)
     at weblogic.management.scripting.WLST.main(WLST.java:106)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at weblogic.WLST.main(WLST.java:29)
Caused by: java.lang.SecurityException: User: weblogic, 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:589)
     at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:479)
     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
     at weblogic.security.service.SecurityManager.runAs(Unknown Source)
     at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:475)
     at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:59)
     at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:1016)
     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)
     at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Could not connect using supplied credentials
Changing password ...
Password change failed

Similar Messages

  • Hello every one, am having issue with my itunes, for some reason or another my icon in the itunes doesnt change, its stuck on Songs, and will not let me get playlist or anything else. can any one tell me if that can be fixed

    hello every one, am having issue with my itunes, for some reason or another my icon in the itunes doesnt change, its stuck on Songs, and will not let me get playlist or anything else. can any one tell me if that can be fixed

    http://support.apple.com/kb/TS3694#error-1
    Error 1 or -1
    This may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.

  • Where can i download the weblogic modules for apache (source/precompiled)

    I have wandered the wonderfull world of the BEA website for 2 full days now and still am not an inch closer to de download site for the weblogic module for apache. That is, i have apache and need to add the weblogic module to it.
    Complications are Solaris 10 and apache 2.0.55. So the latest versions of OS and webserver. Is there a precompiled module available or can i get the sources somewhere?
    I do have a working module for apache 2.0.53 if someone can confirm that this is supported for 55 that would be fine by me.

    At times when the sources were available I tried to build it on a "new" platform (Solaris x86 32bit) and I can tell you: it's NOTHING that is obvious. Building OpenOffice or Mozilla may appear like an easy task. It took me months to get there and to be able to just build the 'build tools'.
    On top, many of the sources are (historically) written in a Pascal dialect and are transferred to C with an own precompiler so there are three languages used (C, C++ and Pascal)  - so it's a pretty hard (next to impossible) job to learn some algorithms from those sources.
    See also here:
    http://cjcollier.livejournal.com/177628.html
    http://home.snafu.de/~dittmar/sapdbdev/
    and just to get an idea of the modules and their structure:
    http://home.snafu.de/~dittmar/sapdbdev/sapdbModules.txt
    Markus

  • Can't remember my answers for changing password setting

    Can't remember my answers for changing password setting?

    Apple ID Security -
    Telephone Apple Care for your country and ask for the Account Security Team, then request help resetting the questions.

  • Bapi/Fn Module for changing Routing

    Hi All,
    Currently I am working on creation and change of Routing using BAPI's . I could find the routing create bapi BAPI_ROUTING_CREATE and it is working fine.
    Can some one help in identifying the BAPI/Function Module for modifying /changing the Routing. For changing details in routing currently we are using t code CA02.
    Thanks ,
    Vengal Rao.

    Hi Joerg,
    Thanks for the function module. A small issue I am facing. when executing it some data in it I am getting error message
       as follow: HIGH_MSGTY   -   E , ERROR_FROM     -   1, ERROR_TO       -      1, OBJ , D_IND         -  0000000001 .
    Please guide me how to identify this error message.
    Thanks,
    Vengal Rao.

  • Function Module for Changing delivery date

    Hi Friends ,
        I am held up with a scenario of changing the delivery date while creating purchase order. Could you please suggest any function module to change the delivery date in purchase order if it is less than 5 days.
    With Regards ,
    Sudhir S
    Moderator message: please do some own research before asking.
    Edited by: Thomas Zloch on Feb 21, 2011 11:45 AM

    Hi praveen for u r requirement there is no need of any FM
    Try this code
    parameters:
      p_date like sy-datum,
      p_no type i.
    data:
      w_date like sy-datum.
    w_date = p_date - p_no.
    write: / w_date .
    it is enogh for u r requirement
    plzz reward if it is usefull...
    for any further quiries my mail id is [email protected]
    plzz dont forget to reward

  • WLST script for changing password for userid in Weblogic 9.2

    Hello Everyone,
    We want to change password for userid in weblogic 9.2. Is there a way we can do this by using WLST script? If so please provide me with steps for doing that using WLST. Thanks in advance.
    - - Weblogic Consultant

    Did you try going to the WLST documentation and searching for it? Go to [http://edocs.bea.com/wls/docs92/pdf/config_scripting.pdf] and search for "Changing a Password". The example there seems to be what you need.

  • Function module for Change Master (CC01) creation

    Hi all,
    Pl. tell me function module or BAPI for 'Change Master' Creation. It is linked with BOM to record BOM changes. Its Tcode is 'CC01'. Pl. reply.
    Regards,
    Darshana

    try this...
    RFC_CREATE_CHANGE_MASTER

  • Function Module for Changing status of a Functional Location.

    Hello,
    I am writing a Proxy for changing the Functional Location (T code IL02).
    I need to set the Deletion flag for the Functional Location.
    Can any body help me with how to do this. As data will be coming from XI and I have to update the Functional location in background with function modules.
    I am using 'BAPI_FUNCLOC_CHANGE' for changing other data. But I am not able to set the Deletion flag with this BAPI.

    Hi Abhijit,
    Can you please tell me steps or the ABAP code for setting the Deletion Flag for a Functional Location?
    Thanking you in Advance,
    Vijay

  • How do I import a module for script use?

    I have a script that uses the AD module for some operations. Here is the code:
    #04/24/2014
    #UsAer Logger
    #Author: Alexander Bazzi
    #Property of AerSale, Inc
    Import-Module ActiveDirectory
    $username=$env:username
    $computerName=$env:computername
    $userProperties = Get-ADUser $username
    $departmentOU = ($userProperties.DistinguishedName -split ',OU=')[1]
    $officeOU=($userProperties.DistinguishedName -split ',OU=')[2]
    $pathOutUser = "C:\Scripts\UsAer_Logger\Output\$officeOU\$departmentOU.txt"
    if(Test-Path $pathOutUser)
    $computerName >> $pathOutUser
    else {
    New-Item $pathOutUser
    $computerName >> $pathOutUser
    When I try to run it on PowerShell ISE, I get the following exception: 
    Import-Module : The following error occurred while loading the extended type da
    ta file: 
    Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
    Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
    esent from "Microsoft.PowerShell".
    Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
    Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
    esent from "Microsoft.PowerShell".
    Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
    Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
    esent from "Microsoft.PowerShell".
    Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
    Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
    esent from "Microsoft.PowerShell".
    Microsoft.PowerShell, C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Active
    Directory\ActiveDirectory.Types.ps1xml : File skipped because it was already pr
    esent from "Microsoft.PowerShell".
    I tried running it without the Import-Module cmdlt, but it didn't recognize the Get-ADUser command. If you could shed some light on this, I'd really appreciate it!
    Many thanks in advance.
    Best,
    Alex

    You have two different copies of Active Directory module installed.
    Get-Module -list Act*
    See if there is a second version.  It is also possible that you are loading something in your profile that is loading those components.  Try start PowerShell with the -NoProfile switch then import AD.  If that works then inspect your profiles
    - all of them.,
    ¯\_(ツ)_/¯

  • I am having issues with tech support for King Games!   Why can't they support their game?

    I have been having issues with Bubble Witch saga for over a week! Mather continue to give me the run around.  Finally today, they have admitted that they are too busy with their other games to offer support!  They ask me to continue to be patient ! Lol. Please, see below.     What is one to do when these app companies are not able to support their apps?  Does Apple think this is good?
    Thanks!
    Dear Robin,
    Thank you for contacting us.
    Please, you have to understand that there are a lot of games provided by King and therefor we have different support teams for the 'bigger' games. Therefor we don't have the information or tools to help you with your enquiries with Bubble Witch Saga.
    I'm sorry for the inconvenience.
    Kind regards,
    Gustaf
    King customer support.

    Thanks!  I just think that Apple would have concern with App companies  who are being offered through Apple!  This may seem as though it isn't Apples issue but, in truth it is, to the extent that it looks bad on Apple. Apple, should expect companies that use their App Store to provide support for their product or not allow these companies to have apps in the Apple store!  Believe it or not..... This is a reflection!  
    But, don't worry, I am trying to get them to support the game.  At the very least my review will not be good and eventually I will stop playing as others have done!!!

  • Function module for Change document for Business partner

    Hi Experts,
    Could any one send me the sample code of function module for CDHDR and CDPOS tables for extracting the change date along with role.
    Eg :
    BPRole Changd on crtd by crtd on Business partner
    ZCASH 30.11.2011 NHALLAL 24.11.2011 0001000237
    CRM000 03.12.2011 NHALLAL 24.11.2011 0001000237
    I wanted to catch up the changed date and changed role from CDHDR (base table) and CDPOS(cluster table - item level).
    Might be involved with creation of extract structure.
    Any sample codes are appreciated. Thanks.
    Regards,
    Janardhan

    resolved

  • Panasonic VDR-D100... having issues importing home videos!

    Hello,
    I am having problems importing home videos from my Panasonic VDR-D100 camcorder onto my computer - any suggestions? Do I need additional software or maybe I'm just doing something wrong?
    I am connecting my camera via USB then turning it on, opening up iMovie and nothing comes up! Any suggestions would be greatly appreciated.
    Thanks in advance for your help!
    Jen

    This may seen like a stupid question, but is the camera set to "Play"? And does the screen show the words "USB Connected" or something to that effect?
    Also, after everything is connected have you tried navigating to the File menu and selecting "Import from Camera..."?

  • Java Module for changing the file's name

    Hi all
    I m developing a java module for altering a file's name. I m trying to append system date and time to the file name and send it back. I was successful in retrieving the file's name, appending date n time in it but now I want to send it back. How can I achieve this ? any pointers will be very helpful
    awaiting your reply
    Regards
    Kapil

    String SIGNATURE = "process(ModuleContext moduleContext, ModuleData inputModuleData)";
              TRACE.entering(SIGNATURE, new Object[] { moduleContext, inputModuleData });
    //          Access the XI message. I.e. this module must be placed in the module chain
               // behind a module that sets an XI message as principal data.
               Object obj = null;
               Message msg = null;
               try {
                         obj = inputModuleData.getPrincipalData();
                         msg = (Message) obj;
                        Message msgg = (Message)inputModuleData.getPrincipalData();     
                        AuditMessageKey amk = new AuditMessageKey(msgg.getMessageId(), AuditDirection.INBOUND);               
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: Module Called");
    //               Read the channel ID, channel and the module configuration
                         String cid  = null;
                         String mode = null;
                         String fileName = null;
                         try {
                              // CS_GETMODDAT START
                              mode = (String) moduleContext.getContextData("mode");
                              // CS_GETMODDAT END
                              // CS_GETCHADAT START
                              cid  = moduleContext.getChannelID();
                              Channel channel = new Channel(cid);
    //                          channel = (Channel) LookupManager.getInstance().getCPAObject(CPAObjectType.CHANNEL, cid);
                              // Example to access a channel configuration parameter in a module: String someParameter = channel.getValueAsString("YourAttributeName");
                              // CS_GETCHADAT END
    //                         Hashtable mp = (Hashtable) inputModuleData.getSupplementalData("module.parameters");
    //                           if(null != mp)
    //                                 fileName = (String)mp.get("FileName");
    //                                 fileName = fileName + todaysDate;
    //                                 mp.put("FileName",fileName);     
                             fileName = channel.getValueAsString("file.targetFileName");
                             Date todaysDate = new Date(System.currentTimeMillis());
                             fileName = fileName + todaysDate;
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: fileed" + fileName);
                              if (mode == null) {
                                   TRACE.debugT(SIGNATURE, "Mode parameter is not set. Switch to 'none' as default.");
                                   mode = "none";
                              TRACE.debugT(SIGNATURE, "Mode is set to {0}", new Object[] {mode});
                         } catch (Exception e) {
                              TRACE.catching(SIGNATURE, e);
                              TRACE.errorT(SIGNATURE, "Cannot read the module context and configuration data");
                              ModuleException me = new ModuleException(e);
                              TRACE.throwing(SIGNATURE, me);
                             Audit.addAuditLogEntry(amk, AuditLogStatus.ERROR, "Rerrrd" + me);
                              throw me;
    //               try{
    //                  Hashtable mp = (Hashtable) inputModuleData.getSupplementalData("module.parameters");
    //                  String fileName = null;
    //                  Date todaysDate = new Date(System.currentTimeMillis());
    //                  if(null != mp)
    //                       fileName = (String)mp.get("FileName");
    //                       fileName = fileName + todaysDate;
    //                       mp.put("FileName",fileName);     
    //                  inputModuleData.setSupplementalData("module.parameters", mp);
    //               }catch(Exception e){
               } catch (Exception e) {
                    TRACE.catching(SIGNATURE, e);
                    if (obj != null)
                         TRACE.errorT(SIGNATURE, "Input ModuleData does not contain an object that implements the XI message interface. The object class is: {0}", new Object[] {obj.getClass().getName()});
                    else
                         TRACE.errorT(SIGNATURE, "Input ModuleData contains only null as XI message");
                    ModuleException me = new ModuleException(e);
                    TRACE.throwing(SIGNATURE, me);
                    throw me;
              return inputModuleData;
    Please refer the above code, it might help you to understand what i m trying to do. I have also included some code that is in comments which I tried by referring the links given by other users but its nt working. Please tell me how to improve my code to set the filename into the <b>reciever file adapter</b>.
    Regards
    Kapil

  • Bapi or Function Module for Change request Management status update

    Hi,
    Do we have any Bapi or function module to change the status of Change request Management.
    Ex: If the status is in To Be Processed i have to change that status to Authorized using any Bapi or FM.
    I have tried with the BAPI crm_icss_change_request but its not updating the status.
    Do you have any idea on this???
    Regards
    Pavan

    hello,
    the function module is 'SOCM_STATUS_VALUES'
    you can find an example of usage of it in the program CRM_SOCM_SERVICE_REPORT
        CALL FUNCTION 'SOCM_STATUS_VALUES'
          EXPORTING
            im_process_type       = report_list-process_type
      IM_LANGU              = SY-LANGU
          TABLES
            status_values         = lt_vsocm_stat_propt.
    I hope it helps
    best regards

Maybe you are looking for