Problems with c++ native methods

hello to all ,
     I am building an client-server application in java , which uses java native methods written
in c++ .In every client's request , the applcation updates a hashtable .The hashtable is kept as an
Object member variable in a java class .So updating the hashtable is like this : the native method is
called which accesses the Object member variable , updates the hashtable and sets the new Object
member variable value.
     That's the way that it should work ,but i am experiencing some serious problems because the jvm
keeps on crashing with UNEXCPECTED SIGNAL 11 .My distribution is Mandrake 9.0 ,and i use java
j2sdk1.4.1_01
Here some very naive questions i have to ask :
1.Is it possible that the jvm crashes because the size of the hashtable is not fixed ?
2.Can it be a system problem (like libgcc ) or else ?
     Any opinion on this would be very helpful
     Thanks in advance ,
          Sbile
P.S. Here the log file being created after every crash
Unexpected Signal : 11 occurred at PC=0x404657B6
Function=is_forwarded__C7oopDesc+0x6
Library=/usr/local/j2sdk1.4.1_01/jre/lib/i386/client/libjvm.so
Dynamic libraries:
08048000-0804e000 r-xp 00000000 03:06 463913 /usr/local/j2sdk1.4.1_01/bin/java
0804e000-0804f000 rw-p 00005000 03:06 463913 /usr/local/j2sdk1.4.1_01/bin/java
40000000-40011000 r-xp 00000000 03:06 278533 /lib/ld-2.2.5.so
40011000-40012000 rw-p 00010000 03:06 278533 /lib/ld-2.2.5.so
40013000-4001c000 r-xp 00000000 03:06 119905 /usr/local/j2sdk1.4.1_01/jre/lib/i386/native_threads/libhpi.so
4001c000-4001d000 rw-p 00008000 03:06 119905 /usr/local/j2sdk1.4.1_01/jre/lib/i386/native_threads/libhpi.so
4001e000-40021000 r--s 00000000 03:06 447528 /usr/local/j2sdk1.4.1_01/jre/lib/ext/dnsns.jar
40021000-40022000 r--s 00000000 03:06 198504 /usr/lib/kaffe/lib/microsoft.jar
40022000-4002f000 r-xp 00000000 03:06 573447 /lib/i686/libpthread-0.9.so
4002f000-40036000 rw-p 0000d000 03:06 573447 /lib/i686/libpthread-0.9.so
40036000-40038000 r-xp 00000000 03:06 278544 /lib/libdl-2.2.5.so
40038000-40039000 rw-p 00001000 03:06 278544 /lib/libdl-2.2.5.so
40039000-40150000 r-xp 00000000 03:06 573443 /lib/i686/libc-2.2.5.so
40150000-40155000 rw-p 00117000 03:06 573443 /lib/i686/libc-2.2.5.so
40159000-40471000 r-xp 00000000 03:06 119911 /usr/local/j2sdk1.4.1_01/jre/lib/i386/client/libjvm.so
40471000-40625000 rw-p 00317000 03:06 119911 /usr/local/j2sdk1.4.1_01/jre/lib/i386/client/libjvm.so
40635000-40646000 r-xp 00000000 03:06 278548 /lib/libnsl-2.2.5.so
40646000-40647000 rw-p 00011000 03:06 278548 /lib/libnsl-2.2.5.so
40649000-4066b000 r-xp 00000000 03:06 573445 /lib/i686/libm-2.2.5.so
4066b000-4066c000 rw-p 00021000 03:06 573445 /lib/i686/libm-2.2.5.so
4066c000-4067c000 r-xp 00000000 03:06 119915 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libverify.so
4067c000-4067e000 rw-p 0000f000 03:06 119915 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libverify.so
4067e000-4069f000 r-xp 00000000 03:06 119916 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libjava.so
4069f000-406a1000 rw-p 00020000 03:06 119916 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libjava.so
406a1000-406b6000 r-xp 00000000 03:06 119918 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libzip.so
406b6000-406b8000 rw-p 00014000 03:06 119918 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libzip.so
406b8000-41d86000 r--s 00000000 03:06 119961 /usr/local/j2sdk1.4.1_01/jre/lib/rt.jar
41dc9000-41de0000 r--s 00000000 03:06 119941 /usr/local/j2sdk1.4.1_01/jre/lib/sunrsasign.jar
41de0000-41e51000 r--s 00000000 03:06 119943 /usr/local/j2sdk1.4.1_01/jre/lib/jsse.jar
41e51000-41e64000 r--s 00000000 03:06 119942 /usr/local/j2sdk1.4.1_01/jre/lib/jce.jar
41e64000-42120000 r--s 00000000 03:06 119959 /usr/local/j2sdk1.4.1_01/jre/lib/charsets.jar
441c8000-441ca000 r--s 00000000 03:06 198471 /usr/lib/kaffe/lib/comm.jar
441ca000-441cc000 r--s 00000000 03:06 198505 /usr/lib/kaffe/lib/pjava.jar
441cc000-441d0000 r--s 00000000 03:06 185441 /usr/local/j2sdk1.4.1_01/lib/servlet.jar
4c3d3000-4c3fe000 r--p 00000000 03:06 212998 /usr/share/locale/ISO-8859-15/LC_CTYPE
4c3fe000-4c40c000 r--s 00000000 03:06 447534 /usr/local/j2sdk1.4.1_01/jre/lib/ext/ldapsec.jar
4c40d000-4c416000 r-xp 00000000 03:06 278554 /lib/libnss_files-2.2.5.so
4c416000-4c417000 rw-p 00008000 03:06 278554 /lib/libnss_files-2.2.5.so
4c61b000-4c638000 r--s 00000000 03:06 447527 /usr/local/j2sdk1.4.1_01/jre/lib/ext/sunjce_provider.jar
4c638000-4c6d7000 r--s 00000000 03:06 447529 /usr/local/j2sdk1.4.1_01/jre/lib/ext/localedata.jar
4c6d7000-4c6eb000 r--s 00000000 03:06 198506 /usr/lib/kaffe/lib/rmi.jar
4c6eb000-4cb9e000 r--s 00000000 03:06 185437 /usr/local/j2sdk1.4.1_01/lib/tools.jar
4cb9e000-4cc93000 r--s 00000000 03:06 198503 /usr/lib/kaffe/lib/kjc.jar
4cc93000-4cd9e000 r--s 00000000 03:06 198507 /usr/lib/kaffe/lib/rt.jar
4cd9e000-4cda6000 r--s 00000000 03:06 201714 /usr/lib/kaffe/lib/sax.jar
4cda6000-4cf61000 r--s 00000000 03:06 201715 /usr/lib/kaffe/lib/xerces.jar
4cf61000-4cf81000 r--s 00000000 03:06 201713 /usr/lib/kaffe/lib/jdom.jar
4cf81000-4cf85000 r-xp 00000000 03:06 266660 /home/sbile/diplomatikh/build/src/lib/libBuildHashTable.so
4cf85000-4cf86000 rw-p 00004000 03:06 266660 /home/sbile/diplomatikh/build/src/lib/libBuildHashTable.so
4cf95000-4d03e000 r-xp 00000000 03:06 508019 /usr/lib/libstdc++.so.5.0.0
4d03e000-4d054000 rw-p 000a8000 03:06 508019 /usr/lib/libstdc++.so.5.0.0
4d059000-4d060000 r-xp 00000000 03:06 278604 /lib/libgcc_s-3.2.so.1
4d060000-4d061000 rw-p 00007000 03:06 278604 /lib/libgcc_s-3.2.so.1
4d0e2000-4d0f2000 r-xp 00000000 03:06 119921 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libnet.so
4d0f2000-4d0f4000 rw-p 0000f000 03:06 119921 /usr/local/j2sdk1.4.1_01/jre/lib/i386/libnet.so
Local Time = Sat May 10 04:25:40 2003
Elapsed Time = 7
# HotSpot Virtual Machine Error : 11
# Error ID : 4F530E43505002E6
# Please report this error at
# http://java.sun.com/cgi-bin/bugreport.cgi
# Java VM: Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode)
# An error report file has been saved as hs_err_pid4063.log.
# Please refer to the file for further information.

