2 Replies Latest reply on Jul 25, 2012 9:15 AM by f.ulbricht

    Hide JBoss internal exceptions from the client

    f.ulbricht Newbie

      Hello friends,

       

      when I use JBoss with remoting from a client and there is an exception thrown on the server, I get the exception and its complete stacktrace and causes transfered to the client. But there may be exceptions thrown by some JBoss subsystem (like Hibernate or the database itself) and I usally do not have these classes in the classpath of my client. Why should I - I do not use them here. This all leads to a ClassNotFoundException by the JBoss marshalling... (It seems sometimes the server and the client freeze after this, but that is a different story)

       

      Is there a way to configure JBoss not to include the complete cause history in its exceptions down to every internal subsystem?

       

      Greetings,

      Frank.

        • 1. Re: Hide JBoss internal exceptions from the client
          f.ulbricht Newbie

          I tried it by using an intercepter that intercepts any exception and transforms it into some usefull exception (e.g. with an error code for our support team) without adding the cause. Works fine for exceptions thrown WITHIN the method. Any container exception (e.g. PersistenceException) will be thrown AFTER my interceptor was invoked. So, still no luck...

           

          Regards,

          Frank.

          • 2. Re: Hide JBoss internal exceptions from the client
            f.ulbricht Newbie

            I found another way. When I create a facade with another session bean with transaction attribute NEVER, I can invoke the original bean locally. The transaction will be over before the method of my facade bean ends. No an interceptor around the facade method call can catch the exception and convert it to something useful. It is a solution but finally it means that I have to duplicate all interface methods in my facade beans...

             

            Regards,

            Frank.