Exception throw by RMS

Hi all,
I was programing j2me by using: NetBean + Sun wireless Toolkit. When running on emularor, my app perfomce very good. But when I deploy on real device(e.g Samsung B7330 using window mobile) I got so much errors.
So I google and find out: J2ME SDK 3.0 intergrating debug on real device. I setup enviroments and run some sample application, they run smooth. But when I run my app, I got an exception when I try to open RMS
javax.microedition.rms.RecordStoreException: error opening record store fileHere my code:
public void saveProfile() {
        byte[] data = toByteArray();
        try {
            rs = RecordStore.openRecordStore("kunkunProfile", true);
            for (RecordEnumeration e = rs.enumerateRecords(null, null, false); e.hasNextElement();) {
                int id = e.nextRecordId();
                rs.deleteRecord(id);
            rs.addRecord(data, 0, data.length);
            rs.closeRecordStore();
        } catch (Exception ex) {
            System.out.println("Exception in OpenRecordStore..." + ex.getMessage());
            try {
                rs.addRecord(data, 0, data.length);
                rs.closeRecordStore();
            } catch (Exception e) {
            ex.printStackTrace();
    }Can anyone help me?
Sorry for my english, I not good English.

Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

Similar Messages

  • How to catch exception throw bc4j

    Dear Forum
    I am user of JDeveloper Swing application.
    while exception throw from bc4j some particular
    type error such as (oracle.jbo.DMLException) JBO-26041
    message display.
    i want to catch error no 26041 inorder to display own
    messageBox.
    There is two methods
    1-:
    i used messageBundle class i overite message string but unable to change dialogBox,i want to use own dialog.
    2-:
    And i fund ,DML exception message return from JUErrorHandlerDlg class.So using this subclass how
    to catch and throw own message.
    Plase send me some code to write sub class of JUErrorHandlerDlg.

    You want this method System to throw an exception if the String[] is empty?
    public void system( ObjectOutputStream output, String cmd []  ) {
       if (cmd.length == 0)
          throw new IllegalArgumentException("Hey! This is an empty array!");
    //...rest of your method
    }You can choose for yourself which exception type is most appropriate. You can in theory always use the base Exception but is not very specific nor recommended. In this case, I think an existing unchecked exception such as IllegalArgumentException would be the most appropriate.

  • Exception throwing

    I have a situation when a runtime exception should be thrown and an utility class is used
    for the exception throwing.
    Example:
    public class ErrorUtils {
    public static void throwARuntimeException(Exception e) throws ARuntimeException {
    throw new ARuntimeException(p1, p2, p3, p4, p5);
    I think such technique is wrong because:
    1. When an exception is thrown the programmer will see ErrorUtils.throwARuntimeException() in the top of the stacktrace.
    2. It allows to write incorrect code. For example:
    try {
    // do somethink that can throw an exception
    catch (Exception e) {
    throwARuntimeException(e);
    e.printStackTrace(); // this line will be never reached but compiler allows to do that
    Maybe somebody can tell me more arguments why it is not good to throw an exception in a separate method?

    I have a situation when a runtime exception should be
    thrown and an utility class is used
    for the exception throwing.
    Example:
    public class ErrorUtils {
    public static void
    oid throwARuntimeException(Exception e) throws
    ARuntimeException {
    throw new ARuntimeException(p1, p2, p3, p4,
    p3, p4, p5);
    I think such technique is wrong because:
    1. When an exception is thrown the programmer will see
    ErrorUtils.throwARuntimeException() in the top of the
    stacktrace.
    2. It allows to write incorrect code. For example:
    try {
    // do somethink that can throw an exception
    catch (Exception e) {
    throwARuntimeException(e);
    e.printStackTrace(); // this line will be never
    ver reached but compiler allows to do that
    Maybe somebody can tell me more arguments why it is
    not good to throw an exception in a separate method?You're real problem here is not so much a question of what you're doing, but how you're doing it.
    Consider the following
    public void someMethod() throws RuntimeException {
      try{
        // ... Do something here that throws a RuntimeException
      catch(Exception e){
        e.printStackTrace(System.err) ;
        throw new RuntimeException(e.toString()) ;
    }Ok, looks better, I reversed the order of operations in the catch block so that the stack trace would print before it throws the exception, but there's still a problem, and that's one of lost granularity.
    If you cast or convert a double to an int, you lose precision because you lose the decimal places. The same is true if you cast from a more specific class to a more general class. So rather than catching a generic Exception, catch a RuntimeException.
    However, the only thing you've gained by doing that is a bit of precision, and you're duplicating effort.
    In dealing with exceptions, the question is WHERE should it be handled. If the code that generated the exception can deal with it that's fine, there's no need to throw it. This is the situation where you want a try catch block to handle it. But if you can't deal with it at that point, then you have to throw it to a higher level for disposition.
    What I'm driving at here is that if all you're going to do in your catch block is print the stack trace and then throw the error upstream, why bother with catching it here at all. In the code where your method is called you're going to have to handle the exception anyway, so you have a catch block for something that you're going to have to do again anyway.
    So, what I would do is the following (Assuming all I want to do is report the error to a higher level).
    public void callingMethod(){
      try{
        myMethodThatThrowsARuntimeException() :
        someOtherMethodThatMightThrowAnotherTypeOfException() ;
      catch(RuntimeException re){
        messageTheUserWithTheProblem(re) ;
        doSomethingSpecificAboutTheRuntimeException ;
        re.printStackTrace(System.err) ;
      catch(Exception e){
        messageTheUserWithTheProblem(e) ;
        e.printStackTrace(System.err) ;
    public void myMethodThatThrowsARuntimeException() throws RuntimeException{
      // ... Code that causes a RuntimeException to occur
    }There are other ways of doing it, but I find that this 1) allows me to write less code and that's always a good thing as far as I'm concerned, and 2) makes the handling of exceptions by my application more predictable.
    Of course your milage may vary.

  • API0408 Exception throws when open mapping in owb 11.2.0.1

    We got the following error message when openning mapping
    API0408: Within the same namespace domain one object has already used the name
    This exception will throw when the mapping name is the same as the table name. The mapping can be openned if changing the name to some name different from exsiting table name.
    A similar notes in metalink(Note:219649.1 Subject: API0408 followed by java.lang.NullPointerException on Mapping Validation), but it's for 10g specific.
    Do you have any clue on this?

    Looks like you are facing Bug 9662211 CAN NOT ADD AN OPERATOR WITH THE SAME NAME AS THAT OF THE MAPPING
    which is not yet fixed

  • AbstractTable model exception throws clause error?

    I want to display a JDialog whenever the user tries to enter a string when the column class is Double. To do this, I am trying to throw an exception from the setValueAt() method in my class that extends AbstractTable model. However, my code results in an "Exception StatisticsException is not compatible with throws clause in AbstractTableModel.setValueAt()". Any idea how I can work around this? Is there a better way to display a JDialog in this case? Thanks in advance.
    public void setValueAt(Object text, int rowIndex, int columnIndex)throws StatisticsException{
             if(variables[columnIndex].isDouble()){
                  try{
                       Double.parseDouble(text.toString());
                       Object[] temp = data.get(rowIndex);
                       temp[columnIndex] = text.toString();
                       data.remove(rowIndex);
                       data.add(rowIndex, temp);
                  }catch(NumberFormatException ex){
                       throw new StatisticsException("Numeric value required.");
             }else{
                  Object[] temp = data.get(rowIndex);
                  temp[columnIndex] = text.toString();
                  data.remove(rowIndex);
                  data.add(rowIndex, temp);
        }

    Ah, yes of course. In the midst of trying to account for data entry errors, I forgot that. The following revised code works just fine. Thanks.
        public void setValueAt(Object text, int rowIndex, int columnIndex){
              Object[] temp = data.get(rowIndex);
              temp[columnIndex] = text.toString();
              data.remove(rowIndex);
              data.add(rowIndex, temp);
        }

  • Exception throws on lookup()

    I develop a Swing Client, which by RMI a JBoss (on Vista machine) accesses and services implements.
    Properties objProperties = new Properties();
    objProperties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
    objProperties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
    objProperties.put(Context.PROVIDER_URL, "serverIPv4:2001" );
    javax.naming.InitialContext initial = new javax.naming.InitialContext(objProperties);
    NamingEnumeration ne=initial.list("");
    while(ne.hasMore()){
    System.out.println("Bind Objects :"+ne.next());
    Object ref=initial.lookup("project_projectQ");An exception is thrown with the Swing Client on the Debian machine, here:
    {color:#0000ff}initial.lookup("project_projectQ");{color}
    The exception reads:
    {color:#0000ff}java.lang.ClassNotFoundException: project.query.projectQHome
    {color}(in this moment there is not one reaction in the server log of the JBoss (on Vista machine), also not in the Debug mode)
    The {color:#0000ff}project.query.projectQHome{color} is with us an interface in one project.ear, which is on the JBoss (the Vista machine) deployed.
    The interface {color:#0000ff}project.query.projectQHome{color} does not exist in the.jar file of the Swing Client.
    The Swing Client runs thus completely conflict-free on various Machinen, on which only one network entrance and jre 1.6.0 must be present.
    On the Debian machine all functionalities of the Swing Client normally, also an email dispatch run functioned smoothly, but the exception already becomes here with the attempt of {color:#0000ff}initial.lookup("project_projectQ"){color} thrown. All ports of the JBoss (on Vista machine) of the Debian machine are attainable and visible.
    Main question position:
    1. Why funtioniert {color:#0000ff}initial.lookup("project_projectQ"){color} not on the Debian machine?
    2. From where does the exception know the name of the interface {color:#0000ff}project.query.projectQHome{color}?
    3. Why can in the variable{color:#0000ff} javax.naming.InitialContext initial = new javax.naming.InitialContext (objProperties);{color} obviously existing information for the Naming object "project_projectQ" in {color:#0000ff}*initial*.lookup("project_projectQ");{color} not to be used?
    Regards

    If the interface {color:#0000ff}project.query.ProjectQHome{color} is merged in the.jar file of the Swing Client,
    those of port 2001,2000 and 4444 are used.
    If this interface is not merged, those of port 2001,2000,4444 and *8083* are used.
    When starting of the JBoss the following is logged:
    {color:#003300}08:47:05,244 INFO [WebService] Using RMI server codebase: http://MAINSERV:8083
    08:47:05,986 INFO [NamingService] Started jndi bootstrap jnpPort=2001, rmiPort=2000, backlog=50, bindAddress=/192.168.1.2, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076 {color}
    The WebService Using RMI server code base 8083 has here the attitude on MAINSERV.
    MAINSERV is the computer name of the Vista machine.
    In my opinion that could be the cause for the CommunicationException,
    there all Windows machines in the local network the computer 'MAINSERV' to reach (e.g. http://KOPIASSES:8080/ for the starting side of the JBoss),
    the Debian distribution can so not, but only over the IP address http://192.168.1.2:8080/ for the starting side of the JBoss and http://192.168.1.88:8083/ for the WebService.
    I tried to change the codebase properties for run.bat of JBoss.
    The changes were also accepted according to JBoss for the WebService, e.g.:
    -Djava.rmi.server.codebase=http://192.168.1.2/
    -Djava.rmi.server.codebase=http://192.168.1.2:8083/
    Perhaps a possibility seems to be,
    but that does not function in such a way, because I probably set the wrong data over here.
    The local Windows machines throw then an exception, as before with the Debian machine:
    javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: project.query.ProjectQHome]

  • ** Exception Throw in Fork Step - How to inform ?

    Hi Friends,
    Customer sends 2 IDoc DEBMAS, ADRMAS. The conditions is when both the IDocs is having the same customer no we need to send to the outside system.  (DEBMAS - E1KNA1M - KUNNR) equals to (ADRMAS - E1ADRMAS - OBJ_ID).
    I have designed BPM for this : Start --> Fork Step --> 2 Receive Step --> Correlation mentioned in 2 receive step --> Next Block --> Fork --> Transformation Step & Send Step (Two sets : 1 is for DEBMAS & 2nd is for ADRMAS)
    I have checked the design. It is semantcially correct. But, I have the following doubts.
    1) If no matching records found in first block (DEBMAS customer no is not equal to ADRMAS) how much time the fork will wait ?
    2) To effect this, 'Exception Branch' is inserted. After Fork which contains 2 receive steps, one control step is inserted to trigger an exception. Question here is, after how much time, this control step will trigger an exception
    3) What is the purpose of 'End Condition' Property in Fork Step ? Is it required.
    Could you kindly help me friends to clarify the above 3 points. If those clarified, my BPM will be complete.
    Thanking you.
    Kind regards,
    Jegathees P.

    >
    Jegatheeswaran Pitchaimuthu wrote:
    > Hi Friends,
    >
    > Customer sends 2 IDoc DEBMAS, ADRMAS. The conditions is when both the IDocs is having the same customer no we need to send to the outside system.  (DEBMAS - E1KNA1M - KUNNR) equals to (ADRMAS - E1ADRMAS - OBJ_ID).
    >
    > I have designed BPM for this : Start --> Fork Step --> 2 Receive Step --> Correlation mentioned in 2 receive step --> Next Block --> Fork --> Transformation Step & Send Step (Two sets : 1 is for DEBMAS & 2nd is for ADRMAS)
    >
    > I have checked the design. It is semantcially correct. But, I have the following doubts.
    >
    > 1) If no matching records found in first block (DEBMAS customer no is not equal to ADRMAS) how much time the fork will wait ?
    > 2) To effect this, 'Exception Branch' is inserted. After Fork which contains 2 receive steps, one control step is inserted to trigger an exception. Question here is, after how much time, this control step will trigger an exception
    > 3) What is the purpose of 'End Condition' Property in Fork Step ? Is it required.
    >
    > Could you kindly help me friends to clarify the above 3 points. If those clarified, my BPM will be complete.
    >
    > Thanking you.
    >
    > Kind regards,
    > Jegathees P.
    your design should be Fork with two receive steps and correlation should be the customer number field for both. This will ensure that only when the customer numbers are equal the BPM will process further.
    Now you need to handle the exception using a block step around the fork step. You can define a time of your choice until how long should the BPM process wait to receive the different idoc with the same customer num. If within the specified time it is not received then you can raise a exception, trigger alerts etc. as u need.

  • About "Illegal group reference" exception throws in Matcher

    I somehow need to have a string containing one or more '$' be used in some appendReplacement() function in a matcher, so I decided to modify the "$" character in that string into "\$" to escape from capturing an invalid group.
    Here is an example illustrating my case:
    http://developer.domaindlx.com/ron/TestRE.java.txt
    But after changing the "$" to "\\$", supposedly I did, "Illegal group reference" exception still threw when I try to use that "$"-containing string in appendReplacement() method in Matchers.
    Can anyone kindly tell me the reason behind and suggest me possible solution?
    Thank you very much.

    You didn't put enough backslashes in (and no I don't know why the extra is needed - probably because there is another layer in there.)
    String newString = oldString.replaceAll("[\\$]", "\\\\\\$");

  • ******* me off i tried to delete a song off of my iPhone, but it just won't delete. I have tried every thing except throwing it out of the window, cause I'm so ****** off. I hate you apple for making this so difficult.

    I've tried everything that I have read, but to no avail. the song keeps comming up, it is a purchased song, maybe this has someting to do with why I can not delete it?

    What version of IOS are you running?
    To delete a song simply swipe from right to left and an option to delete will pop up.

  • I am 2 ibook samples that are stuck in downloading. I have cleared cache, history etc. restarted and done everything except throw my ipad; any suggestions?

    I am 2 ibook samples that are stuck in downloading. I have cleared cache, history and restarted. Still stuck...any suggestions?

        I can see that this issue has been quite extensive, and frustrating, and I am so sorry for all that has happened societygirl! I would like to help you work this issue out. Please follow & send me a Direct Message, so I can get your account specifics and help finally bring this to a resolution.
    Thank you,
    MichelleH_VZW
    Follow us on Twitter @VZWSupport

  • Exception Handling Standards -The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.

    In the current project my exception handling implementation is as follows :
    Exception Handling Layer wise :
    DL layer :
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    BL Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    throw;
    UI Layer
    catch (Exception ex)
    bool rethrow = ExceptionPolicy.HandleException(ex, "Ui Policy");
    if (rethrow)
    Response.Redirect("ErrorPage.aspx", false);
    We have a tool to check the standards. And tool output is as follows :
    The exception Exception should never been thrown. Always Subclass Exception and throw the subclassed Classes.
    I need suggestions on how to implement the same according to standards.

    Your tool is wrong if it says to never throw Exception.  This was a common recommendation back in the .NET v1 days but has long since been thrown out.  It is perfectly fine to use Exception when you have a general exception that provides no information
    that an application can use to make an informed opinion.
    The general rules of exception throwing is to throw the most specific exception that makes sense. If there is no specific exception that applies and it would be useful for the caller to handle the exception differently than other exceptions then creating
    a custom exception type is warranted.  Otherwise throwing Exception is reasonable. As an example you might have an application that pulls back product data given an ID. There is no built in exception that says the ID is invalid. However an invalid ID
    is something that an application may want to handle differently than, say, an exception about the product being discontinued.  Therefore it might make sense to create an ItemNotFoundException exception that the application can react to.
    Conversely there is no benefit in having different exception types for disk full and disk quota met. The application will respond the same in either case.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Throws Exception when jdbc connect to Oracle

    Hi! I'm waiting for your answers.
    When i use jdbc to connect Oracle,system throws exceptions as follows:
    java.lang.ClassCastException: oracle.sql.converter.CharacterConverter12Byte
    oracle.sql.CharacterSet1Byte oracle.sql.CharacterSet1Byte.getInstance (int,racle.sql.converter.CharacterConverter)
              CharacterSet1Byte.java:82
         oracle.sql.CharacterSet oracle.sql.CharacterSetWithConverter.getInstance(int)     CharacterSetWithConverter.java:85
    I code in Oracle9i Jdeveloper 9.0.2. The Oracle version is 9.0.2.
    My code example is as follows:
    package mypackage2;
    import java.sql.*;
    import oracle.jdbc.driver.*;
    public class Class1
    public Class1()
    public static void main(String[] args)
    Class1 class1 = new Class1();
    Connection conn = null;
    try
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    //exception throws in getConnection()
    conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@localhost:1521:CR","system","CR2001");
    catch (Exception e)
    e.printStackTrace();

    import java.io.*;
    import java.sql.*;
    import java.text.*;
    import oracle.jdbc.driver.*;
    public class viewtable
         Connection con;
         Statement st;
         public viewtable (String args[]) throws ClassNotFoundException,FileNotFoundException,IOException,SQLException
         url="jdbc:oracle:thin:system/manager@IP:1521:SID";
         Class.forName ("oracle.jdbc.driver.OracleDriver");
         try
         con=DriverManager.getConnection(url);
              st = con.createStatement ();
              doexample ();
              st.close ();
              con.close ();
         }catch(SQLException e)
              System.err.println(e.getMessage());
         public void doexample () throws SQLException
         ResultSet rs = st.executeQuery("select * from sales");
              if(rs!=null) {
              while(rs.next())
                   int a = rs.getInt("no");                    System.out.println("NO = "+a);
              rs.close();
         public static void main (String args[])
              System.out.println ("Oracle Exercise 1 \n");
              try
                   viewtable test = new viewtable(args);
              } catch (Exception ex)
                   System.err.println ("Exception caught.\n"+ex);
                   ex.printStackTrace ();
    the above is the full code, please check the problem....many thanks

  • Performance costs of throwing an Exception

    Hi people. I was just reading another post around here, and I became curious about how much the Exception mechanism could become an overhead... I made a simple (REALLY simple) little test class, and I was shocked to perceive that actually throwing an Exception is cheap (I always thought that it would be just the opposite...). Try running this later:
    public class Test {
         public boolean something() {
              return true;
         public void nothing() throws Exception {
              throw new Exception("Voila");
         static public void main(String[] algo) {
              Test test = new Test();
              long now = System.currentTimeMillis();
              test.something();
              System.out.println("boolean method took " +
    (System.currentTimeMillis() - now) + " milliseconds.");
              now = System.currentTimeMillis();
              try {
                   test.nothing();
              } catch (Exception e) {
                   System.out.println("exception method took " +
    (System.currentTimeMillis() - now) + " milliseconds.");
    }and here are some results I got:
    1)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    2)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    3)
    boolean method took 0 milliseconds.
    exception method took 0 milliseconds.
    Of course, I assume that when the stack grows a bit, the result could be quite different. I ran this on a AMD 900 MHz, 512Mb RAM, JDK 1.4.1_01 under Eclipse.
    PS: Excuse me for my bad English :)
    falowwwwww

    Yeah, I guess I was always right...
    Here's the (fixed) code:
    public class Test {
         public boolean something() {
              return true;
         public void nothing() throws Exception {
              throw new Exception("Voila");
         static public void main(String[] algo) {
              Test test = new Test();
              long now = System.currentTimeMillis();
              for (int i=0; i<Integer.MAX_VALUE; i++) {
                   test.something();
              System.out.println("boolean method took " + (System.currentTimeMillis() - now)
                   + " milliseconds.");
              now = System.currentTimeMillis();
              for (int i=0; i<Integer.MAX_VALUE; i++) {     
                   try {
                        test.nothing();
                   } catch (Exception e) {
              System.out.println("exception method took " + (System.currentTimeMillis() - now)
                   + " milliseconds.");
         }The boolean loop took twelve seconds to finish... The exception loop ran for almost 18 minutes (when I stopped it! it didn't even complete!)
    If anyone want to, run the code and post here the real results. Thanks!!
    I guess that "our great designers" here at my company will lose their jobs... Well I think they deserve it. If only they payed attention to me at the beggining when I complained about throwing lots of unnecessary exceptions... eheheheh
    PS: Excuse me for the bad English again!!
    falow!!!!!!!

  • WebService throw Exception

    I am trying to test throwing exceptions from a java web service.
         * Web service operation
        @WebMethod(operationName = "newRole")
        public String newRole(@WebParam(name = "name") String name, @WebParam(name = "users") String users)  throws Exception
            throw new Exception("TestException");
        }Now whenever I test this webservice I get:
    "Service invocation threw an exception with message : null; Refer to the server log for more details"
    "Exceptions details : java.lang.reflect.InvocationTargetException ..."
    The stack trace is massive.
    Now if I examine the log I see the regular normal "Exception: TestException" message.
    How can I get the web service to properly convert the Exception into a proper SOAP message not wrapped up on this InvocationTargetException .
    Thanks,
    Stephen

    Hi Mahesh,
    I refered those scenarios. But, our requirment is we want to take 'Additional Text' option from SXMB_MONI and map to WS source structure one element.
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?><!-- Call Adapter --> <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1"><SAP:Category>XIServer</SAP:Category><SAP:Code area="INTERNAL">PL_TIMEOUT</SAP:Code><SAP:P1/><SAP:P2/><SAP:P3/><SAP:P4/><SAP:AdditionalText>TIME OUT REACHED</SAP:AdditionalText><SAP:ApplicationFaultMessage namespace=""/><SAP:Stack>Timeout condition of pipeline reached
    </SAP:Stack><SAP:Retry>N</SAP:Retry></SAP:Error>
    Could you kindly help me ?

  • Error getting application exception message from client EJB 3

    Hi, somebody nkow what is the error?
    I have this simple session bean deploy in a jboss 4.0.5 GA application server
    My interface:
    package server.ejb.usuarios;
    import javax.ejb.Remote;
    @Remote
    public interface Prueba {
         public void getError() throws Exception;
    }My Session bean implementation:
    package server.ejb.usuarios;
    import javax.ejb.Stateless;
    import server.ejb.usuarios.Prueba;
    public @Stateless class PruebaBean implements Prueba {
         public void getError() throws Exception {
              throw new Exception("Mensaje de error");
    }Simple, i can deploy this bean on my application server, now i have this client code:
    package clientold;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import server.ejb.usuarios.Prueba;
    public class MainPruebaError {
          * @param args
         public static void main(String[] args) {
              Context ctx;
              try {
                   ctx = getInitialContext();
                   Prueba pruebaSession = (Prueba) ctx.lookup("PruebaBean/remote");
                   pruebaSession.getError();
              } catch (NamingException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              } catch(Exception e){
                   System.out.println("Get error from server: " + e.getMessage());
                   e.printStackTrace();
         private static Context getInitialContext() throws NamingException {
              Properties prop = new Properties();
              prop.setProperty("java.naming.factory.initial",
                        "org.jnp.interfaces.NamingContextFactory");
              prop.setProperty("java.naming.provider.url", "127.0.0.1:1099");
              prop.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
              return (new InitialContext(prop));
    }and my client catch the exception but i can�t get the correct exception message. I need pass custom message from my server to my clients and wrap it in a exception, but when i run this example got the next output:
    Get error from server: [Ljava.lang.StackTraceElement;
    java.lang.ClassNotFoundException: [Ljava.lang.StackTraceElement;
         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:50)
         at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:139)
         at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
         at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
         at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
         at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
         at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
         at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
         at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
         at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
         at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
         at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)
         at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
         at org.jboss.remoting.Client.invoke(Client.java:525)
         at org.jboss.remoting.Client.invoke(Client.java:488)
         at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:41)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
         at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:46)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
         at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:40)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
         at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
         at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
         at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
         at $Proxy0.getError(Unknown Source)
         at clientold.MainPruebaError.main(MainPruebaError.java:21)What is the problem??, i must see on the output
    Get error from server: Mensaje de errorbut i have :
    Get error from server: [Ljava.lang.StackTraceElement;why???, is only a simple application exception and don,t work, somebody can help me??
    i have tried to use an interceptor class for get the exceptions and work, but without interceptor, dont work
    thanks

    I can resolve this problem change the JDK version used to develop my clint application and to run the jboss application server.
    Current, in JBoss 4.0.5, the JDK requirement is JDK 5, and i was using JDK 6.

Maybe you are looking for

  • Error Database synchronization fail

    Hello, I have a problem with DataGuard. I found the following error-code: bkkbrs1:tagtrak:/shared/tagtrak/log > dgmgrl DGMGRL for Solaris: Version 10.1.0.2.0 Production Copyright (c) 2000, 2004, Oracle. All rights reserved. Welcome to DGMGRL, type "h

  • Setting decimal point to "," instead of "."

    Hello Can any body tell me how to set format for numeric amount in order to have Decimal point set to "," instead of "." and thousount separator set to blank instead of comma in HTMLDB thank

  • Windows 8 refresh and reader

    I installed Reader on Windows 8. Then after an HP update my laptop kept crashing. I ran Windows 8 refresh to recover. Now Adboe Reader does not appear in the Program and Features so I can't uninstall it from there. I see the acrodrd32.exe file in c:\

  • What happened to the plus sign to open new tabs in ff4?

    I have lost the plus sign for opening new tabs which used to be next to an open tab. Where is it and how can I get it back?

  • I can't record video on my iPad 2

    Can anyone help me? I open up my camera  app and I can't record a home video, I press where it says video and it won't even highlight so please tell me what to do