New to EJB, JMS

I recently started to understand the concepts and examples around EJB, JMS, servlets. Now I am trying to understand how does UserTransactions (JTA) works in an environment where there is a TIBCO server that handles the queues and transactions to Oracle that gets handled by JBoss. I am just trying to understand what happens between utx.begin and utx.commit or utx.rollback when there are calls specific to JMS and JDBC are involved (in my case Tibco and Jboss). Does everything gets rolled back or commit ? I couldn't find any material that clears such concept. Best I could get was some information about Bean Managed transaction in JavaEE 5 tutorial. It would be great and helpful if someone could direct me to good resources or if somebody could explain it to me.

JTA can make your queue and database a single unit of work. If the database process fails, the message is put back on the queue. You have to use XA database drivers and two-phase commit.
For somebody who's new, this is a pretty advanced topic.
%

Similar Messages

  • Specifying JNDI Details for Controls (EJB/JMS) in Workshop

    Hello,
    I was running into some basic issues in using workshop for building applications. Any help is appreciated !
    How do I point Controls (EJB/JMS) to JNDI where the Objects have been bound
    In J2EE I will do this :
    Context ctx = new InitialContext(ht); // ht has Provider URL etc.
    Specifically in Design view of Workshop for (WLI) JMS Control how do you define PROVIDER_URL, SECURITY_PRINCIPAL, etc. My JMS Server is targeted to separate Managed Server that where Workshop Applications are deployed and I do not want to create Foriegn Destinations etc. on Managed Server where Applications get deployed.
    For EJB Controls: How do you lookup remote EJBs that get deployed as a part of (EARs) on managed server (different from where Workshop Application and EJB Controls reside)
    Basic Question: How do we distribute this "EJB Control" JAR to clients to call these EJBs using controls and specify the JNDI Environment for the control that surfaces the EJB resource deployed remotely?
    I cannot import these as modules in an Workshop Application (=> EAR) and generate controls from these as they will get "deployed" in that application and we want only one deployment.
    Thanks
    Harish

    Hi there,
    In your GUI client you should consdier building a model that represents the data that you want the GUI to display. This model would contain the references to the EJB's that you need to use. If you want to avoid using some kid of model then it really depends on the complexity of your GUI. If your GUI consists of one JFrame then everything can be done inside the main class for the GUI. If you have lots of sub windows then you need to consider where the references will be used. If theyare used in more than one window then you could end up with lots of complex cross references which is why the model would be better in this situation.
    JNDI lookups can be expensive and this depends on several factors particularly network latency, if your client is self contained then once you have a reference to a home interface then you may as well keep and use it for any future calls. The key to this is keeping references to home interfaces as instance variables rather than scoping them locally.
    There should really be no bottleneck caused by using as single session bean as a Facade to your EJB tier. The Session Facade is a very common pattern and the one that is most espoused by the various authors writing EJB tech books. As far as coupling is concerned this is an ideal situation as your client can then make coarse grained calls to the single facade session bean instead of making lots of smaller fine-grained calls to several session beans. I'd say that this is a good general design.
    Hope this helps
    Amanda
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers

  • New to EJBs  exception in client code

    Hi i am new to EJBs when i execute the client code it is giving the following exceptions
    can any one tell me the steps to execute a simple EJB session bean. what class paths and what config and what xml files are required??
    i followed so many tutorials but the problem is not solved
    thanks
    here is the exception i wrote the JNDI name as "HelloWorld" in the weblogic-ejb-jar.xml (i am using weblogic 8.1 application server)
    Full compiler error(s):
    C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_FirstEjb_HelloClient\jsp_servlet\__helloclient.java:139: cannot resolve symbol
    symbol  : class HelloHome
    location: class jsp_servlet.__helloclient
            HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class); //[ /HelloClient.jsp; Line: 17]
            ^
    C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_FirstEjb_HelloClient\jsp_servlet\__helloclient.java:139: cannot resolve symbol
    symbol  : class HelloHome
    location: class jsp_servlet.__helloclient
            HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class); //[ /HelloClient.jsp; Line: 17]
                              ^
    C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_FirstEjb_HelloClient\jsp_servlet\__helloclient.java:139: cannot resolve symbol
    symbol  : class HelloHome
    location: class jsp_servlet.__helloclient
            HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class); //[ /HelloClient.jsp; Line: 17]
                                                                                   ^
    C:\bea\user_projects\domains\mydomain\.\myserver\.wlnotdelete\extract\myserver_FirstEjb_HelloClient\jsp_servlet\__helloclient.java:140: cannot resolve symbol
    symbol  : class Hello
    location: class jsp_servlet.__helloclient
            Hello hello = home.create(); //[ /HelloClient.jsp; Line: 18]
            ^
    4 errorsand the client jsp file is as follows
      <%@ page import="java.util.*"%>
    <%@ page import="javax.naming.InitialContext"%>
    <%@ page import="javax.naming.Context"%>
    <%@page language="java" contentType="text/html"%>
    <html>
        <head>
            <title>JSP Page</title>
        </head>
        <body>
            <%
                Properties props = System.getProperties();
                   out.println("SREENIVAS  FIRST EJB");
              try {
                   Context ctx = new InitialContext(props);
                Object obj = ctx.lookup("HelloWorld");
                HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
                Hello hello = home.create();
                   out.println(hello.hello());
                hello.remove();
                ctx.close();
            } catch (Exception e) {
                e.printStackTrace();
        %></body>
    </html>

    i got the output
    its working
    the change i did is
    i put all the remote,home and local interfaces in a package and added that package to a jar file.
    then i added the jar file to class path.
    import this package into your client class.
    thats it now just deploy your ejbmodule.jar and webapplication.war in the server and test the code
    bye bye

  • Can anyone assist me..new to ejb's

    hi all, i am new to ejbs..
    i have j2sdk1.4 on windows 2000 and able to run java programs..
    if i want to learn ejb's what software i needed and how to do settings..
    thx in advance

    Check out the sun tutorial. It'll get you started. You'll need ant and some sort of app server like tomcat or weblogic or webshere.

  • New to EJB

    hi all,
    i am new to EJB...i have learnt servlets, jsp... with tomcat... i want to learn ejb..i have read some theoritcal tutorials... can anyone give the some sample programs or practical tutorials...with myecplise tooll...and jboss..integration....
    thanks in advance..
    --loguKK                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Google is the best option..............

  • New to EJB, resources for EJB

    hi
    i'm new to ejb. can anybody suggest resources or links for learning EJB

    1. Get a good book. "Head First EJB" from O'reilly is a good investment.
    2. Hand on exercises. Try the Sun's J2EE tutorial.
    3. Study the spec.
    4. You're expert now.

  • New to EJB (Server Help Needed)

    I am new to EJB and I'm learning through a few books and online tutorials. The only problem is that when I try to use them, I get errors. I've done some researching and I think it has to do with my server setup. Here is what I have running and successfully configured:
    Apache Web Server
    Tomcat Container
    Java 2 SDK 1.4.0_01
    Java XML Pack (Winter 2002)
    I have Sun Studio 4 installed and I think that it installs J2EE but I'm not sure. Can someone help me understand where to go next? What do I have to install/configure to get the EJBs to work? Thanks, Jeremy

    Hello,
    J2EE is roughly about two things: Web applications beeing build out of Servlets, Jsp and HTML pages and a server-side component modell to deploy business logic in EJBs.
    Now for the Web part (generating dynamic HTML content etc.) you have what you need. Tomcat is doing just find. To deploy EJBs, you need an application server which has an EJB container. I don't know the Studio 4 but my understanding is that it is an IDE helping you to develop software, not an application server. You have to install such an appserver.
    My recommendation: go and download BEAs Weblogic 7.0 (www.beasys.com).This is a commercial product but it comes with a 30 day trial license. BEA provides a rather good online docu. Play with this appserver and deploy some EJBs.
    Alternatively there is also a free appserver: JBoss (www.jboss.org) but I have never used it. Yet, they have also online docu and forums to help you through.
    good luck,
    einar

  • New project ¿EJB 2.1 vs. EJB3?

    We are about to startup a new J2EE-based project. The expected number of lines is bigger than 200K lines of business logic (this prediction is based on the old system we're migrating to J2EE). The deadline is Q3 2006 and we have a in-depth background on J2EE 1.4 technologies (JSF, EJB 2.1, JSP, Servlets, etc., OC4J).
    The critical decision is which EJB's version we should be using in our project.
    Two options are considered:
    1. EJB 2.1. Drawbacks: our code will be obsolote by the time the project is finished and the need for a new migration project to updgrade to EJB 3.0.
    2. EJB 3: Drawbacks: Oracle may not support this specification for its application in production environments by the time the project is finished.
    ¿What do you think could be the best choice ?
    Regards.

    Oracle 10.1.3 Developers Preview 4 supports EJB 3.0.
    Question -- When is 10.1.3 going to go production ? Our bussiness decision is depending upon it .. so please give some realistic date.
    Thanks.
    --Anand                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • New to JBoss/JMS: Help to get started

    Hi,
    I'm a J2EE programmer (and have been one for a while) but have never used JBoss or JMS, and need to know how JMS works in JMS, how to setup queues, monitor them (perhaps using HermesJMS), etc. I use Eclipse (new to me as well), so would like to know if I need to install the JBoss Eclipse IDE plugin, or if I could do all of this without that.
    Also, to get started and understand some existing code that uses this already, what would be a quick way. Skimmed through some references but dont have much time for a steep learning curve. Thanks.
    We use Tomcat (and jBPM within it) and JBoss for JMS.

    Hi
    I would also like to add,
    - I aware that all the configuration files are available under deploy/jms folder.
    - jbossMQ-service.xml and uil2-service.xml files have great role to do while creating queues and creating ConnectionFactory, respectively.
    But I am not able to relate all the things and not able to start with a small example, even I am not able to define QueueConnectionFactory.
    I am getting error like,
    Exception in thread "main" javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled)]
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at SendRecvClient.setupPTP(SendRecvClient.java:61)
    at SendRecvClient.sendRecvAsync(SendRecvClient.java:76)
    at SendRecvClient.main(SendRecvClient.java:107)
    Caused by: java.lang.ClassNotFoundException: org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
    at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.rmi.MarshalledObject.get(Unknown Source)
    at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
    ... 5 more
    So Any startup small application along with configuration details is highly appriciated.
    Regards,
    Maulik

  • New to EJB encounter javax.naming.NoInitialContextException

    HI, I am using j2ee 1.4 sdk to test my first EJB,
    in client code:
    InitialContext initialContext = new InitialContext();
    // lookup InterestCalculator EJB
    Object homeObject =
    initialContext.lookup( "InterestCalculator" );a Exception throwed!
    I think it is because I need to setup JNDI environment, but I don't know how to
    do it.
    Can anybody give me some tips?

    Hi,
    Use the following:
    Properties env = new Properties();
    env.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
    env.put("java.naming.provider.url", url);
    initial = new InitialContext(env);
    objref = initial.lookup(jndiname);where
    URL refers to the application server running on a machine with hostname (e.g. ashost) and with an ORB-port (e.g. 3700 as default port). For example,
    iiop://ashost:3700
    JNDIName matches in the deployment file. In the example, it is rmiconverter which can be found as
    <jndi-name>rmiconverter</jndi-name> in the file,
    <install_dir>/samples/rmi-iiop/simple/src/sun-ejb-jar.xml.
    -Amol

  • New bie ejb

    hi ,
    i am relatively newbie to ejb, i have been learing ejb for last week , having going through some stuff in ejb 2.1/3.0 versions i am relatively confused of difference ejb stuff here.
    what is the possible better version to start the ejb with, and can someone tell me the some differences in ejb 3.0 and ejb 2.1 stuffs.
    thanks in advance.

    If you're new to the technology you should definitely start with EJB 3.0. EJB 3.0 takes a POJO approach to writing ejb components so there are many fewer classes/interfaces to write and the rules for writing
    them are much simpler than before. There is also a much better API for handling persistent data called
    the Java Persistence API. Java Persistence API entities are not EJB components, but they can be
    used from EJB components (session beans, message-driven beans) as well as from other Java EE
    components.
    The Java EE 5 Tutorial is a good place to start :
    http://java.sun.com/javaee/5/docs/tutorial/doc/
    We also have an EJB FAQ and some simple examples here :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    https://glassfish.dev.java.net/javaee5/ejb/EJB30.html
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • New bee in JMS

    Dear ALL,
    I am new bee in this area.
    Pls. how and from where can I download api and tuts.
    thanks
    Dukkar Lee

    The JMS specification, tutorial, and a list of vendors can be found at
    http://java.sun.com/products/jms
    Enjoy!

  • What's New in EJB 3? Free Seminar - Patrick Linskey - October 6th - London

    The BEA User Group, Skills Matter and SolarMetric are pleased to invite you to a free seminar on EJB 3 Persistence, which will take place in London on October 6th and is organised by the BEA User Group.
    EJB 3 expert group member and Bitter EJB author Patrick Linskey will introduce the audience to the EJB 3 Persistence specification.
    EJB 3 expert group member and Bitter EJB author Patrick Linskey will introduce the audience to the EJB 3 Persistence specification. Patrick will provide background on where EJB 3 Persistence came from and how it meets the goal of making EJB simpler. Patrick will then go through the details of the EJB 3 persistence specification with lots of code examples.
    By the end of the session, the audience should have a firm grasp on the basics of EJB 3 persistence including annotations for representing mappings and EJB QL, the benefits of using a POJO persistence model like EJB 3, and how to use EJB3 Persistence both when deploying to an appserver and in a J2SE application.
    For more information or to register, go to: http://skillsmatter.com/menu/210
    Skills Matter is a leading provider of training, mentoring and project based skills transfer in agile software development. We provide Java training, UML training, RUP, XP and TDD training and many other courses. For more information about Skills Matter, go to: http://www.skillsmatter.com
    The BEA User Group UK is a free, informal group of users of BEA products, run by volunteers. The group launched in April 2005 and aims to hold 4 regular meetings a year in the London area. For more information about the BEA User Group UK, go to: http://www.beaug.uk.com
    SolarMetric is the provider of Kodo JDO, SolarMetric's robust, high-performing, feature-rich implementation of the Java� Data Objects specification for transparent persistence. For more information about the SolarMetric, go to: http://www.solarmetric.com

    Hi Etteloc,
    Welcome to the community and thanks for posting!
    I'm sorry that your Mum's telephone service has developed a fault and also for the length of time this has taken to sort out.  I completely understand the circumstances and how vital it is for her to have a working telephone service. 
    No need to worry as I can get things sorted from here.  Click on my username and under the section "about me" you'll see the link to get in touch with us.  Please include the link to this thread when you complete the form.
    Once completed, post back with something along the lines of "details sent" (without pasting the reference number) and I'll arrange for it to be picked up as soon as possible.
    Thanks a million,
    Robbie
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • New to JBOSS / JMS ! How to get started ?

    Hi,
    I'm a J2EE programmer.
    I have used JBoss as well as JMS (before long time with WebLogic), and need to know how JMS works in JBOSS, how to setup queues, monitor them (perhaps using JBOSSMQ and Active MQ), etc. I use Eclipse Europa.
    To get started and understand some existing code that uses this already, what would be a quick way. As running down with POC deadlines.
    I would appriciate if any one can provide sample application and configuration details to start with.
    Regards,
    Maulik

    Hi
    I would also like to add,
    - I aware that all the configuration files are available under deploy/jms folder.
    - jbossMQ-service.xml and uil2-service.xml files have great role to do while creating queues and creating ConnectionFactory, respectively.
    But I am not able to relate all the things and not able to start with a small example, even I am not able to define QueueConnectionFactory.
    I am getting error like,
    Exception in thread "main" javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException: org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled)]
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:728)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
    at javax.naming.InitialContext.lookup(Unknown Source)
    at SendRecvClient.setupPTP(SendRecvClient.java:61)
    at SendRecvClient.sendRecvAsync(SendRecvClient.java:76)
    at SendRecvClient.main(SendRecvClient.java:107)
    Caused by: java.lang.ClassNotFoundException: org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
    at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
    at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
    at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
    at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    at java.rmi.MarshalledObject.get(Unknown Source)
    at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72)
    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652)
    ... 5 more
    So Any startup small application along with configuration details is highly appriciated.
    Regards,
    Maulik

  • Do i have to use JMS with EJBS?

    Hi
    I want to use JMS as a messaging system (a queue) between my system and someone elses. I would like to have some java classes on Tomcat to do the job. But...whenever i hear about JMS i always hear it in relation to EJBs. Can i only use JMS with EJBS?
    If i can use JMS is there anything important i need to know about.
    Thanks in advance!
    San H.

    As far as I understand you are use JNDI and JMS is not bound with EJB's. These are java API's which are independent. Like JDBC you can use with Servlets, Applets, standalone applications, EJB, JMS etc etc.......
    In the same way you can use JNDI and JMS with diferent API. And the important feature of Java is that all java API interact with each other when these are independent. I would appricate comments of everyone......................Thanks

Maybe you are looking for