JNDI validation - problem in Security.runAs with wlclient.jar !!!!!HELP

Hi,
I am getting the error given below in calling the following thin client program.
public static void main(String[] args) throws NamingException
          Security.runAs(new Subject(), new PrivilegedAction(){
               public Object run() {
                    Properties props = new Properties();
                    TopicConnectionFactory confac = null;
                    props.put(InitialContext.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
                    props.put(InitialContext.PROVIDER_URL,CLUSTER);
                    try {
                         InitialContext jndiContext = new InitialContext(props);
                         jndiContext.close();
                    } catch (NamingException e) {
                         e.printStackTrace();
                         System.exit(0);
                    return null;
java.lang.SecurityException: SubjectManager not installed
     at weblogic.security.subject.SubjectManager$1.createAbstractSubject(SubjectManager.java:169)
     at weblogic.security.subject.SubjectManager$2.run(SubjectManager.java:285)
     at java.security.AccessController.doPrivileged(Native Method)
     at weblogic.security.subject.SubjectManager.getAbstractSubject(SubjectManager.java:273)
     at weblogic.security.subject.SubjectManager.runAs(SubjectManager.java:234)
     at weblogic.security.Security.runAs(Security.java:48)
     at com.test.jms.JMSConnectionTest.run(JMSConnectionTest.java:62)
     at com.test.jms.JMSConnectionTest.main(JMSConnectionTest.java:55)

i think that you need create a subject like that.
LoginContext loginContext = null;
try {
loginContext = new LoginContext(username, password, url);
loginContext.login();
} catch {}
Subject subject = loginContext.getSubject();
Security.runAs(subject, new SimpleAction .......

Similar Messages

  • Running with java -jar

    I have a client.jar that has a bunch of vm parameters and relies on a few other jars. The jar has the main class specified in the manifest. Ultimately I would like to take the dependent jars and put them in the client jar and use the manifest classpath option. I have been unable to get this to work. What I am finding is that running with java -jar basically ignores all of my vm parameters. I have tried removing the dependent jars and referencing them from the command line classpath argument. This still did not work. The only thing that has worked is not using a client.jar at all and just running my main class with all the vm parameters. This is not an acceptable solution for me. Thoughts?
    Thanks,
    Howard

    Yes, this is what is so weird about the problem. Neither the manifest class-path option or running with cp is working when the main class lives in a jar.

  • Problem in Payment Run with Debit Memos

    Hi Every one
    I am facing the problem in payment run in which vendor debitmemos were picked up but they are in the exception list. I was observing it in various vendors and have tested in QA that as well when there is an invoice to be paid these debit memos automatically adjustedagainst those invoice and hence net amount is being paid. The problem is these debit memos were generated in exceptional list about an year ago but at that time they were not considered in payment as they had no invoice against it to net off. But after that everytime they run payment run they come in this exceptional although there is invoice against them to net off the payment. Can any body help me out in this regard what could be the possible reason for this and any solution for this. Thanks in advance.

    Hi,
    In F110 while  enteingr the parameters in the free selection choose the document number in the Field name
    and give the document numbers of only invoices. dont include the debit meoms.
    then you will not get the exception list at all.
    Regards,
    Padma

  • Applet doesn't run with Tomcat - please help!

    Hello!
    I have a problem with running an applet in Eclipse IDE, using J2EE and a Dynamic Web Project and a Tomcat server.
    The directory structure is:
    ProjectName
    - Java Resources->PackageName->AppletName.java
    - built->classes->PackageName->AppletName.class
    - WebContent->index.html
    In my index.html page I put this code:
    <applet code="PackageName.AppletName" width="500" height="200"></applet>
    If I run this applet like a simple Java Applet, it runs.
    But If I run this on server, my browser doesn't show me anything. I've try several posibilities, but it doesn't work. I should do some configurations on my Tomcat or I wrote something wrong on in my index.hml code, or my AppletName it isn't a simple java class?
    Thank you for your time!
    Adina

    My index.html is in WebContent, so I've already put the AppletClass.class there.
    I've tried with a jar and if I run this on server it doesn't work either. I don't know if there is any Tomcat->server.xml settings...
    It's so frustrating...
    Any ideas?
    The error message is:
    Java Plug-in 1.6.0_22
    Using JRE version 1.6.0_22-b04 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\adina
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    load: class app not found.
    java.lang.ClassNotFoundException: app
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://localhost:8080/app.class
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 9 more
    Exception: java.lang.ClassNotFoundException: app
    Edited by: 811815 on Nov 17, 2010 12:11 AM

  • OOME when doing RMI with wlclient.jar

    Hi,
    I'm calling EJB-components that are hosted on a WLS 8.1 server.
    The client uses wlclient.jar from WLS 9 distribution (WebLogic Server 9.2 Fri Jun 23 20:47:26 EDT 2006 783464) and jre 1.5.0_11.
    I get OOME at the client after doing several hundred EJB calls.
    I have checked that the client code does not leak ejb-references, initial contexts etc. I have also tried to call ejb remove and close the initialcontext and start anew but it does not help, the "com.sun.corba.se.impl.orbutil.CacheTable" still becomes the top heap consumer.
    The outline of how the program proceeds is:
    1. create initial context
    2. lookup ejb home
    3. call the create-method of a stateless session bean
    4. call some ejb business methods several hundred times
    -- here is the OOME, most often not during the ejb call, but when memory is examined the RMI-implementation objects are filling the heap
    5. call ejb remove
    6. close initial context
    So that's the problem. How could I get around this?
    I included some HPROF statistics below. HPROF made the stats immidiately after the OOME . All the top rank rows are related to RMI implementation classes, not application classes.
    Regards,
    Kari
    SITES BEGIN (ordered by live bytes) Tue Oct 06 12:02:10 2009
    percent live alloc'ed stack class
    rank self accum bytes objs bytes objs trace name
    1 10.29% 10.29% 3758560 3614 39151840 37646 310238 byte[]
    2 9.31% 19.60% 3400848 45698 3400848 45698 312167 char[]
    3 5.46% 25.06% 1994432 62326 3528256 110258 312197 com.sun.corba.se.impl.orbutil.CacheTable$Entry
    4 3.21% 28.27% 1172952 8747 1172952 8747 312066 char[]
    5 3.00% 31.27% 1096752 45698 1096752 45698 312166 java.lang.String
    6 2.90% 34.17% 1059688 6869 1089912 7103 310593 byte[]
    7 2.30% 36.47% 838592 26206 2827456 88358 312171 com.sun.corba.se.impl.orbutil.CacheTable$Entry
    8 2.19% 38.65% 798200 25112 798200 25112 306612 char[]
    9 2.02% 40.67% 738552 30773 769344 32056 310605 java.util.HashMap$Entry
    10 1.99% 42.66% 727064 6991 3915184 37646 310235 com.sun.corba.se.impl.encoding.CDROutputStream_1_2
    11 1.84% 44.50% 671712 1294 1196448 3818 312195 com.sun.corba.se.impl.orbutil.CacheTable$Entry[]
    12 1.84% 46.34% 671712 1294 1196448 3818 312196 com.sun.corba.se.impl.orbutil.CacheTable$Entry[]
    13 1.65% 48.00% 604472 6869 625064 7103 310578 com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl
    14 1.65% 49.65% 603792 25158 628680 26195 300952 java.util.HashMap$Entry
    15 1.65% 51.30% 602688 25112 602688 25112 306611 java.lang.String
    16 1.50% 52.80% 549520 6869 568240 7103 310599 com.sun.corba.se.impl.protocol.giopmsgheaders.RequestMessage_1_2
    17 1.50% 54.31% 549520 6869 568240 7103 310587 java.util.HashMap$Entry[]
    18 1.44% 55.74% 524352 4 524352 4 302751 java.util.HashMap$Entry[]
    19 1.26% 57.00% 460632 3387 475592 3497 310457 com.sun.corba.se.impl.interceptors.ClientRequestInfoImpl
    20 1.21% 58.21% 441072 9189 2515152 52399 304085 java.nio.HeapByteBuffer
    21 1.05% 59.27% 385000 6875 397768 7103 310405 com.sun.corba.se.impl.legacy.connection.SocketFactoryContactInfoImpl
    22 1.03% 60.29% 375120 15630 375120 15630 313808 java.lang.StackTraceElement
    23 1.00% 61.29% 364728 3507 1939496 18649 309771 com.sun.corba.se.impl.encoding.CDRInputStream_1_2
    24 0.96% 62.25% 349696 3877 5040200 58488 310969 char[]
    25 0.90% 63.15% 329712 6869 340944 7103 310231 com.sun.corba.se.impl.encoding.CDROutputObject
    26 0.77% 63.92% 279904 8747 279904 8747 312070 com.sun.corba.se.impl.orbutil.CacheTable$Entry
    27 0.75% 64.67% 275040 6876 365360 9134 304217 char[]
    28 0.75% 65.42% 274760 6869 284120 7103 310586 java.util.HashMap
    29 0.74% 66.16% 271200 3390 289920 3624 310960 java.util.HashMap$Entry[]
    30 0.74% 66.91% 271200 3390 289920 3624 310941 com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2
    31 0.74% 67.65% 271120 3389 287360 3592 311344 java.util.HashMap$Entry[]
    32 0.67% 68.32% 243984 10166 257856 10744 310884 java.util.HashMap$Entry
    33 0.67% 68.99% 243984 10166 257856 10744 310879 com.sun.corba.se.spi.servicecontext.UnknownServiceContext
    34 0.65% 69.64% 239272 2583 908696 10308 300090 char[]
    35 0.60% 70.24% 219808 6869 227296 7103 310799 com.sun.corba.se.impl.encoding.BufferManagerWriteStream
    36 0.60% 70.84% 219808 6869 227296 7103 310584 com.sun.corba.se.spi.servicecontext.ServiceContexts
    37 0.57% 71.42% 209928 8747 209928 8747 312065 java.lang.String
    38 0.56% 71.98% 205776 8574 205776 8574 313784 java.lang.StackTraceElement
    39 0.54% 72.52% 196800 5427 427112 11183 310920 byte[]
    40 0.54% 73.06% 196352 1700 444904 4043 310971 char[]
    41 0.47% 73.53% 172056 7169 172056 7169 312484 java.lang.StackTraceElement
    42 0.47% 73.99% 170000 2125 178800 2235 311358 java.util.HashMap$Entry[]

    Andy Piper wrote:
    Configuration:
    =============
    * Windows 2000 Prof SP3
    * Sun JDK 1.4.1_01 (1.4.2)Incidentally you should be using 1.4.1_03 (or later) in the client if
    you are using wlclient.jar.I tried some combinations of WL and client JDKs,
    even that:
    * WL started under Sun JDK 1.4.2
    * client started under Sun JDK 1.4.2
    * all classes (EJBs, value objects, etc)
    compiled under Sun JDK 1.4.2
    >
    >
    FAIL because of java.rmi.MarshalException
    weblogic.iiop.IIOPInputStream.checkChunk(IIOPInputStream.java:449)
    at
    weblogic.iiop.IIOPInputStream.read_longlong(IIOPInputStream.java:1002)There is known bug with reading longs inside a chunked value. This is
    fixed in SP2 and the relevant CR is CR124377 - you can get a patch for
    SP1 from support.It's realy very nice news for us.
    Thank you very match for help and quick response.
    Best regards,
    Eugene Voytitsky

  • Problems in instalation/running with JDK 5.0

    I'm rellatively new to Java programming. I've had a few classes, know the basic concepts and have tried some tutorials. Recently I installed JDK 5.0 update 6 in my computer (first I tried the Netbeans bundle, but saw it was very complicated and unnecesary) then found the installation for only the JDK and JRE.
    The compilation goes without complication, but when I want to run the program come the obstacles
    I've tried to start with some simple programs but whatever I do, I get the Exception in thread "main" java.lang.NoClassDefFoundError in every program that I've done. I even tried the simplest HelloWorld program (found in http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html ) and get the same error
    Now for the important part. I've already did my research, tried to debug everything. First off, added to my PATH env variable the path to the jdk5.0/bin dir to run javac and java in every directory. And also tried running "java HelloWorldApp classpath="dir to .class" and no success.
    I checked the env variable for CLASSPATH and only found a path to a Quicktime dir and nothing else (yes, I have Quicktime Pro installed). I've tried adding the dir of the .class file to it with no success
    I don't know what else to do. If someone has suggestions as to what else there is to do, please do not hessitate to even give the simplest and dumbest of advise

    I agree with the previous poster that it's better not to rely on the CLASSPATH environment variable.
    If you go to this link:
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/index.html#basic
    you can find the documentation for javac and java, which may interest you in itself. The one for javac explains the essence of how classes are found.
    Now, assuming you are on Windows,
    http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html
    documents how to run java. You need to pass as -cp all relevant class paths.
    I know this is not helping you directly, but it's hard if not impossible to deduce the problem from what you wrote (at least to me). But if you try this and you still get the same error, please post the full and exact command line you tried.

  • Problem installing program running with Java

    When i start to run a program appear a window witj following message: "preparing to run java virtual machine"..after that appear next small window with installshield wizard. When make a transition between this small windows to start to install the program, nothing happens it is he does not make this transition.
    I already download the new version without results.
    Do have any ideia what could be the problem.?
    Thanks
    Jorge

    Which JRE is bundle inside your application ?
    Is it International or US only ??
    I have a reason to believe that US version is
    throwing NullPointerException when installing it
    on windows 2000 server
    When you starting the installer, The installer is unpacking the JRE - so check which directory it expanded and than Try running java.exe from the JRE that was installed.
    Maybe its currupted, You dont need to run any code
    even if your run java.exe without anything the
    exception is thrown
    If exception is thrown try the international version of JRE

  • Problem in MRP run with Project/WBS Element

    Dear PP Gurus,
    I want to run MRP thro Project/WBS Element.
    I have created WBS Element & WBS BOM for Material. Then created sales order for that material and assign WBS element to sales order.
    Maintain Planning Strategy 21 ( Make to Order/Project) for Main Mtl.
    Now when I run MRP with MD51 then no requriements are generated for main material and its components.
    Is there any thing missing from PS-PP & SD point of view?
    Pl guide me for the same.
    Thanks in Advance.
    Umesh

    Dear Nagrajan,
    Thanks for your reply.
    There is no safety stock & un-restricted stock of that material.
    Also I don't want to assign this mtl to that wbs Network. If I assign the Material to WBS network then network req.is generated and thro Normal MD02 MRP generates the requirements.
    & in the plan order it will not show WBS Element
    But My req. is I want to run MRP with  MD51 & want WBS element as account asignment tab in plan order & production order too.
    IS there any config. missing from PP/ PS / SD ?
    Pl guide me for the same.
    Thanks ,
    Umesh

  • Problems accesing secure sites (https) SSL/TLS help???

    Hello
    We have a machine running Mountain Lion 10.8.3 that can`t access a bank`s site. In the same network we also have another machine running Lion 10.7.5 and it connects succesfully to the bank's site.
    We did a capture of packets with Wireshark and we see that the following:
    Mountain Lion try to uses SSL, without success.
    Lion uses TLSv1 and works perfect.
    If someone can help me and gives me any idea of this behaivor.
    Thanks in advance.
    Verny

    10.8.4. If you're having problems with certificates only on that one site, try the following.
    Back up all data.
    Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Keychain Access in the icon grid.
    From the menu bar, select
    Keychain Access ▹ Preferences ▹ Certificates
    There are three menus in the window. Change the selection in the top two to Best attempt, and in the bottom one to  CRL. Log out, log back in, and test.

  • RXTX receive problems, but works fine with COMM.jar

    Hi there,
    I have a program that controls a piece of hardware via the serial port. It sends a command and has a serialport event listener that sits and waits for any response. Using the Sun Comm Library this works fine, but when I use the latest RXTX package, only send works, it receives nothing back (the event listener is never triggered). I know it sends as the device does what it has just been told to do.
    Any ideas anyone?
    Thanks folks. :)

    I notice that www.rxtx.org has a mail list for asking questions like that.

  • WlClient.jar & JAAS authentication Issues

    If I run the JAAS example (examples/security/jaas) that comes with
    wl8.1 sp1 but use wlclient.jar instead of weblogic.jar, the
    LoginContext.login() method returns a Subject even if I pass in an
    invalid user/password combination. If weblogic.jar is in the
    classpath, a javax.security.auth.login.LoginException is thrown which
    is what I want to happen for invalid credentials. When running with
    wlclient.jar, the code doesn't fail until it actually attempts to
    access the EJB at which point it gets a org.omg.CORBA.NO_PERMISSION.
    I am trying to use JAAS to login from a swing app and I want to use
    wlclient.jar instead of weblogic.jar, but I need to be able to
    determine whether the login was successful without waiting until I
    access a secured EJB. Why does wlclient.jar behave differently than
    weblogic.jar? How can I determine if my login worked if Weblogic is
    going to return a Subject no matter what username/password I pass in?

    Hi,
    I have a similar problem when using wlclient.jar. I am able to authenticate using
    the UsernamePasswordLoginModule (with authOnLogin true), but I get an error when
    invoking a secured EJB:
         UsernamePasswordLoginModule.initialize(), debug enabled
         UsernamePasswordLoginModule.initialize(), authOnLogin enabled
         UsernamePasswordLoginModule.login(), username weblogic
         UsernamePasswordLoginModule.login(), URL t3://localhost:7001
         Logged in
         Invoking EJB
         java.rmi.AccessException: CORBA NO_PERMISSION 0 Maybe; nested exception is:
              org.omg.CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: Maybe
              at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:95)
              at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
    The login is successfull, but I get the org.omg.CORBA.NO_PERMISSION when invoking
    the EJB. If I replace wlclient.jar with weblogic.jar it works fine! But we can't
    use weblogic.jar in our deployed client, because a) it's HUGE, b) it conflicts
    with Ant 1.6.1.
    Any ideas?
    "Memo S" <[email protected]> wrote:
    >
    Here is the answer
    A UsernamePasswordLoginModule LoginModule was added for use by the IIOP
    thin-client.
    This class has the same API as that of the weblogic.security.auth.login.UsernamePasswordLoginModule
    class, but in this implementation, there is a new property called authOnLogin.
    When true, this property forces the login method to perform authentication
    (rather
    than on the first invocation). The default for this new property is false.
    Regards.
    Memo S
    "Ganapathi" <[email protected]> wrote:
    If I run the JAAS example (examples/security/jaas) that comes with
    wl8.1 sp1 but use wlclient.jar instead of weblogic.jar, the
    LoginContext.login() method returns a Subject even if I pass in an
    invalid user/password combination. If weblogic.jar is in the
    classpath, a javax.security.auth.login.LoginException is thrown which
    is what I want to happen for invalid credentials. When running with
    wlclient.jar, the code doesn't fail until it actually attempts to
    access the EJB at which point it gets a org.omg.CORBA.NO_PERMISSION.
    I am trying to use JAAS to login from a swing app and I want to use
    wlclient.jar instead of weblogic.jar, but I need to be able to
    determine whether the login was successful without waiting until I
    access a secured EJB. Why does wlclient.jar behave differently than
    weblogic.jar? How can I determine if my login worked if Weblogic is
    going to return a Subject no matter what username/password I pass in?

  • Exception : SubjectManager not installed when doing Security.runAs()

    Hi
    I am getting an exception : Subjectmanager not installed while running Security.runAs(new Subject , .....
    The problem occurs onley when there is only wlclient.jar in the classpath .
    Anyone knows the solution
    I don't want to add weblogic.jar in the classpath .

    Sachin Shukla <> writes:
    Initialization of the client jar is a hairy dance. It generally
    happens implicitly when an ORB is created. This sounds like a use-case
    we missed. If you create your initial context first it should probably
    resolve itself.
    andy
    I am getting the exception "SubjectManager not installed" when calling Security.runAs with thin client jar. This is the first statement on entering main(). This error doesnt occur when using weblogic.jar.
    I was doing this because the principal and credentials set on main thread, for JNDI authentication were getting passed to all the child threads. To evade this, I thought of calling the following code in every new thread - Security.runAs(new Subject(), new PriviledgedAction(){
    public Object run(){
    //do stuff
    Thanks in advance
    Sachin

  • Weblogic.jar vs wlclient.jar problems

    Hi,
    I have a swing client and am trying to get authentication working correctly.
    A problem i am running across occurs when i try to login using empty strings.
    new LoginContext("Sample", new SampleCallbackHandler("", "", server));
    With weblogic.jar, no exceptions are thrown.
    With wlclient.jar, this is thrown: "UsernamePasswordLoginModule Error: NamingException on authenticate, Unhandled exception in lookup"
    Is this a bug, or am i doing something wrong? Thanks in advance.
    Chetan

    Hello Sir
    Did u solve the problem
    i am also getting the same problem
    please help me if u found the solution

  • JAAS authentication is not working with IIOP and wlclient.jar

    Hi,
    I'm currently working on a remote client that requires authentication with JAAS.
    The Application server is Weblogic 9.2 MP1.
    The client is deployed with wlclient.jar and the used protocol is iiop.
    I'm also using the default UsernamePasswordLoginModule module for authentication.
    The LoginContext.login goes smoothly but the Principal Set in the obtained Subject object is empty!
    Using the same code with weblogic.jar and t3 protocol the principals are filled(i.e. I can see the groups where the involved user is member).
    Any suggestions ??
    regards,
    Luca

    So, when you execute this, where exactly does it crash/stop, or what is the output you get from those dbms_output lines? Do you know the output of memberOf and are you sure that things will match?

  • HT204053 i want to change my icloud id on my iPhone, but it won't let me now that i have upgraded.  I no longer have the password and the problem is It is using an old id which the email isn't valid and the security question does not think my birthday is

    I want to change my icloud id on my iPhone, but it won't let me now that i have upgraded.  I no longer have the password and the problem is It is using an old id which the email isn't valid and the security question does not think my birthday is valid.  I cannnot delete the account because "find my iphone" wants the password linked to this old account.  But when i go into the find my iphone app it is using my corect Apple ID.  How do i fix this?

    If you still have access to your old email address, go to https//appleid.apple.com, click Manage my Apple ID and sign in with your iCloud ID.  Tap edit next to the primary email account, tap Edit, change it back to your old email account and verify it.  Then edit the name of the account to change it back to your old email address.  You can now use your current password to turn off Find My iPhone on your device. Then go to Settings>iCloud, tap Delete Account and choose Delete from My iDevice when prompted (your iCloud data will still be in iCloud).  Next, go back to https//appleid.apple.com and change your primary email address and iCloud ID name back to the way it was.  You can now go to Settings>iCloud and sign in with your correct iCloud ID and password.
    If you don't have access to your old email address, you will have to contact Apple to have them reset the password so you can disable Find My iPhone and sign into your iCloud account.  You can either go to https://expresslane.apple.com, select "More Products and Services", then "Apple ID", then  on the next page select "Other Apple ID Topics", then "Lost or forgotten Apple ID password" and click "Continue"; or you can contact Apple Support (http://www.apple.com/support/icloud/contact/).

Maybe you are looking for