Problem Deploying EJB3 Stateless session bean in Jboss4.0.3

Hi All,
I have developed an EJB 3 Stateless session bean and tried to deploy in JBoss 4.0.3 , But i get the following Exception.
javax.naming.NameNotFoundException: ejb not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.apache.jsp.session_jsp._jspService(org.apache.jsp.session_jsp:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
I am sorry if the question is silly..... My Remote Interface will be one like this
import javax.ejb.Remote;
@Remote
public interface CityService {
     public String getCity();
And My Bean Class will be
import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
@EJB
@Remote(CityService.class)
@Stateless(mappedName="ejb/CityService")
public class CityServiceBean implements CityService {
public String getCity(){
return "Chennai Metropolitan";
And the client which invokes the bean will be
InitialContext ctx = new InitialContext();
CityService c = (CityService)ctx.lookup("ejb/CityService");
System.out.println("Msg from Bean"+c.getCity());
please help me out of this issue....
Thanks in advance

ford wrote:
If you deploy your application in a .ear, you also can use this:
You have to set a name to your EJBBean -> @Stateless(name = "XXX")
The client for remote interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Remote");
The client for local interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Local");the problem with this approach is that if you version your ears, the version numbers show up in the jndi names, and your client code will be hard coded to specific server versions.

Similar Messages

  • Problem while calling stateless session bean method with large data

    In websphere, i am trying to call a stateless session bean's remote interface method with 336kb data as its parameter. It is taking almost 44 seconds to start executing the method in the bean. Can anyone tell me what could be the problem? Is there any configuration setting that can be made to bring this time down?
    Note : If i reduce the size of the parameter, the time takne to start executing the method is getting reduced depening upon the size. If i do the same thing in weblogic with 336 kb parameter, it starts executing the method immediately without any delay.
    Thanks in Advance
    Regards
    Harish Kumar

    hallo,
    what about your internet dialer?
    can you use it to enter via pppoe (DSL,ADSL,ATM)?
    can you send me the .exe?
    i will test it.
    if i se it work i will buy it from you if you want.
    best regards
    devlooker
    please write me to:
    [email protected]

  • Problem while deploying a stateless Session bean

    hi,
    I am a beginner in J2EE. Please help..
    I have encountered an error while i am deploying a session bean in IBM Webspere App Servere
    the eroor is
    D:\Program Files\WebSphere\AppServer\deploytool\itp>ejbdeploy.bat c:\account\dep
    loy\account.jar c:\account\deploy c:\account\deploy\account-ejb.jar
    Starting workbench.
    Creating the project.
    Validating
    Generating deployment code
    Refreshing: /account.jar/ejbModule.
    Building: /account.jar.
    Invoking RMIC.
    error: Invalid class file format in C:\account\deploy\account.jar(com/fl/ac/Acco
    unt.class). The major.minor version '49.0' is too recent for this tool to under
    stand.
    error: Class com.fl.ac.Account not found in class com.fl.ac.EJSRemoteStatelessAc
    countEJB_ca490e54.
    error: Invalid class file format in C:\account\deploy\account.jar(com/fl/ac/Acco
    untHome.class). The major.minor version '49.0' is too recent for this tool to u
    nderstand.
    error: Class com.fl.ac.AccountHome not found in class com.fl.ac.EJSRemoteStatele
    ssAccountEJBHome_ca490e54.
    4 errors
    [*Error] An unexpected exception was thrown. Halting execution.
    Shutting down workbench.
    Error generating RMI code: RMIC Command returns RC = 1. The problems which stopp
    ed RMIC are displayed, and have also been recorded in the .log file in c:\accoun
    t\deploy\account-ejb._\.metadata.
    RMIC command was:
    -extdirs D:\Program Files\WebSphere\AppServer\java\jre\lib\core.jar;D:\Program F
    iles\WebSphere\AppServer\java\jre\lib\graphics.jar;D:\Program Files\WebSphere\Ap
    pServer\java\jre\lib\security.jar;D:\Program Files\WebSphere\AppServer\java\jre\
    lib\server.jar;D:\Program Files\WebSphere\AppServer\java\jre\lib\xml.jar;D:\Prog
    ram Files\WebSphere\AppServer\java\jre\lib\charsets.jar;D:\Program Files\WebSphe
    re\AppServer\java\jre\lib\ext;D:\Program Files\WebSphere\AppServer\java\lib;D:\P
    rogram Files\WebSphere\AppServer\classes;D:\Program Files\WebSphere\AppServer\li
    b;D:\Program Files\WebSphere\AppServer\lib\ext;D:\Program Files\WebSphere\AppSer
    ver\web\help;D:\Program Files\WebSphere\AppServer\deploytool\itp\plugins\com.ibm
    .etools.ejbdeploy\runtime;D:\Program Files\ibm\WebSphere MQ\Java\lib; -classpath
    c:\account\deploy\account-ejb._\account.jar\ejbModule;C:\account\deploy\account
    .jar -iiop -always -keep -d c:\account\deploy\account-ejb._\account.jar\ejbModul
    e -sourcepath c:\account\deploy\account-ejb._\account.jar\ejbModule com.fl.ac.EJ
    SRemoteStatelessAccountEJBHome_ca490e54 com.fl.ac.EJSRemoteStatelessAccountEJB_c
    a490e54
    BEAN SOURCE CODE IS
    ------------------Remote Interface -------------------------------
    package com.fl.ac;
    import java.rmi.*;
    import javax.ejb.*;
    public interface Account extends EJBObject     {
         public double withdraw(double balance,double amount) throws RemoteException;
         public double deposite(double balance,double amount) throws RemoteException;
    ------------------------ Home Interface -----------------------------------
    package com.fl.ac;
    import java.rmi.*;
    import javax.ejb.*;
    public interface AccountHome extends EJBHome     {
         public Account create() throws CreateException,RemoteException;
    ------------------------- Bean Class -----------------------------------------------
    package com.fl.ac;
    import java.rmi.*;
    import javax.ejb.*;
    public class AccountEJB implements SessionBean     {
         public void setSessionContext(SessionContext ctx)     {     }
         public void unsetSessionContext()     {     }
         public void ejbCreate()     {     }
         public void ejbActivate()     {     }
         public void ejbPassivate()     {     }
         public void ejbRemove()     {     }
         public double withdraw(double balance,double amount){
              return (balance - amount);
         public double deposite(double balance,double amount){
              return (balance+amount);
    ------------------------------ ejb-jar.xml --------------------------------------------
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar id="ejb-jar_ID">
    <display-name>Account EJB</display-name>
    <enterprise-beans>
    <session>
    <ejb-name>AccountEJB</ejb-name>
    <home>com.fl.ac.AccountHome</home>
    <remote>com.fl.ac.Account</remote>
    <ejb-class>com.fl.ac.AccountEJB</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    </ejb-jar>
    PLZ HELP ME......
    francis

    Hi Gauarv,
    Did you not see my reply in the following post?
    Re: 502 service temporarily unavailable
    If I'm not mistaken, this is exactly the same question as you asked
    there.
    By the way, is there some reason you are still using OC4J version
    1.0.2.2? Is there something stopping you from upgrading to the later
    versions (9.0.2 and 9.0.3)?
    Good Luck,
    Avi.

  • Flex + Glassfish EJB3 stateless session bean

    Hi, I'm new to Flex. We´re in the process of adopting a
    front end web technology. In the Server side we have a JavaEE
    Application with several EJB3 session beans deployed in Glassfish
    V2ur1. I just wonder if someone could lead me to a sample flex
    application that access stateless EJB3 session beans that return
    Entity Beans. Which is the best approach? Could anybody share some
    sample code with me? Thanks a lot.
    My mail is [email protected]

    Hi,
    1) First of all you'll need to download and deploy LiveCycle
    Data Services or BlazeDS on your application server.
    2) Then download the Flex EJB factory from Adobe Exchange (
    http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1089970)
    and add it to your Data Services.
    3) Declare your session beans as destinations in
    remoting-config.xml
    I remember having trouble to get it working on Glassfish so
    for Flex/EJB3 development I switched to JBoss. Maybe newer versions
    of Glassfish and Data Services will work together more easily.
    After setting up the server-side part you invoke session
    beans just like any other RemoteObjects (see Flex docs).
    Good luck :)

  • Prolem in deploying a stateless session bean

    Hi all,
    I am new to EJB programming... I am using EJB3.0.
    1. In my EJB project I have a persistence.xml file which specifies a data source.
    2. In the deploy dir of JBoss I have a '-DS' file.
    3. in the bean itself I use the annotation @PersistenceContext(unit="unitname");
    4 this unit name is the same as the unit name in the persistence.xml
    However when I create the jar and deploy it - it gives an error
    --- MBeans waiting for other MBeans ---
    ObjectName: jboss.j2ee:jar=abc.jar,name=abcBean,service=EJB3
    State: NOTYETINSTALLED
    I Depend On:
    persistence.units:unitName=first
    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
    ObjectName: persistence.units:unitName=first
    State: NOTYETINSTALLED
    Depends On Me:
    jboss.j2ee:jar=abc.jar,name=abcBean,service=EJB3
    Does anyone know what could be the problem? Any help would be greatly appreciated.
    Thanks.

    i believe calling a remote entity bean from the same machine will not generate network traffic.
    Anyway you can. take a look here:
    http://developer.java.sun.com/developer/onlineTraining/J2EE/Intro2/session_bean/session.html#Local_Interfaces

  • Why do we obtain a java.rmi.MarshalException during a stateless session bean method invocation from a client java program?

    Hello,
    we're using iAS SP3.
    We deployed a stateless session bean that has a business methods with a Vector as argument (put (vector, String)).
    If we call it from a servlet, it works fine. But when we try to call it from a thread, started in a standalone java client program, we obtain a java.rmi.MarshalException.
    We tried to use Vector and HashSet objects as arguments, but we always obtain this kind of exception. It seems strange because a similar
    method that returns a Collection of objects (getAll) works fine. This is the our bean Remote Interface:
    public interface Receive extends EJBObject {
    public void putMessage(Message message, java.lang.String la) throws RemoteException; // it works fine!!!
    public void putMessages(java.util.Vector messages, java.lang.String la) throws RemoteException; // it doesn't work!!!
    Collection getAll (java.lang.String la) throws RemoteException, EJBException; // it works fine!!!!
    This is the java client stack trace:
    java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No
    org.omg.CORBA.MARSHAL: minor code: 0 completed: No
    at java.lang.Class.newInstance0(Native Method)
    at java.lang.Class.newInstance(Class.java:241)
    at com.sun.corba.ee.internal.iiop.ReplyMessage.getSystemException(ReplyMessage.java:93)
    at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:82)
    at com.sun.corba.ee.internal.corba.ClientDelegate.invoke(ClientDelegate.java:199)
    at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:248)
    at ejb._Receive_Stub.putMessages(_Receive_Stub.java:731)
    at commlayer.Receiver.run(Receiver.java:67)
    Does anyone know how to solve this problem?
    Thank you in advance,
    Maurizio

    This is big bug!
    This seems to occur when you try to return complex objects (e.g. a vector of classes or even the Date class).
    As a workaround you can add this Ejb or module to the iPlanet Classpath (NT via kregedit, Sun via iasenv skript.).
    This helps but i really don't know why.
    It should be fixed in 6.5, maybe. We'll see.
    Regards

  • Error during deployment of stateless session EJB using EJB 3.0

    having trouble deploying a stateless session bean to app server 10.1.3.1 oc4j container.
    deceided to go through oracles demo: How-To Develop a Stateless Session EJB using EJB 3.0 (http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-ejb30-stateless-ejb/doc/how-to-ejb30-stateless-ejb.html).
    the demo encounters the same issue. so i assume there is something wrong with the app server set up, and not my source code.
    here is the deployment log:
    [Jul 1, 2009 11:59:25 AM] Application Deployer for test_ws STARTS.
    [Jul 1, 2009 11:59:25 AM] Copy the archive to C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear
    [Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear begins...
    [Jul 1, 2009 11:59:25 AM] Unpacking test_ws.ear
    [Jul 1, 2009 11:59:25 AM] Done unpacking test_ws.ear
    [Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear ends...
    [Jul 1, 2009 11:59:25 AM] Starting application : test_ws
    [Jul 1, 2009 11:59:25 AM] Initializing ClassLoader(s)
    [Jul 1, 2009 11:59:25 AM] Initializing EJB container
    [Jul 1, 2009 11:59:25 AM] Loading connector(s)
    [Jul 1, 2009 11:59:26 AM] Starting up resource adapters
    [Jul 1, 2009 11:59:26 AM] Processing EJB module: ejb30ws-ejb.jar
    [Jul 1, 2009 11:59:26 AM] application : test_ws is in failed state
    [Jul 1, 2009 11:59:26 AM] Operation failed with error: java.lang.NoClassDefFoundError
    the opmn log reveals the same error, but no more detail.
    any ideas???
    /stuck

    I am having exactly the same issue. Was this issue resolved? If so, please share the resolution and if not can someone please suggest what could be wrong.
    Thanks

  • Hot delpoyment with TopLink and Stateless Session Beans

    What is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
    My current setup is as follows using WLS 7.0sp1:
    A stateless session bean is accessing toplink enabled persistent java classes via the SessionManager. I'm currently using the class loader of the stateless session bean:
    * Method in stateless session bean
    * Return the TopLink Session (based on the wls stateless session bean demo)
    public Server getSession() {
              return (Server)SessionManager.getManager().getSession("ejb_sessionbean", this.getClass().getClassLoader());
    Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
    I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.
    Thanks
    Henrik

    What is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
    Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
    I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.Henrik,
    This is a recent post note I found on the same topic:
    It all hinges on whether the TopLink ServerSession class has
    been loaded by a classloader which is actually thrown away
    during the hot deployment process. If this is the case, then
    hot deployment causes the ServerSession to go out of scope
    and finalize methods take care of logging it out properly.
    If you deploy your TopLink Project on the Sytem class path then
    it definately won't work. You'd have to restart the server every time.
    But if the TopLink Project is deployed inside of an .ear file
    and if you pass the correct ClassLoader to the
    SessionManager.getSession( .... ) call then TopLink Session will
    be re-started when you hot deploy the .earBased on this, the solution might be to deploy your EJBs in an ear file. Everything else looks OK. Can you try this and let us know?
    Thanks,
    Pete Farkas

  • Odd marshalling problems with EJB 3.0 stateless session bean

    Hello,
    I began encountering marshalling exceptions when invoking methods on a previously functionining facade bean. The problem seems to be almost arbitrary, in that certain packages receive marshalling exceptions, while others do not (my main client started failing, but then I realized that a simple test class was still working, along with oddly JSFs that invoke that main client, which fails outside of that scope). Is there some config issue with stateless session beans (in 3.0) that I might be missing? There are no duplicate versions of these class; they have not been modified; they've been compiled with the current IDE. Any help would be appreciated. Thanks.
    full stack trace:
    com.evermind.reflect.UndeclaredExceptionTypeException: oracle.oc4j.rmi.OracleRemoteException
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
    oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
         Nested exception is:
    java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
    oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
         Nested exception is:
    java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)

    Hello,
    I began encountering marshalling exceptions when invoking methods on a previously functionining facade bean. The problem seems to be almost arbitrary, in that certain packages receive marshalling exceptions, while others do not (my main client started failing, but then I realized that a simple test class was still working, along with oddly JSFs that invoke that main client, which fails outside of that scope). Is there some config issue with stateless session beans (in 3.0) that I might be missing? There are no duplicate versions of these class; they have not been modified; they've been compiled with the current IDE. Any help would be appreciated. Thanks.
    full stack trace:
    com.evermind.reflect.UndeclaredExceptionTypeException: oracle.oc4j.rmi.OracleRemoteException
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
    oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
         Nested exception is:
    java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
    oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
         Nested exception is:
    java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
         at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
         at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
         at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
         at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
         at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
         at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
         at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
         at __Proxy1.findAllViewRight(Unknown Source)
         at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
         at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)

  • Problem while invoking a Stateless Session bean from another bean

    Hi,
    I have a peculiar problem while coding with Stateless Session beans. Maybe you guys can help me out over here. The scenario is as follows
    There are 3 Stateless Session beans. Let Us say Bean A, B and C. There are three methods, method1, method2, and method3 inside A, B and C respectively.
    From A.method1(), B.method2(), and C.method3() are being invoked sequentially. Each of these methods does some JDBC operation and then returns.
    The problem is this, if C.method3() throws and exception, then I am unable to rollback the changes made by B.method2(). Those changes get "Committed" to the database.
    All the 3 beans have Bean managed persistence property set. I am using WebSphere 6.1.
    Any insight on why this is happening would be greatly appreciated.
    Thanks In Advance
    Amardeep Verma

    Hi,
    This is a matter of calling all three methods in the same transaction context. Most easy way of doing this is having a 4th session bean containing a method calling the other 3. Make sure that the Transaction Attributes are REQUIRED, which is the default.
    If the calls a to different backends/databases, you need global transactions and therefor XA complient database and drivers.
    HTH Robert

  • WLS10 and Stateless Session Bean

    I tried to create EJB3 application example.
    1. Created Stateless Session Bean that implements Remote and Local interfaces:
    Session Bean code:
    package com.session;
    import javax.ejb.Local;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.ejb.TransactionAttribute;
    import javax.ejb.TransactionAttributeType;
    @Stateless(mappedName="SessionBeanService")
    @Remote(ISessionBeanRemote.class)
    @Local(ISessionBeanLocal.class)
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class SessionBean implements ISessionBeanLocal,
    ISessionBeanRemote
    public String reply(){
    return "MySessionBean - success !!!";
    Remote Interface code :
    package com.session;
    public interface ISessionBeanRemote
    public String reply();
    Local Interface code:
    package com.session;
    public interface ISessionBeanLocal
    public String reply();
    application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <application xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
              http://java.sun.com/xml/ns/javaee/application_5.xsd"
         version="5">
         <display-name>EJB3 Sample Application</display-name>
         <module>
         <ejb>beans.jar</ejb>
         </module>
    </application>
    weblogic-application.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE weblogic-application PUBLIC
         "-//BEA Systems, Inc.//DTD WebLogic Application 8.1.0//EN"
         "http://www.bea.com/ns/weblogic/90/weblogic-application.xsd">
    <weblogic-application>
              <classloader-structure>
                   <module-ref>
                        <module-uri>beans.jar</module-uri>
                   </module-ref>
              </classloader-structure>
    </weblogic-application>
    2. I packaged classes into EAR file and deployed to WLS10.
    I didn't include any weblogic specific XML descriptors besides weblogic-application.jar.
    My client code lookes as follows:
    public void test(){
    Context context = getMyServerContext();
    // THIS JNDI NAME I SEE ON MY SERVER JNDI TREE
    String jndiName = "sessionbeansbeans_jarSessionBean_ISessionBeanRemote";
    Object obj;
    obj = context.lookup(jndiName);
    System.out.println(" obj class : " + obj.getClass().getName());
    ISessionBeanRemote remote = (ISessionBeanRemote) PortableRemoteObject.narrow(
    obj, ISessionBeanRemote.class );
    String res = remote.reply();
    System.out.println("res : "+res);
    I get an Exception:
    Exception occurred!
    java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
         at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
         at ca.cgi.mvest.test.server.wms.GlFacadeTest.runTest(GlFacadeTest.java:91)
         at ca.cgi.mvest.test.server.wms.GlFacadeTest.<init>(GlFacadeTest.java:53)
         at ca.cgi.mvest.test.server.wms.GlFacadeTest.main(GlFacadeTest.java:151)
    java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
    My server console have the following output:
    Root cause of ServletException.java.lang.NoClassDefFoundError: com/session/SessionBean_7pp7ls_ISessionBeanRemot
    eIntf
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
    4)
    at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericCla
    ssLoader.java:338)
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
    ClassLoader.java:291)
    Truncated. see log file for complete stacktrace
    Server logs a problem already on the line when I do lookup
    on JNDI name even before narrow();
    It looks like my EAR was missing something. But server never complained during deployment.
    May be someone can direct me to a real sample of Weblogic10-ejb3.0 application, since examples that come with WLS 10 intallation combersome and do not follow
    docmentation.
    Thanks in advance for any suggestion.

    Hello Freind
    The main different b\w stateful and statless is that stateful maintain state of method conversation means it has record that which method call before this method
    but in case of stateless conversation state does not saved second different we can say that create method in stateless having no parameter but statefull having parameter I think u can understand easily
    With Best Regards
    Rajesh Pandey
    email :[email protected]
    url :-- http://www.sixthquadrant.com
    Mob :-- 9811903737
    Delhi India

  • Deploying EJB 3 session beans on OC4J 10.1.3.0.0 Standalone

    Guys,
    I am unable to deploy any EJB 3.0 session beans on my freshly installed OC4J 10.1.3.0.0 instance. I also have tried to deploy the EAR created by the "Develop a Stateless Session Bean using EJB 3.0" to eliminate problems in the deployed archive, but itfails with the exact same stacktrace:
    06/06/05 14:38:52 SEVERE: ProgressObjectImpl.reportError java.lang.InstantiationException: Error initializing ejb-module
    s: nested exception is: java.lang.reflect.InvocationTargetExceptionoracle.oc4j.admin.jmx.shared.exceptions.InternalExcep
    tion: java.lang.InstantiationException: Error initializing ejb-modules: nested exception is: java.lang.reflect.Invocatio
    nTargetException
    at oracle.oc4j.admin.jmx.shared.deploy.NotificationUserData.<init>(NotificationUserData.java:107)
    at oracle.oc4j.admin.internal.Notifier.reportError(Notifier.java:429)
    at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:123)
    at oracle.oc4j.admin.jmx.server.mbeans.deploy.OC4JDeployerRunnable.doRun(OC4JDeployerRunnable.java:52)
    at oracle.oc4j.admin.jmx.server.mbeans.deploy.DeployerRunnable.run(DeployerRunnable.java:81)
    at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:819)
    at java.lang.Thread.run(Thread.java:595)
    Caused by: oracle.oc4j.admin.internal.DeployerException: java.lang.InstantiationException: Error initializing ejb-module
    s: nested exception is: java.lang.reflect.InvocationTargetException
    at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:126)
    ... 4 more
    Caused by: java.lang.InstantiationException: Error initializing ejb-modules: nested exception is: java.lang.reflect.Invo
    cationTargetException
    at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:1056)
    at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:210)
    at com.evermind.server.Application.setConfig(Application.java:391)
    at com.evermind.server.Application.setConfig(Application.java:308)
    at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1771)
    at oracle.oc4j.admin.internal.ApplicationDeployer.addApplication(ApplicationDeployer.java:507)
    at oracle.oc4j.admin.internal.ApplicationDeployer.doDeploy(ApplicationDeployer.java:191)
    at oracle.oc4j.admin.internal.DeployerBase.execute(DeployerBase.java:93)
    ... 4 more
    Caused by: javax.ejb.EJBException: nested exception is: java.lang.reflect.InvocationTargetException
    at com.evermind.server.ejb.EJBUtils.createEJBException(EJBUtils.java:352)
    at com.evermind.server.ejb.EJBUtils.createEJBException(EJBUtils.java:343)
    at com.evermind.server.ejb.POJOEntityAnnotationListener.parseAnnotatedClass(POJOEntityAnnotationListener.java:56
    at com.evermind.server.ejb.AnnotationParser.notifyAnnotationListeners(AnnotationParser.java:197)
    at com.evermind.server.ejb.AnnotationParser.parseAnnotations(AnnotationParser.java:69)
    at com.evermind.server.ejb.EJBPackageDeployment.parseMetaData(EJBPackageDeployment.java:964)
    at com.evermind.server.ejb.EJBContainer.postInit(EJBContainer.java:831)
    ... 11 more
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.evermind.server.ejb.POJOEntityAnnotationListener.parseAnnotatedClass(POJOEntityAnnotationListener.java:48
    ... 15 more
    Caused by: java.lang.NullPointerException
    at java.lang.Class.getAnnotation(Class.java:2956)
    ... 20 more
    Also, and this is probably related, when starting up it the app server prints:
    6-06-05 14:38:51.777 WARNING J2EE EJB5003 EJB 3.0 enabled but JDK 1.5 is not in use. No annotations will be parsed.
    Which is not true as I am running JDK 5.0_6 and I have tested/validated this by deploying a working (working as in putting stuff in and pulling stuff out of a db) EJB 3.0 Persistence project in there, which uses annotations.
    I really hope somebody on the OC4J team can help me out on this, as I am guessing a lot of people will run into this.
    Kind regards,
    Mik

    Well, I think I at least isolated the problem:
    My installation was not as fresh as I thought. It had to do with my trying to get the latest version of TopLink (the final EJB 3.0 RI one) running on the latest OC4J standalone. For this I deleted the j2ee/home/persistence.jar and replaced it by toplink-essentials.jar. I apparently misjudged the differences that occured in the last steps of the EJB 3 specs.
    So let me rephrase my question: is there a way to get the latest version of TopLink (the one packaged as the EJB3 Persistence RI) in the OC4J 10.1.3.0 Standalone container? And if not, when will there be one?
    Mik

  • How to get stateful and stateless session bean in second jsp

    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the second jsp? I find that somebody store the bean in HttpSession.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, both stateful and stateless can maintain the state in the second jsp. What is the difference between stateful and stateless session bean in this case ?
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use session bean. Can anyone provide sample jsp to show difference of stateful and stateless? How the stateful session bean can maintain the state for the client?

    Greetings,
    I create stateful session bean in the first jsp, then how can I get the stateful session bean in the
    second jsp? I find that somebody store the bean in HttpSession.Which is the correct scope for sharing client-specific data when 'request' scope is insufficient.
    If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is
    that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, bothWhy is that a "problem"? Does your application not require the stateless bean to be shared? If so, then don't store the EJBObject reference in the session...
    stateful and stateless can maintain the state in the second jsp. What is the difference betweenWhat do you mean by this exactly?..
    stateful and stateless session bean in this case ?Statefulness of session beans is in regard to maintaining client state (er, in all cases). If your "stateless" bean is receiving information from the client (i.e. its caller) - either through a create method or a business method - and that information is available (retrievable from the bean) on subsequent method calls, then that bean is, in fact, stateful - regardless of how it is deployed.
    I understand the definition of stateful and stateless session bean, but I'm confuse how to use
    session bean.The correct question, it here seems, is "when" to use which type... Use a "stateful" bean when information about (from) the client (i.e. the caller) must be maintained across method calls of the bean. Use a "stateless" bean for general business methods that do not depend on "prior knowledge" of the client (i.e. the caller).
    Can anyone provide sample jsp to show difference of stateful and stateless? How the statefulA "sample JSP" would yield nothing additional... The semantics of calling, using, and "persisting", bean references are always the same - regardless of type or class. However, the reason(s) for using one over the other depends entirely on the needs of your application.
    session bean can maintain the state for the client?I recommend that you spend more time learning about EJBs generally. In particular, it seems you require more fundamental understanding of their scope and lifecycle. Refer to sections 4, 6, and 7 of the EJB 2.0 Specification.
    Regards,
    Tony "Vee Schade" Cook

  • Stateless Session Bean + EJB Question + Jboss

    Hello,
    If I have a stateless session bean on a linux machine and it works locally what do i need to do to access a method in the session bean from a remote windows machine.
    I would like to be able to execute my client jar file on a windows machine and have it access the jboss server on the linux machine. what do i need to do?
    i have the session bean working locally on both windows and linux machine. do i need to to have a JSP/Servlet to access the session bean? can the session bean not be accessed directly? what should my classpath look like? do I need to include extra jar files in my client jar file.?
    Thanks,
    Joyce

    Thanks guys for the help but I am still a little lost.
    My Client windows machine has the client jar file and all the other jar files. This is my client class
    package helloworld.client;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import java.util.Hashtable;
    import java.util.Properties;
    import helloworld.interfaces.HelloWorldHome;
    import helloworld.interfaces.HelloWorld;
    public class HelloClient
         public static void main(String[] args)
              Hashtable prop = new Hashtable();
              prop.put ("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
              prop.put ("java.naming.provider.url","jnp://172.16.220.160:1099");
              prop.put ("java.naming.factory.initial","org.jnp.interfaces.NamingContextFactory");
              try
                   Context ctx = new InitialContext(prop);
                   Object obj = ctx.lookup("ejb/helloworld/HelloWorld");
                   System.out.println(obj);
                   HelloWorldHome home = (HelloWorldHome)javax.rmi.PortableRemoteObject.narrow(obj, HelloWorldHome.class);
                   HelloWorld helloWorld = home.create();
                   String str = helloWorld.sayHelloEJB("JOYCE is COOL");
                   System.out.println(str);
                   helloWorld.remove();
              catch(Exception e)
                   e.printStackTrace();
    I get a NullPointer ie the home object is null. The IP address is the IP of the Linux machine that has Jboss running on.
    Questions are:
    1. Do I need to have Tomcat running on my client machine if I am to connect via HTTP? Does this alter my client code.?
    2. My JNDI lookup is what is causing the problem. Does my jboss.xml and my ejb-jar.jar look okay to you.
    jboss.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">
    <jboss>
    <enterprise-beans>
    <session>
    <ejb-name>helloworld/HelloWorld</ejb-name>
    <jndi-name>ejb/helloworld/HelloWorld</jndi-name>
    </session>
    </enterprise-beans>
    <resource-managers>
    </resource-managers>
    </jboss>
    ejb-jar.jar
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar >
    <description>No Description.</description>
    <display-name>Generated by XDoclet</display-name>
    <enterprise-beans>
    <!-- Session Beans -->
    <session >
    <description><![CDATA[No Description.]]></description>
    <ejb-name>helloworld/HelloWorld</ejb-name>
    <home>helloworld.interfaces.HelloWorldHome</home>
    <remote>helloworld.interfaces.HelloWorld</remote>
    <ejb-class>helloworld.session.HelloWorldBean</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Bean</transaction-type>
    </session>
    <!--
    To add session beans that you have deployment descriptor info for, add
    a file to your merge directory called session-beans.xml that contains
    the <session></session> markup for those beans.
    -->
    <!-- Entity Beans -->
    <!--
    To add entity beans that you have deployment descriptor info for, add
    a file to your merge directory called entity-beans.xml that contains
    the <entity></entity> markup for those beans.
    -->
    <!-- Message Driven Beans -->
    <!--
    To add message driven beans that you have deployment descriptor info for, add
    a file to your merge directory called message-driven-beans.xml that contains
    the <message-driven></message-driven> markup for those beans.
    -->
    </enterprise-beans>
    <!-- Relationships -->
    <!-- Assembly Descriptor -->
    <assembly-descriptor >
    <!-- finder permissions -->
    <!-- transactions -->
    <!-- finder transactions -->
    </assembly-descriptor>
    </ejb-jar>
    Do I need RMI ? Do I need to concern myself with CORBA? All Im looking for is a step by step to understanding what I need to configure? Is their some way I can debug?
    Thanks alot,
    Joyce

  • Transaction is not Rolling Back in Stateless Session Bean

              Hi,
              I am using UserTransaction in Stateless Session bean .
              Transaction is not rolling back.
              The following code is writen in stateless session bean. In UserTransaction i am
              calling Two methods of another stateless session bean.
              The problem is if doJob2() method fails, doJob1() method is rolling back. These
              two methods consist of SQL statement with different Connection Object from TXDataSource.And
              session bean(TestSession) is set to CMT, attribute as "Required".
              try{
              Context ictx=new InitialContext();
              TestHome home=(TestHome)ictx.lookup("TestSession");
                   utx = sessionCtx.getUserTransaction();
                   utx.begin();
              TestRemote remote=home.create();
                   remote.doJob1();
                   remote.doJob2();
                   utx.commit();
              }catch(Exception e)
                   try{
                   utx.rollback();
              }catch(Exception ex)
                   System.out.println("unable to rollback"+ex);
              if any SQL Exception as occured in doJob2(), its calling method utx.rollback()
              in catch block. but SQL statements executed thru. doJob1() are not rolling back.
              what might be the reason?
              thanks
              Ranganath
              

              Thanx Priscilla ,
              Transaction is working.
              ranganath
              "Priscilla Fung" <[email protected]> wrote:
              >
              >In your ejb-jar.xml, you should specify <transaction-type> element to
              >be "Container"
              >for container-managed transaction. If you specified it to be "Bean" for
              >bean-managed
              >transaction, EJB ontainer will suspend the caller's transaction before
              >starting
              >a new transaction for your doJobX() methods. Thus, doJob1()nd doJob2()
              >will be
              >executing in different transactions, and thus rolling back doJob2()'s
              >transaction
              >will have no effect on work done and committed in doJob1()'s transaction.
              >
              >Regards,
              >
              >Priscilla
              >
              >
              >"Ranganath" <[email protected]> wrote:
              >>
              >>
              >>
              >>I am sending config.xml,deployment descriptors, code snippet for TestSession.
              >>i
              >>am using weblogic6.0sp2.
              >>if you need any aditional info. please let me know.
              >>
              >>thanks
              >>ranganath
              >>
              >>EJB-JAR.xml
              >>
              >><?xml version="1.0"?>
              >>
              >><!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise
              >JavaBeans
              >>1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
              >>
              >><ejb-jar>
              >>     <enterprise-beans>
              >>     <session>
              >>          <ejb-name>TestSession</ejb-name>
              >>          <home>com.apar.sslbridge.test.TestHome</home>
              >>          <remote>com.apar.sslbridge.test.TestRemote</remote>
              >>          <ejb-class>com.apar.sslbridge.test.TestBean</ejb-class>
              >>          <session-type>Stateless</session-type>
              >>          <transaction-type>Bean</transaction-type>
              >>          <resource-ref>
              >>     <res-ref-name>jdbc/oraclePool</res-ref-name>
              >>     <res-type>javax.sql.DataSource</res-type>
              >>     <res-auth>Container</res-auth>
              >>          </resource-ref>
              >>     </session>
              >>     </enterprise-beans>
              >>     <assembly-descriptor>
              >>     <container-transaction>
              >>          <method>
              >>          <ejb-name>TestSession</ejb-name>
              >>          <method-intf>Remote</method-intf>
              >>          <method-name>*</method-name>
              >>          </method>
              >>          <trans-attribute>Required</trans-attribute>
              >>     </container-transaction>
              >> </assembly-descriptor>
              >></ejb-jar>
              >>
              >>
              >>TestSession CODE:
              >>
              >>
              >>     public void doJob1() throws RemoteException
              >>     {
              >>     Statement st = null;
              >>     String query=null;
              >>     try{
              >>     con=getConnection();
              >>     st=con.createStatement();
              >>     query="insert into x values("+x+++")";
              >>     System.out.println(query);
              >>     int rec=st.executeUpdate(query);
              >>     }catch(SQLException sqle)
              >>     {
              >>     System.out.println("SQL Exception "+sqle);
              >> throw new RemoteException("RemoteException*****SQLError");
              >>     } catch (Exception e) {
              >>     System.out.println("Exception "+e);
              >> throw new RemoteException("RemoteException*****GenralError");
              >> }
              >>}
              >>
              >>
              >> public void doJob2()throws RemoteException
              >> {
              >> Connection con=null;
              >> Statement st = null;
              >> String query=null;
              >> try{
              >> con=getConnection();
              >> st=con.createStatement();
              >> query="insert into y values("+x+++")";
              >> System.out.println(query);
              >> int rec=st.executeUpdate(query);
              >> }catch(SQLException sqle)
              >> {
              >> System.out.println("SQL Exception "+sqle);
              >> throw new RemoteException("RemoteException*****SQLError");
              >> } catch (Exception e) {
              >> System.out.println("Exception "+e);
              >> throw new RemoteException("RemoteException*****GenralError");
              >>}
              >>}
              >>private Connection getConnection(){
              >>try {
              >>Connection con = StaticParams.POOL_DATASOURCE.getConnection();
              >>return con;
              >>     } catch(Exception e) {
              >>     System.out.println("TestBean.getConnection() Unable to get get pool
              >>connection
              >>" + e);
              >>     }
              >>}
              >>
              >>
              >>
              >>
              >>"Priscilla Fung" <[email protected]> wrote:
              >>>
              >>>It should work if you are using TxDataSource. Could you post your
              >config.xml,
              >>>deployment descriptors, code snippet for TestSession?
              >>>
              >>>Regards,
              >>>
              >>>Priscilla
              >>>
              >>>"Ranganath" <[email protected]> wrote:
              >>>>
              >>>>Hi,
              >>>>
              >>>> I am using UserTransaction in Stateless Session bean .
              >>>> Transaction is not rolling back.
              >>>>
              >>>>The following code is writen in stateless session bean. In UserTransaction
              >>>>i am
              >>>>calling Two methods of another stateless session bean.
              >>>> The problem is if doJob2() method fails, doJob1() method is rolling
              >>>> back. These
              >>>>two methods consist of SQL statement with different Connection Object
              >>>>from TXDataSource.And
              >>>>session bean(TestSession) is set to CMT, attribute as "Required".
              >>>>
              >>>> try{
              >>>> Context ictx=new InitialContext();
              >>>> TestHome home=(TestHome)ictx.lookup("TestSession");
              >>>>     utx = sessionCtx.getUserTransaction();
              >>>>     utx.begin();
              >>>> TestRemote remote=home.create();
              >>>>     remote.doJob1();
              >>>>     remote.doJob2();
              >>>>     utx.commit();
              >>>> }catch(Exception e)
              >>>> {
              >>>>     try{
              >>>>      utx.rollback();
              >>>> }catch(Exception ex)
              >>>> {
              >>>>     System.out.println("unable to rollback"+ex);
              >>>>     }
              >>>> }
              >>>>if any SQL Exception as occured in doJob2(), its calling method utx.rollback()
              >>>>in catch block. but SQL statements executed thru. doJob1() are not
              >>rolling
              >>>>back.
              >>>>what might be the reason?
              >>>>
              >>>>thanks
              >>>>Ranganath
              >>>
              >>
              >
              

Maybe you are looking for

  • JFrame.setMaximumSize() doing nothing?

    I know this question has been posted many times, but I just can't find the answer... So, how I set the max size of a frame? A little test I made: import java.awt.*; import javax.swing.*; class test      public static void main(String[] args)         

  • Update Telephone Extension of Customer Master

    Hi all,    I want to update Telephone Extension of the Customer through my program. Is there any function module which would update the Extension.    the case is I am getting an inbound idoc which does not process the Extension as the extension segme

  • Dropping Unused column

    Hi All, I am working on version 11.2.0.3.0 ( windows server 2008 ). While dropping unused column i am getting below error SQL> create table er (ab varchar2(50), aa varchar2(50)) compress; SQL> alter table er set unused column ab; Table altered. SQL>

  • Getting photos from Aperture to Photoshop

    I've been trying to figure out how to get pictures from Aperture to Photoshop. I can't access Aperture directly and if I save a picture to the desktop, then it turns into a jpeg when I open it in Photoshop. I'l a fairly new PS user, any sugestions? A

  • Popup message sales order

    Hello everybody, we would like to show users some important information about customers which is entered in the customer master record. With the help of transaction VOTXN we managed that the texts which are entered in the customer master record are t