EJB and Servlets

Hi there,
A frontend processing of HTTP request that pass thru WebLogic server that make
API calls thru tuxedo to the application servers that eventually running C, C++
that retrieve data from a backend database of Oracle.
Being the services of EJB and Servlets, EJB is more kind of processes inside the
server but Servlets can handle better in request and respond (talk to the client),
whats your opinions in this kind of integration? Go for pure EJB or Servlets?
Or shall mixed matched? and how should the architecture should looks like?
Thanks
Neo

Sorry, wrong question, just ignore it.

Similar Messages

  • How to set classpath to EJB and Servlets

    Hi all,
    How can I add a classpath to EJB and Servlets in Weblogic 6.1, so that that classpath
    can be achieved by both EJB jar and war file? I have deployed a .ear file having
    the jar and war files. Now the EJBs inside the jar file are not reaching the class
    files of the war file and the class files in the war file are not reaching to
    the EJBs. Please let me know at the earliest.
    Atanu

    Hi.
    You might try looking at the petstore example which combines webapps (war files) with
    ejbs in an ear file to see how to do this. It may be a simple config problem.
    Regards,
    Michael
    Atanu Dey wrote:
    Hi all,
    How can I add a classpath to EJB and Servlets in Weblogic 6.1, so that that classpath
    can be achieved by both EJB jar and war file? I have deployed a .ear file having
    the jar and war files. Now the EJBs inside the jar file are not reaching the class
    files of the war file and the class files in the war file are not reaching to
    the EJBs. Please let me know at the earliest.
    Atanu--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Sequence of deployment for EJBs and Servlets....

    Is there any way to control the order in which weblogic 6.0 deploys EJBs
              and servlets?
              We have a few startup servlets which use EJBs, however, weblogic 6.0
              seems to start the Servlets before it deploys the EJBs and thus our
              servlets fail.
              Haider Abbas Kazmi - Java Mobile App. Developer
              [haider.kazmi.vcf]
              

    6.1 solves this problem:
              http://e-docs.bea.com/wls/docs61/adminguide/appman.html#1030797
              Haider Abbas Kazmi <[email protected]> wrote:
              > This is a multi-part message in MIME format.
              > --------------9AC9295410C7463D3A71C1A6
              > Content-Type: text/plain; charset=us-ascii
              > Content-Transfer-Encoding: 7bit
              > Is there any way to control the order in which weblogic 6.0 deploys EJBs
              > and servlets?
              > We have a few startup servlets which use EJBs, however, weblogic 6.0
              > seems to start the Servlets before it deploys the EJBs and thus our
              > servlets fail.
              > --
              > Haider Abbas Kazmi - Java Mobile App. Developer
              > --------------9AC9295410C7463D3A71C1A6
              > Content-Type: text/x-vcard; charset=us-ascii;
              > name="haider.kazmi.vcf"
              > Content-Transfer-Encoding: 7bit
              > Content-Description: Card for Haider Abbas Kazmi
              > Content-Disposition: attachment;
              > filename="haider.kazmi.vcf"
              > begin:vcard
              > n:Kazmi;Haider
              > tel;cell:(416)9864702
              > tel;fax:(416) 6434832
              > tel;work:(416) 3666425 x315
              > x-mozilla-html:FALSE
              > url:http://www.everypath.com/
              > org:Everypath Canada;Research & Development
              > adr:;;260 King St;Toronto;Ontario;M5A 4L5;Canada
              > version:2.1
              > email;internet:[email protected]
              > title:Java Mobile App. Developer
              > fn:Haider Kazmi
              > end:vcard
              > --------------9AC9295410C7463D3A71C1A6--
              Dimitri
              

  • EJB and Servlets on different clusters

              Say I set up two clusters, one for servlets and one for EJBs.
              To lookup to EJBs, the servlets must look up an initial context and provide a URL.
              Should the URL be hardcoded in the servlet to the EJB cluster name, or is there a way
              to specify this URL at a higher level?
              Can you specify something like this in the properties file?
              What's the best way to do this?
              Please advise,
              Dave
              

    David,
              How about specifying the EJB cluster URL in the servlets init argument in the
              weblogic.properties ??
              Sam
              David Mrozek wrote:
              > Say I set up two clusters, one for servlets and one for EJBs.
              > To lookup to EJBs, the servlets must look up an initial context and provide a URL.
              > Should the URL be hardcoded in the servlet to the EJB cluster name, or is there a way
              > to specify this URL at a higher level?
              > Can you specify something like this in the properties file?
              > What's the best way to do this?
              > Please advise,
              > Dave
              

  • Problems with EJB and Servlet

    I'm doing a simple servlet that invokes an EJB taht returns an ArrayList with a values.
    My problem is that I do trace of my execution an this woks well in the EJB but when my remothe method do the return the app finish and never return to servlet that invoked it. I don't know 'cause this happend.
    I'm using WASD 5.0.1 as my Web y EJB container.
    Help would be appreciate

    What does that ArrayList contain?
    Could you post the code please.

  • Third-party jars not visible to EJB's and servlets.

    Hi, This is an unanswered post in an newsgroup which exactly displays our
    current problem,
    Extract Begins -->
    "I've got a WebApp with classloading issues while running WebLogic 5.1.
    According to the JSDK 2.2 API, if I include third-party classes in
    WEB-INF/lib, my EJBs and servlets should be able to load any jar'ed classes
    inside. In practice, however, it seems to make no difference. My EJB always
    comes back with a NoClassDefFound error for xerces.jar that's in WEB-INF/lib
    (and I've even tried adding it to the EJB JAR itself with no change).Of
    course, if I put Xerces in the server's classpath, there are no problems but
    that's a road I don't want to go down.How can I tell my EJB's to load
    third-party classes from the WEB-INF/lib directory of the WAR file? I'd
    appreciate your insight. <-- End
    We are busy migrating one of our apps from 5.1 to 6.1, What we have done
    thus far and fairly successfully is the following,
    We packaged all the jsps, WEB-INF, html, images into a WAR file and then
    packed all EJB's, META-INF and classes to which the ejbs refer, into an EAR
    file.
    EMARKET_APPS/
    +myjsp.jsp
    +myhtml.html
    +images
    +WEB-INF/+
    |
    +classes/+
    |
    +myclass1.class
    +myclass2.class
    |
    +lib/+
    |
    +OReily.jar
    +jts.jar
    +xerces-1_4_1.jar
    +junit.jar
    +jcschart110Kwl.jar
    |
    +web.xml
    +weblogic.xml
    +META-INF/+
    |
    +applications.xml
    +ejbs/+
    |
    +myejb1.jar
    +myejb2.jar
    +lib/+
    |
    +classes.jar
    Please advise.
    Rgs Roly

    Have you tried to include the jars in the Class path entry in the manifest file.
    That should work eventhough I haven't tried it yet (fighting with ear deployement
    and I must say WLS seems to be winning). I'll get back to when I've tried it.
    There is a VERY good article on theserverside.com regarding class loaders and
    EAR/WAR/EJBs at http://www.theserverside.com/resources/articles/J2EE-Deployment/chapter.html
    Good luck
    /erik

  • Newbie ?: EJB vs servlets

    I'm just starting out teaching myself J2EE related technologies. I have extensive development experience in other environments. I've only dabbled in Java quite a few years ago.
    I have a general sense of the difference between EJB and servlets but couldn't find an official description/comparison in any of the FAQs that I've read. Could someone please compare and contrast the two technologies?
    Also, I'd welcome any tips/suggestions regarding my learning experience, including but not limited to:
    - suggested sequence of learning supporting/related technologies (e.g. Java, JSP, servlets, JavaBeans, EJB, JDBC, JavaServer Faces, CORBA, OOAD, UML etc.)
    - recommended/popular development tools/IDEs etc.
    - learning resources/books etc.
    I'm currently reading the free PDF version of "Core Servlets and JSP" by Marty Hall.
    Thanks,
    Gary White

    Few Diffs:-
    1. Servlets run in a web container and EJBs run in a EJB Container.
    2. Use of Servlets is thru HTTP protocol and EJBs by look-up(internally RMI-IIOP)
    3. Developers has to explicity code for dattabaase transaction and security. EJBs: Container will manage every thing.
    4. Mainly: Servlets are server side code that generate dydnamic web page content to display. But EJBs are reusable component run in container.
    The sequence is: Java, JavaBeans, JDBC, Servlets, JSP, JSF & EJB
    I recommened JCreator LE IDE as it is developed in VC++ which runs fast. But another powerfull IDE is the Eclipse.
    Books:
    Java. Thinking in Java, Sun Tutorial
    JSP & Servlets: the book you are following work fine
    EJB> Mastering EJB by Ed Romans

  • How to work with EJBs and database for a simple login application

    Hi all :)
    I am new in JSP,EJB and Servlets. I just wanted to develop a simple login application, using JSP+EJBand servlets. In some tutorial I found that the beans are already populatesd with database records. But will it be good logic to retrive all records into a bean and then search for a perticuler users data for authentication.
    Can any one tell me me what is the best logic for doing so. :(
    Thanx in advance.

    Himanshu.Shekhar wrote:
    Hi all :)
    I am new in JSP,EJB and Servlets. I just wanted to develop a simple login application, using JSP+EJBand servlets. In some tutorial I found that the beans are already populatesd with database records. But will it be good logic to retrive all records into a bean and then search for a perticuler users data for authentication.No. Let the database do the search. It's far more efficient.
    %

  • Whether java component (Not ejb, not servlet) can be deployed in App Server and get the services provided by App Server

    As I mentioned in subject, I am just wondering Whether the java component (Not
    ejb, not servlet) can be deployed in App Server and get the services provided
    by App Server or not?

    Nevermind folks - I got it to work. All my configuration was correct; I had other issues with the ejb-jar file that the verifier informed me of (my previous deployments were with the verifier turned-off).

  • Access EJB from Servlet that in different archive?

    <font class="mediumtxt">package kyro.ejb.session;
    import javax.ejb.*;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;
    @Stateless(name="StandAlone")
    @Remote(StandAlone.class)
    public class StandAloneBean
    implements StandAlone, StandAloneLocal
    public StandAloneBean() {
    public String sayHello() {     
    return "sayHello";
    I want to access ejb from servlet that .war and .jar not in single .ear. I want to try that just with annotation not xml descriptor cause is easy to understand for me. I use Glassfish. But i can't lookup that ejb. How can i lookup that ejb with jndi? Can't you give me example of servlet to access that? I not use JNDI.properties, are that caused i can't access my ejb? I just thing .war and.jar in one server, are i have to used JNDI.properties. can you explain how to use JNDI.properties in servlet or separate file?
    </font>

    But i can't lookup that ejb. How are you trying and what exception is occurring?
    How can i lookup that ejb with jndi? [https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html|https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html]
    m

  • How to inject ejb in servlet

    hi all
    How to inject ejb in servlet ?
    please explain how to config my servlet and my paroject
    I have an ear file with two jar files
    Thanks in advance

    hi
    I have this error in my project
    I have an ear file ,two war file and three jar file in it
    and I did configuration
    but there was this error
    14:19:45,398 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[conference-servlet].[enterLet]] Allocate exception for servlet enterLet: javax.naming.NameNotFoundException: ITrmnlAuthenticationBL not bound
    @Remote
    public interface ITrmnlAuthenticationBL{
    @Stateless
    public class TrmnlAuthenticationBL implements ITrmnlAuthenticationBL{
    public class EnterLet extends HttpServlet {
         @EJB(mappedName = "ITrmnlAuthenticationBL")
         private ITrmnlAuthenticationBL trmnlMg;
    please explain my mistake

  • Load balancing for JSPs and servlets

    Hi:
              I am using IIS as the proxy server, with the WLS plug-in, to a WLS
              cluster. This provides round robin load balancing just fine. Will it
              provide weight based load balancing if I set 'weblogic.system.weight'
              differently on each server, or is that not relevant for clustering JSPs
              and servlets?
              Sincerely,
              Ashish
              

    Currently the plugins ( for NES, IIS and Apache) just use the round robin
              algorithm. the property
              weblogic.system.weight is used only be weblogic's replica aware clusterable
              RMI/EJB stubs.
              To use this property for your JSP/Servlet load balancing you have to use
              weblogic server as proxy fron-ending your weblogic cluster.
              --Viresh Garg
              Ashish Vimal wrote:
              > Hi:
              > I am using IIS as the proxy server, with the WLS plug-in, to a WLS
              > cluster. This provides round robin load balancing just fine. Will it
              > provide weight based load balancing if I set 'weblogic.system.weight'
              > differently on each server, or is that not relevant for clustering JSPs
              > and servlets?
              > Sincerely,
              > Ashish
              

  • EJB versus servlet

    Hello everyone,
    I'm hoping you can point me in the right direction. I'm looking for
    articles or books that cover the pros and cons of implementing solutions
    using EJBs and/or servlets. More specifically, when and where it makes the
    most sense to use EJBs or servlets or both, and how the two compare. Also,
    how well regarded are EJBs in the marketplace (seems to be a love/hate
    relationship).
    I've read some of Jason Hunter and Richard Monson-Haefel's older material
    but I'm hoping you might know of (or have) something more recent.
    Thanks in advance!
    Joe

              Of course the best article is the one that Xiang suggested, J2EE blueprints.
              If you want something quickly to read, I enjoyed this one very much:
              "How to Build a Really Big Distributed J2EE System Using Tools You Have Around
              the Office"
              http://www.javasuccess.com/design_wp.html
              And of course this one:
              "J2EE Design Considerations for Weblogic Server"
              http://www.bea.com/products/weblogic/server/papers.shtml
              Regards,
              David
              "Joe Martins" <[email protected]> wrote:
              >Hello everyone,
              >
              >I'm hoping you can point me in the right direction. I'm looking for
              >articles or books that cover the pros and cons of implementing solutions
              >using EJBs and/or servlets. More specifically, when and where it makes
              >the
              >most sense to use EJBs or servlets or both, and how the two compare.
              > Also,
              >how well regarded are EJBs in the marketplace (seems to be a love/hate
              >relationship).
              >
              >I've read some of Jason Hunter and Richard Monson-Haefel's older material
              >but I'm hoping you might know of (or have) something more recent.
              >
              >Thanks in advance!
              >
              >Joe
              >
              >
              

  • Creating ejb in servlet

    Hello!
    I have a code, that looks up a home interface of ejb and creates remote.
    If I run it in init method of servlet - all is ok and if I run it in static
    block - all goes wrong - I get an Exception(something about Proxy$ ..)
    I understand, that static init run before servlet init() call, but why I
    cannot create ejb in static block ?
    Thank you in advance
    Bye.

    You should give us more details...
    Here's my guess... Static blocks are executed when the class is loaded.
    Maybe at that time the EJB isn't deployed yet.
    How about changing the order of deployment of your Web app to a higher
    number? (look in console, under Deployment>Webapps>yourapp under tab
    General, the field Deploy Order).
    Try this and let us know...
    Emmanuel
    "shark79" <[email protected]> wrote in message
    news:[email protected]..
    Hello!
    I have a code, that looks up a home interface of ejb and creates remote.
    If I run it in init method of servlet - all is ok and if I run it instatic
    block - all goes wrong - I get an Exception(something about Proxy$ ..)
    I understand, that static init run before servlet init() call, but why I
    cannot create ejb in static block ?
    Thank you in advance
    Bye.

  • Unable to access EJB from servlet

    Hi,
    I have in service method my servlet code.
    Hashtable env = new Hashtable();
                        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationInitialContextFactory");
                        env.put(Context.PROVIDER_URL, "ormi://localhost/hello");
                        env.put(Context.SECURITY_PRINCIPAL, "admin");
                        env.put(Context.SECURITY_CREDENTIALS, "mypwd");
                        Context ctx = new InitialContext(env);
              Object obj = ctx.lookup("HelloName");
                        HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj, HelloHome.class);
                        Hello hello = home.create();
    this is how i have orion-ejb-jar.xml
         <enterprise-beans>
              <session-deployment name="Hello" location="HelloName" >
              </session-deployment>
         </enterprise-beans>
         ejb-jar.xml
              <session>
                   <ejb-name>Hello</ejb-name>
                   <home>examples.HelloHome</home>
                   <remote>examples.Hello</remote>
                   <local-home>examples.HelloLocalHome</local-home>
                   <local>examples.HelloLocal</local>
                   <ejb-class>examples.HelloBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
              </session>
    When i access the servlet i get this error.
    javax.naming.NameNotFoundException: HelloName not found
         at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:149)
         at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:217)
         at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:88)
         at javax.naming.InitialContext.lookup(InitialContext.java:345)
         at examples.HelloServlet.service(Unknown Source)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:772)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:782)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
         at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
         at java.lang.Thread.run(Thread.java:479)
    Is location attribute in orion-ejb-jar.xml used to specify JNDI name? Can i get the JNDI tree showing the name mappings in oc4j? How do i correct this error?
    Ravi

    Ravi --
    The most portable and standards oriented solution is to define an ejb-ref in the web.xml for the servlet, and then look up the name using the formal EJB UNC model.
    web.xml:
    <ejb-ref>
    <ejb-ref-name>ejb/AppSessionFacadeHome</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>faqapp.ejb.AppSessionFacadeHome</home>
    <remote>faqapp.ejb.AppSessionFacade</remote>
    </ejb-ref>
    servlet lookup
    InitialContext ctx = new InitialContext();
    Object homeObject = ctx.lookup("java:comp/env/ejb/AppSessionFacadeHome");
    EJBHome ejbHome = (EJBHome)
    portableRemoteObject.narrow (homeObject, AppSessionFacadeHome.class);
    cheers
    -steve-