The dreaded Signal 11 means you've overwritten some memory you're not supposed to.
Check that all of your array indexes are in range, that you're not accessing memory that's been freed etc etc.
Try placing print statements at strategic places in your native code to narrow down the problem

Similar Messages

  • Problems with loading native library/missing methods: no ttJdbcCS1121

    Hi guys,
    Im getting this problem in glassfish 2.1, but in glassfish 3 or in tomcat, i dont get this problem. (Windows)
    Any thoughts?
    java.sql.SQLException: Problems with loading native library/missing methods: no ttJdbcCS1121 in java.library.path
    at com.timesten.jdbc.JdbcOdbcConnection.connect(JdbcOdbcConnection.java:1750)
    at com.timesten.jdbc.TimesTenDriver.connect(TimesTenDriver.java:305)
    at com.timesten.jdbc.TimesTenDriver.connect(TimesTenDriver.java:161)
    at java.sql.DriverManager.getConnection(DriverManager.java:525)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at com.summitinvt.mdaq.db.handler.DBConnector.getConnection(DBConnector.java:108)
    at com.summitinvt.mdaq.db.handler.DBConnector.initiateConnection(DBConnector.java:101)
    at com.summitinvt.mdaq.db.handler.DBConnector.<init>(DBConnector.java:34)
    at com.summitinvt.mdaq.db.handler.DBConnector.<init>(DBConnector.java:14)
    at com.summitinvt.mdaq.db.handler.DBConnector$DBConnectorUtil.<clinit>(DBConnector.java:24)
    at com.summitinvt.mdaq.db.handler.DBConnector.getInstance(DBConnector.java:28)
    at com.summitinvt.mdaq.rats.server.CommunicatorImpl.getPnLByCurrency(CommunicatorImpl.java:1074)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:592)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:562)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:207)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:243)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:754)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
    at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:427)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:315)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:287)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
    at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:94)
    at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:222)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:166)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:648)
    at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:593)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:587)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:1093)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:291)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.invokeAdapter(DefaultProcessorTask.java:666)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.doProcess(DefaultProcessorTask.java:597)
    at com.sun.enterprise.web.connector.grizzly.DefaultProcessorTask.process(DefaultProcessorTask.java:872)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.executeProcessorTask(DefaultReadTask.java:341)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:263)
    at com.sun.enterprise.web.connector.grizzly.DefaultReadTask.doTask(DefaultReadTask.java:214)
    at com.sun.enterprise.web.portunif.PortUnificationPipeline$PUTask.doTask(PortUnificationPipeline.java:382)
    at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:264)
    at com.sun.enterprise.web.connector.grizzly.ssl.SSLWorkerThread.run(SSLWorkerThread.java:106)
    regards
    John

    A similar problem was reported before on this Forum - see
    Re: not able create connection to timesten
    checking the Release Notes I can see 11.2.1.8.0 has been tested against Glassfish 3 but I
    can't see any mention about Glassfish 2 in the v7 or v11 Release Notes (albeit only on a quick
    search).
    In my full install on XP, ttJdbcCS1121.dll is in C:\TimesTen\tt1121_32\bin

  • Problems with loading native library/missing methods:no ttJdbcCS in java.li

    Iam facing one problem while connecting the timesten client to the server The SQL Exception which Iam getting is pasted below:-
    Problems with loading native library/missing methods: no ttJdbcCS in java.library.path
    I am working with MAC OS X 10.7.2 and my timesten client version is 11.2.1.0
    I have also changed the Java Preferences from 64-bit to 32-bit but still whenever i tried to connect with the SQL Developer it gives me the above error.

    I just tried this out. My environment is OS X 10.7.4, Timesten (32-bit) client 11.2.1.9.0, SQL Developer 3.1.07, Oracle Java 1.7.0_04.
    The key things you need to be sure to do (in a terminal window) are:
    1. Be sure to . in the TimesTen environment script <tt_install_dir>/bin/ttenv.sh to set the full TT environment.
    2. Change directory to SQLDeveloper.app/Contents/Resources/sqldeveloper
    3. Run 'sh sqldeveloper.sh -J-d32'
    and all should be fine.
    Note that if you are using Java7 as I am then there is a step 1a. Change the CLASSPATH environment variable to specify ttjdbc6.jar not ttjdbc5.jar. For some reason running the app directly from Finder does not work even if you add -J-d32 into the sqldeveloper launch script. I'm still looking into that.
    Chris

  • Problems with loading native library missing methods ttJdbc1122.dll

    Problems with loading native library/missing methods: C:\TimesTen\tt1122_64\bin\ttJdbc1122.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform
    Hi,
    I have installed TimesTen 11.2.2 64-bit version on 64-bit windows 7.
    I have TimesTen 7 64-bit as well installed on my machice
    When trying to connect to TimesTen (Direct connection) using jdbc from eclipse, I get the following error "Problems with loading native library/missing methods: C:\TimesTen\tt1122_64\bin\ttJdbc1122.dll: Can't load AMD 64-bit .dll on a IA 32-bit platform".
    The JDK version is 1.6.25 - 64 bit version.
    Please help me resolving this error.
    Thanks in Advance,
    Balamurugan

    Are you using SQL Developer?
    There is or used to be a restriction of only being able to using 32 bit. A suggestion might be to try the 32 bit client.

  • TS3297 Why I can't download a free game I get a message that there's a problem with my payment method but not what it is this is a free app I tried support and got nowhere help

    Why can't I down load a free app  I get a message that there is a problem with my payment method but I gave all information correctly , I did recently change my card no because I lost my old one .i did change the no. On my account      HOPE YOU HAVE SOME SUGGESTIONS  I DON'T SEE WHY THEY HAVE TO CHECKMY PAYMENT METHOD FOR A FREE GAME

    Contact iTunes customer support.
    We're all users like yourself and as such have no access to your account.

  • Getting problem with DOMImplementation classes method getFeature() method

    hi
    getting problem with DOMImplementation classes method getFeature() method
    Error is cannot find symbol getFeature()
    code snippet is like...
    private void saveXml(Document document, String path) throws IOException {
    DOMImplementation implementation = document.getImplementation();
    DOMImplementationLS implementationLS = (DOMImplementationLS) (implementation.getFeature("LS", "3.0"));
    LSSerializer serializer = implementationLS.createLSSerializer();
    LSOutput output = implementationLS.createLSOutput();
    FileOutputStream stream = new FileOutputStream(path);
    output.setByteStream(stream);
    serializer.write(document, output);
    stream.close();
    problem with getFeature() method

    You are probably using an implementation of DOM which does not implement DOM level-3.

  • Problem with the renameTO method in the Linux environment

    Hi
    I got a problem with the renameTO method in the Linux environment. The file is not moving.
    This method is returning false. the same code executed successfully in Windows environment.
    Can anyone give some fix to this one or an alternate solution to move the files in both windows and Linux.
    boolean success;
    File root = new File(tempPath);
                   File f = new File(root, phyFileName);
                   File dest = new File(targetPath);
    success = f.renameTo(new File(dest, actualFileName));actualFileName = 400.doc
    dest = /home/jboss-4.0.3/axsscm_1.0/axsscmDocuments/xchange/fileup/fshare/PO/1786

    JITHENDRA wrote:
    Thanks for the prompt replyNo problem.
    >
    Can u solve the below doubt.
    Will renameTo method wont work in Linux? If so why?Did you not read what I said? I suspect you are trying to rename a file so that it actually has to be moved to a different volume (partition or hard disk) so it won't work. One would have the same problem on Windows trying to rename a file on the c: drive to a name on the d: drive.
    >
    >
    Can u give a sample or good link to do the above work which works fine in all environments.?Just follow the pseudo code I gave. 15 minutes work.

  • Problems with the dispatchEvent-Methode

    Hallo,
    I have a strange problem with above mentioned methode
    I have a JTextField, and I want that only numeric inputs are
    accepted, so I used a KeyListener -Interface in the following way
    public void keyTyped(KeyEvent e)
    JTextField field =(JTextField)e.getSource();
    char c =e.getKeyChar();
    if(c>57 | c<46 |c==47 &&c >31)
    field.dispatchEvent(e);
    the other methodes keyPressed and keyReleased are implemented in the same way.
    So if I type in now in my JTextField an 'a' or whatsoever
    then the following Exception occurs:
    java.lang.StackOverflowError
    at java.awt.Toolkit.getEventQueue(Toolkit.java:1483)
    at java.awt.EventQueue.setCurrentEventAndMostRecentTime(EventQueue.java:731)
    at java.awt.Component.dispatchEventImpl(Component.java:3448)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    at java.awt.Container.processEvent(Container.java:1566)
    at java.awt.Component.dispatchEventImpl(Component.java:3598)
    at java.awt.Container.dispatchEventImpl(Container.java:1623)
    at java.awt.Component.dispatchEvent(Component.java:3439)
    at ueberstd.ComputeHours.keyTyped(ComputeHours.java:128)
    at java.awt.Component.processKeyEvent(Component.java:5048)
    at javax.swing.JComponent.processKeyEvent(JComponent.java:2385)
    at java.awt.Component.processEvent(Component.java:4902)
    Mmh, and this is not the whole Exception message.
    There are missing a couple of lines.
    But may be one of you knows what my mistake is.
    Thanks advance.

    This is not the best way to validate for numerics. Check out the "Creating a Validated Text Field" section from the Swing tutorial:
    http://java.sun.com/docs/books/tutorial/uiswing/components/textfield.html#validation

  • Problems with loading native library/missing methods: no ttJdbc1121 in java

    Hi,
    Can anyone help me? I keep getting this error when trying to start my jboss server. I have no problem with this when i run my standalone java application. My jboss version is 4.2 and my timesten version is 11.2.1.6.1 . My oracle version is 10G express edition. Any ideas?
    Thank you very much.

    The TimesTen JDBC driver is not a pure Java driver. It requires to load several native code libraries. Most appservers have to be told what directories to search for those libraries (a bit like the O/S LD_LIBRARY_PATH variable). This error occures when you have not told the appserver where to look to find hte native code libraries (<tt_install_dir>/lib).
    I'm not a JBOSS expert so I can't advise you on this; you need to consult the JBOSS documentation to find out what parameter/setting you need to modify to fix this.
    Chris

  • Problem with blocked native processes

    My application relies heavily on native processes so that I am trying to implement fallback strategies if a native process doesn't work as expected.
    While creating test scenarios I had a problem with handling errors caused directly by the start() method of the NativeProcess class. It throws errors if the target process can’t be accessed or is corrupted. For example if you take an exe file in Windows that works correctly and modify it in a hex editor to corrupt it the following error is thrown:
    Error: Error #3219: The NativeProcess could not be started. '%1 is not a valid Win32 application.'
          at flash.desktop::NativeProcess/internalStart()
          at flash.desktop::NativeProcess/start()
    If I try to put a try-catch block around the process.start() call something unexpected happens:
    The error is cought correctly, but another error is thrown instantly:
    Error: Error #1503: A script failed to exit after 30 seconds and was terminated.
          at mx.managers.layoutClasses::PriorityQueue/removeSmallest()[E:\dev\4.x\frameworks\projects\ framework\src\mx\managers\layoutClasses\PriorityQueue.as:238]
          at mx.managers::LayoutManager/validateProperties()[E:\dev\4.x\frameworks\projects\framework\ src\mx\managers\LayoutManager.as:567]
          at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framewo rk\src\mx\managers\LayoutManager.as:730]
          at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects \framework\src\mx\managers\LayoutManager.as:1072]
    The problem with this error is that I got no idea how to catch or prevent it. Depending on what I do in the catch block there is another error. For example if I try to log the error I get (but sometimes not as instantly as above):
    Error: Error #1503: A script failed to exit after 30 seconds and was terminated.
          at mx.logging::Log$/getLogger()[E:\dev\4.x\frameworks\projects\framework\src\mx\logging\Log. as:360]
    Strange is that the error is fired instantly sometimes not after 30 seconds.
    How can I fix this?

    In the first case I used a loader to load an error image. In the second case I tried something like:
    var logger:ILogger = Log.getLogger("Test");
    logger.error("NativeProcessError");
    I don't have the exact code at the moment, because I'm not on that computer.

  • Problem with DVI native - cable?

    I have a Intel Mini and am trying to get it to display on my Philips 20" HDTV. The TV has DVI native input (not HDMI). Here's the situation:
    - Output Mini to S-Video or Composite Video into the S-Video or Composite on the TV works as expected, but the image quality is pretty poor. I understand this is a known limitation - fuzzy text seems to be common.
    - the DVI input socket on the Philips serves double duty for either DVI or analog input. For analog, I can use a DVI-VGA adapter (either the Apple one or a Belkin I have), and hook it up to my IBM laptop via a std. VGA cable and it displays under the "PC" input channel on the TV as expected. If I try to use VGA output from the Mini (this means using the Apple DVI/VGA adapter supplied with the Mini, connected to a VGA cable, and then another VGA/DVI adapter to plug into the TV's DVI port) - I do not get an image. Keep in mind the TV doesn't have a separate VGA port - it specifically uses and accepts VGA/analog input via the DVI port.
    - When I try to use a DVI-D cable from the Mac to the TV, tuning the TV to the "DVI" channel, I get no image.
    When I say I don't get an image, I'm not talking about a sync problem. I do not even get a flicker at startup before the video driver loads, and I cannot display anything when booting into single-user mode. This is true with either the VGA method from the Mac described above, or the DVI method.
    The DVI cable I am using has 19 pins - 9 + 9 + flat blade. The Apple and Belkin DVI to VGA adapters have 23 pins - 9 + 9 + 4 around the flat blade, and the flat blade itself.
    Am I not getting any signal because I do not have those 4 pins around the flat blade? The only other DVI cables I have seen have 25 pins - 24 small pins and the flat blade, but do not have the 4 around the flat blade.
    Does anyone have a reference on the pinouts of DVI std? It seems strange to me that I don't even get a flicker at startup (and I've tried both "PC" and "DVI" channels on the TV). This behavior indicates to me that I do not have a problem with sync or timing specs (yet anyway) - as it appears the TV doesn't even receive any type of signal from the Mini.
    Intel Mini Mac OS X (10.4.6)
    Intel Mini   Mac OS X (10.4.6)  

    Technically speaking, a display should not have a DVI-I input. DVI-I was invisioned by its creators to be an output only, so it should only be on a host and not on a monitor or TV. That said, there are some manufacturers that couldn't resist using DVI-I on their displays.
    Since both the MBP and the mini have DVI-I outputs, when you hook them to a display with a DVI-I input using a DVI-I cable, there is definitely the possibility for conflict. It looks as though your MBP gives priority to the analog connection and hence reports a VGA monitor whereas your mini appears to prioritize the digital output and is reading a seperate EDID table and reporting the display differently.
    I recommend you either try using a DVI-A-to-DVI-A cable or a DVI-D-to-DVI-D cable. This will eliminate any possibility for contention. And based on the results you have had so far, you might want to start with the DVI-A-to-DVI-A cable.

  • Problem with a template method in JDialog

    Hi friends,
    I'm experiencing a problem with JDialog. I have a base abstract class ChooseLocationDialog<E> to let a client choose a location for database. This is an abstract class with two abstract methods:
    protected abstract E prepareLocation();
    protected abstract JPanel prepareForm();Method prepareForm is used in the constructor of ChooseLocationDialog to get a JPanel and add it to content pane.
    Method prepareLocation is used to prepare location of a database. I have to options - local file and networking.
    There are two subclasses ChooseRemoteLocationDialog and ChooseLocalFileDialog.
    When I start a local version, ChooseLocalFileDialog with one input field for local file, everything works fine and my local client version starts execution.
    The problem arises when I start a network version of my client. Dialog appears and I can enter host and port into the input fields. But when I click Select, I get NullPointerException. During debugging I noticed that the values I entered into these fields ("localhost" for host and "10999" for port) were not set for corresponding JTextFields and when my code executes getText() method for these input fields it returns empty strings. This happens only for one of these dialogs - for the ChooseRemoteLocationDialog.
    The code for ChooseLocationDialog class:
    public abstract class ChooseLocationDialog<E> extends JDialog {
         private E databaseLocation;
         private static final long serialVersionUID = -1630416811077468527L;
         public ChooseLocationDialog() {
              setTitle("Choose database location");
              setAlwaysOnTop(true);
              setModal(true);
              Container container = getContentPane();
              JPanel mainPanel = new JPanel();
              //retrieving a form of a concrete implementation
              JPanel formPanel = prepareForm();
              mainPanel.add(formPanel, BorderLayout.CENTER);
              JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
              JButton okButton = new JButton(new SelectLocationAction());
              JButton cancelButton = new JButton(new CancelSelectAction());
              buttonPanel.add(okButton);
              buttonPanel.add(cancelButton);
              mainPanel.add(buttonPanel, BorderLayout.SOUTH);
              container.add(mainPanel);
              pack();
              Toolkit toolkit = Toolkit.getDefaultToolkit();
              Dimension screenSize = toolkit.getScreenSize();
              int x = (screenSize.width - getWidth()) / 2;
              int y = (screenSize.height - getHeight()) / 2;
              setLocation(x, y);
              addWindowListener(new WindowAdapter() {
                   @Override
                   public void windowClosing(WindowEvent e) {
                        super.windowClosing(e);
                        System.exit(0);
         public E getDatabaseLocation() {
                return databaseLocation;
         protected abstract E prepareLocation();
         protected abstract JPanel prepareForm();
          * Action for selecting location.
          * @author spyboost
         private class SelectLocationAction extends AbstractAction {
              private static final long serialVersionUID = 6242940810223013690L;
              public SelectLocationAction() {
                   putValue(Action.NAME, "Select");
              @Override
              public void actionPerformed(ActionEvent e) {
                   databaseLocation = prepareLocation();
                   setVisible(false);
         private class CancelSelectAction extends AbstractAction {
              private static final long serialVersionUID = -1025433106273231228L;
              public CancelSelectAction() {
                   putValue(Action.NAME, "Cancel");
              @Override
              public void actionPerformed(ActionEvent e) {
                   System.exit(0);
    }Code for ChooseLocalFileDialog
    public class ChooseLocalFileDialog extends ChooseLocationDialog<String> {
         private JTextField fileTextField;
         private static final long serialVersionUID = 2232230394481975840L;
         @Override
         protected JPanel prepareForm() {
              JPanel panel = new JPanel();
              panel.add(new JLabel("File"));
              fileTextField = new JTextField(15);
              panel.add(fileTextField);
              return panel;
         @Override
         protected String prepareLocation() {
              String location = fileTextField.getText();
              return location;
    }Code for ChooseRemoteLocationDialog
    public class ChooseRemoteLocationDialog extends
              ChooseLocationDialog<RemoteLocation> {
         private JTextField hostField;
         private JTextField portField;
         private static final long serialVersionUID = -2282249521568378092L;
         @Override
         protected JPanel prepareForm() {
              JPanel panel = new JPanel(new GridLayout(2, 2));
              panel.add(new JLabel("Host"));
              hostField = new JTextField(15);
              panel.add(hostField);
              panel.add(new JLabel("Port"));
              portField = new JTextField(15);
              panel.add(portField);
              return panel;
         @Override
         protected RemoteLocation prepareLocation() {
              String host = hostField.getText();
              int port = 0;
              try {
                   String portText = portField.getText();
                   port = Integer.getInteger(portText);
              } catch (NumberFormatException e) {
                   e.printStackTrace();
              RemoteLocation location = new RemoteLocation(host, port);
              return location;
    }Code for RemoteLocation:
    public class RemoteLocation {
         private String host;
         private int port;
         public RemoteLocation() {
              super();
         public RemoteLocation(String host, int port) {
              super();
              this.host = host;
              this.port = port;
         public String getHost() {
              return host;
         public void setHost(String host) {
              this.host = host;
         public int getPort() {
              return port;
         public void setPort(int port) {
              this.port = port;
    }Code snippet for dialog usage in local client implementation:
    final ChooseLocationDialog<String> dialog = new ChooseLocalFileDialog();
    dialog.setVisible(true);
    location = dialog.getDatabaseLocation();
    String filePath = location;Code snippet for dialog usage in network client implementation:
    final ChooseLocationDialog<RemoteLocation> dialog = new ChooseRemoteLocationDialog();
    dialog.setVisible(true);
    RemoteLocation location = dialog.getDatabaseLocation();Exception that I'm getting:
    Exception occurred during event dispatching:
    java.lang.NullPointerException
         at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:42)
         at suncertify.client.gui.dialog.ChooseRemoteLocationDialog.prepareLocation(ChooseRemoteLocationDialog.java:1)
         at suncertify.client.gui.dialog.ChooseLocationDialog$SelectLocationAction.actionPerformed(ChooseLocationDialog.java:87)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6134)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
         at java.awt.Component.processEvent(Component.java:5899)
         at java.awt.Container.processEvent(Container.java:2023)
         at java.awt.Component.dispatchEventImpl(Component.java:4501)
         at java.awt.Container.dispatchEventImpl(Container.java:2081)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4301)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3965)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3895)
         at java.awt.Container.dispatchEventImpl(Container.java:2067)
         at java.awt.Window.dispatchEventImpl(Window.java:2458)
         at java.awt.Component.dispatchEvent(Component.java:4331)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
         at java.awt.Dialog$1.run(Dialog.java:1046)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)java version "1.6.0"
    OpenJDK Runtime Environment (build 1.6.0-b09)
    OpenJDK Client VM (build 1.6.0-b09, mixed mode, sharing)
    OS: Ubuntu 8.04
    Appreciate any help.
    Thanks.
    Edited by: spyboost on Jul 24, 2008 5:38 PM

    What a silly error! I have to call Integer.parseInt instead of getInt. Integer.getInt tries to find a system property. A small misprint, but a huge amount of time to debug. I always use parseInt method and couldn't even notice that silly misprint. Sometimes it's useful to see the trees instead of whole forest :)
    It works perfectly. Sorry for disturbing.

  • Problem with calling onApplicationStart() method

    Hi all,
         I have a problem with calling application.cfc's methods from coldfusion template. The problem is like when i am calling "onapplicationstart" method inside a cfml template i getting the error shown below
    The onApplicationStart method was not found.
    Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.
    My code is like below.
    Application.cfc
    <cfcomponent hint="control application" output="false">
    <cfscript>
    this.name="startest";
    this.applicationtimeout = createtimespan(0,2,0,0);
    this.sessionmanagement = True;
    this.sessionTimeout = createtimespan(0,0,5,0);
    </cfscript>
    <cffunction name="onApplicationStart" returnType="boolean">
        <cfset application.myvar = "saurav">
    <cfset application.newvar ="saurav2">
        <cfreturn true>
    </cffunction>
    </cfcomponent>
    testpage.cfm
    <cfset variables.onApplicationStart()>
    I have tried to call the above method in different way also like
    1--- <cfset onApplicationStart()>
    i got error like this
    Variable ONAPPLICATIONSTART is undefined.
    2---<cfset Application.onApplicationStart()>
    The onApplicationStart method was not found.
    Either there are no methods with the specified method name and argument types or the onApplicationStart method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity
    Please help me out.
    Thanks
    Saurav

    You can't just call methods in a CFC without a reference to that CFC. This includes methods in Application.cfc.
    What are you trying to do, exactly, anyway? You'd probably be better served by placing a call to onApplicationStart within onRequestStart in Application.cfc, if your goal is to refresh the application based on some condition:
    <cffunction name="onRequestStart">
         <cfif someCondition>
              <cfset onApplicationStart()>
         </cfif>
    </cffunction>
    Dave Watts, CTO, Fig Leaf Software
    http://www.figleaf.com/
    http://training.figleaf.com/

  • Problem with loading native library in java version "1.5.0_05"

    My application uses a native coded drawing. With java version 1.4.xx it was working just fine but with java 1.5.xx it gives the following error at the time of loading native library:
    java.lang.UnsatisfiedLinkError: /home/abyzov/tmp/friend32-1.6.02/libfriend.so:
    /home/abyzov/tmp/friend32-1.6.02/libfriend.so: undefined symbol: XtWindowToWidget
    I assumed that java loads all necessary X-libraries at start up but it seems to be not true for version 1.5.xx. Does anybody now about this kind of problems? Should I report it as a bug?

    I have this exact same problem. I developed an application all along using 1.4.2_08 to be exact no problems. I was forced to switch to 1.5.0_06, now when I try to run the app I get:
    java.lang.UnsatisfiedLinkError: <path to library>/libcomlib.so: <path to library>/libcomlib.so: undefined symbol: yp_get_default_domain
    I have tried compiling it in both 1.4.2_8 and 1.5.0_06 and it compiles perfectly but when I run with 1.5.0_06 it messes up.
    If you found the problem with this or anyone else has any advice please let me know.

  • Problem with a string method

    Hello, I am working on a program that converts Roman numerals to Arabic numbers and the opposite. I have the Arabic to Roman part down, yet Roman to Arabic part is causing troubles for me.
    I know that there are many solutions out there, yet I would like just solutions within my code that would fix the problem it has.
    Instead of the whole code, here's the method that changes Roman to Arabic.
         //method to convert Roman numerals to Arabic numbers
         public static int toArabic (String x)
              int arabica=0;
              char chars;
              for (int y=0; y<=(x.length()-1); y++)
                   chars=x.charAt(y);
                   switch (chars)
                        case 'C':
                             if( x.length() == 1)
                                  arabica+=100;
                                  y++;
                             else if (x.charAt(y+1)=='M')
                                  arabica+=900;
                                  y++;
                             else if (x.charAt(y+1)=='D')
                                  arabica+=400;
                                  y++;
                             else
                                  arabica+=100;
                             break;
                        case 'X':
                             if(x.length() == 1)
                                  arabica+=10;
                                  y++;
                             else if (x.charAt(y+1)=='C')
                                  arabica+=90;
                                  y++;
                             else if (x.charAt(y+1)=='L')
                                  arabica+=40;
                                  y++;
                             else
                                  arabica+=10;
                             break;
                        case 'I':
                             if(x.length() == 1)
                                  arabica+=1;
                                  y++;
                             else if (x.charAt(y+1)=='X')
                                  arabica+=9;
                                  y++;
                             else if (x.charAt(y+1)=='V')
                                  arabica+=4;
                                  y++;
                             else
                                  arabica++;
                             break;
                        case 'M':
                             arabica+=1000;
                             break;
                        case 'D':
                             arabica+=500;
                             break;
                        case 'L':
                             arabica+=50;
                             break;
                        case 'V':
                             arabica+=5;
                             break;
    There's a problem with this, however, is that whenever I put something in like XX, CC, XXX, or II, the program says
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
    at java.lang.String.charAt(String.java:687)
    at RomanNumerals.toArabic(RomanNumerals.java:172)
    at RomanNumerals.main(RomanNumerals.java:33)
    I think this problem is caused by the if-else and else-if statements in my method for cases C, X, and I, as this problem doesn't come up when I do similar things to cases without the if statements. Could you perhaps find out what is causing this problem? I've been working on it for days after finishing the rest and I can't figure it out.
    Thanks

    import java.io.*;
    public class RomanNumerals{
              public static void main (String [] args)
              DataInput keyboard=new DataInputStream (System.in);
              String input;
              try
                   //options
                   System.out.println("1. Roman numerals to Arabic numbers");
                   System.out.println("2. Arabic numbers to Roman numerals");
                   System.out.println("3. Exit");
                   System.out.print("Enter your option: ");
                   input=keyboard.readLine();
                   int choice=Integer.parseInt(input);
                   switch (choice)
                        //Roman numerals to Arabic numbers
                        case 1:
                             String romanInput, ro;
                             int answer1;
                             System.out.print("Enter a Roman numeral: ");
                             romanInput=keyboard.readLine();
                             ro=romanInput.toUpperCase();
                             answer1=toArabic(ro); //line 33 where the error occurs
                             System.out.println("The Arabic number is: "+answer1);
                             break;
                        //Arabic numbers to Roman numerals
                        case 2:
                             String arabicInput, answer;
                             System.out.print("Enter an Arabic number: ");
                             arabicInput=keyboard.readLine();
                             int arabic=Integer.parseInt(arabicInput);
                             answer=toRomans(arabic);
                             System.out.println("The Roman numeral is: "+answer);
                             break;
                        case 3:
                             break;
                        default:
                             System.out.println("Invalid option.");
              catch(IOException e)
                   System.out.println("Error");
                   //method to convert Arabic numbers to Roman numerals
         public static String toRomans (int N)
              String roman="";
              while (N>=1000)
                   roman+="M";
                   N-=1000;
              while (N>=900)
                   roman+="CM";
                   N-=900;
              while (N>=500)
                   roman+="D";
                   N-=500;
              while (N>=400)
                   roman+="CD";
                   N-=400;
              while (N>=100)
                   roman+="C";
                   N-=100;
              while (N>=90)
                   roman+="XC";
                   N-=90;
              while (N>=50)
                   roman+="L";
                   N-=50;
              while (N>=40)
                   roman+="XL";
                   N-=40;
              while (N>=10)
                   roman+="X";
                   N-=10;
              while (N>=9)
                   roman+="IX";
                   N-=9;
              while (N>=5)
                   roman+="V";
                   N-=5;
              while (N>=4)
                   roman+="IV";
                   N-=4;
              while (N>=1)
                   roman+="I";
                   N-=1;
              return(roman);
         //method to convert Roman numerals to Arabic numbers
         public static int toArabic (String x)
              int arabica=0;
              char chars;
              for (int y=0; y<=(x.length()-1); y++)
                   chars=x.charAt(y);
                   switch (chars)
                        case 'C':
                             if( x.length() == 1)
                                  arabica+=100;
                                  y++;
                             else if (x.charAt(y+1)=='M')
                                  arabica+=900;
                                  y++;
                             else if (x.charAt(y+1)=='D')
                                  arabica+=400;
                                  y++;
                             else
                                  arabica+=100;
                             break;
                        case 'X':
                             if(x.length() == 1)
                                  arabica+=10;
                                  y++;
                             else if (x.charAt(y+1)=='C')   //the line 172 where error occurs
                                  arabica+=90;
                                  y++;
                             else if (x.charAt(y+1)=='L')
                                  arabica+=40;
                                  y++;
                             else
                                  arabica+=10;
                             break;
                        case 'I':
                             if(x.length() == 1)
                                  arabica+=1;
                                  y++;
                             else if (x.charAt(y+1)=='X')
                                  arabica+=9;
                                  y++;
                             else if (x.charAt(y+1)=='V')
                                  arabica+=4;
                                  y++;
                             else
                                  arabica++;
                             break;
                        case 'M':
                             arabica+=1000;
                             break;
                        case 'D':
                             arabica+=500;
                             break;
                        case 'L':
                             arabica+=50;
                             break;
                        case 'V':
                             arabica+=5;
                             break;
              return(arabica);
         }When I put in XX as the input, this is what the error comes out as:
    Enter a Roman numeral: XX
    Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: 2
        at java.lang.String.charAt(String.java:687)
        at RomanNumerals.toArabic(RomanNumerals.java:172)
        at RomanNumerals.main(RomanNumerals.java:33)

Maybe you are looking for