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.

Similar Messages

  • 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.

  • 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.

  • RemoteException and ClassNotFoundException

    i'm a newbie in RMI, i followed the tutorial, but can't get my example to work.
    i did a jar with all classes needed.
    this is the content of server.jar:
    META-INF/
    META-INF/MANIFEST.MF
    jharon/
    jharon/model/
    jharon/model/AbstractDocument.class
    jharon/model/Category.class
    jharon/model/DocumentFactory.class
    jharon/model/DocumentFactoryIf.class
    jharon/model/DocumentKeeper.class
    jharon/model/HtmlDocument.class
    jharon/model/ImmutableCategoryIf.class
    jharon/model/ImmutableDocumentIf.class
    jharon/model/MutableCategoryIf.class
    jharon/model/MutableDocumentIf.class
    jharon/model/Profile.class
    jharon/model/Publishable.class
    jharon/server/
    jharon/server/Publisher.class
    jharon/server/PublisherEngine.class
    jharon/server/PublisherEngine_Skel.class
    jharon/server/PublisherEngine_Stub.class
    the jar has been constructed by ANT with this script:
    <target name="compile" depends="init" description="Compile sources" >
            <javac   srcdir="${src.dir}"
                destdir="${build.dir}"
                debug="on"
                deprecation="on">
                <include name="**/*.java"/>
                <classpath refid="project.class.path"/>
            </javac>
            <rmic  base="${build.dir}" includes="jharon/server/PublisherEngine.class" />
        </target>
    <target name="server-jar" depends="init, compile" description="Create
            server-jharon.jar">
            <jar jarfile="${dist.dir}/${server}"
                basedir="classes">
                <include name="jharon/server/**/*.class"/>
                <include name="jharon/model/**/*.class"/>
                 <manifest>
                    <attribute name="Main-Class"
                        value="jharon.server.PublisherEngine"/>
                </manifest>
            </jar>
        </target>then, following the tutorial i unset the CLASSPATH, launch the rmiregistry, and then:
    java -jar server-jharon.jar
    which reports me this very long error:
    java -jar server-jharon.jar
    PublisherEngine exception: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: jharon.server.PublisherEngine_Stub
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: jharon.server.PublisherEngine_Stub
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:352)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
    at sun.rmi.transport.Transport$1.run(Transport.java:148)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:534)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:350)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at jharon.server.PublisherEngine.main(PublisherEngine.java:33)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: jharon.server.PublisherEngine_Stub
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:342)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:207)
    at sun.rmi.transport.Transport$1.run(Transport.java:148)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
    at java.lang.Thread.run(Thread.java:534)
    Caused by: java.lang.ClassNotFoundException: jharon.server.PublisherEngine_Stub
    at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:219)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:430)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:631)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
    at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:200)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1513)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
    ... 9 more
    anyone could help me please?
    thanks
    Valerio

    apparently i solved with this sequence of commands:
    1) unset $CLASSPATH
    2) export CLASSPATH=/local/path/to/server-jharon.jar
    3)rmiregistry &
    4) java -jar server-jharon.jar
    and i get this answer:
    PublisherEngine bound
    which means (i hope) that the rmi registry has registred that instance...
    i'll keep updated

  • RemoteExceptions and Entity bean failover

    The documentation gives an example of how to achieve failover with
              entity beans. (See below). How can one tell that the RemoteException
              is due to the server being down rather than some other reason.
              For example in EJB 1.0 aren't many exceptions generated in the bean
              wrapped in a RemoteException? For example if there is an SQLException
              the bean might throw a RemoteException that wraps the SQLException. In
              such a case it doesn't make sense to try it again.
              So what is the correct way to find out whether the exception is due to a
              server failure rather than some other reason?
              dan
              AccountHome home =
              (AccountHome)ctx.lookup("example.AccountHome");
              Account account;
              int attempts;
              while (attempts < LIMIT) {
              try {
              tx.begin();
              account = home.findByPrimaryKey(ACCOUNT);
              account.deposit(500);
              account.withdraw(10);
              tx.commit();
              break;
              catch (RemoteException re ) {
              // Retry
              try {
              tx.rollback();
              attempts++;
              catch (Exception e) {
              // Something unrecoverable has happened
              throw e;
              

    Yes, this is the "nasty" case as I've heard several people put it. It's among the
              problems that make distributed programming difficult. Since the database is managing
              the transaction log, the other app servers in the cluster do not know if the tx was
              committed or not either.
              -- Rob
              dan benanav wrote:
              > If a remote exception is thrown from an entity bean then is it the case that we know
              > the transaction has rolled back? What if the server went down after the transaction
              > was committed?
              >
              > dan
              >
              > Rob Woollen wrote:
              >
              > > dan benanav wrote:
              > >
              > > > Isn't there a more definitive way to determine whether the problem is due to a
              > > > connection error or the server being down?
              > > >
              > >
              > > My first answer to your question is why do you need this? Both a db
              > > connection error and the server going down should be relatively rare events in a
              > > production system. RemoteException is meant to indicate that a system-level
              > > error has occured and the transaction has rolled back. Doing another find in
              > > this case is not going to limit your application's performance / scalability.
              > >
              > > -- Rob
              > >
              > > >
              > > > Rob Woollen wrote:
              > > >
              > > > > dan benanav wrote:
              > > > >
              > > > > > The documentation gives an example of how to achieve failover with
              > > > > > entity beans. (See below). How can one tell that the RemoteException
              > > > > > is due to the server being down rather than some other reason.
              > > > >
              > > > > Any application error should be thrown as an application exception that
              > > > > you could obviously distinguish from RemoteException.
              > > > >
              > > > > As you correctly point out, db errors like SQLException are often
              > > > > wrapped in RemoteException when they reach the client.
              > > > >
              > > > > I would code the application to give up if it gets an application
              > > > > exception. For instance, if you try to withdraw more money than you have,
              > > > > there is no sense in retrying.
              > > > >
              > > > > I would retry (up to a small limit) on RemoteExceptions if it makes
              > > > > sense in your application. Even SQLExceptions may be transient. For
              > > > > instance, Oracle may not have been able to serialize your transaction on
              > > > > the first attempt, but your second try might go through.
              > > > >
              > > > > -- Rob
              > > > >
              > > > > >
              > > > > >
              > > > > > For example in EJB 1.0 aren't many exceptions generated in the bean
              > > > > > wrapped in a RemoteException? For example if there is an SQLException
              > > > > > the bean might throw a RemoteException that wraps the SQLException. In
              > > > > > such a case it doesn't make sense to try it again.
              > > > > >
              > > > > > So what is the correct way to find out whether the exception is due to a
              > > > > > server failure rather than some other reason?
              > > > > >
              > > > > > dan
              > > > > >
              > > > > > AccountHome home =
              > > > > > (AccountHome)ctx.lookup("example.AccountHome");
              > > > > > Account account;
              > > > > > int attempts;
              > > > > >
              > > > > > while (attempts < LIMIT) {
              > > > > > try {
              > > > > > tx.begin();
              > > > > > account = home.findByPrimaryKey(ACCOUNT);
              > > > > > account.deposit(500);
              > > > > > account.withdraw(10);
              > > > > > tx.commit();
              > > > > > break;
              > > > > > }
              > > > > > catch (RemoteException re ) {
              > > > > > // Retry
              > > > > > try {
              > > > > > tx.rollback();
              > > > > > attempts++;
              > > > > > }
              > > > > > catch (Exception e) {
              > > > > > // Something unrecoverable has happened
              > > > > > throw e;
              > > > > > }
              > > > > > }
              

  • 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.

  • Good old EJBException question...

    I've trawled through this forum for a good explanation of EJBException versus RemoteException. I've not found anything I consider particularly intuitive. In fact, I've been amazed by some of the confusion that seems to exist about this, with some people responding with answers that are simply wrong.
    So, for my own enlightenment and hopefully the other people who've asked this question - could someone please give an explanation of when to throw an EJBException, when to throw a RemoteException (if ever) and when to throw another type of Exception?
    I'm also interested in what the client is guaranteed to receive in each of these cases and what effect this has on the bean that has thrown it.
    And just to keep things good and simple could they try to do it without mentioning "the specification"? I have read the specification but would like to know how it manifests itself in the real world and what is considered "good practice" in this matter.
    Many thanks in advance.

    hey kevin, you causing problems again!
    you've probably seen this article by now on EJBExcepitons at the serverside.com but here is the link anyway:
    http://www-106.ibm.com/developerworks/java/library/j-ejbexcept.html
    EJB exceptions are mine field but there are a couple solid guidelines that i follow when designing my beans with exceptions:
    1. Application Exceptions ( not descendants of RuntimeException or RemoteException ) are passed back to the client as is to give them the chance to take the appropriate recovery action. So before you leave your business method, you'd better make damned sure that you don't compromise data integrity. If you can't guarantee data integrity do the EJBContext.setRollbackOnly() thing. Which means that as a client you should get into the habit of doing UserTransaction.getStatus().
    2. Runtime Exceptions ( ignore EJBException for now ). I don't catch them but i'm not expecting them, and i don't know what to do with them. Thankfully, the container does (which is to log the exception, throw back RemoteExceptions to remote clients and EJBException to local clients, rollback the transaction and then take the bean instance out of service). So i delegate the handling of runtime exceptions to the container. i do not catch Throwable in my bean methods.
    3. System Exception ( EJBExceptions ). Where possible using EJB standard exceptions such as CreateException and FinderException. If my bean throws a checked exception, i need to gauge whether or not i can recover from it. I can't, i wrap it in an EJBException and throw it out for the container to do its stuff ( log, raise client exception, rollback and die ). Otherwise, i perform clean up in my bean to return my resources to the state they were before i started executing this method and raise the checked exception.
    In the article above the author's penultimate section talks about when to use an application exception over a system exception. Its always the client the determines which way your go. For example, what should you do during a create ejb you need to look up some data in the database and an SQLException is raised. Within the create method it is an application exception for sure because the system is not compromised, however, from the clients point of view, the bean cannot be created because key data was missing. Hence, the method should wrap the SQLException in an EJBException and throw it out to make sure the bean is not created. (If fact, the method retry something else and if nothing else works raise the EJBException).
    cleve

  • EJBException doubt

    In an enterprise bean if an EJBException occurs, it will be repackaged as a RemoteException and sent to the client. How can the client identify what kind of exception occured, that is whether its a JDBC Exception, JNDI exception etc?

    Well, I shall answer myself. I found this link http://www-128.ibm.com/developerworks/library/j-ejbexcept.html

  • Behaviour of AXIS with Spring and Java, in response to bad webservice call

    This is a stretch, but I wonder if you can help me - I'm new to this, and working in a project that has already been configured to work with Axis.
    We have a Java project built with the Spring framework, in order to provide webservices for access via SOAP. As I understand it (ie not very well!) Axis works to accept these SOAP messages from the client and transform them into calls on our Java methods, and do the reverse with the responses - cool! Which is excellent, and it works well with the config files we have already set up.
    But I have two problems/questions, which may well be related�
    2) In trying to test what exactly happens in which case, I sent some test messages to the service, and found that I could send incorrect parameter names, and sometimes the service still gets called! Axis seems to match the data it recieves to the parameters of the method in some clever way that I don�t understand. Sometimes this works, sometimes it shows a type error. But it seems to depend what parameter I rename as to what exactly happens, so the results are (superficially, at least) unpredictable! I'm sure this behaviour is configurable in some way, but I can't seem to find out how this is done. I'd like to make it so that missing parameters are passed into the method as nulls (as is happening now), but that badly named, duplicated or extraneous parameters are refused, with a specific errormessage stating what the issue is. Similarly, I'd like to reply with an explanatory message if a parameter is passed wth an incorrect type, rather than just a message "org.xml.sax.SAXException: Bad types" that does not detail which parameter is problematic.
    1) The client can receive a "500" response, with an "Internal Server Error" message, although I'm having trouble figuring out exactly when this happens. I'd like to be able to configure what message they receive, in order to give them more information about what they got wrong.
    I just don't know where to start with this - I'm sure there must be ways of configuring all this!
    As much info about an example of what I'm looking at as seems sensible follows. Please forgive me if I've used incorrect terminology somewhere! :)
    Thanks a heap,
    Tracey
    ======================
    So, let's say I have a Java class called DiaryService, with a method called createDiary that takes the appropriate data and returns a confirmation/error message - it starts like this :
        public String createDiary(final String library,
                final BigDecimal companyCode, final Date diaryDate,  final Date actionedDate,
         final String diaryMessage) throws RemoteException And another called GetDiary that returns a Diary as a SOAP bean which looks like this :
        public DiarySoapBean getDiary(final String library,
                final BigDecimal companyCode, final Date diaryDate) throws RemoteExceptionAxis very helpfully lets me access the createDiary and getDiary, by sending XML messages like this example:
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <ns1:createDiary soapenc:root="1" xmlns:ns1="http://localhost:8080/morph_zta/services/DiaryService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
    <library xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">ZRMORPHTA</library>
    <companyCode xsi:type="xsd:Decimal" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">1</companyCode>
    <diaryDate xsi:type="xsd:date" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">2007-01-01Z</diaryDate>
    <actionedDate xsi:type="xsd:date" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">2007-01-01Z</actionedDate>
    <diaryMessage xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"/>Blah blah blah</diaryMessage>
    </ns1:createDiary>
    </soapenv:Body>If I rename a parameter, the service may get called, with some other data in that parameter or not, or may not get called at all and the user get a "SAXException: Bad types" error message. I would like it to return a message stating that the parameter is not expected.
    If I duplicate a parameter, the first occurrence appears to be used, and the next ignored. I would like it to return a message saying tnat the extra parameter is not expected.
    If I add gibberish parameters, I get a "No such operation" message. I would like to be able to tell which parameters are incorrect.
    We have entries like this in web.xml:
        <listener>
            <listener-class>
                   org.apache.axis.transport.http.AxisHTTPSessionListener
         </listener-class>
        </listener>
        <servlet>
            <display-name>Apache-Axis Servlet</display-name>
            <servlet-name>axis</servlet-name>
            <servlet-class>
                   com.workingmouse.webservice.axis.SpringAxisServlet
         </servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>axis</servlet-name>
            <url-pattern>/servlet/AxisServlet</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>axis</servlet-name>
            <url-pattern>*.jws</url-pattern>
        </servlet-mapping>
        <servlet-mapping>
            <servlet-name>axis</servlet-name>
            <url-pattern>/services/*</url-pattern>
        </servlet-mapping>     And these bits in our server-config.wsdd :
        <!-- Global config options -->
        <globalConfiguration>
            <parameter name="adminPassword" value="admin"/>
            <parameter name="attachments.Directory" value="./attachments"/>
            <parameter name="attachments.implementation"
                    value="org.apache.axis.attachments.AttachmentsImpl"/>
            <parameter name="sendXsiTypes" value="true"/>
            <parameter name="sendMultiRefs" value="true"/>
            <parameter name="sendXMLDeclaration" value="true"/>
            <parameter name="axis.sendMinimizedElements" value="true"/>
            <requestFlow>
                <handler type="java:org.apache.axis.handlers.JWSHandler">
                    <parameter name="scope" value="session"/>
                </handler>
                <handler type="java:org.apache.axis.handlers.JWSHandler">
                    <parameter name="scope" value="request"/>
                    <parameter name="extension" value=".jwr"/>
                </handler>
        <handler name="acegiAuthenticationHandler" type="java:{our}.AcegiAuthenticationHandler"/>
            </requestFlow>
         <responseFlow>
              <handler name="OutgoingSOAPMessageViewer" type="java:{our}.OutgoingSOAPMessageViewer"/>
         </responseFlow>
        </globalConfiguration>
        <!-- Handlers -->
        <handler name="LocalResponder"
                type="java:org.apache.axis.transport.local.LocalResponder"/>
        <handler name="URLMapper"
                type="java:org.apache.axis.handlers.http.URLMapper"/>
        <handler name="Authenticate"
                type="java:org.apache.axis.handlers.SimpleAuthenticationHandler"/>
        <!-- Axis services -->
        <service name="AdminService" provider="java:MSG">
            <parameter name="allowedMethods" value="AdminService"/>
            <parameter name="enableRemoteAdmin" value="true"/>
            <parameter name="className" value="org.apache.axis.utils.Admin"/>
            <namespace>http://xml.apache.org/axis/wsdd/</namespace>
        </service>
        <service name="Version" provider="java:RPC">
            <parameter name="allowedMethods" value="getVersion"/>
            <parameter name="className" value="org.apache.axis.Version"/>
        </service>
        <!-- Global config options -->
        <transport name="http">
            <requestFlow>
                <handler type="URLMapper"/>
                <handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler"/>
            </requestFlow>
        </transport>
        <transport name="local">
            <responseFlow>
                <handler type="LocalResponder"/>
            </responseFlow>
        </transport>
        <service name="DiaryServices" provider="Handler" style="rpc">
            <parameter name="handlerClass" value="com.workingmouse.webservice.axis.SpringBeanRPCProvider"/>
            <parameter name="springBean" value="diaryServices"/>
            <parameter name="springBeanClass" value="uk.co.trisystems.morph.ta.diary.soap.DiaryService"/>
            <parameter name="allowedMethods" value="createDiary getDiary"/>
            <parameter name="scope" value="application"/>
            <beanMapping qname="ns:diary" xmlns:ns="urn:DiaryService" languageSpecificType="java:uk.co.trisystems.morph.ta.diary.soap.DiarySoapBean"/>
        </service>Cheers
    Tracey Annison

    Hi,
    I have solved the problem, I forgot a parameter in the select, so java tells the an error. But now I have another problem. The procedure doesn't execute the order by. I pass the couple column_name order_type in a string as ("provider_description desc") dinamically but the procedure doesn't execute the ordering. Why?
    Thanks, bye bye.

  • Updating a table entry when remoteexception occures

    Hi,
    We are having the requirement that if remoteexception happens from EJB 1.1 then we need to update one table with status set to false.
    Since remoteexception is a system exception the transaction is marked for rollback and when we catch remoteexception and try to update the table
    it is not getting updated because the client transaction is also rolledback.
    we are actually using Websphere commerce server and we saw that WCS is able to update some of its own DB tables even when remoteexception occurs but we are not able to do it.
    So is there a way that when remotexception happens from EJB 1.1 we can update one of our tables.
    if yes then how can we do it.
    Thanks
    Ravi

    Try by putting this update code in a separate EJB with REQUIRES_NEW transaction scope.
    The the update is done in it's own transaction, and will not get affected by the other transactions 'marked for rollback' setting.
    -Roy

  • Develop and Deploying Web Service

    I'am developing a web service whose interface has the following method signature
    public abstract boolean setValueChanged()
              throws RemoteException;
              and the implemnetation class implementing it.
    After building the classes wsdl and the mapping file when i try to deploy in J2EE server i get the following
    error message:
    D:\Sun\AppServer\domains\domain1\applications\j2ee-modules\WorkBook\WEB-INF\classes\com\easi\document\DocObject_SOAPSerializer.java:226:
    cannot resolve symbol
    symbol : method isValuechanged ()location: class com.easi.document.DocObject
    ns3_myns3__boolean__boolean_Boolean_Serializer.serialize(new Boolean(instance.isValuechanged()), ns1_valuechanged_QNAME, null, writer, context);
    can anyone help me. Thanks in advance

    Yes, you should be able to do it. Once you create the web service you can attach ws-policy file to enable ws-security
    Regards,
    Sunil P

  • Doubt: NullPointerException instead of RemoteException???

    Hi,
    Scenario:
    1. An external object (hosted by another process) registers itself in WebLogic
    JNDI by invoking bind
    2. WebLogic EJBs invoke the external object, everything is OK
    3. Process hosting the external object goes down
    4. Remote reference still exists in JNDI
    5. Invoking the remote object throws the following exception:
    2002-09-09 15:54:13,492 ERROR [ExecuteThread: '6' for queue: 'default'] cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean
    - Failed to send message to clientconnector: Test-SMSC
    java.lang.NullPointerException
         at weblogic.transaction.internal.PropagationContext.getVersion(PropagationContext.java:646)
         at weblogic.transaction.internal.PropagationContext.writeExternal(PropagationContext.java:165)
         at weblogic.common.internal.ChunkedObjectOutputStream.writeObject(ChunkedObjectOutputStream.java:92)
         at weblogic.common.internal.ChunkedObjectOutputStream.writeObjectWL(ChunkedObjectOutputStream.java:113)
         at weblogic.rjvm.MsgAbbrevOutputStream.setTxContext(MsgAbbrevOutputStream.java:111)
         at weblogic.rmi.internal.BasicOutboundRequest.setTxContext(BasicOutboundRequest.java:143)
         at weblogic.rmi.internal.BasicRemoteRef.getOutboundRequest(BasicRemoteRef.java:95)
         at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:116)
         at cz.oskarmobil.is.bmg.connectivity.tcpip.UCPClientConnector_WLStub.sendMessage(Unknown
    Source)
         at cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean.sendMessage(UCPPostprocessorBean.java:294)
         at cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean.sendMessage(UCPPostprocessorBean.java:237)
         at cz.oskarmobil.is.bmg.connectivity.protocolhandler.ucp.UCPPostprocessorBean.onMessage(UCPPostprocessorBean.java:177)
         at weblogic.ejb20.internal.MDListener.execute(MDListener.java:348)
         at weblogic.ejb20.internal.MDListener.transactionalOnMessage(MDListener.java:282)
         at weblogic.ejb20.internal.MDListener.onMessage(MDListener.java:263)
         at weblogic.jms.client.JMSSession.onMessage(JMSSession.java:2309)
         at weblogic.jms.client.JMSSession.execute(JMSSession.java:2232)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:152)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:133)
    Why not RemoteException??? Why NullPointerException??? Wouldn't be RemoteException
    the right exception in this case?
    Please clarify this, since I thought it is enough to catch only RemoteException
    and relookup the object but now seems NullPointerException is also needed to be
    catched.
    Or, do I miss something?
    /SB

    while inserting data inserted into Temp_EmployeeDetails1, but not inserting in EmployeeDetails1,
    Because it is an INSTEAD OF trigger; instead of directly inserting the data into the base table the Trigger is fired and you have to insert the data on your own, e.g. after validationg or modifying the data.
    See
    INSTEAD OF INSERT Triggers /
    Designing INSTEAD OF Triggers
    Use an AFTER Trigger instead or modify your INSTEAD OF Trigger =>
    create trigger [dbo].[tr_emp1]
    on [dbo].[Employeedetails1]
    instead of insert
    as
    begin
    insert into Emploeeydetails1
    [EmployeeID],
    [Employeename],
    [Deptname]
    select ins.[EmployeeID],
    ins.[Employeename],
    ins.[Deptname]
    from inserted ins
    insert into Temp_Emploeeydetails1
    [EmployeeID],
    [Employeename],
    [Deptname]
    select ins.[EmployeeID],
    ins.[Employeename],
    ins.[Deptname]
    from inserted ins
    end
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How can client determine cause of RemoteException

    My BMP entity bean includes an SQL statement to UPDATE a database row (this UPDATE is in the ejbStore method).
    The UPDATE statement includes the following syntax
    UDPATE ....
    SET ....,
    no_of_changes = :no_of_changes + 1
    WHERE ....
    AND no_of_changes = :no_of_changes
    This ensures the UPDATE only proceeds if no other user has updated the row between my ejbLoad and ejbStore.
    If the update fails, becuase another user has updated the row, I throw an exception DatabaseBusyException, which extends RemoteException.
    My problem is that my client only sees a RemoteException, and I am therefore unable to be sure what message to give to the client. Ideally I would be able to tell it was a DatabaseBusyException and would inform the user that the 'Database is busy. Please retry later'.
    Any suggestions?

    Hmm, not sure on this. If the session bean is using remote access (PortableRemoteObject.narrow), then yes, all exceptions to the client are wrapped in Remote. But you should be able to get the exception message straight from remote - I'm not sure about the originating exception type, e.g. MyException.
    I must admit I've been focusing more server side so far, and the limited client side stuff I've done seems to indicate that remote simply passses the exception message. I don't think remote is being wrapped twice as you suggest, also not sure why you feel you need to trundle through the exceptions to the original message. I'm getting exceptions thrown from the SQL level in the EJB right up to the client (through several other session bean layers), and the original exception details are being preserved in the message body. EMail if you want to discuss further off-line.
    Rgds, LB

  • Weblogic 6.1sp2 custom exceptions being transformed to remoteexceptions

    Hi,
    We've recently ported our application from weblogic 6.0sp2 to weblogic 6.1sp2.
    In our ejbs we throw custom exceptions in our business logic, but somehow, in
    weblogic6.1sp2, these are being transformed into ejbexception/remoteexceptions.
    Do you have any ideas what we may be doing wrong?
    Thanks

    Thanks,
    we were doing that, but our custom exceptions were inheriting from RuntimeException
    instead of Exception which was the cause of the problem because weblogic 6.1 is
    more strict than weblogic 6.0.
    Diana
    Matthew Shinn <[email protected]> wrote:
    Hi Diana,
    Make sure your custom exceptions are declared in the throws clause of
    the
    home\remote\localHome\local interface methods. If they are not declared
    in the
    throws clause of your interface methods, they will be wrapped in RemoteExceptions
    or EJBExceptions before being thrown to the client.
    - Matt
    Diana wrote:
    Hi,
    We've recently ported our application from weblogic 6.0sp2 to weblogic6.1sp2.
    In our ejbs we throw custom exceptions in our business logic, but somehow,in
    weblogic6.1sp2, these are being transformed into ejbexception/remoteexceptions.
    Do you have any ideas what we may be doing wrong?
    Thanks

  • Invoking multiple host web services from JCAPS web service (RemoteException

    I am trying to invoke 2 web services sequentially ( not JCAPS service , some host service exposed as web service ), from my jcd which is also exposed
    as a web service.Both the host service have incorporated basic http authentication scheme,and i am setting the security credentials in the enviornment.
    (ie SOAP/HTTP external systems - client).
    However when I deploy my web service and try to invoke the host services,the first host service being called is invoked successfully and i get the response back.But the second service throws a RemoteException and the SOAP response carries "Client not authorized" message in faultstring detail tag.
    I do have separate external SOAP/HTTP systems for both the services,also the external systems have been configured with
    the HTTP basic authentication credentials.
    Infact I tried creating 2 separate JCAPS service for calling the host services individually.I am able to get the expected output
    from the services.
    The issue only arises when the host services are invoked in a sequential manner from a single JCAPS service.
    Please do let me know if i can fill in some more gaps in the information i have provided.
    Could this possibly be an issue in JCAPS?

    I have couple of doubts in this context.
    a) Is this issue only restricted when web services not developed using JCAPS are invoked or it arises also when 2 JCAPS external services are invoked
    sequentially.(I tried a PoC where in i created 2 deployments for calling the host services and invoked the deployment using another JCAPS web service and it worked fine)
    b) Also if this issue only arises when the external web services being invoked have security credentials or just invoking any web services in sequence create
    this problem.
    PS : Any link to contact the sun support team?

Maybe you are looking for

  • Payment Terms on Credit Note

    Hi, How to set system to calculate due date of credit note base on payment terms (same as invoice)? For example: Customer A has payment terms 7 days If I issue invoice on 05.09.2008 due date is 12.09.208 but when I issue credit note on 05.09.2008 due

  • Sizing photo's for iPhoto via Photoshop

    Hi all. Every time I upload my photo's from my Canon 5D I use Adobe Bridge (CS4) to view them and make adjustments in Camera Raw. No problem. Then I down size them in PS CS4 using "Save for Web and Devices" and put them into iPhoto. When I open them

  • Unable to Edit Portal Role properties

    Hi,    I am trying to make a Role/Workset as an "Entry Point" and am unable to set the "Navigation" Property for the role and Workset. The problem is that I do not see a Property Editor for the role. All I see are the options to display Role, Permiss

  • PS CS5 stalls when opening file with type layers

    Macbook Pro / 10.6.7 / 4GB RAM / 2GHz i7 / CS5 12.0.4.x64. No extra plugins or anything. New system, clean install from last week. When I open a file (any size/color/dimensions) that has type layers PS with hang for about 25 seconds, then come back j

  • "Allow log on locally" permission (SetInteractiveLogonRight) for SCOM 2012

    Hi Experts, Do we need to have  "Allow log on locally" permission (SetInteractiveLogonRight) for any of the SCOM accounts in 2012 R2? If yes why? Regards, Prajul Nambiar