J2ee Questions

Hi;
I have same questions concerning J2ee platform :
Q1: I have of the performance problem with EJB entity and would like to use mapping Objects/Tables => so its a good solution or not ? which tool I must to use ?
Q2: how realized a identification of users with diffirents profils (the better solution ?).
Q3: which is your opinion on struts plateform (performance, complexity, ...).
Best regards

Hi;
I'am sorry I have implemented CMP 2.0 EJB under Websphere 5.0 and its very catastrophic for the performance because I manage a big database on DB2.
I have realized of the performance tests with a architecture Mapping objects/Tables (JDO) and its better.
Q2: I will realize a web application (Intranet) and my question : JAAS its a good solution for the indentification or there are another solution ?
Regards;

Similar Messages

  • Pointer to an unanswered j2ee question

    This is just a pointer to a question posted on j2ee that remains unanswered; hopefully someone here can help - I'm attempting to get into j2ee stuff, obviously.
    Regards,
    Here's the post: http://forum.java.sun.com/thread.jspa?threadID=5305753&tstart=0
    ~Bill
    Edited by: abillconsl on Jun 17, 2008 1:22 PM

    Two books:
    (1) "Database Modeling and Design" by Toby Teorey,
    (2) "Patterns of Enterprise Application Architecture" by Martin Fowler.
    You'll want to know about SQL and normalization. The Teorey book is good for both. Fowler's book will help with writing that data access layer in Java. - MOD

  • J2EE questions with thick client

    I�m trying to move from an existing client-server Swing application (currently talks directly to a database via JDBC) to a 3-tier J2EE model. This is primarily so that I can use HTTP web services on port 80 to bypass firewalls, and to allow for future architectural expansion beyond the current Swing client. I am experienced with Java and Swing, but very new to J2EE, so I'm hoping that there are some obvious points that I am missing.
    I am surprised by the lack of 'thick client' examples, tutorials, and documentation that I see with J2EE - almost everything is oriented towards HTML web applications. Here are some questions that I have for using J2EE with a thick client (specifically Swing):
    * Where are business logic methods executed? On the client or the server? I get the impression that with J2EE and EJB, all business logic is executed on the server via RPC. Can I choose to have this done in the client instead? If so, how?
    * My Swing applications depend heavily on PropertyChangeEvents being fired from the data objects in order for me to update my UI. If the answer to the previous question is that all business logic is executed on the server, then is there a way for my client listeners to receive these change events? If not, how do I know when to update my UI?
    * If all business methods are executed on the server, what about accessor methods? Do those need to make a round trip for every call? I've read a little bit about Data Transfer Objects (DTO's) to solve this, but I don't completely understand the concept - if DTO's have no embedded business logic, then how do I know whether a particular getXXX() method has business logic attached to it, and therefore whether to reference the DTO or the server EJB object?
    Thanks for answers to these questions. Googling for 'J2EE' and 'thick client' came up with no useful information; I'm hoping to post a HOWTO that will help others after I get this running.

    The petstore sample application from blueprints (java.sun.com/blueprints) has an admin module which is a Java Webstart enabled "thick client" that gets business logic processing done on the server. Also the client chapter for the "designing enterprise apps with J2EE" book (also available as html from the same link) gives some tips on designing clients. These may be of help to you

  • J2EE question.. ftp in a session bean

    Hi guys,
    pretty new to j2ee. I need to make a system that retrieves some files using ftp and manipulate teh files and return to a servlet the link to file (which will live on a webserver).
    I read that java.io package should not be used with ejb's. the MDB thats using the ftp api that i created seems to run fine, with no errors. However the files aren't showing up. Am i missing something here?
    I give an absolute path to where the files should be downloaded. all i know is that the files don't show up there and that tehre are no exceptions. Could weblogic be storing the files somewhere else?
    can ejb's give make directories adn files on the server where they're running?
    where does "/" refer to when given in a ejb? is it the root of the file
    system or some other location?

    grr.. never mind.. its working
    sorry!

  • J2EE Question

    Hi
    I am preparing for a certification exam. I have doubt about this question. Please help me. Please let me know the correct answer
    =======================================================================
    1. Part of an application's business logic is implemented using a limited set
    of connections to a legacy system. The development team want to provide an EJB
    interface to this legacy code. The BEST approach to managing connection
    resources would be to use:
    A.     Stateful Session beans one per connection
    B.     Stateless Session beans one per connection
    C.     BMP Entity Bean one per connection
    D.     CMP Entity Bean one per connection
    Select the best answer.
    2.     When an Web module (WAR file) accesses an EJB module, what is the BEST way for a Web module to reference the EJB interfaces and client stubs?
    A.     Package the EJB interfaces and client stubs into a separate EJB Client JAR file and specify this JAR file in the MANIFEST Class-path of the Web module.
    B.     Specify the EJB JAR file in the MANIFEST Class-path of the Web module.
    C.     Package the EJB interfaces and client stubs into the Web module.
    D.     Package the EJB and Web modules into an EAR file and specify EJB jar in the Class-path property of the EAR deployment descriptor.
    Select the best answer.
    3. A developer wishes to make a server function available to an applet via a Servlet. The applet passes the Servlet a serialized object as an argument. How should the developer implement the Servlet?
    A.     Sub-class HttpServlet and create an ObjectInputStream from the
    ServletInputStream in the doGet() method.
    B.     Sub-class HttpServlet and create an ObjectInputStream from the
    ServletInputStream in the service() method.
    C.     Sub-class GenericServlet and create an ObjectInputStream from the ServletInputStream in the doGet() method.
    D.     Sub-class GenericServlet and create an ObjectInputStream from the ServletInputStream in the service() method.
    Select the best answer
    4.     A DataSource named "MyDatasource" has been created and configured (in WebSphere Application Server, Advanced Single Server Edition) to have an "idle timeout" of 30 and a "minimum pool size" of 10. If a servlet acquires a connection from that DataSource, and the servlet holds the connection for 2 minutes without using it, which statement is TRUE?
    A.     The servlet's connection will be unaffected by the idle timeout.
    B.     The pool size will be increased by 10 when some other servlet needs a connection.
    C.     After 30 seconds, WebSphere can return the connection to the connection pool
    D.     The servlet's service() method will throw a
    javax.sql.PooledConnectionException if the servlet attempts to use its
    connection
    Select the best answer.
    5.     A Web site is getting a lot of 'hits' and the amount of session data managed by the server is becoming too large for it to handle. Which of the following are appropriate ways to solve the problem?
    A.     Expand the capacity of the server.
    B.     Add additional servers to share the load.
    C.     Store the session data in a Cookie.
    D.     Store all session data in hidden fields on the web pages that are served.
    Select 2 answers.
    6.     A developer needs to create a web site that displays information about a user's BankAccount. The information is contained in a BankAccount entity bean and is guaranteed to be accurate to within 1 day of account activity. Which of the following Access beans is the BEST to use to represent the BankAccount in this scenario?
    A.     RowSet
    B.     ColumnSet
    C.     Copy Helper
    D.     Proxy Wrapper
    E.     JavaBean Wrapper
    7. A client invokes the create() method on an CMP entity bean. Which of the following is a correct sequence in which the operations mentioned below are performed?
    a.     Container creates an EJBObject.
    b.     EJB home object invokes ejbCreate() on Bean instance
    c.     Bean instance is associated with EJBObject.
    d.     Container creates new bean instance.
    e.     Container calls setEntityContext() on bean instance.
    f.     Container creates the bean representation in a database.
    g.     ejbPostCreate() method is invoked on bean instance.
    A.     b -> f -> a -> c -> g
    B.     b -> a -> f -> c -> e -> g
    C.     a -> d -> c -> b -> e -> g -> f
    D.     a -> d -> c -> b -> f -> g -> e
    E.     a -> c -> e -> b -> f -> g
    Select the best answer.
    10. While testing a BMP Entity Bean, a developer discovers that a transaction rollback does not cause a rollback of the changes made to the bean as it should. Which of the following should the developer suspect?
    A.     The ejbPassivate() method has a bug.
    B.     The ejbStore() method has a bug.
    C.     The ejbCreate() method has a bug.
    D.     The datastore does not support JTA.
    E.     The transaction does not implement javax.transaction.UserTransaction.
    Select 2 answers.
    11.     A JSP is displaying data from a JavaBean accessed through a < jsp:useBean > tag. It is an error condition if the JavaBean is not found in the request scope at runtime. What should the JSP developer do to ensure correct behavior?
    A.     Specify the real JavaBean's Java type as the value for only the class attribute of the jsp:useBean tag.
    B.     Specify the JavaBean's Java type as the value for only the type attribute of the jsp:useBean tag.
    C.     Add an isErrorPage specification in a JSP page directive.
    D.     Add an errorPage specification in a JSP page directive.
    Select 2 answers.
    12.     A Servlet must perform 3 operations that are independent of one another. They are time consuming with each operation consuming about 10 msec of CPU. The Servlet's response depends on the completion of all three operations. The developer decides to perform each operation on a separate worker thread to run them concurrently. Which of the following describe important parts of this implementation?
    A.     The Servlet should implement MultiThreadModel
    B.     The Servlet should implement SingleThreadModel
    C.     Access to the HttpSession must be synchronized.
    D.     The worker threads must not write to the ServletOutputStream.
    E.     The worker threads must not read from the ServletInputStream.
    Regards
    Arghya Banerjee

    1. B
    2. C
    3. B
    4. A (if 30 is minutes) or C (if 30 is number of seconds)
    5. B,C,D
    6.
    7. e
    10.
    11.C,D
    12.
    Let me know the answers for the rest of the questions.

  • JMS J2EE question

    I am using 6.40, and am running JMS queue tests.
    The J2EE engine dies frequently, I have to re-install about once a day.
    However, I have consistently increased the size of the Data Volume when I install, and as I do this, the time between crashes increased from about 1 day to every 2 to three days.  Now I only have to re-install about every 2 to 3 days.
    I guess that means I am filling up the data logs or something.  The default is about 400 MG, and I have currently set it to 9000 mg and am getting better response.  IN fact I am not sure I will have to reinstall this latest implementation, the 9000 mg install seems to be hanging in there so far.
    By the way, the crash behavior is that the broker will not  accept send or receive JMS messages, and the J2EE engine will not come up, even if I restart the SAP System from the MMC.
    Is there any way to periodically flush the data volume or the logs so it will never crash ?
    Is there any way to do this in an automated manner?
    Thanks, John

    Hi John,
    You should enable the "overwrite" mode for the log area. Open the Database Manager, go to Configuration -> Log Settings and choose the Overwrite Mode for the Log Area option.
    Hope that helps!
    Vladimir

  • Grouping of Instances?

    Hi All,
    What Exactly is Sequence,Group,Container Instance,Container Island? is it possible to get the details of these from Command line.
    How to group Instances of Oracle 9iAS running in Various Machines Under one group?.(Please see the page 6-4 of Oracle 9i Apps Server Admin Guide ).
    Regds
    Sree

    Sree,
    Please post OC4J/J2EE questions on that forum. You will get better responses.
    There's cool tool that let's you visualize processes, islands, etc.
    See: http://otn.oracle.com/products/ias/ias_utilities.html#ihat
    Hope this helps,
    Ashesh Parekh
    Oracle9iAS Product Manager

  • Unable to call an EJB which isn't in the same application as the calling client

    We're attempting to invoke an EJB running in a different O9iAS application from the calling client (servlet).
    We're told by our local Oracle support team that this isn't possible but we have no problem performing the same operation from within a Weblogic or WebSphere set up. Is this problem peculiar to O9iAS? We're told that even O9iAS rel2 does not support this type of operation. Does anyone know of a work-around that might help?
    Thanks

    John -- This should be possible but there were some problems with this in early releases. You may want to start by searching the
    j2ee forum http://forums.oracle.com/forums/forum.jsp?id=486963 as most of the J2EE questions get answered there.
    Thanks -- Jeff

  • Environment variables of 9i  App server

    I have to configure few Environment variables in 9i App server. How can i do that. Also I want to view all the exisitng Env varibles.
    Thanks
    N

    Nitin,
    What kind of environment variables? Could you provide some more details. All Application Server settings are done via the EM Website.
    Also, if this is a J2EE question, please post it on the J2EE forum.
    Thanks,
    Ashesh Parekh
    Oracle9iAS Product Management

  • JSF HTML Command Button: Prevent Page Reload

    I know that for ADF Faces Core Command Buttons, you can set partialSubmit to true to prevent the page from reloading. I need to do the same thing for a JSF HTML Command Button, but there is no such property. I really just want to change properties for the button when it is clicked using javascript. I don't want anything to submit at all. Is there something I could put for the action property to prevent this?
    thanks,
    tim

    Have you tried returning false from your Javascript? If it's a function, you need to make sure you return the function's result, as well.
    Edited by: Avrom Roy-Faderman on Sep 19, 2008 11:31 AM
    Oh, BTW--while I (and I'm sure many others on this forum) are happy to answer generic Java EE (as opposed to ADF or JDeveloper Tooling for J2EE) questions when we can, you'll probably get a better mix of JEE gurus on a JEE forum.

  • HTTP is a stateless protocol

    Hi all,
    I have some questions, could you plz clarify me on that.
    1. HTTP is a stateless protocol - how do app servers typically create and manage HTTP sessions?
    2. Disadvantages of using EJBs
    3. When/why would we should make a class static?
    4. Where are tile attributes stored
    regards
    Martin

    Are you even remotely serious?
    Question #1: HTTP
    Question #2: J2EE
    Question #3: Java
    Question #4: Struts
    The fact you are not able to answer #3 makes me seriously doubt you will be able to answer #2. The fact you cannot answer #1 makes me seriously doubt you will be able to answer #4.
    Rather than trying to get a hodge-podge of questions answered, start some research yourself. There are dozens of J2EE tutorials on the web, even more about the Java language itself. At some point, look into HTTP. Most books on this are less than 30 pages. Finally, when you are ready in a few weeks, start looking at Struts.
    I'll throw you a bone: yes, HTTP is stateless. J2EE containers implement session state by generating a random UID and associating that (in a Map) with session data. The client is instructed, normally, to set a cookie with the UID and send it back on subsequent requests. The server can then associate a given client with his/her session data.
    - Saish

  • Compare Portal configuration...Please guide

    Hello All,
    I need to compare Portal configuration between portal dev and qas servers.
    Have extracted the following configs:
    1. KM
    2. PCD
    3. J2EE
    Questions:
    -> KM - Following blogs KM transports: Part II & KM transports: Part III, the KM export file is generated with ConfigCM extension. I did try changing the extension from ConfigCM to ConfigfArchieve but I an unable to open the file either way.
    Any guidance on this please.
    -> PCD - Have exported entire PCD contents into this .epa file. How do I open this file?
    Awaiting Reply.
    Thanks,
    Ritu

    The EPA file is a WinRAR/ZIP file.
    Comparing configurations is non-trivial, and you will have some challenges! There are often SIDs and instance numbers scattered through the config..

  • How to access application state from stateless web service?

    I have a beginner J2EE question. After reading through J2EE tutorial, I still don't know how to create an application that would run on J2EE server, and which would have a web service interface to other world, and which would have several threads running, which would connect to other enterprise applications via TCP? Because if I understand it correctly, web service requires a stateless session bean, which means that it can't access any stateleful session bean (except always create one and remove it instantly). So there seems to be no way to store application state and have running threads.
    I'm asking this because .NET seems to have a very simple Application dictionary, which can save all application objects, including threads, and it is very easy to access this Application state from a stateless web service. Isn't there any similar functionality in J2EE? And if not, how it should be done in Java world then?
    I guess that the Connector architecture could be the solution, but it is not documented in the tutorial.

    There's nothing in the J2EE spec that says that you have to use Web Services. Web Services by definition are stateless.
    If your requirements are that you have to use a session bean along with a Web Service, then the architecture needs to be rethought, because it doesn't seem to me that Web Services are what you want.
    That said, you can use a hybrid. You can expose some of the functionality of your application as Web Services while the remaining is implemented in a classic J2EE type framework that is stateful.
    I would also think that you could store your application state via entity beans. You could save and load them when the web service is accessed. An entity bean doesn't require a database... just some form of persistence (could be an XML file for instance).
    You need to decide which components of J2EE make sense when and where.

  • Using SSL for Web Service Access

    Hi,
    I'm not sure if this the best forum, but this is technically a J2EE question.
    I'm using JDeveloper and OC4J. I have a java class that I'm publishing as a stateful webservice; however, the only clients will be other java routines. (I generated a WSDL file and then stubs.) This webservice has to run on a Windows 2000 box inside of OC4J. I have this done and can call it from across the network from a Linux box. This all works fine. However, I need to add security preferably by going to SSL. I can't find out how to do this. Does anyone know? Do I manually edit the generated stub files? Any chance there is some sample code somewhere?
    thanks,
    Joe Gamache

    Please look at Appendix A of the "Web Services Developer's Guide" from iAS v9.0.2 covers Oracle SOAP. The section, "Working With Oracle9 iAS SOAP
    Transport Security", covers using SSL.
    Here is a simple example with steps:
    Prerequisites
    1 . Suppose you have configured Apache to use SSL , that is
    -     Apache has a valid server certificate
    -     Apache requires the client certificate
    -     Apache has a bundle of root certificates of CA with wich it can trust client certificates
    -     Apache is in front of OC4J with mod_oc4j (9.0.2) or mod_proxy ( 1.0.2.2)
    For more information on this please refer to Oracle9i Application Server Security Guide
    2. Have a working knowledge of Oracle Wallet Manager
    Steps
    The following steps let you use an https web services client
    1.     First you need a certificate store in order to store the private key , the client X509 certificate and some trusted authorities. This store in our case is a wallet exported by Oracle Wallet Manager.
    2.     In order to generate a correct wallet you need :
    a.     Start the Oracle Wallet Manager ( OWM )
    b.     Create a new empty wallet
    c.     Generate a Certificate Signing Request (CSR )
    d.     Import the X509 certificate that the CA generated from the CSR
    e.     Import the root certificate of the CA that trusts the server certificate you would like to connect to ( that of Apache )
    f.     Export the wallet
    3.     Let's call exported_wallet the wallet that we exported from OWM , and lets put it under c:\temp . Suppose that the wallet password is camarda.
    4.     The JDK you plan to use for your client , in the extension directory ( that is $JDK_HOME/jre/lib/ext ) , must contains the following library
    a.     jcert.jar
    b.     jsse.jar
    c.     jssl-1_1.jar
    5.     Oracle SSL library use JNI in order to implement some low level encryption API , so you need a shared library usually located in $ORACLE_HOME/bin . For NT platform this library is njssl9.dll . Be sure to have this library in your path
    6.     Now given a WDSL , use the Jdeveloper wizard to generate a proxy
    7.     Modify the URL end-point from http to https
    8.     Add to the proxy the following lines of code
    System.setProperty("ssl.SocketFactory.provider","oracle.security.ssl.OracleSSLSocketFactoryImpl");
    System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryImpl");
    System.setProperty("java.protocol.handler.pkgs","HTTPClient");
    System.setProperty("oracle.wallet.location","C:\\temp\\exported_wallet");
    System.setProperty("oracle.wallet.password","camarda");
    Example
    In red : modified
    In blue : added
    import oracle.soap.transport.http.OracleSOAPHTTPConnection;
    import java.net.URL;
    import org.apache.soap.Constants;
    import org.apache.soap.Fault;
    import org.apache.soap.SOAPException;
    import org.apache.soap.rpc.Call;
    import org.apache.soap.rpc.Parameter;
    import org.apache.soap.rpc.Response;
    import org.w3c.dom.Element;
    import java.util.Vector;
    import java.util.Properties;
    import oracle.xml.parser.v2.*;
    * Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
    * Date Created: Mon May 20 14:24:48 CEST 2002
    * WSDL URL: http://26.2.197.119:8888/InterOp/Services.wsdl
    public class AnagInquireServicesEJBStub {
    public String endpoint = "https://26.2.197.119/InterOp/AnagInquireServices";
    private OracleSOAPHTTPConnection m_httpConnection = null;
    public AnagInquireServicesEJBStub() {
    m_httpConnection = new OracleSOAPHTTPConnection();
    public Element ricercaPF(String istat1, String istat2, String codiceFiscale) throws Exception {
    System.setProperty("ssl.SocketFactory.provider","oracle.security.ssl.OracleSSLSocketFactoryImpl");
    System.setProperty("ssl.ServerSocketFactory.provider","oracle.security.ssl.OracleSSLServerSocketFactoryImpl");
    System.setProperty("java.protocol.handler.pkgs","HTTPClient");
    System.setProperty("oracle.wallet.location","C:\\temp\\exported_wallet");
    System.setProperty("oracle.wallet.password","camarda");
    Element returnVal = null;
    URL endpointURL = new URL(endpoint);
    Call call = new Call();
    call.setSOAPTransport(m_httpConnection);
    call.setTargetObjectURI("AnagInquireServices");
    call.setMethodName("ricercaPF");
    call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
    Vector params = new Vector();
    params.addElement(new Parameter("istat1", String.class, istat1, Constants.NS_URI_SOAP_ENC));
    params.addElement(new Parameter("istat2", String.class, istat2, Constants.NS_URI_SOAP_ENC));
    params.addElement(new Parameter("codiceFiscale", String.class, codiceFiscale, Constants.NS_URI_SOAP_ENC));
    call.setParams(params);
    Response response = call.invoke(endpointURL, "");
    if (!response.generatedFault()) {
    Parameter result = response.getReturnValue();
    returnVal = (Element)result.getValue();
    else {
    Fault fault = response.getFault();
    throw new SOAPException(fault.getFaultCode(), fault.getFaultString());
    return returnVal;
    public void setMaintainSession(boolean maintainSession) {
    m_httpConnection.setMaintainSession(maintainSession);
    public boolean getMaintainSession() {
    return m_httpConnection.getMaintainSession();
    public void setTransportProperties(Properties props) {
    m_httpConnection.setProperties(props);
    public Properties getTransportProperties() {
    return m_httpConnection.getProperties();
    public static void main( String args[] ) {
    AnagInquireServicesEJBStub a = new AnagInquireServicesEJBStub();
    try {
    XMLElement e = (XMLElement) a.ricercaPF("102030","102030","CMRGPP69M29D761K");
    e.print(System.out);
    } catch (Exception ex) {
    ex.printStackTrace();
    } finally {

  • Netbeans - How to Upload a csv File

    Hi all
    A J2EE question from a java beginner:
    I am using NetBeans and JBoss to develop a web application.
    I need to create a JSP page for user to upload a csv file and then read from the csv file (the file is in certain fixed format).
    The csv file will be read line by line to be updated into database.
    In JSP Page I have this:
    <td align="left" scope="col"><input type="file" name="meterList" id="meterList"></td>
    <td><input type="submit" name="upload" id="upload" value="Upload File" ></td>What should I do in Servlet when I clicked on the "Upload" button?
    How if I want to control the uploading size and type of the the file?
    How to get the file to be processed in servlet?
    Your help is much appreciated.
    Thanks alot.

    this question has been asked a million times
    try searching next time
    and uploading a csv file has nothing to do with netbeans

Maybe you are looking for

  • MacBook Pro C2D 17" auto restarts

    Got a MBP 17' So far when I put it to sleep by closing the lid the MBP restarts. only has happened 2x Both times it was asleep and I heard the start chime, opened it it was restarting. anyone else run into this?

  • Connecting ipod

    my computer recognizes my ipod but when i eject it how do i get my computer to recognize it again without re plugging it.

  • ORA: 00001 error when issued commit_form

    I have a question about finalizing the changes when using commit_form. There is a database trigger on the table which records all the changes update, insert, delete into an audit table. The actual sequence of actions going on in the form are 1. Updat

  • Jmf simple code

    Hi all, this is my simple code that plays a video from a specifed location. * To change this template, choose Tools | Templates * and open the template in the editor. package javaapplication1; * @author rohan import com.sun.media.util.ContentType; im

  • Import Excel Worksheet

    I can get Numbers to import my Excel worksheets and make changes. However, how do I save the changes in the new Numbers format? Whenever I try it says I don't have permission to make changes or save. Thanks.