RemoteException deprecation and EJBException

Is throwing a RemoteException from remote interfaces a deprecated
programming practice?
I've read some articles and newsgroups which stated that.
If true, since when exactly is this deprecated?
Remote interfaces implement java.rmi.Remote so they must throw a
RemoteException, don't they?
Should I throw EJBException instead of RemoteException?
Any remarks, explanations would be greatly helpful.

Exactly.
The container implementation of your remote interface will throw a
RemoteException or javax.transaction.TransactionRolledBackException
(which is an instance of RemoteException) if you throw an EJBException
from your Bean implementation.
If instead you use a Local interface, then you should either get the
EJBException or javax.ejb.TransactionRolledBackLocalException (which is
an instance of EJBException).
It's a bit complicated and I might have been unclear myself for which I
apologize.
HTH,
Dejan
Yonatan Taub wrote:
I don't quite follow.
Do you mean that my remote interface class should declare that it throws a
RemoteException while my bean implementation class
should not state in its throws clause a RemoteException?
"Deyan D. Bektchiev" <[email protected]> wrote in message
news:[email protected]...
EJB 1.1 Spec deprecates throwing RemoteExceptions from the Bean
implementations.
EJBs can still throw it and the container should behave in the same was
as if an EJBException was thrown.
The difference is when all this happens if your EJB has a Remote and
Local interfaces. The local clients (those using the local interface)
should get the EJB exception that might be wrapped in a
TransactionRolledBackException to indicate that the current transaction
was rolled back, while the remote clients should get the EJB exception
(or any RuntimeException thrown from your EJB implementation) wrapped in
a RemoteException.
HTH,
Dejan
Yonatan Taub wrote:
All of this is known to me.
Since then I read some more material on the subject.
It seems that throwing a RemoteException from a bean implementation
class
is deprecated.
RemoteException indicates a system exception and the bean implementation
class should throw an EJBException.
The container specific implementation would catch this exception and
throw a
RemoteException.
http://groups.google.com/groups?q=ejb+RemoteException+deprecated+ejbexcepti
on&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=8i5b64%24bk8%241%40newsgroups.bea.com&rn
um=4
I would appreciate your thoughts on the subject.

