Comparing Strings...weird problem

hello. I have kind of a weird problem going on here. I am attemping to write a java app that will read input from a file character by character and append each character to a String object, halt when it comes to either a whitespace (' '), a newline ('\n'), a tab ('\t'), or the end of the file (-1). Im basically just having the file read in one string at a time. Anywho, when ever i go to compare the string i read in from the file with another string in an if statement, it always comes up false, even when the values are exactly the same. Any ideas of what i might be doing wrong? Here's the code for u java gurus ;).
import java.io.*;
class UpdateHalls
private static String myString;
private static FileReader inFile;
public static void main(String[] args)
try
inFile = new FileReader("test.txt");
myString = new String();
getString();
System.out.println(myString);
if (myString == "this")
System.out.println("it worked");
else
System.out.println("nope");
inFile.close();
catch(IOException ex)
     System.out.println(ex);
private static void getString()
char myChar;
String tempString = new String();
try
myChar = (char)inFile.read();
     while ((myChar != ' ') && (myChar != '\n') && (myChar != '\t') && ((int)myChar != -1))
     tempString = tempString + myChar;
     myChar = (char)inFile.read();
catch(IOException ex)
System.out.println(ex);
myString = tempString;
BTW, the very first word in the file is "this".
Thanks a lot!

Another method that you can use is String.compareTo(String)This method returns an int which is 0 only if the two strings are equal... for example
String st1 = "this is a string";
String st2 = "this is another string";
//this won't return 0 because they aren't equal
if(st1.compareTo(st2) == 0) System.out.println("They are equal")
//this will return 0 because they are equal
if(st1.compareTo("this is a string" == 0) System.out.println("They are equal");This isn't neater than .equals() , but it's another way when dealing with strings

Similar Messages

  • Weird problem i have with JTextField

    I have a weird problem with this code...
    if
    JTextField.setText("value")
    then why is
    JTextField.getText() == "value"
    false?
    Can somebody please tell me why this happens....
    The applet below illustrates the problem
    public class help extends javax.swing.JApplet {
    private javax.swing.JTextField Sample;
    public help() {
    initComponents();
    DemonstrateProblem();
    public void DemonstrateProblem()
    System.out.println(Sample.getText());
    if(Sample.getText() == "value")
    System.out.println("This is what you think will happen");
    else
    System.out.println("But instead you end up here");
    System.out.println("Why????");
    private void initComponents()
                   Sample = new javax.swing.JTextField();
                   Sample.setText("value");

    Thanks for the help...
    I didn't realize that by using "==" i was comparing the objects and not the strings they contained.. (did i get that right??)
    anyways i used your suggestion and now it works....
    I am posted my new code for thoose who may want to learn from my mistake
    public class help extends javax.swing.JApplet {
    private javax.swing.JTextField Sample;
         private java.lang.String StrSample;
    public help() {
    initComponents();
    DemonstrateProblem();
    public void DemonstrateProblem()
              System.out.println("This is what Sample =");
    System.out.println(Sample.getText());
              System.out.println("This is what StrSample =");
              System.out.println(StrSample);
    if(StrSample.equals("value"))
    System.out.println("This is what you think will happen");
    else
    System.out.println("But instead you end up here");
    System.out.println("Why????");
    private void initComponents()
                   Sample = new javax.swing.JTextField();
                   Sample.setText("value");
                   StrSample = Sample.getText();

  • How to compare string in a case-insensitive manner using JavaScript?

    Hello everyone,
    Now I have a javascript to compare checkbox's value with user's input, but now seems it only can compare case-sensitively, does some one know if there is a function in javascript that it can compare string case-insensitively ?
    Here is my script :
    function findOffice(field)
    var name;
    name=prompt("What is the office name?");
    var l = field.length;
    for(var i = 0; i < l; i++)
    if(field.value==name)
    field[i].checked=true;
    field[i].focus();
    field[i].select();
    break;
    <input type="button" name="Find" value="Find And Select" onClick="findOffice(form1) >
    Thanks in advance !
    Rachel

    Thank you so much, I already solved the problem with your advice.
    You really have a beautiful mind, :-).
    I appreciate your help !
    Rachel

  • Comparing string in select query

    Hi,
    select single *
           from mara
           where <b>matnr = wa-matnr</b>.
    Here matnr is char18. Can we compare string like this?
    When <b>wa-matnr</b> is in <b>lower case</b> it is setting sy-subrc = 4, even though the matnr exists in mara. When converted to upper case and used it is setting sy-subrc = 0.
    Is there any other solution for the problem? I have checked out with matnr's conversion routine. It is also not working.

    just try  dat way...
    <b>ex...</b>
    data:wa_matnr like mara-matnr.
    data:wa_matnr1 like mara-matnr.
    data: gv_matnr like mara-matnr.
    wa_matnr = 'comptest'.
    CALL FUNCTION 'TERM_TRANSLATE_TO_UPPER_CASE'
      EXPORTING
       LANGU                     = SY-LANGU
        TEXT                     = wa_matnr
    IMPORTING
       TEXT_UC                   = wa_matnr1
    EXCEPTIONS
      NO_LOCALE_AVAILABLE       = 1
      OTHERS                    = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    select single matnr
    from mara into gv_matnr
    where matnr = wa_matnr or matnr = wa_matnr1.
    write : gv_matnr.

  • Cancel button weird problem

    im trying to program a game that works with JOptionPane, and ive come to this weird problem:
    this works fine but throws a null pointer exeption when i press the cancel button:
    if (e.getSource() == easy)     {
    do {
         word = JOptionPane.showInputDialog (x.create(1));
    result = "" + ((x.right(word)) ? "YOU GUESSED!" : "YOU MISSED!");
    JOptionPane.showMessageDialog (null, result);
    while (palabra != null);
    but when i try to catch the exeption:
    if (e.getSource() == easy)     {
    try {
    do
         word = JOptionPane.showInputDialog (x.create(1));
    result = "" + ((x.right(word)) ? "YOU GUESSED!" : "YOU MISSED!");
    JOptionPane.showMessageDialog (null, result);
    while (word != null);
    catch (NullPointerException no){}
    The weird thing happens:
    the first time i press cancel it works fine but if i press easy again and then cancel it just reloads the input dialog and if i press cancel again it works, but if i do easy again, this time i have to press cancel 4 times for it to work, and if i press easy again i need 8 cancel, then 16 and so on....
    i have no idea why this happens....
    can anybody give me some help?
    thank you.

    /* the error takes place when presing the cancel button
         to make this work press "press me first" and then activate me will show the
         window, presing cancel and then again activate me makes everithing worse */
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class sample     {
    static JButton neu = new JButton("Press Me!");
    JButton act = new JButton("Activate Me!");
    String word,result;
    public Component createComponents() {
    neu.setMnemonic('i');
    neu.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
         act.addActionListener(this);
    if (e.getSource() == act)     {
            do
             word = JOptionPane.showInputDialog ("press cancel");
             result = "" + ((word.equals("cancel")) ? "yes!" : "cancel!!!");
             JOptionPane.showMessageDialog (null, result);
            while (word != null);
         JPanel pane = new JPanel();
            pane.setLayout(new GridLayout(0, 10));
         pane.add(act);
         return pane;
    public static void addComponentsToPane(Container newbie) {
    newbie.setLayout(new GridLayout(5,5,5,5));
    newbie.add(neu);
    private static void createAndShowGUI() {
            JFrame frame = new JFrame("Demo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            addComponentsToPane(frame.getContentPane());
            frame.pack();
            frame.setVisible(true);
    public static void main(String[] args) {
    try {                              
                UIManager.setLookAndFeel(
                    UIManager.getCrossPlatformLookAndFeelClassName());
            } catch (Exception e) { }
    JFrame frame = new JFrame("LETTERAMA");
            sample app = new sample();
            Component contents = app.createComponents();
            frame.getContentPane().add(contents, BorderLayout.CENTER);
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
          frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
           frame.pack();
            frame.setVisible(true);
    //ps. sorry for the horrible grids, i was kind of in a hurry

  • Weird problem with role assignment in Portal

    Hi,
    In our newly installed Portal for eRecruitment Production System we encounter a weird problem with assigning roles to users.
    When I open User Administration and search for roles, it displays the Portal roles perfectly.
    However, when I search for a user in User Administration and click on it when found, I am unable to find any roles to assign! So I am unable to find any roles, when I want to modify the assigned roles for a particular user, while the roles do exist and can be found on its own. How is this possible? Am I missing something here?
    We have installed SPS 15 and use ABAP as user store. We have used reverse proxy and web dispatchers in this case.
    Thanks in advance and best regards,
    Jan Laros

    Found some entries in the default trace from this morning:
    #1.#005056A15F78006A000004F400006D310004520B11DB3CE8#1216107404407#com.sap.security.core.jmx.impl.CompanyPrincipalFactory#sap.com/tc~wd~dispwda#com.sap.security.core.jmx.impl.CompanyPrincipalFactory.static Set evaluateDatasourcesToSearchFor(String[] requestDatasourceIds,     String privateType, Locale locale)#JALAROS#58762##nun.efteling.nl_POP_9750151#JALAROS#581700b0524011ddc029005056a15f78#SAPEngine_Application_Thread[impl:3]_36##0#0#Error##Java###Error while connecting to remote producer {0}
    [EXCEPTION]
    {1}#2#PRODUCER_0KTHQ3YTJV#com.sap.security.core.persistence.remote.CommunicationException: Cannot display remote roles of selected producer. The producer has removed your consumer instance from their portal.
            at com.sap.portal.ivs.global.roles.RemoteProducerAccessImpl.sendToRemote(RemoteProducerAccessImpl.java:497)
            at com.sap.portal.ivs.global.roles.RemoteProducerAccessImpl.checkConnectivity(RemoteProducerAccessImpl.java:220)
            at com.sap.security.core.jmx.impl.CompanyPrincipalFactory.evaluateDatasourcesToSearchFor(CompanyPrincipalFactory.java:656)
            at com.sap.security.core.jmx.impl.CompanyPrincipalFactory.simplePrincipalSearchByDatasources(CompanyPrincipalFactory.java:3172)
            at com.sap.security.core.jmx.impl.JmxSearchHelper.getSimpleEntitySearchResult(JmxSearchHelper.java:74)
            at com.sap.security.core.jmx.impl.JmxSearchHelper.calculateSimpleEntityTable(JmxSearchHelper.java:1182)
            at com.sap.security.core.jmx.impl.JmxServer.calculateSimpleEntityTableByDatasources(JmxServer.java:1061)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
            at java.lang.reflect.Method.invoke(Method.java:391)
            at com.sap.pj.jmx.introspect.DefaultMBeanInvoker.invoke(DefaultMBeanInvoker.java:58)
            at javax.management.StandardMBean.invoke(StandardMBean.java:286)
            at com.sap.pj.jmx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:944)
            at com.sap.pj.jmx.server.interceptor.MBeanServerWrapperInterceptor.invoke(MBeanServerWrapperInterceptor.java:288)
            at com.sap.engine.services.jmx.CompletionInterceptor.invoke(CompletionInterceptor.java:409)
            at com.sap.pj.jmx.server.interceptor.BasicMBeanServerInterceptor.invoke(BasicMBeanServerInterceptor.java:277)
            at com.sap.jmx.provider.ProviderInterceptor.invoke(ProviderInterceptor.java:258)
            at com.sap.engine.services.jmx.RedirectInterceptor.invoke(RedirectInterceptor.java:340)
            at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
            at com.sap.engine.services.jmx.MBeanServerSecurityWrapper.invoke(MBeanServerSecurityWrapper.java:287)
            at com.sap.engine.services.jmx.ClusterInterceptor.invoke(ClusterInterceptor.java:776)
            at com.sap.pj.jmx.server.interceptor.MBeanServerInterceptorChain.invoke(MBeanServerInterceptorChain.java:330)
            at com.sap.security.core.jmx._gen.IJmxServer$Impl.calculateSimpleEntityTableByDatasources(IJmxServer.java:717)
            at com.sap.security.core.wd.jmxmodel.JmxModelCompInterface.calculateSimpleEntityTable(JmxModelCompInterface.java:396)
            at com.sap.security.core.wd.jmxmodel.wdp.InternalJmxModelCompInterface.calculateSimpleEntityTable(InternalJmxModelCompInterface.java:443)
            at com.sap.security.core.wd.jmxmodel.wdp.InternalJmxModelCompInterface$External.calculateSimpleEntityTable(InternalJmxModelCompInterface.java:746)
            at com.sap.security.core.wd.umeuifactory.UmeUiFactoryCompInterface.getSimpleEntityTable(UmeUiFactoryCompInterface.java:471)
            at com.sap.security.core.wd.umeuifactory.wdp.InternalUmeUiFactoryCompInterface.getSimpleEntityTable(InternalUmeUiFactoryCompInterface.java:517)
            at com.sap.security.core.wd.umeuifactory.wdp.InternalUmeUiFactoryCompInterface$External.getSimpleEntityTable(InternalUmeUiFactoryCompInterface.java:894)
            at com.sap.security.core.wd.relaterole.RelateRoleComp.searchNewRoles(RelateRoleComp.java:259)
            at com.sap.security.core.wd.relaterole.wdp.InternalRelateRoleComp.searchNewRoles(InternalRelateRoleComp.java:282)
            at com.sap.security.core.wd.relaterole.AssignParentRolesView.onActionSearchNewRoles(AssignParentRolesView.java:215)
            at com.sap.security.core.wd.relaterole.wdp.InternalAssignParentRolesView.wdInvokeEventHandler(InternalAssignParentRolesView.java:261)
            at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
            at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
            at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)
            at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)
            at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
            at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
            at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:313)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingPortal(ClientSession.java:733)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:668)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
            at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
            at com.sap.tc.webdynpro.clientserver.session.core.ApplicationHandle.doProcessing(ApplicationHandle.java:73)
            at com.sap.tc.webdynpro.portal.pb.impl.AbstractApplicationProxy.sendDataAndProcessActionInternal(AbstractApplicationProxy.java:860)
            at com.sap.tc.webdynpro.portal.pb.impl.localwd.LocalApplicationProxy.sendDataAndProcessAction(LocalApplicationProxy.java:77)
            at com.sap.portal.pb.PageBuilder.updateApplications(PageBuilder.java:1257)
            at com.sap.portal.pb.PageBuilder.SendDataAndProcessAction(PageBuilder.java:325)
            at com.sap.portal.pb.PageBuilder$1.doPhase(PageBuilder.java:826)
            at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processPhaseListener(WindowPhaseModel.java:755)
            at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.doPortalDispatch(WindowPhaseModel.java:717)
            at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:136)
            at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)
            at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)
            at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:313)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
            at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
            at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
            at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
            at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
            at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)
            at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)
            at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
            at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
            at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
            at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
            at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
            at java.security.AccessController.doPrivileged(AccessController.java:180)
            at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
            at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    #1.#005056A15F780060000004FD00006D310004520C6A35F87C#1216113181849#com.sap.engine.services.security.roles.SecurityRoleReference##com.sap.engine.services.security.roles.SecurityRoleReference#J2EE_GUEST#0####399cb180524e11dd9849005056a15f78#SAPEngine_Application_Thread[impl:3]_37##0#0#Error#1#/System/Security/Audit/J2EE#Java###{0}: Authorization check for caller assignment to J2EE security role [{1} : {2}] referencing J2EE security role [{3} : {4}].#5#ACCESS.ERROR#service.naming#jndi_all_operations#SAP-J2EE-Engine#administrators#
    #1.#005056A15F78005C00000C0500006D310004520C6A394185#1216113181992#com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl##com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl#J2EE_GUEST#0####39aa6d20524e11ddaee2005056a15f78#SAPEngine_Application_Thread[impl:3]_29##0#0#Error#1#/System/Server#Java###Runtime exception occurred while processing external JMX request [ JMX request (java) v1.0 len: 150 |  src: 2 target-node: 9750150 req: getAttribute params-number: 2 params-bytes: 0 |  ]
    [EXCEPTION]
    {0}#1#com.sap.engine.services.jmx.exception.JmxSecurityException: Caller J2EE_GUEST not authorized, only role administrators is allowed to access JMX
            at com.sap.engine.services.jmx.EngineAuthorization.checkMBeanPermission(EngineAuthorization.java:88)
            at com.sap.engine.services.jmx.auth.UmeAuthorization.checkMBeanPermission(UmeAuthorization.java:77)
            at com.sap.engine.services.jmx.JmxServerFrame.checkMBeanPermission(JmxServerFrame.java:98)
            at com.sap.engine.services.jmx.MessageClientSecurityWrapper.checkPermissions(MessageClientSecurityWrapper.java:76)
            at com.sap.engine.services.jmx.MessageClientSecurityWrapper.invokeMbs(MessageClientSecurityWrapper.java:38)
            at com.sap.engine.services.jmx.ClusterInterceptor.invokeMbs(ClusterInterceptor.java:196)
            at com.sap.engine.services.jmx.ClusterInterceptor.getAttribute(ClusterInterceptor.java:512)
            at com.sap.engine.services.jmx.MBeanServerInterceptorInvoker.invokeMbs(MBeanServerInterceptorInvoker.java:84)
            at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImpl.invokeMbs(P4ConnectorServerImpl.java:61)
            at com.sap.engine.services.jmx.connector.p4.P4ConnectorServerImplp4_Skel.dispatch(P4ConnectorServerImplp4_Skel.java:64)
            at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:313)
            at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199)
            at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136)
            at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
            at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
            at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
            at java.security.AccessController.doPrivileged(AccessController.java:180)
            at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
            at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

  • Connecting through firewall (weird problem)

    Hello,
    I'm having a very weird problem with JMX on a Linux server. I'm aware of the fact that the out-of-the-box JMX agent doesn't work with firewalls and I'm using a custom agent or rather I'm trying to. The problem is that JConsole/Custom Client fails to connect to the agent with a NoSuchObjectException.
    The Server side code looks as follows
    public class TestServer {
    public static void main(String[] args) throws Exception {
    System.setProperty("java.rmi.server.randomIDs", "true");
    LocateRegistry.createRegistry(15003);
    MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    JMXServiceURL serviceUrl = new JMXServiceURL(
    "service:jmx:rmi://localhost:15002/jndi/rmi://localhost:15003/jmxrmi");
    JMXConnectorServer connectorServer = JMXConnectorServerFactory
    .newJMXConnectorServer(serviceUrl, null, mbs);
    connectorServer.start();
    Thread.sleep(Integer.MAX_VALUE);
    The Client side code looks as following
    public class TestClient {
    public static void main(String[] args) throws Exception {
    JMXServiceURL u = new JMXServiceURL(
    "service:jmx:rmi:///jndi/rmi://ec2-67-202-2-113.z-2.compute-1.amazonaws.com:15002/jmxrmi");
    JMXConnector c = JMXConnectorFactory.connect(u);
    The Exception I'm getting is
    Exception in thread "main" java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.NoSuchObjectException: no such object in table]
         at javax.management.remote.rmi.RMIConnector.connect(Unknown Source)
         at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
         at javax.management.remote.JMXConnectorFactory.connect(Unknown Source)
         at foo.bar.TestClient.main(TestClient.java:12)
    The Java version on the Server is
    java version "1.6.0_02"
    Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
    Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)

    You were right. There was one more thing though which I figured out with Wireshark/Ethereal. The machines in Amazon's EC2 Network are running behind a NAT or something and I had to specify the external address with -Djava.rmi.server.hostname=BlaBlub.

  • Weird problem with the apple tv (3rd gen) playing choppy iTunes Music

    I have a weird problem with the apple tv(3rd gen) when i use my macbook pro to play itunes music via airplay the music is extremely choppy however that only happens if I have both my mac and apple tv connected to the same 5 ghz band on my dual band wifi network if i switch either one of my mac or apple tv to the 2.4 ghz band it works fine. I would like to find a solution instead of having to do this work around because i prefer my 5 ghz band for both my mac and apple tv and have my other things connected to my 2.4 ghz.

    5 GHz, so far as I'm aware transfers no more data than 2.4 Ghz. There are other things involved that might help data through volume such as the wifi standard or dual width channels, but essentially if you compare like for like they are they same for the amount of data they can send. The main advantage of 5GHz is that it's less susceptible to interference and potentially more private.
    It's possible that you have different issues on each band, I couldn't say at this time but have you checked for interference.

  • Weird problem With my Audigy 4

    Hi all, I have a weird problem with my audigy 4. When I install the Nvidia IDE and Sata driver for my motherboard, I get sound problem in BF2, It glitches, I don't here my gun, well it's all ****ed up. Does anyone know why?Thanks in advance.

    I have had every iphone model ever made. I have never had a problem like this before. It appears that there are small spots all over the screen. Not to be confused with the "yellow spots" other iphone 4 user have been reporting due to the glue not drying before they reached the customer. This is a different type of spot. I would compare it to a petrie dish that scientist test for things in.
    The only thing I can think of is something is happening with the coating over the glass (oleophobic coating maybe braking down?). It only happened on the front screen and not the back glass. You can get the spots to go away when you use a micro fiber cloth to remove the natural oil from your face against the phone. The minute you start using the phone again, they appear. They are kinda annoying and make your phone screen look dirty and have a weird glare in it when your in the sun.
    I made an appointment tomorrow to go to the apple store to see what they can tell me. Hope fully its nothing major. The worst thing that could happen is the phone gets replaces by another. Ill keep everyone update.

  • Jspinner weird problem

    Hi all,
    I have this weird problem with Jspinners when I try to run this code. When I run it, the second spinner shows the date (while the first one only shows the time) and they are both larger than they are supposed to be (try resizing after it shows up)
    Any help would be greatly appreciated.
    // CODE STARTS HERE ////////////////////////////////
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    public class Test {
         public static void main(String args[]) {
              TimeSpinner spin1 = new TimeSpinner();
              TimeSpinner spin2 = new TimeSpinner();
              JFrame frame = new JFrame();
                   frame.getContentPane().setLayout(new FlowLayout());
                   frame.getContentPane().add(spin1);
                   frame.getContentPane().add(spin2);
                   frame.setSize(300,300);
                   frame.show();
    class TimeSpinner extends JSpinner {
         public TimeSpinner() {
              super();
              // spinner date model
              SpinnerDateModel sdm = new SpinnerDateModel();
              sdm.setCalendarField(Calendar.MINUTE);
              this.setModel(sdm);
              try {
                   this.commitEdit();
              } catch (Exception e) {
                   e.printStackTrace();
              JSpinner.DateEditor de = (JSpinner.DateEditor)this.getEditor();
              de.getFormat().applyPattern("hh:mm a");
         public void setFixedSize(int width, int height) {
              Dimension fixedDimension = new Dimension(width, height);
              this.setMinimumSize(fixedDimension);
              this.setMaximumSize(fixedDimension);
              this.setPreferredSize(fixedDimension);

    The problem is in the format. The format supplied by the standard API does exactly what you described. The alternative is to create your own format or (better) your own formatter.
    I ended up creating my own DateSpinner which is not too difficult.
    Cheers,
    Didier

  • Apple Banned me, because of a very weird problem with my "Factory Unlocked"

    Hi Everybody! Im having a very weird problem with my unlocked iphone 4.
    First of all, i would like to apologize because of my english, is not very good. My native language is Spanish.
    Well.. Im from Mexico, and here we can buy the iphone Unlocked on the Apple Online Store.
    Here's my problem. Apple has exchanged my iphone 3 times.
    I returned the iphone the first time because the screen was totally yellowish, other than that everything was working great!, that was by the end of September.
    On October 20th, i recieved my second iphone, and then a bigger problem started .
    Before i continue, let me give you this information: here in Mexico we have basically 3 cell phone companies
    1.- Telcel
    2.- Movistar
    3.- Unefon
    OK, now on october 20th, i recieved my second iphone, and then procced to activate via itunes using my UNEFON sim card (microsim).
    And every time i tried to activate it, only got this message onscreen:
    http://i148.photobucket.com/albums/s2/jorgelomeli/Screenshot2010-10-29at24915PM. png
    I though something was wrong with my brand new factory unlocked iphone 4.
    I have 4 more simcards from my brothers (they all had iphone 4 too)
    I tried telcel sim card, and i could activate my iphone. Then i insterted the Movistar microsim, and it worked too!! But then when i put the Unefon sim, the itunes logo inmediatly appears on the screen asking to activate on itunes, and when i tried that, the only response i got was the image above saying " The Simcard inserted on this iphone does not appear to be supported"
    Weird thing here is, that, when i put my Unefon sim card on my brothers iphone 4, it worked great! on all of them, internet 3g, phone, wireless , evrything!
    I called apple support, and they exchange the iphone for another one.
    I recieved the third iphone on October 29. Last friday. and guess what? SAME PROBLEM! different serial number, same week production (week 42) but exactly the same message on itunes.
    Very, very frustrated, i called apple again, and after 1 hour with thechnical support, they told me " We are sorry, but we can only offer you, your money back, NO MORE EXCHANGES FOR YOU"
    I said why?... i dont want my money back! i want an UNLOCKED iphone!, but they refuse to give me another iphone.
    When i asked techincal support, why my unefon sim card worked great on all three of my brothers iphone but not on mine, he just told me, "I really dont know, i guess they just got lucky" ****, this answer put all my trust i had on apple products for years, right on the garbage.
    Since they refused to give me another iphone, i accepted my money back, and inmediatly after i finished the call, i asked my brother to buy me one more time an iphone 4 using his name, and his credit card. Now i have to wait until November 8-12 to recieve my new iphone, hoping this time i get a REAL UNLOCKED iphone, and not a partially unlocked iphone.
    btw. i even went to Unefon costumer service and bought a new prepiad line, with a new microsim, just to be 100% sure that this problem is not because of the sim. And again didnt worked on my iphone, but it worked on any of my brothers iphone4.
    Serial numbers of the 3 iphones:
    79039C0U* (this one worked great with Unefon, only problem was yellow screen)
    85042GR4*
    81042FJB*
    What do you suggest me? any info would be really aprecciated
    FYI i also restore 4 times the last iphone and nothing seemed to work, i use 3 different computers, Macbook Pro, iMac, and an Hp with Windows 7, and the same message on all three computers.
    Wierd thing also, one of my brothers bougth an iphone 4 this last week too, but he bought the 16Gb not the 32Gb. His iphone production week is 42 also! and when i put my Unefon sim in his iphone works great!
    I dont know what else i can do, I just need to have faith that my new iphone coming this november will be real unlocked, but what if i'll recieve an iphone and then the same problem?? time for android? just kidding really guys, what can i do? anyone with similar problem like me? i dont wanna use Telcel or Movistar, i wanna use Unefon, and thats why i bought an Unlocked iphone
    btw: jailbreak is not a solution for me, because i always like to use legal software on all my apple products, and because of the warranty.

    According to http://support.apple.com/kb/HT1937, there are two official carriers in Mexico (Movistar and Telcel) and neither carrier offers an unlocked phone.

  • Iphone 4, having a weird problem /: can't seem to fix it!

    So i have been having my iphone for a while, i have no warranty on the phone now. I have this weird problem that when i scoll down my messages and stuff i can see the outline of the message kind of show rainbowish colors that sort of show a bit when i scroll, right near the border of the message. its kind of annoying at times, also there are times when i press the home button, right when i get to my wallpaper, the outline of the letters when i text are there like very very faint, they disappear after for a while but then come back sort of like a glitch, and i cant fix it at all. then i would see faint horizontal lines, i would notice them when i use the camera, they disappear also. can anyone help me with this or suggest something?

    Screen lag is normaly the LCD itself. But try restoring the iPhone. http://support.apple.com/kb/HT1414

  • Hiya, I've got a weird problem with my iPhone4. On the 'home page' of my iPhone the mail symbol tells me there's a new mail waiting for me. However, there's no new mail to be found. Does anyone know what the problem is? Thanks

    Hiya, I've got a weird problem with my iPhone4. On the 'home page' of my iPhone the mail symbol tells me there's a new mail waiting for me. However, there's no new mail to be found. Does anyone know what the problem is? Thanks

    This response is a little late as I just read about your problem. I have a 2012 Dodge Charger and a 2012 Chrysler Town and Country and both worked flawlessly with the iPhone 5s my wife and I had. However, we just upgraded to the iPhone 6 and Uconnect will receive calls but you cannot answer them. You can callout successfully, however. the annoyance being the inability to answer incoming calls in the HandsFree mode.

  • SAP GUI 7.10p15 weird problem on FB70

    Hi all,
    We upgraded SAP GUI 7.10 to patch level 15 from patch level 14 using the install server on our Windows XP machines. A weird problem seems to appear since then on FB70. You press once or twice the ENTER key, without filling any field on the screen and the GUI stays on a busy state forever (trying to constantly redraw the screen as to show an error message on missing account number). It results to 100% CPU usage on the client (Windows XP machines, tried on Windows 7 also with same result) and seems to also stress the SAP system a bit. The only way to stop that behavior is to use the Windows task manager and kill the busy window. I have not seen this behavior before and can't reproduce it in any other transaction until now.
    I got access on a machine that was still on patch level 14 and works just fine. I did the upgrade and the same behaviour (busy, 100% CPU) instantly appears. Oddly enough, this behavior does not occur if I run FB70 throught the debugger (/h) in any case.
    Have you seen something like this or do you have any clue why that weird behavior might appear?
    Thank you very much in advance for any insight

    Hello Artemios,
    Yes, this seems to be a know issue with Patch 15. Please open a ticket on BC-FES-GUI to get a fix for that or wait until Patch 16 is released.
    Kind regards,
    Martin

  • Weird problem involving my external hard drive - help please!

    I recently got a formac mini 120 gb firewire hard drive, which had been working fine with my g4 quicksliver.
    i then went to a friends (g5 machine) with my drive and he put some data on it - bought it back to mine and managed to re connect the drive and take the data - no problem - very happy.
    I recently gave my drive to another friend using a g5 and when it came back, nothing - i don't get the drive symbol appearing. turned the comp on and off many times and tried re-connecting etc still no drive appearing.
    Then i took the drive to my friend with a mac lap top power book. connected there - working fine. Baffling. was happy that my data can still be accessed.
    I know it's not the firewire cable because i can get power to the drive - i can see the red light at the fron on.
    Can anyone help with this weird problem?
    Thanks

    Thought you could use this info about getting FireWire to work!
    First, you should always Repair Permissions in Disk Utility before and after any update; I would do that now. If you installed your update with FireWire plugged in, your Mac may not recognize it anymore.
    Try resetting your FireWire ports by disconnecting all FW devices, shut down your Mac and unplug it from AC power (wall socket) for 30 minutes. plug it back in and try FW.
    If that did'nt work, download the combo update from this site (yours may be corrupt), not Software Update, disconnect all firewire + USB devices except keyboard + mouse, Repair Permissions, re-install update, Repair Permissions again + try. Yours might be the 10.4.10 Combo update. I have no idea since you did not fill out your specs. fully when you signed in to this site. Others reading, download the Combo that applies to your system. This link is for PPC Macs not Intel Macs.
    If that still did'nt get it Zap the PRAM. While restarting Mac hold down the following key combo Command-Option-P-R. Keep holding those keys down till you hear the second start-up chime, then release.
    For those of you with Macs that are not PowerBooks or iBooks, a bad internal battery can cause FireWire to not be recognized, so make sure it's good! Also, here is Apple doc.#88338 on getting FireWire to work.
    Good Luck!
    Cheers!
    DALE

Maybe you are looking for

  • Disk Repair help

    Hi I am getting a message in disk repair that says "This drive has a hardware problem that can't be repaired.  Back up as much as possible and replace disk. See an Apple Dealer. It is Media S.M.A.R.T  status failing  (whatever that means) Does this m

  • Print to video not functioning - help?

    Trying to output a finished vid to my Panasonic AG-DVC30. Print to Vid command activates the camera, and it records... but the screen remains blue, and nothing is recorded on the dv tape. A poster named Hotzeug posted the same problem with his Canon,

  • Downloading and opening a PDF form

    I have been trying to download a form through safari which should arrive as a pdf. However instead of this a 'servlet' arrives on my desktop (which apparently contains all the info I need but is just a text edit list of commands for me) - I have trie

  • Help on stuck thread

    Hi, From my server log I noticed that there are some stuck threads. After looked at the thread dump thread 18 is blocking. MainPortalServlet.java is extends PortalServlet and line 96 is super.service(request,response); Please help me to analyse why i

  • My phone has been upgrading for a few days ,how do I stop it?

    My phone has been upgrading for a few days,how do I stop it?