Undo problem in a java made notepad

i have been working on notepad.i want to provide it features like that provided in MS-DOS TURBO C++.i.e. all the steps can be reversed.
can anybody tell me how to solve this problem in easiest way.I HAVE TWO SOLUTIONS BUT THEY DON'T SATISFY MY MIND.THEY ARE CUMBERSOME

i have been working on notepad.i want to provide it
features like that provided in MS-DOS TURBO C++.i.e.
all the steps can be reversed.
can anybody tell me how to solve this problem in
easiest way.I HAVE TWO SOLUTIONS BUT THEY DON'T
SATISFY MY MIND.THEY ARE CUMBERSOMEWould you tell the solutions you have in your mind? It might be possible that I would be thinking of the same, but let's hear it from you. :)
And post any code if you have written.

Similar Messages

  • StyledDocument Undo problem

    I use StyledDocument in my program (text editor) and I have following exception:
    javax.swing.text.StateInvariantError: GlyphView: Stale view: javax.swing.text.BadLocationException: Length must be positive
    at javax.swing.text.GlyphView.getText(GlyphView.java:106)
    at javax.swing.text.GlyphPainter1.getSpan(GlyphPainter1.java:43)
    at javax.swing.text.GlyphView.getPreferredSpan(GlyphView.java:498)
    at javax.swing.text.FlowView$LogicalView.getPreferredSpan(FlowView.java:679)
    at javax.swing.text.FlowView.calculateMinorAxisRequirements(FlowView.java:214)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:913)
    at javax.swing.text.BoxView.getMinimumSpan(BoxView.java:542)
    at javax.swing.text.BoxView.calculateMinorAxisRequirements(BoxView.java:881)
    at javax.swing.text.BoxView.checkRequests(BoxView.java:913)
    at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:325)
    at javax.swing.text.BoxView.layout(BoxView.java:682)
    at javax.swing.text.BoxView.setSize(BoxView.java:379)
    at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1599)
    at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:935)
    at javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:911)
    at javax.swing.text.JTextComponent.modelToView(JTextComponent.java:1118)
    at Editor.Editor.caretUpdate(Editor.java:1204)
    at Editor.Editor.caretUpdate(Editor.java:686)
    at javax.swing.text.JTextComponent.fireCaretUpdate(JTextComponent.java:356)
    at javax.swing.text.JTextComponent$MutableCaretEvent.fire(JTextComponent.java:3165)
    at javax.swing.text.JTextComponent$MutableCaretEvent.stateChanged(JTextComponent.java:3187)
    at javax.swing.text.DefaultCaret.fireStateChanged(DefaultCaret.java:638)
    at javax.swing.text.DefaultCaret.changeCaretPosition(DefaultCaret.java:1010)
    at javax.swing.text.DefaultCaret.handleSetDot(DefaultCaret.java:918)
    at javax.swing.text.DefaultCaret.setDot(DefaultCaret.java:899)
    at javax.swing.text.DefaultCaret$UpdateHandler.insertUpdate(DefaultCaret.java:1453)
    at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:184)
    at Editor.OverwritableSyntaxDocument.fireInsertUpdate(OverwritableSyntaxDocument.java:52)
    at javax.swing.text.AbstractDocument$DefaultDocumentEvent.undo(AbstractDocument.java:2797)
    at javax.swing.undo.UndoManager.undoTo(UndoManager.java:210)
    at javax.swing.undo.UndoManager.undo(UndoManager.java:275)
    at Editor.Editor.actionPerformed(Editor.java:333)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
    at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
    at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:232)
    at java.awt.Component.processMouseEvent(Component.java:5100)
    at java.awt.Component.processEvent(Component.java:4897)
    at java.awt.Container.processEvent(Container.java:1569)
    at java.awt.Component.dispatchEventImpl(Component.java:3615)
    at java.awt.Container.dispatchEventImpl(Container.java:1627)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
    at java.awt.Container.dispatchEventImpl(Container.java:1613)
    at java.awt.Window.dispatchEventImpl(Window.java:1606)
    at java.awt.Component.dispatchEvent(Component.java:3477)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    That exception occurs only if I try to undo some editons in first line of StyledDocument
    In other lines it works without any problems.
    I use following implementation:
         public void undoableEditHappened(UndoableEditEvent e)
              UndoableEdit edit=e.getEdit();
              if(compoundEdit==null)
                   compoundEdit=new CompoundEdit();
              if(edit instanceof AbstractDocument.DefaultDocumentEvent &&
                   ((AbstractDocument.DefaultDocumentEvent)edit).getType()== AbstractDocument.DefaultDocumentEvent.EventType.CHANGE)
                   compoundEdit.addEdit(edit);
              else
                   compoundEdit.addEdit(edit);
                   compoundEdit.end();
                   undoManager.addEdit(edit);
                   compoundEdit=null;
                   //update undo/redo buttons
                   buttonsUpdate();
         }I don't have ideas to solve this problem. Help me, please...

    I don't have ideas to solve this problem. Help me, please...Based on the random code you posted, neither do I.
    My my last posting in this thread will work for you:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637225

  • Problems with a java bean in Weblogic 5.1

    Hello,
              I am having a problem deploying a java bean in Weblogic 5.1:
              I have been given a .class and a .jar file for a java bean (not an EJB). I
              placed the .class file into e:\temp\WEB-INF\classes and added the following
              line to my weblogic.properties file:
              weblogic.httpd.webApp.testApp=e:/temp/
              I have also updated the web.xml file in the WEB-INF directory as follows:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              Application 1.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <servlet>
              <servlet-name>EdIface</servlet-name>
              <jsp-file>test.jsp</jsp-file>
              </servlet>
              <servlet-mapping>
              <servlet-name>EdIface</servlet-name>
              <url-pattern>EdIface</url-pattern>
              </servlet-mapping>
              </web-app>
              When I try to access my http:\\server:port\testApp\test I get an "Error
              500 - internal server error".
              Has anyone had experice with deploying a java bean with jsut the .class and
              .jar file? Where should I put the .jar file?
              I appreciate any advice!
              

    Bump

  • TS1398 I have the ipad retina display version - I have a BIG issue with this when out and about that on about 50% of the time will it see my HTC mobile WiFi hotspot - rebooting either, or both devices doesn't cure the problem it drives me MAD!!!!

    I have the ipad retina display version - I have a BIG issue with this when out and about, that only about 50% of the time will it see my HTC mobile WiFi hotspot - rebooting either, or both devices doesn't cure the problem it drives me MAD!!!!
    The HTC hotspot works fine with everything else I connect to it.
    Also - ipad will not connect to my HTC via bluetooth. Again, I can connect to everything else with my HTC other than my ipad.
    I have to say this is my first venture into Apple products and I have always wanted to get away from my windows based laptop to get a MacBook, the problems I have had (flash player etc) & continue to have (as above) are putting me right off swapping over. I HATE technology that doesn't work and my ipad has been hard work!

    I stated my ipad as being an ipad2, but I now think it is a 3??? It was new Jan this year and is the 64gb retina display version.
    I really would like to get to the bottom on this problem wit mobile hotspots as it is sitting on my desk next to me now and I cannot get it to connect to my HTC mobile hotspot!!!! It might be taking a flying lesson soon at this rate!!! Grrrrrrr...........

  • Text Layout Framework columncount Undo problem

    Text Layout Framework columncount Undo problem ::
        The number of times columncount is changed it gets applied to textflow
    and those number of operation is stored in undoStack(UndoManger).But when i
    undo it, it comes back to intial state, without undoin step by step.
    I have given my source code..
    Y so or any other alternative to achieve this..
    Thanx in advance..  
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init()">
        <fx:Script>
            <![CDATA[
                import flashx.textLayout.container.ContainerController;
                import flashx.textLayout.conversion.ITextImporter;
                import flashx.textLayout.conversion.TextConverter;
                import flashx.textLayout.edit.EditManager;
                import flashx.textLayout.edit.IEditManager;
                import flashx.textLayout.edit.ISelectionManager;
                import flashx.textLayout.edit.SelectionState;
                import flashx.textLayout.elements.InlineGraphicElement;
                import flashx.textLayout.elements.ParagraphElement;
                import flashx.textLayout.elements.TextFlow;
                import flashx.textLayout.events.SelectionEvent;
                import flashx.textLayout.events.StatusChangeEvent;
                import flashx.textLayout.formats.Direction;
                import flashx.textLayout.formats.TextLayoutFormat;
                import flashx.undo.UndoManager;
                import mx.collections.ArrayCollection;
                import mx.controls.Alert;
                import mx.controls.CheckBox;
                import mx.events.FlexEvent;
                import mx.events.SliderEvent;
                import spark.components.Group;
                import spark.components.TextArea;
                import spark.core.SpriteVisualElement;
                public var directions:ArrayCollection = new
    ArrayCollection(
                        {label:"Left-to-Right",
    data:Direction.LTR},
                        {label:"Right-to-Left",
    data:Direction.RTL}
                private var _textContainer:SpriteVisualElement = null;
                private static const textInput:XML = <TextFlow
    xmlns="http://ns.adobe.com/textLayout/2008">
                    <div>
                        <p><span>The Text Layout Framework is
    an extensible library, built on the new text engine in Adobe Flash Player 10,
    which delivers advanced, easy-to-integrate typographic and text layout features
    for rich, sophisticated and innovative typography on the web.
                    Some benefits provided by this framework
    include: 1) rich typographical controls, including kerning, ligatures,
    typographic case, digit case, digit width and discretionary hyphens
                    2) cut, copy, paste, undo and standard keyboard
    and mouse gestures for editing 3) selection, editing and flowing text across
    multiple columns and linked containers
                    4) bidirectional text, vertical text and over
    30 writing scripts including Arabic, Hebrew, Chinese, Japanese, Korean, Thai,
    Lao, Vietnamese, and others
                    5) vertical text, Tate-Chu-Yoko (horizontal
    within vertical text) and justifier for East Asian typography. Try editing this
    text and playing with the options below! Notice an inline image is also
    included.</span></p>
                    </div>
                    </TextFlow>;
                private var _textFlow:TextFlow;
                private function init():void {
                    _textContainer = new SpriteVisualElement();
                    canvas.addElement(_textContainer);
                    var importer:ITextImporter =
    TextConverter.getImporter(TextConverter.TEXT_LAYOUT_FORMAT);
                    _textFlow = importer.importToFlow(textInput);
                    _textFlow.flowComposer.addController(new
    ContainerController(_textContainer, canvas.width-40, canvas.height));
                    _textFlow.interactionManager = new
    EditManager(new UndoManager());
                    _textFlow.flowComposer.updateAllControllers();
                private function changeNoColumns(event:Event):void {
                    var tlf:TextLayoutFormat = new
    TextLayoutFormat();
                    tlf.columnCount = cols.value;
                    tlf.columnGap = 15;
                    tlf.direction = direction.selectedItem.data;
                    var em:EditManager =
    _textFlow.interactionManager as EditManager;
                    em.selectAll();
                    (_textFlow.interactionManager as
    EditManager).applyFormat(tlf,tlf,tlf);
                    _textFlow.flowComposer.updateAllControllers();
                protected function
    undo_clickHandler(event:MouseEvent):void
                    var em:EditManager =
    _textFlow.interactionManager as EditManager;
                    trace("Can undo " + em.undoManager.canUndo() +
    " can redo " + em.undoManager.canRedo());
                    em.undo();
                protected function
    redo_clickHandler(event:MouseEvent):void
                    var em:EditManager =
    _textFlow.interactionManager as EditManager;
                    trace("Can undo " + em.undoManager.canUndo() +
    " can redo " + em.undoManager.canRedo());
                    em.redo();
            ]]>
        </fx:Script>
        <s:Panel title="Text Layout Framework Sample" width="100%"
    height="100%">
            <s:layout>
                <s:VerticalLayout paddingTop="8" paddingLeft="8"/>
            </s:layout>
            <s:VGroup>
                <s:Group id="canvas" width="600" height="200" />
                <s:HGroup width="100%" verticalAlign="middle">
                    <s:Label text="# Columns:"/>
                    <s:NumericStepper id="cols"  minimum="1"
    maximum="20" snapInterval="1" change="changeNoColumns(event)" />
                    <s:Label text="Text Direction:"/>
                    <s:DropDownList id="direction"
    change="changeTextDirection(event)" dataProvider="{directions}"
    selectedItem="{directions[0]}"/>
                    <s:Button label="Undo"
    click="undo_clickHandler(event)"/>
                    <s:Button label="Redo"
    click="redo_clickHandler(event)"/>
                </s:HGroup>
            </s:VGroup>
        </s:Panel>
    </s:WindowedApplication>

    It cannot be reproduced with TLF 3.0 + SDK 4.5.

  • Hi, I have the following problem with Time Capsule: La imagen del disco de copia de seguridad "/Volumes/Data/MacBook Pro de Carlos.sparsebundle" ya está en uso. Please your comments to solve this problem, i can't made a backup. Thanks.

    Hi, I have the following problem with Time Capsule: La imagen del disco de copia de seguridad “/Volumes/Data/MacBook Pro de Carlos.sparsebundle” ya está en uso. Please your comments to solve this problem, i can't made a backup. Thanks.

    Try Here  >  http://pondini.org/TM/Time_Capsule.html
    Perhaps P 2  >  Time Machine could not complete . . . sparsebundle could not be accessed. (Error 109).

  • Getting Problem while publishing Problem while publishing java.lang.IllegalArgumentExcep

    getting Problem while publishing Problem while publishing java.lang.IllegalArgumentExcep while deploying persistance with ejb sample application into cloud. can any one please tell me why i am getting this?

    Hi Goutham,
    I am facing the same issue. Please let me know how you have resolved it.

  • Problem in generate Java  from PL SQL package in Jdeveloper

    Hi
    i have problem in create java class from PL SQL package in JDeveloper.
    I use Database navigator of jdeveloper and right click on a package and choose Generate Java then in Jpublisher window choose my view Controller and accept other default values.
    I call methods of generated class in the Action of a button in my JSP page, but when I click the button it  throw null pointer exception !!! i fund one of generated method return null and it lead to this exception.
    protected DefaultContext __tx = null;
    public DefaultContext getConnectionContext() throws SQLException  {
    if (__tx==null){
    __tx = (getConnection()==null) ? DefaultContext.getDefaultContext() : new DefaultContext(getConnection());
        return __tx;
      public Connection getConnection() throws SQLException
        if (__onn!=null) return __onn;
         else if (__tx!=null) return __tx.getConnection();
         else if (__dataSource!=null) __onn= __dataSource.getConnection();
         return __onn;
    i try to generate class in Model project and create DataControl for that and use method action but noting change and i get null pointer again!!
    Jdeveloper Versino = 11.1.1.7.0

    Let me ask you another question: Why do you generate java from the package at all?
    Where do you want to call the package?
    Back to your question: you should see code like
        public void setDataSourceLocation(String dataSourceLocation) throws SQLException {
            javax.sql.DataSource dataSource;
            try {
                Class cls = Class.forName("javax.naming.InitialContext");
                Object ctx = cls.newInstance();
                java.lang.reflect.Method meth = cls.getMethod("lookup", new Class[] { String.class });
                dataSource = (javax.sql.DataSource) meth.invoke(ctx, new Object[] { "java:comp/env/" + dataSourceLocation });
                setDataSource(dataSource);
            } catch (Exception e) {
                throw new java.sql.SQLException("Error initializing DataSource at " + dataSourceLocation + ": " + e.getMessage());
    in the generated code. This code look up a datasource (which you have defined e.g. on the Weblogic Server) by calling the method
    setDataSourceLocaltion("jdbc/HRConnDS");
    This look up the datasource nad stores it in the class variable.
    Timo

  • Problem defining a java client on tomcat to call the esb web service

    Dear Support,
    I have a java program that has been incorporated on the oracle SOA suite. We now have a problem defining a java client on tomcat to call the esb web service. The Oracle SOA part is running fine”.
    The software versions we are using :
    1 - Oracle SOA suite on 10.1.3.3 Oracle AS
    2 – Java 1.5
    3 – Tomcat 5.5
    4 – OS XP Professional

    If you have a main method in jour generated WSclient class (by the proxy) add the following code below the //add your own code:
    AddFileResponseType testResponse = myPort.addFile(testRequest);
    where AddFileResponseType is the responsetype of the WS and addFile is the method to call. this is just an example of my own webservice.
    Next stap is to put the cursor in the main method and choos debug or run.
    This should invoke the main method en call the webservice
    I hope this helps you
    Kim

  • Solution Manager systems RAM requirements - problems with the Java Engine

    Hello,
    I am about to install SAP Solution Manager 7 on a WIndows 2003 Server x64 but I need to know what the RAM requirements are? I have been having problems with the Java Engine starting and it seems to time out, I have heard that this is a very RAM hungry process and it might be why?
    Many thanks for your help in advance,
    Omar

    Hello Omar,
    To size SAP Solution Manager 7.0 EHP1 we recommend to use the SAP Solution Manager Quicksizer Tool at:
    http://service.sap.com/sizing-solman
    Here you find information on how to use the tool, how to collect input data for E2E Scenario Sizing, on SAP E2E RCA Sizing, Introscope Tuning, Wily Enterprise Manager Cluster Setup for E2E RCA Scenario and BI Aggregation Strategy in E2E Scenario.
    Please find more information about installing Solution Manager in:
    http://service.sap.com/instguides -> SAP Solution Manager
    I hope this information helps.
    Thanks,
    Mark

  • Hi every one can any one help i have a problem in importing java dump for

    hi every one can any one help i have a problem in importing java dump for solman 4.0 mssql 2005 sr3

    Hi wahed,
    Please elobrate question not clear.
    Regards,
    Shahed iqbal

  • I have a MAC, Ive just installed OS10.10.3 operating system in it and I can't open Photoshop.  This is a wide spread problem that involves Java and Photoshop software.  Since you produce both these products , I turn toward you to direct me to the best "Fi

    I have a MAC, Ive just installed OS10.10.3 operating system in it and I can't open Photoshop.  This is a wide spread problem that involves Java and Photoshop software.  Since you produce both these products , I turn toward you to direct me to the best "Fix"?

    Go here Mac OS X Yosemite (10.10) compatibility FAQs | CC

  • JFileChooser problem opening just java files

    Hi everyone, trying to write simple text ed. that will only open java files (part of JFileChooser). Yes have looked at API but so stupid that i couldnt get it to work can anyone help?
    public void openFile() {
              BufferedReader in = null;
              try {
                   JFileChooser chooser = new JFileChooser();
                   //---Open Java Files only---
                   if (chooser.showOpenDialog(null)
                   == JFileChooser.APPROVE_OPTION) {
                   File selectedFile = chooser.getSelectedFile();          
                   in = new BufferedReader
                             (new FileReader(selectedFile));
         catch(FileNotFoundException e) {
              JOptionPane.showMessageDialog
                   (null, "Bad Filename. Try Again");
         catch(IOException e) {
              JOptionPane.showMessageDialog
                   (null, "Corrupted File. Try Again");
         finally {
              if (in != null)
                   try {
                        StringBuffer buffer = new StringBuffer();
                        String text = new String();
                        text_chat.setText(text + "\n\n");
                        while((text=in.readLine())!=null)
                             buffer.append(text+ "\n");
                        text_chat.setText(buffer.toString());
                   catch(IOException e) {
                        JOptionPane.showMessageDialog
                             (null, "Error closing File.");
    }

    Can you tell me how did you solve the problem? Right now I am encounter ing the same problem. The java files on JFileChooser did not show up!

  • Getting the error " [java] Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class " while building the O2A 2.1.0 PIP

    Getting the error " [java] Problem invoking WLST - java.lang.RuntimeException: Could not find the OffLine WLST class " while building the O2A 2.1.0 PIP. I am using the Design Studio 4.3.2 for building the O2A 2.1.0 PIP. Please let me know how to resolve this issue. Here I am enclosing the log file .

    We have basically the same issue when we try to create the interpreter using the embedded method..
    I was able to use the interpreter embedded in a java client as long as the weblogic jars were located in a weblogic install if I tried to use them from a maven repository no luck at all...
    All of this worked easily in 9.2 now in 10.3 it seems more error prone and less documented.
    I have seen close to a 100 posts on issues related to this so is there a document which outlines specifics....
    We / I have used weblogic now for almost 10 years and moving from 8.1 to 9.2 was painful and we expected the move from 9.2 to 10.3 not to be soo bad but its proving to be as painful if not more painful than moving to 9.2. We seem to spend a good bit of our time working around issues in the next new release that were not in the previous one..
    Any help would be appreciated I think we will open a support case but even that is more painful...
    Any help would be greatly appreciated..
    PS: We confirmed that all jars in the startweblogic classpath were in the startup. The server we have the embedded wlst instance is a managed server and we are using the component in a war... Are there any restrictions which we are unaware of.
    Error we get is
    1 [ERROR] com.tfn.autex.order.weblogic.QueueMaintenanceUtility.addQueue():217 Error Adding Queue wowsers JNDI Name wowsers Exception: Invocation Target exception while getting the WLSTOffLineScript path

  • Problem invoking WLST - java.lang.NoClassDefFoundError: weblogic.management

    Hi Guys!
    I want craete the new user 'jdoe' for domain 'tst2_domain' (WebLogic Server Version: 10.3.5.0)
    For it I have script 'create_user.sh':
    # Set the Environment Variables
    /home/testuser/Oracle/Middleware/user_projects/domains/tst2_domain/bin/setDomainEnv.sh
    export JAVA_HOME=/home/testuser/Oracle/Middleware/jdk160_24/
    export PATH=$PATH:$JAVA_HOME/bin/
    export CLASSPATH=/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/testuser/Oracle/Middleware/Oracle_OSB1/modules/com.bea.common.configfwk_1.5.0.0.jar:/home/testuser/Oracle/Middleware/Oracle_OSB1/lib/sb-kernel-api.jar:/home/testuser/Oracle/Middleware/Oracle_OSB1/lib/sb-kernel-impl.jar:/home/testuser/Oracle/Middleware/Oracle_OSB1/lib/sb-kernel-common.jar:/home/testuser/Oracle/Middleware/Oracle_OSB1/lib/sb-kernel-resources.jar
    # Execute the WLST script..
    cd resources
    java weblogic.WLST createUsers.py.../resources/createUsers.py:
    url = 'localhost:7001'
    username = 'weblogic'
    password = 'welcome1'
    print 'Adding users to DefaultAuthenticator.'
    connect(username, password, url)
    # Check if user already exists
    cd('/')
    authProvider = cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("DefaultAuthenticator")
    if authProvider.userExists('jdoe'):
         print 'User jdoe already exists'
         exit()
    else:
         # Create users
         print 'Creating new user: jdoe'
         authProvider.createUser('jdoe','welcome2','a sample service bus administrator')
         authProvider.addMemberToGroup('Administrators','jdoe')
    print 'Users created successfully.'
    exit()Domain 'tst2_domain' is running...
    I started the create_user.sh and then i had the error:
    $ ./create_user.sh
    Initializing WebLogic Scripting Tool (WLST) ...
    Problem invoking WLST - java.lang.NoClassDefFoundError: weblogic.management.scripting.WLScriptContext
    Could you please help me? Which the problem in the script?
    $ ./setWLSEnv.sh
    CLASSPATH=/home/testuser/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/patch_oepe1050/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/jrockit_160_24_D1.1.2-4/lib/tools.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/testuser/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/testuser/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/testuser/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:
    PATH=/home/testuser/Oracle/Middleware/wlserver_10.3/server/bin:/home/testuser/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/home/testuser/Oracle/Middleware/jrockit_160_24_D1.1.2-4/jre/bin:/home/testuser/Oracle/Middleware/jrockit_160_24_D1.1.2-4/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/testuser/bin
    Your environment has been set.
    $ java weblogic.WLST
    Exception in thread "main" java.lang.NoClassDefFoundError: weblogic.WLST
       at gnu.java.lang.MainThread.run(libgcj.so.7rh)
    Caused by: java.lang.ClassNotFoundException: weblogic.WLST not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
       at java.net.URLClassLoader.findClass(libgcj.so.7rh)
       at gnu.gcj.runtime.SystemClassLoader.findClass(libgcj.so.7rh)
       at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
       at java.lang.ClassLoader.loadClass(libgcj.so.7rh)
       at gnu.java.lang.MainThread.run(libgcj.so.7rh)

    But if run script as $ ./wlst.sh /home/testuser/create_user/resources/createUsers.py - its ok!
    $ ./wlst.sh /home/testuser/labs/Practice_05/create_user/resources/createUsers.py
    CLASSPATH=/home/testuser/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/patch_oepe1050/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/jrockit_160_24_D1.1.2-4/lib/tools.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/testuser/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/testuser/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/testuser/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:
    PATH=/home/testuser/Oracle/Middleware/wlserver_10.3/server/bin:/home/testuser/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/home/testuser/Oracle/Middleware/jrockit_160_24_D1.1.2-4/jre/bin:/home/testuser/Oracle/Middleware/jrockit_160_24_D1.1.2-4/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/testuser/bin
    Your environment has been set.
    CLASSPATH=/home/testuser/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/patch_oepe1050/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/home/testuser/Oracle/Middleware/jrockit_160_24_D1.1.2-4/lib/tools.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/home/testuser/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/home/testuser/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/home/testuser/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/home/testuser/Oracle/Middleware/utils/config/10.3/config-launch.jar::/home/testuser/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbynet.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/home/testuser/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbytools.jar::
    Initializing WebLogic Scripting Tool (WLST) ...
    Welcome to WebLogic Server Administration Scripting Shell
    Type help() for help on available commands
    Adding users to DefaultAuthenticator.
    Connecting to t3://localhost:7001 with userid weblogic ...
    Successfully connected to Admin Server 'tst2_as_server' that belongs to domain 'tst2_domain'.
    Warning: An insecure protocol was used to connect to the
    server. To ensure on-the-wire security, the SSL port or
    Admin port should be used instead.
    Creating new user: jdoe
    Users created successfully.
    Exiting WebLogic Scripting Tool.

Maybe you are looking for

  • SMARTFORMS: 'OUTPUT CANNOT BE ISSUED error

    Hi, I have designed a smartform for Delivery document. One of the delivery has 700 lines of Packing for 1 single line item. When I execute this delivery, the output is not displayed The error message is "the output could not be issued". In debug mode

  • How do I add a logo in the header of a TestStand 2012 HTML report?

    I've been trying to add a company logo to the header of a HTML report on TestStand 2012 without success. I've followed the help topic below however this seems to be for TestStand 3.1 and does not work on 2012.  http://digital.ni.com/public.nsf/allkb/

  • SAP Best Practices Baseline package for Russia V3.607

    Dear colleagues, My partner - BearingPoint Russia - has an interest to SAP Best Practices Baseline package for Russia V3.607 Would you please help to find the contact whom they can ask the questions about content & price to? Best regards, Dmitry Popo

  • How do I skew a vector onto another vector?

    I have a vector that I would like to skew in order to match the blue block as shown above. I did this using the Object > Transform > Transform Each function, however the result is less than ideal. Is there any way to accurately and easily map the vec

  • Library items/javascript/paths

    i am rebuilding a company website which uses a library item for their navigation: http://www.curiouspictures.com/ i am simply cleaning up the html and all unnecessary files/folders/etc. i have a new navigation layout that was built from this particul