Similar Messages

  • Deprecated and internal proprietary API in Java

    Hi, all
    I'm facing a problem right now that our product is near to the ending of the life cycle and won't t have big release from 2013. Hence we are thinking that the JRE/JDK in the product should be stable enough and will not have significant change in the future. After a checking of the latest load build of the product with JDK1.7.0_09, we found that we did have many warnings regarding to the Deprecated API and internal proprietary API like ORB, ORBSocketFactory, IIOPProfileTemplate etc.
    So, I'm doubting...should I find the way to replace those Deprecated and internal proprietary APIs? Is it really necessary? Where can I find APIs to replace them? Any documents?
    I have been frustrated with the doubt for long time, hopefully anyone can help me.
    Thanks in advanced.

    anyone can shed me the lights?

  • Oracle9 i Release 2 (9.2) Deprecated and Desupported Components

    Hi all,
    I am just getting into Oracle Database.
    Being a Java programmer, I was excited of its java support.
    However, having just read its list of Deprecated and Desupported Components (see list below), I am wondering about what is the current status of Java support and what are the new alternatives for doing what those previous components were meant to do.
    Thanks!
    Deprecated and Desupported Components:
    n Remote Method Invocation (RMI)/Internet Inter-ORB Protocol (IIOP)
    n General Inter-ORB Protocol (GIOP)
    n Oracle Servlet Engine (OSE)
    n Common Object Request Broker Architecture (CORBA) framework and J2EE
    containers
    n Java 2 Enterprise Edition (J2EE)
    n Java Transaction API (JTA)
    n Java Naming and Directory Interface (JNDI)
    n CosNaming
    n servlets
    n Oracle Java Server Pages (OSJP)
    n Enterprise Java Beans (EJB) container
    The following components will be deprecated in a future release:
    n INTYPE File Assistant (IFA)
    n Oracle Trace. Oracle Corporation strongly advises the use of SQL Trace and
    TKPROF instead.

    In previous versions of the database Oracle supported running EJB and other J2EE structures directly out of the database. However, Oracle have an application server, O9iAS, which also does this. Consequently, they have deprecated J2EE support in the database; we're supposed to use O9iAS instead.
    We can still use Java in the database, as stored procedures. Oracle is deeply committed to supporting Java per se. Indeed a lot of Oracle's more advanced functionality seems to rely on Java (although, interestingly enough, they also have a rolling program of re-writing that functionality into C, as it performs better).
    Cheers, APC

  • CONFIG_NF_CT_ACCT is deprecated and will be removed soon

    dmesg wrote:CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
    nf_conntrack.acct=1 kernel paramater, acct=1 nf_conntrack module option or
    sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
    I just noticed this today in dmesg and wanted to check if it's a known "issue". It's probably been there for a while and I"m not really concerned at this point.
    I'm just curious. Is it an upstream issue or a package configuration issue?
    Should I just continue to ignore it?
    Last edited by Xyne (2009-09-24 21:37:29)

    Maybe someone with more knowledge in this can clarify it but to me it seems to be something like this:
    Before that option(?) needed to be defined at compile time and was either always on or always off.
    Now it seems it's an option that can be passed to the module, and it can be configured in the way it is stated in the log. If anything the deprecated option now just sets the default behavior.
    nf_conntrack.acct=1 -> configured in /etc/sysctl.conf, set automatically when the computer boots.
    acct=1 nf_conntrack -> module option, used in modprobe.conf (just like any other module option)
    sysctl net.netfilter.nf_conntrack_acct=1 -> alternate way to change some kernel options after the computer boots, must like nf_conntrack.acct=1
    At least it's the way I see it, I guess it's another thing to go into the wiki (iptables page). Oh and now I'll have to see what that option does because I have no idea what it's for

  • Remoteexception and  ejbexception

    I have a stateless session bean method:
    try{
    catch(){
    throw new EJBException()...// here
    I read some article says: either throw EJBException for local or throw RemoteException for remote.
    but my EJB suppose to be used by both local or remote client, how can I throw both EJBException or RemoteException?
    Thanks

    Your EJB should not directly throw RemoteException. First, you need to decide whether the
    condition you encounter is an application exception or a system exception. An application
    exception is a condition from which the client might be able to recover and is considered non-fatal
    by the container. When an application exception is thrown, the client will receive that exact
    exception. An application is a user-defined exception or any other existing exception that is a
    sublcass of java.lang.Exception (except java.rmi.RemoteException)
    With a system exception, the container destroys the bean instance that threw the exception
    and automatically rolls back the current transaction. The way to signify a system exception is by
    throwing EJBException or any runtime exception.
    The container will convert that exception to the appropriate client-side
    exception. In the case of a Local EJB client, the client will receive EJBException. If the client is
    an EJB 2.x Remote client, it will receive RemoteException. If the client is a 3.0 Remote client, it
    will receive EJBException.

  • Deprecated and obsolete parameters in 10gR2

    From the oracle documentation, the following initialization parameters have been deprecated or obsoleted in this release. in some cases, oracle specifies what superceded the original parameter but in most cases not. does anyone know how to find out more about what was replaced and by what?
    see the following:
    Appendix A: Initialization Parameters Obsolete in 10g
    ENQUEUE_RESOURCES
    DBLINK_ENCRYPT_LOGIN
    HASH_JOIN_ENABLED
    LOG_PARALLELISM
    MAX_ROLLBACK_SEGMENTS
    MTS_CIRCUITS
    MTS_DISPATCHERS
    MTS_LISTENER_ADDRESS
    MTS_MAX_DISPATCHERS
    MTS_MAX_SERVERS
    MTS_MULTIPLE_LISTENERS
    MTS_SERVERS
    MTS_SERVICE
    MTS_SESSIONS
    OPTIMIZER_MAX_PERMUTATIONS
    ORACLE_TRACE_COLLECTION_NAME
    ORACLE_TRACE_COLLECTION_PATH
    ORACLE_TRACE_COLLECTION_SIZE
    ORACLE_TRACE_ENABLE
    ORACLE_TRACE_FACILITY_NAME
    ORACLE_TRACE_FACILITY_PATH
    PARTITION_VIEW_ENABLED
    PLSQL_NATIVE_C_COMPILER
    PLSQL_NATIVE_LINKER
    PLSQL_NATIVE_MAKE_FILE_NAME
    PLSQL_NATIVE_MAKE_UTILITY
    ROW_LOCKING
    SERIALIZABLE
    TRANSACTION_AUDITING
    UNDO_SUPPRESS_ERRORS
    Appendix B: Initialization Parameters Deprecated in 10g
    LOGMNR_MAX_PERSISTENT_SESSIONS
    MAX_COMMIT_PROPAGATION_DELAY
    REMOTE_ARCHIVE_ENABLE
    SERIAL_REUSE
    SQL_TRACE
    BUFFER_POOL_KEEP (replaced by DB_KEEP_CACHE_SIZE)
    BUFFER_POOL_RECYCLE (replaced by DB_RECYCLE_CACHE_SIZE)
    GLOBAL_CONTEXT_POOL_SIZE
    LOCK_NAME_SPACE
    LOG_ARCHIVE_START
    MAX_ENABLED_ROLES
    PARALLEL_AUTOMATIC_TUNING
    PLSQL_COMPILER_FLAGS (replaced by PLSQL_CODE_TYPE and PLSQL_DEBUG)
    my boss is pushing for explanations and i have no idea how to find the information (i personally am of the school that says if during the database creation, you get warning messages, it's gone and you just accept it...maybe i have been working with oracle too long?)
    Thanks for any assistance.

    Hi,
    Check for these parameters in Oracle9i documentation. There are some mentioning of new parameters to be used for the deprecated parameters. Ofcourse, not all are available.
    HTH
    Regards,
    Badri.

  • SetRollbackOnly and EJBException..what should happen?

    I am wondering what peoples opinions are about what should happen when commiting a transaction in the following scenario.
    I have a transaction started by a stateless session bean method. This method just finds an entity bean and sets one of its attributes. When this stateless session bean method finishes, the transaction is commited by the container. While commiting the transaction, the container calls the ejbStore method of the entity bean. The ejbStore method calls a method on a different stateless session ejb. This stateless session ejb method calls setRollbackOnly and throws an ApplicationException. The entity ejbStore method catches the ApplicationException and throws it nested within an EJBException.
    The ejb2.0 spec says that the container should throw a javax.ejb.TransactionRolledbackLocalException if it can't commit a transaction. This is what I receive, but my question is what would you expect the nested transaction to be?
    I would expect the EJBException that I threw from ejbStore to be the nested exception.
    ie. I would expect this....
    javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: javax.ejb.EJBException: nested exception is: au.com.sparq.test.ApplicationException: ApplicationException a b c...
    But as soon as setRollbackOnly is called, I will only ever receive this exception....
    javax.ejb.TransactionRolledbackLocalException: Error committing transaction:; nested exception is: weblogic.transaction.internal.AppSetRollbackOnlyException
    Why is an AppSetRollbackOnlyException being thrown by the container when I have told the container to rollback the transaction by throwing the EJBException from the ejbStore method of the entity ejb? In this case, the container shouldn't care that setRollbackOnly had been called. It should only be if the ejbStore method doesn't throw an EJBException that the AppSetRollbackOnlyException is thrown.
    The side effect of this behaviour is that I can never get access to the ApplicationException thrown within the ejbStore method, so I can never tell what caused it to fail.

    This is the expected behavior since Windows XP/Windows Server 2003.
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • RequestProductPurchaseAsync(): deprecated and new ones

    I am about to migrate my app from Windows 8 to Windows 8.1. Until now, I used
    public static IAsyncOperation<string> RequestProductPurchaseAsync(
    string productId,
    bool includeReceipt
    for In-app purchases. This method is declared as deprecated/obsolte now.
    There is a new method:
    public static IAsyncOperation<PurchaseResults> RequestProductPurchaseAsync(
    string productId
    In the help file
    [link] for this new method is this Remark:
    >>
    Use the LicenseInformation.IsActive property to confirm that a product license is active
    after a "successful" RequestProductPurchaseAsync call.
    Note  This method of confirming a successful purchase is only applicable to the
    RequestProductPurchaseAsync overloads that don't return a
    PurchaseResults object.
    You can see an example of how to use this method in our code sample.
    <<
    What I don't understand:
    Why does the first sentence tell us that we should use the IsActive property to confirm a successful purchase while the second sentence tells us that we should not?
    Why does this first sentence only exist for the new method and not in the help page for the deprecated method?
    Why does the mentioned code sample use IsActive, nevertheless?
    Does anybody understand this?

    It makes sense to me.  It looks like they've modified the purchasing to offer more info about the purchase, instead of just returning the receipt.  It makes it easier for devs to know what's going on.
    1)  Don't worry about it.  Use the non-depreciated method and just check the returned object's Status value.  It will be Succeeded if the purchase succeeded, or another code if it fails.
    2) Because there isn't any other way to tell if it succeeded for the depreciated method.
    3) It's not wrong, you can still use it.  In fact, once the purchase has completed, that's how you'd tell across devices or after uninstalls/reinstalls. 
    Darin R.

  • Deprecated and bad memory (mine)

    I used to know it, but forgot it:
    Where can I find which methods to use instead of deprecated ones ?
    Thanks
    Hanns

    Yes, BUT WHERE ???????As stated the API documentation.
    For example look at the javadocs for:
    java.util.Data.public Date(int year,int month,int date)
    The docs for this method states that you should be using Calendar.set() instead.
    I would guess that you are using a method that doesn't have an alternative. For example Thread.stop(), Thread.resume() and Thead.suspend(). The documentation doesn't provide an alternative because there is no alternative.
    Perhaps you might provide some more detail as to what you are looking for.

  • Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead

    Hello I am doing a website for my work and trying to connect a database to dreamweaver (Via WAMP) - I have done this successfully before when doing a "test" site, but now when I do the same thing as I did last time (after DW and WAMP updates) I now get an error message when I F12 (preview in browser) my results.php page. (please see image below):
    I have tried to find a fix on google, but have found none that help me if I am using WAMP with Dreamweaver. I can see maybe I need to change the code in the config.inc.php file, or paste the below code somewhere, but for the life of me I cannot work out which file I am meant to copy this code in to and where? I have tried to copy it in the top of the config.inc.php file but the error still remains.
    <?php
    error_reporting(E_ALL ^ E_DEPRECATED);
    Does anyone know how to make the error go away please?
    thanks
    Sara

    Sara.Reese wrote:
    ok thanks. Dont supose you know how to make the error go away in the mean time though do you? I would love to not see it! Esp when showing the boss when I preview it
    Try:
    <?php
    error_reporting(0); // Turn off all error reporting
    ?>

  • Java JVM 8: Using incremental CMS is deprecated and will likely be removed in a future release

    Hello,
    We (my company) have been using YoungGC=Parallel; Old=CMS/Incremental since Java 1.5 for a Java caching application running in a 64 GB heap (yes, even in HotSpot 1.5).
    At various times, we have tested the G1 collector.  The performance for our caching application has not met expectations with G1GC.  Always looking for ways to improve the system, we are certainly open to new technologies.  However, the loss of the CMS collector will mean our application won’t be able to adopt newer versions of Java.
    Basic JVM options for GC:
    -XX:+UnlockExperimentalVMOptions
    -XX:+UseParNewGC
    -XX:+UseConcMarkSweepGC
    -XX:+CMSIncrementalMode
    -XX:-CMSIncrementalPacing
    -XX:CMSIncrementalDutyCycleMin=100
    -XX:CMSIncrementalDutyCycleMin=95
    -XX:+ExplicitGCInvokesConcurrent
    -XX:ConcGCThreads=6
    With these options, on servers with 64GB heap used at 60% and thousands of QPS, we see Young GC pauses in the range of 50-100 ms every roughly 10 seconds (for .5-1% of the time) and about the same for the short GC pauses of the background CMS. We NEVER see a long CMS pause and the servers run for months at a time, being taken down pretty much only to patch the OS. With a new generation of the hardware, improved software and taking advantage of the ConcGCThreads option, we are just beginning a series of tests to determine how high we can crank-up the memory to reduce the farm size.This project is expected to go OpenSource later this year. Without the CMS collector, very large heaps will become very difficult (or impossible) to manage.
    Before removing the CMS collector, and I understand it is causing grief to still have it in the Java code base, please ensure there is an adequate replacement (G1 is currently not it).
    Thank you for your attention,
    Pierre

    I recomend you probe and test the MetaSpace GC policy in 1.8
    Probably you improve the application in 30% of performance terms.

  • Up2date --undo "This feature is deprecated and no longer functional."

    We are trying to se up a Patch Mangement strategy. Our initial thoughts are to have a yum repository updated to a point in time. Then this repository will be used to update the test environment first, then (once it is tested) the dev environment, then production. All from the same 'static' yum repository.
    Our question comes in about 'rolling back' this upgrade if something breaks. The up2date --undo is not longer functional. We have read alot about the rpm rollback and repackage features. But cannot find any current documentation.
    Is anyone managing their patching this way, and have a 'rollback' function in place?
    Thanks.

    While the "--rollback" feature appears to be still present in the versions of rpm(8) shipped with RHEL5/OEL5, the feature was eventually discarded as being unreliable. The RPM/YUM folk decided this was the wrong approach anyway so the rollback code just got tossed.
    Here is a snippet from the Fedora 11 rpm(8) changelog. Now ordinarily you can see the changes in an RPM package like this:
    $ rpm -q --changelog <rpm-package-name>But the RPM changelog has gotten so long, some of it is just packaged in the stock documentation:
    $ cd /usr/share/doc/rpm-*/
    $ bzless Changelog.bz2
    commit d9c780d19edeaf81427411205a9620c9516902c1
    Author: Panu Matilainen <[email protected]>
    Date:   Mon Mar 17 14:36:43 2008 +0200
        Remove rollback and repackage from documentation
    commit db37b74a2bfebf067f421b891d3837baaca7fc6f
    Author: Panu Matilainen <[email protected]>
    Date:   Mon Mar 17 14:27:03 2008 +0200
        Nuke leftover rollback test program, update translations
    commit d89482a7c7777d379ab415ebba747b6af19babdb
    Author: Panu Matilainen <[email protected]>
    Date:   Mon Mar 17 14:10:11 2008 +0200
        Remove repackage support to finish off with rollback
        The two main classes of rollback/repackage need are
        1) Gimme back the previous version, this broke XYZ on my system.
           This is better handled by downgrading to the previous version of original
           package instead of repackaged garbage. We should maintain real package
           (version) history somewhere.
        2) Upgrade messed up my configuration.
           Instead of repackaging everything we could be far more intelligent
           wrt config files, stick them into real version control or at least have
           hooks to do so.
        RPMCALLBACK_REPACKAGE_* and RPMTRANS_FLAG_REPACKAGE definitions left around
        to avoid needlessly breaking everybodys callbacks (for now)
    commit 37543ee0405c38a9d54a12bf0d54698773a3933c
    Author: Panu Matilainen <[email protected]>
    Date:   Mon Mar 17 11:53:27 2008 +0200
        Remove rollback support
        - not possible to do reliably within rpm
        - effort is better wasted on investigating fs-level snapshots, which
          is way beyond rpm scope except for hooks to interact with the snapshot
          mechanism to communicate beginning/end of transaction and such
    commit ed78cef2c3e14df29d95b476f00d51203fbe098e
    Author: Panu Matilainen <[email protected]>
    Date:   Mon Mar 17 12:04:39 2008 +0200
        Remove support for automatic rollback on failure
        - doing this reliably from rpm is simply not possible as there's no way
          to undo script actions, might as well not pretend we can
        - for a feature that's not generally usable it complicates mainline code
          way too much
    ...With that in mind, I would seek another solution such as adequate full back-up archives :D

  • RemoteException   vs   EJBException

    Hi
    In EJB 2.0 specification, it is mentioned that the use of java.rmi.RemoteException was deprecated for container-invoked callbacks (like ejbCreate, ejbPassivate, ejbActivate) and must use javax.ejb.EJBException instead.
    But when I create a new EJB 2.0 component with java.rmi.RemoteException, build and deployment was successful. Also with javax.ejb.EJBException, build and deployment was successful.
    This means can we use either of these exceptions in EJB 2.0....?
    Is it not necessary to replace java.rmi.RemoteException with javax.ejb.EJBException ....?
    Thanks
    Raghu

    Maybe deprecation was only introduced in specification but not in implementation, otherwise compilation should have reported a deprecation warning.

  • PutValue and getValue deprecated???

    I'm using jdev 3.2 and have been getting the following warnings:
    Warning: method putValue(java.lang.String, java.lang.Object)in interface javax.servlet.http.HttpSession has been deprecated.
    When I check the documentation for HttpSession, those methods are not listed as being deprecated, and they are not listed on the deprecation list either.
    So...are they or are they not deprecated????

    The methods are deprecated in Servlet api 2.2.

  • Oracle jdbc driver class and classes12.jar whether deprecated.?

    Hi All,
    1. In one of the post, it has been told that oracle.jdbc.driver.OracleDriver will be deprecated and also recommended to used oracle.jdbc.OracleDriver.
    According to that post, I changed the driver class name in my code as below:
    Class.forName("oracle.jdbc.OracleDriver");
    Then to check the driver name, I insert the below code:
    Enumeration<Driver> driverEnum = DriverManager.getDrivers();
    +while (driverEnum.hasMoreElements()){+
    System.out.println("driver : "driverEnum.nextElement());+
    +}+
    Below is the output:
    driver : oracle.jdbc.driver.OracleDriver@addbf1
    Even after specifying the driver class name to be used as oracle.jdbc.OracleDriver, why it is taking oracle.jdbc.driver.OracleDriver..?
    INFO : The Oracle JDBC Driver (classes12.jar) version is 10.2.0.4.0.
    2. We are using classes12.jar for developing all JDBC code. In Oracle Database 11g Release 2 (11.2.0.2.0) JDBC Drivers, there is no classes12.jar. Is this deprecated? Which jar can be used instead of classes12.jar?
    Thanks in advance.

    In Oracle Database 11g Release 2 (11.2.0.2.0) JDBC Drivers, there is no classes12.jar. Is this deprecated? Which jar can be used instead of classes12.jar?For JDBC 4.0 features ojdbc6.jar with JDK 6.0.
    For JDBC 3.0 support ojdbc 5.jar with JDK 5.0
    http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html

