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
          

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

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

  • 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
              

  • Help-how can i connect between a client and servlets on different machines

    hi all
    I asked this question already but:
    I am tring to run a client which is an HTML file that has a "submit" button, that when pressed it should connect (or something) to a servlet, which is on a different mechine.
    what must i write instead of: "localhost"?
    and what web server should i use?
    this is the code on the client side:
    <form action=http://localhost:8080/servlet/MyServlet method=POST target=_blank>
    <input type=submit name="M1" >
    </form>
    thank you

    thanks
    I tryed that by writing the ip address of the servlets mechine instead of "localhost", but there was no reaction
    i wrote:
    <form action=http://10.33.24.33:8080/servlet/MyServlet
    method=POST >
    <input type=submit>
    </form>
    what is wrong with that?
    when i pressed the submit button nothing happened.
    does any body know what can i do?

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

  • EJB & Servlet deployment in Clustered Env.

              Hi,
              I have made a cluster of 3 weblogic servers. I would like to send a request to one
              server (e.g. http://myserver1:7001/TestServlet). The servlet utilizes an EJB which
              is not located and not deployed on myserver1 , but on other 2 servers in the cluster.
              The algorithm is round-robin. It gives me a lot of errors (Impl... classes not found
              etc etc).
              Do I have to deploy everything on all the servers?
              If I do that, the request is not routed to other servers. Since the servlet finds
              the EJB locally, it never goes to the other servers, regardless of the algorithm.
              I have set up the "home-is-clusterable" and all other relevant properties for EJB
              deployment.
              Any ideas??
              Sharad
              

    If the ejb is deployed on the server that is looking for the ejb, then it
              won't go network to use the ejb. That is a "big" WL optimization, and helps
              quite a bit for most apps.
              If you want to segregate the ejb and web functionality, you should probably
              consider running two distinct clusters (in 5.1 parlance).
              I suggest putting web and ejb together though and clustering that. Latency
              is lower. Scalability is not particularly affected. Configuration is much
              simpler.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              +1.617.623.5782
              WebLogic Consulting Available
              "Sharad Joshi" <[email protected]> wrote in message
              news:[email protected]...
              >
              > Hi,
              >
              > I have made a cluster of 3 weblogic servers. I would like to send a
              request to one
              > server (e.g. http://myserver1:7001/TestServlet). The servlet utilizes an
              EJB which
              > is not located and not deployed on myserver1 , but on other 2 servers in
              the cluster.
              > The algorithm is round-robin. It gives me a lot of errors (Impl... classes
              not found
              > etc etc).
              >
              > Do I have to deploy everything on all the servers?
              > If I do that, the request is not routed to other servers. Since the
              servlet finds
              > the EJB locally, it never goes to the other servers, regardless of the
              algorithm.
              > I have set up the "home-is-clusterable" and all other relevant properties
              for EJB
              > deployment.
              >
              > Any ideas??
              >
              > Sharad
              

  • 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

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

  • Different things on Applets and Servlets

    I use Eclipse. I create two projects: applet and servlet (deploy on Tomcat). One is with the function main, the other has doGet. In these functions I write the same string:
    Mac.getInstance("HmacSHA1");
    But when I run applet - it's ok, when I deploy servlet and run on Tomcat - there are exception: java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available
    How to make it availible at servlet?
    Message was edited by:
    AntonVatchenko

    The 2 apps (applet versus servlet) are likely using different versions of the Java runtime (and / or security extensions to them). And on one version that security algorithm exists (is built-in, or added as an extension in your JRE's lib/ext folder or something like that); while on the other the algorithm does not exist.
    Make the J2EE container (the one running the servlet) use the same version of Java as the applet is. I suppose that's just a hint though, that your next question will be something like "Ok, how do I do that?". My job was just to point you in the right direction. Hopefully I've done that.

  • 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 and ASP

     

    Think of XSL and JSP as the X and Y axis. They approach solving an HTML (or
    XML) rendering problem in two different ways. Each has its benefits. When
    the primary input is a known flavor of XML, then XSL is definitely a better
    way to go.
    Cameron Purdy
    Tangosol
    "Argyn Kuketayev" <[email protected]> wrote in message
    news:[email protected]...
    I think the best approach would be to use XML and XSL. I didn't work on itfor
    production, but I'm going to try.
    I would call EJB's from servlet, then put returns in one or more XMLfiles, then
    take XSL and convert to anything, say HTML on the fly and send it back to
    client's browser.
    In this model web designer won't need to care about Java, JavaBeans andJSP tags,
    he will get my XML definition and make a XSL.
    Jason Jonas wrote:
    The best way we have found is:
    /->Database
    Client->Servlet->EJBs-->Legacy Systems
    ^ | \->Etcetera
    \ |
    \---JSP
    All client requests are handled by servlets. Servlets perform the
    brunt of Java work that would otherwise be in your JSP or a bean. The
    servlets, of course, make calls to EJBs. The EJBs carry out all
    business logic (e.g. talking to databases, legacy systems...). The
    servlets then set attributes in the request and forward the request to
    a JSP. The only responsibility the JSP has is presentation. We have
    found this reduces the required Java in a JSP down to a manageable
    subset that, in some cases, the HTML folks can handle. For instance,
    enumerating through a Vector to populate a list box... It doesn't
    always work this way, but most of the time.
    If client requests first hit a JSP, I would certainly encourage you to
    use JavaBeans in an effort to reduce the amount of Java in a JSP to a
    manageable amount.
    Jason
    On Tue, 08 Aug 2000 18:23:13 -0400, Argyn Kuketayev
    <[email protected]> wrote:
    one more option:
    in your JSP call servlets, and they will call EJBs and return java
    beans
    (simple containers like struct in C/C++) with data.
    in this case JSP will be your presentation layer, servlet - controllerand
    EJBs - model. you may prefer to wrap all entity EJB calls in astateless
    session beans, which will implement your business workflow.
    example:
    displayItems.jsp has a form with one text field "name" and a button
    "search".
    when you click a button, it will post a request to ItemListServlet. the
    servlet takes "name" parameter, and calls a ItemHome.findByName(String
    ItemName) method of Item session EJB. then it processes the returning
    Collection, and puts an array with myItems[] into a session andredirects to
    another page ItemList.jsp. now, ItemJsp takes an array and populates atable
    on the screen. here myItems is a simple java class with public fields,like
    C struct.
    in this option, your servlets are kind of dispatchers between jsp andEJBs.
    >>>
    Arda Mirek wrote:
    What is the recommended/proven architecture for accessing
    EJB through JSP (speed / ease of development / maintainability)?
    Is accessing EJBs through JSP a bad idea and is it better to provide
    another layer between the two like JavaBeans (JSP -> JavaBeans ->
    EJB) ?
    >>>>
    Speed and scalibility is very important (as usual :)
    Thanks.
    Arda Mirek

Maybe you are looking for