Maybe you are looking for

  • To CHARGE or NOT to CHARGE, that is the 3G question!

    Man I am so confused. I read CHARGE it like a laptop thus if near a plug, plug it in as its like a laptop and goes on cycles not turning 20% and then charge into your 20% becoming the 100% then having 1 hour on your battery. So, which is it? I have r

  • How to authenticate only specific AD users in ACS 5.1

    Hi All, Is it possible for ACS 5.1 to only allow specific AD users to authenticate the switches and routers? Currently What I have configured is onlyfor all AD users. I can't seem to find a way to be selective. Thanks Regards

  • How to control the maximum time that a dynamic sql can execute

    Hi, I want to restrict the maximum time that a dynamic sql can execute in a plsql block. If the execution is not completed, the execution should be terminated and a exception should be raised. Please let me know, if there is any provision for the sam

  • Why does all the formatting in my composed e-mails disappear when I send them?

    Hi! I've noticed lately that whenever I type up an e-mail with formatting (like changing the color of text, in particular), it looks fine when I'm typing it, but as soon as I send it, the formatting disappears. I bcc'd myself a few of the e-mails tha

  • Reducing size of iPhotos

    I have an individual photo in my iphoto library - I want to upload this to send to a magazine - the original image is over the 1 MB limit. How do I reduce the size of the photo?