Maybe you are looking for

  • How do I turn off Sleep/Hibernation/Startup Beeps and Sounds?

    I have a Lenovo Thinkpad x200 running vista ultimate. type 7454-cto How do i turn off these annoying beeps that sound every time my computer goes into and out of sleep and hibernation. I've tried turning the sound scheme to "No sounds," but the beep

  • Problem in context changing ( message mapping )

    <u>source structure    </u> Message Name         Header(1)                 H1                      H2                  LineItem(1)            Item(1-unbounded)        I1                      I2      <u>target structure</u> Message name Header(1)    H

  • Anomalous behaviour on login, security ptoblem ?

    For the first time my MacBook Pro had a lot of spontaneous activity on login. Activity Monitor shows a "find" process owned by "nobody" that takes a lot of cpu time and there was also a lot of network activity with many megabytes of transfer. At nlea

  • Can changes to a FrameMaker document be tracked by date?

    If there are changes to conditional text in FrameMaker, can they be tracked by author and date? The goal is to create a log of changes that my group can reference. Thank you!

  • No PRO*C in 8iR2

    I installed the new 8iR2 (this was my first successfull install of 8i) and could not find the PRO*C compiler when finished. Is it not part of this distribution, or is the precompiler not supported with 8i (because all people are doing java)? Kai null