Feedback: ACME - J2EE Best Practices Sample

Hi!
Today I'd like to provide some feedback on the aforementioned samples one can download
from the following location:
http://otn.oracle.com/products/ias/files/J2EE_Best_Practices_Sample_Code.zip
I hope you'll find it useful...
I unzipped the file and followed the instructions given in ReadMe.html, created the database user and tables (Create_User.sql, Best_Practices_DDL.sql).
Well no problems so far. Just a question. Why not using something like NUMBER(10,2) instead of FLOAT(10)
for the cost of a product? But this is just a sidenote.
Lets come to the real big mistakes in this example which make it hard to call this an example of best practices.
1)
Sign in as admin/admin and try to edit your profile! It won't work. In your browser you'll see the following message:
"Validation Error
You must correct the following error(s) before proceeding:
Invalid Username, already exists. Please try again."
And on your console:
javax.ejb.ObjectNotFoundException: No such entity: admin
javax.ejb.ObjectNotFoundException: No such entity: admin
Digging into the source the flow is:
UserEditAction.java -> UserForm.java -> user.jsp -> UserSaveAction.java (getting action "edit") ->
User.java -> CustomerUtility.java -> UserFacadeBean.java -> ...
Lets have a look in the reverse order starting with UserFacadeBean.updateCustomer(User user):
Line 54: CustomerEJBLocal customerLocal = userLocalHome.findByPrimaryKey(user.getID());
Looks good, as far as user.getID() returns the primary key. Lets skip CustomerUtitity because it only
locates the SessionFacade and passes the user object without modifications.
User.java is the value object created in UserSaveAction.perform:
Line 25: user.setID(((UserForm) form).getUserName());
Line 26: user.setUserName(((UserForm) form).getUserName());
Line 25 is obviously wrong. There are different possibilities to fix this. One quick (and dirty) change would be to alter
CustomerEJBLocal customerLocal = userLocalHome.findByPrimaryKey(user.getID());
in:
CustomerEJBLocal customerLocal = userLocalHome.findByUsername(user.getID());
or effectly the same and far better to understand:
CustomerEJBLocal customerLocal = userLocalHome.findByUsername(user.getUserName());
May be this was the intended solution. By the way there is no unique key on customer.username in the database. Another solution is to use the primary key. But then you have to alter the application starting at UserEditAction.java. You'll probably know what to do...
2)
This problem should only occur if your NLS_NUMERIC_CHARACTERS is set to ",.". Nevertheless the root cause is bad programming. Look for
String getCost() and setCost(String ...)
or
String getTotalCost() and setTotalCost(String ...)
or
return "" + _cost;
and so on.
Ugly... and remember the database field is a FLOAT(10)!
The mapping in orion-ejb-jar.xml looks like that:
<cmp-field-mapping name="totalcost" persistence-name="TOTALCOST" persistence-type="FLOAT(10)"/>
That's why you'll get an ORA-01722:INVALID NUMBER exception during the cast.
A String '123.12' is wrong if you have a database with German NLS settings for example.
Anyway one should NEVER use Strings in such a place. I'd strongly recommend that you remove both issues!
Besides this, I would like to thank you for providing samples on OTN. They are of great value for beginners like me. Perhaps you could just try to test the examples more seriously. Especially for beginners it's hard to believe that there should be something wrong in those samples.
This could end up in frustrated users thinking they are as thick as two short planks. :-)
Regards,
Eric

Hello Eric -
Thanks for the feedback, it is very helpful and appreciated.
1)Sign in as admin/admin and try to edit your profile! It >won't work. In your browser you'll see the following >message:"Validation ErrorWe've rectified this problem and the new zip file should appear on OTN within 24 hours.
The root cause was an error in one of the SQL scripts that populated the "customer" table.
The response from the developer responsible for this application is pasted below.
The first error is a data >error. I did make it where >username and id are both actually the username, so the >code referencing the username as the id was just a >shortcut. There really is not a need for both the >username and id fields in this example.
Both should be constrained to be unique with the id >actually being the key. I originally
was going to allow users to change their usernames, that >is why both the username and id fields.
In the released version of the DDL file the id is not set >to the username.[it should read]
insert into "ACMEADMIN"."CUSTOMER" values ('admin',
'Administrator', '555 Elm St. NoWhere USA', >'555-555-5555', 'admin', 'admin');cheers
-steve-

Similar Messages

  • Importing SECTIONS (not Styles) from ePub Best Practices Sample Doc

    I have successfully imported STYLES from the ePub Best Practices Sample Document (http://support.apple.com/kb/HT4168) into an existing Pages document. However, the Best Practices doc also has defined SECTIONS which you can see by clicking on the sections button in the toolbar.
    How can I get those defined Section types (i.e. Table of Contents, Index, etc.) into my other document which does not included those?
    Thanks,
    Jeff

    Hi Jeff,
    With the sample document and your new Pages document, View > Page Thumnails. Click on a thumbnail in the sample doc, Edit > Copy. Click in the thumbnail pane in the new doc and Edit > Paste. I guess this does the same as selecting and copying the text in the doc window.
    Regards,
    Ian.

  • Connect JavaFx(Applets) to J2EE - best practice & browser session

    Hi there,
    I’m new to JavaFX and Applet programming but highly interested.
    What I don’t get at the moment is how you connect the locally executed code of the applet to your system running on a server (J2EE).
    Of course there seem to be different ways but I would like to avoid using RMI or things like that because of the problem with firewalls and proxies.
    So I would like to prefer using HTTP(s) connection.
    And here my questions:
    1.) Is there any best practice around? For example: using HTTP because of the problems I mentioned above. Sample code for offering java method via HTTP?
    2.) Is there a possibility to use the browser session? My J2EE applications are normally secured. If the user opens pages he has to login first and has than a valid session.
    Can I use the applet in one of those pages and use the browser environment to connect? I don’t want the user to input his credentials on every applet I provide. I would like to use the existing session.
    Thanks in advance
    Tom

    1) Yes. If you look at least at the numerous JavaFX official samples, you will find a number of them using HttpRequest to get data from various servers (Flickr, Amazon, Yahoo!, etc.). Actually, using HTTP quite insulates you from the kind of server: it doesn't matter if it run servlets or other Java EE stuff, PHP, Python or other. The applet only knows the HTTP API (GET and POST methods, perhaps some other REST stuff).
    2) It is too long since I last did Java EE (was still J2EE...), so I can't help much, perhaps somebody will shed more light on the topic. If the Web page can use JavaScript to access this browser session, it can provide this information to the JavaFX applet (JS <-> JavaFX communication works as well as with Java applets).

  • BPC 5 - Best practices - Sample data file for Legal Consolidation

    Hi,
    we are following the steps indicated in the SAP BPC Business Practice: http://help.sap.com/bp_bpcv151/html/bpc.htm
    A Legal Consolidation prerequisit is to have the sample data file that we do not have: "Consolidation Finance Data.xls"
    Does anybody have this file or know where to find it?
    Thanks for your time!
    Regards,
    Santiago

    Hi,
    From [https://websmp230.sap-ag.de/sap/bc/bsp/spn/download_basket/download.htm?objid=012002523100012218702007E&action=DL_DIRECT] this address you can obtain .zip file for Best Practice including all scenarios and csv files under misc directory used in these scenarios.
    Consolidation Finance Data.txt is in there also..
    Regards,
    ergin ozturk

  • New to J2EE; Best Practices

    Hi everyone, and thanks in advance for all of your help.
    I'm somewhat new to J2EE, at least in the sense of creating my own application. I work for a small software company in New England, and have to work on an enterprise application as part of my job; unfortunately, I don't get much exposure to the total of J2EE. Instead, most of my work is on small extensions, database scripts, or external projects that don't quite give me the exposure I'm looking for.
    As an exercise, I've decided to put together a sample J2EE application. I've spent time reading the (many) J2EE tutorials out there, but I'm having trouble putting it all together. This application works, but I know that I've used some bad patterns, and was hoping to get some feedback. My application consists of 4 Java classes and 8 JSPs, but none over 100 lines, and only 1 above 50.
    One final note before I start: yes, I know there are some frameworks out there that would help; I plan on migrating to Struts at some point. However, I wanted to make sure I understand the core J2EE structure before I delved into that.
    My application simply allows a user to add, edit, or delete entries in a database. The database consists of 1 table (Projects), with two fields: an id, and a name.
    The first page, Projects.jsp, lists the current projects in the database for the user:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page pageEncoding="UTF-8" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <jsp:useBean id="projectsDAO"
                 class="com.emptoris.dataAccess.ProjectsDataAccessObject"
                 scope="application" />
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <title>Projects</title>
      </head>
      <body>
        <form name="projectsForm"
              action="<%= response.encodeURL("ProjectsController.jsp") %>"
              method="post">
          <c:if test="${projectsDAO.projects.numberOfProjects > 0}">
            <table>
              <tr>
                <th>Select</th>
                <th>ID</th>
                <th>Name</th>
              </tr>
              <c:forEach items="${projectsDAO.projects.projects}" var="project"
                         step="1">
                <tr>
                  <td>
                    <input type="radio" name="projectId" value="${project.id}" />
                  </td>
                  <td><c:out value="${project.id}" /></td>
                  <td><c:out value="${project.name}" /></td>
                </tr>
              </c:forEach>
            </table>
            <input type="submit" name="action" value="Edit Project" />
            <input type="submit" name="action" value="Delete Project" />
          </c:if>
          <input type="submit" name="action" value="Add New Project" />
        </form>
      </body>
    </html>The ProjectsDataAccessObject is a class that simply mirrors the table in the database. Adding, editing, or removing entries in this class will modify the database accordingly:
    package com.emptoris.dataAccess;
    import java.sql.*;
    import com.emptoris.model.*;
    public class ProjectsDataAccessObject {
        private Connection connection;
        private Statement statement;
        private Projects projects;
        public ProjectsDataAccessObject() throws ClassNotFoundException,
            SQLException {
            Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
            connection =
                DriverManager.getConnection(
                    "jdbc:microsoft:sqlserver://AFRASSO:1433", "sa", "password"
            statement = connection.createStatement();
            statement.execute("USE test");
        public Project getProject(int id) throws SQLException {
            Projects projects = getProjects();
            Project project = projects.getProject(id);
            return project;
        public Projects getProjects() throws SQLException {
            if (projects == null) {
                projects = new Projects();
                String query = "SELECT id, name FROM Projects";
                ResultSet resultSet = statement.executeQuery(query);
                Project project;
                while(resultSet.next()) {
                    project = new Project();
                    project.setId(resultSet.getInt(1));
                    project.setName(resultSet.getString(2));
                    projects.addProject(project);
            return projects;
        public void addNewProject(Project project) throws SQLException {
            String query =
                "INSERT INTO Projects (name) VALUES ('" + project.getName() + "')";
            statement.execute(query);
            query =
                "SELECT MAX(id) FROM Projects";
            ResultSet resultSet = statement.executeQuery(query);
            resultSet.next();
            project.setId(resultSet.getInt(1));
            projects.addProject((Project) project.clone());
        public void removeExistingProject(int id) throws SQLException {
            String query =
                "DELETE FROM Projects WHERE id = " + id;
            statement.execute(query);
            projects.removeProject(id);
        public void updateExistingProject(Project project) throws SQLException {
            String query =
                "UPDATE Projects SET name = '" + project.getName() +
                    "' WHERE id = " + project.getId();
            statement.execute(query);
            projects.getProject(project.getId()).setName(project.getName());
    }So the first question I have is: is this appropriate? I've set up the data access object correctly? I feel like I'm basically reproducing the Projects class... do I even need this class anymore? I certainly don't use it in any of the JSP pages (as you will see).
    Also, I've simply added it to the application context here. Is that the correct way to create and access a data access object like this one?
    The second question is: the form's action parameter is a JSP page that acts as a semi-controller, reads the parameters from the form, and passes that information to a class, which then determines where next to send the application. Does this make sense? I'm not really sure of the idea of using a JSP page as a controller, but I don't know any other way to get the results of the form to the controller class.
    Here is the controller JSP, ProjectsController.jsp:
    <%@ page contentType="text/html; charset=UTF-8" %>
    <%@ page pageEncoding="UTF-8" %>
    <jsp:useBean id="projectsDAO"
                 class="com.emptoris.dataAccess.ProjectsDataAccessObject"
                 scope="application" />
    <jsp:useBean id="projectsController"
                 class="com.emptoris.controller.ProjectsController"
                 scope="request">
      <jsp:setProperty name="projectsController" param="action" property="action" />
    </jsp:useBean>
    <jsp:forward page="<%= response.encodeURL(
                               projectsController.getDestinationPage()
                           ) %>" />and here is the ProjectsController class:
    package com.emptoris.controller;
    public class ProjectsController {
        private String action;
        public ProjectsController() {
        public String getDestinationPage() {
            if (action.equals("Add New Project"))
                return "AddProject.jsp";
            else if (action.equals("Edit Project"))
                return "EditProject.jsp";
            else if (action.equals("Delete Project"))
                return "DeleteProject.jsp";
            return null;
        public void setAction(String action) {
            this.action = action;
    }I'll stop there. I think this is enough information to give me feedback on what I've done thus far. If I've been unclear about something, please let me know and I'll fill in the blanks, or post more code if necessary. Also, feel free to comment on other aspects of the design and style that you see in this code; I'm here to learn, so even if I haven't brought it up, that just means I don't yet see the issues of what I've done yet. :)
    Thanks again for all of your help!
    Regards,
    Anthony Frasso

    hi,
    My best advise not to for any IDE.
    If you do all the things manually, you will get the idea of the reason of doing. if you go with IDE, for ex, if you are creating session bean, IDE itself will create some files for you, these things you will not get to know.
    if you create these things manually, usually you will get lot of errors, so you will get lot of experience than using any IDE.
    if you are going to develop any project or application at that time you can use NetBeans or eclipse or some other ide u like.

  • J2EE Best Practices on Cache (I know there's a lot of answers but...)

    Hello friends,
    i'm developing a JSP-Servlet MVC application and I have the following problem. I want to control errors at low level, so i want to permit send a form, presenting a error message in a new window with a back button that cals history.back(). The problem is that I want that user data must not be rewrited. I hope that form backs to exactly the same point before user submits. When i play with the cache headers, all i get is have the data back, but when i try to submit from selects or change anything ans submits, the response is the same, like if I repaeat the same inputs.
    I tried cache-control: no-cache,no-store,post-check=0,pre-ceck=0
    and the HTTP1.0 pragma no-cache
    all with expires clausule. But i can't get what I want. Browser disables submit button, and if not I have problems with selects onchange (which acts in fact like a submit by the button) and when I fight that troubles, then I find that user must rewrite the form data during a histroy.back() event.
    So my question is, once i said all this things, which is the best way to implement that functionality??
    Please help me it's very improtant for me, i've read HTTP RFC inclusive, but I just don't get it after combine everything from my JSP filter (setResponse).
    Thank you very much in advance, hope you can help me

    What kind of TV is it?
    The most common way to hook up a laptop to an external display is with the VGA connection.
    VGA connections are fairly common on modern flat panels. If you're trying to connect to a standard definition CRT(tube) TV, an s-video video connection may be possible if both the laptop and TV support s-video. Quality will be poor, however.
    Disclosure: Former BBY employee.

  • In the Begining it's Flat Files - Best Practice for Getting Flat File Data

    I probably should have posed this question here before I delved into writing Java to get data for reports, but better late than never.
    Our ERP is written in COBOL. We have a third party ODBC which allows us to access data using a version of SQL. I have several Java sources compiled in my database that access the data and return something relevant. The Java sources are written in a procedural style rather than taking advantage of object oriented programming with attributes and methods.
    Now that I am becoming more comfortable with the Java language, I would greatly appreciate any feedback as to best practices for incorporating Java into my database.
    My guess is that it would be helpful to model the ERP "tables" with Java classes that would have attributes, which correspond to the fields, and methods to return the attributes in an appropriate way. Does that sound reasonable? If so, is there a way to automate the task of modeling the tables? If not reasonable, what would you recommend?
    Thanks,
    Gregory

    Brother wrote:
    I probably should have posed this question here before I delved into writing Java to get data for reports, but better late than never.
    Our ERP is written in COBOL. We have a third party ODBC which allows us to access data using a version of SQL. I have several Java sources compiled in my database that access the data and return something relevant. The Java sources are written in a procedural style rather than taking advantage of object oriented programming with attributes and methods.
    OO is a choice not a mandate. Using Java in a procedural way is certainly not ideal but given that it is existing code I would look more into whether is well written procedural code rather than looking at the lack of OO.
    Now that I am becoming more comfortable with the Java language, I would greatly appreciate any feedback as to best practices for incorporating Java into my database.
    My guess is that it would be helpful to model the ERP "tables" with Java classes that would have attributes, which correspond to the fields, and methods to return the attributes in an appropriate way. Does that sound reasonable? If so, is there a way to automate the task of modeling the tables? If not reasonable, what would you recommend?Normally you create a data model driven by business need. You then implement using whatever means seem expedient in terms of other business constraints to closely model that data model.
    It is often the case that there is a strong correlation between data models and tables but certainly in my experience it is rare when there are not other needs driven by the data model (such as how foreign keys and link tables are implemented and used.)

  • Best practice for including additional DLLs/data files with plug-in

    Hi,
    Let's say I'm writing a plug-in which calls code in additional DLLs, and I want to ship these DLLs as part of the plug-in.  I'd like to know what is considered "best practice" in terms of whether this is ok  (assuming of course that the un-installer is set up to remove them correctly), and if so, where is the best place to put the DLLs.
    Is it considered ok at all to ship additional DLLs, or should I try and statically link everything?
    If it's ok to ship additional DLLs, should I install them in the same folder as the plug-in DLL (e.g. the .8BF or whatever), in a subfolder of the plug-in folder or somewhere else?
    (I have the same question about shipping additional files too, such as data or resource files.)
    Thanks
                             -Matthew

    Brother wrote:
    I probably should have posed this question here before I delved into writing Java to get data for reports, but better late than never.
    Our ERP is written in COBOL. We have a third party ODBC which allows us to access data using a version of SQL. I have several Java sources compiled in my database that access the data and return something relevant. The Java sources are written in a procedural style rather than taking advantage of object oriented programming with attributes and methods.
    OO is a choice not a mandate. Using Java in a procedural way is certainly not ideal but given that it is existing code I would look more into whether is well written procedural code rather than looking at the lack of OO.
    Now that I am becoming more comfortable with the Java language, I would greatly appreciate any feedback as to best practices for incorporating Java into my database.
    My guess is that it would be helpful to model the ERP "tables" with Java classes that would have attributes, which correspond to the fields, and methods to return the attributes in an appropriate way. Does that sound reasonable? If so, is there a way to automate the task of modeling the tables? If not reasonable, what would you recommend?Normally you create a data model driven by business need. You then implement using whatever means seem expedient in terms of other business constraints to closely model that data model.
    It is often the case that there is a strong correlation between data models and tables but certainly in my experience it is rare when there are not other needs driven by the data model (such as how foreign keys and link tables are implemented and used.)

  • Best Practices for Removing Shots from BDMV folder

    CS6 Production Premium Suite
    Win7x64
    Canon XA10
    I would appreciate feedback on the best practices for the following situation:
    Using Windows Explorer, I copy the BDMV folder from the XA10 to my Talk2 project folder.
    The BDMV folder has three one hour shots (talks) where each shot is one hour called Talk1, Talk2, and Talk3.
    Each shot consists of several MTS files in the STREAM folder since MTS files have a maximum file size so a new MTS file is created when a given MTS file reaches the maximum file size.
    Since I only want to have Talk2 stuff in my Talk2 project folder, I need to remove the Talk1 and Talk3 stuff from the BDMV folder.
    I delete the Talk1 and Talk3 MTS files from the STREAM folder.
    I delete the Talk1 and Talk3 CPI files from the CLIPINF folder.
    I leave the PLAYLIST folder as is.
    Using the Media Browser, I import Talk2 (which consists of two MTS files).
    I edit the clip.
    This procedure seems to work, but I do not know if there are any "got you" issues.
    Thanks in advance.

    Oh, don't do it that way.  I know a lot of people do, heck, my boss does, but it's just asking for trouble.
    Treat your card as if it was your original tape master (because it is).  It is the most important thing you have.  Don't delete or move any part of it. 
    If you want to break up the talks, do it as you shoot them.  Use separate cards for each talk and archive each one separately.  There is too much valuable information in the structure of the card format.  You may not need it now but your editing program may need it later.
    Hard drive space is cheap but digital recordings are priceless

  • Best practice for distributing/releasing J2EE applications.

    Hi All,
    We are developing a J2EE application and would like some information on the best
    practices to be followed for distributing/releasing J2EE applications, in general.
    In particular, the dilemma we have is centered around the generation of stub, skeleton
    and additional classes for the application.
    Most App. Servers can generate the required classes while deploying the EJBs in the
    application i.e. at install time. While some ( BEA Weblogic and IBM Websphere are
    two that we are aware of ) allow these classes to be generated before the installation
    time and the .ear file containing the additional classes is the one that is uploaded.
    For instance, say we have assembled the application "myapp.ear" . There are two ways
    in which the classes can be generated. The first is using 'ejbc' ( assume we are
    using BEA Weblogic ), which generates the stub, skeleton and additional classes for
    the application and returns the file, say, "Deployable_myapp.ear" containing all
    the necessary classes and files. This file is the one that is then installed. The
    other option is to install the file "myapp.ear" and let the Weblogic App. server
    itself, generate the required classes at the installation time.
    If the first way, of 'pre-generating' the stubs is followed, does it require us to
    separately generate the stubs for each versions of the App. Server that we support
    ? i.e. if we generate a deployable file having the required classes using the 'ejbc'
    of Weblogic Ver5.1, can the same file be installed on Weblogic Ver6.1 or do we
    have to generate a separate file?
    If the second method, of 'install-time-generation' of stubs is used, what is the
    nature/magnitude of the risk that we are taking in terms of the failure of the installation
    Any links to useful resources as well as comments/suggestions will be appreciated.
    TIA
    Regards,
    Aasif

    Its much easier to distribute schema/data from an older version to a newer one than the other way around. Nearly all SQL Server deployment features supports database version upgrade, and these include the "Copy Database" wizard, BACKUP/RESTORE,
    detach/attach, script generation, Microsoft Sync framework, and a few others.
    EVEN if you just want to distribute schemas, you may want to distribute the entire database, and then truncate the tables to purge data.
    Backing up and restoring your database is by far the most RELIABLE method of distributing it, but it may not be pratical in some cases because you'll need to generate a new backup every time a schema change occurs, but not if you already have an automated
    backup/maintenance routine in your environment.
    As an alternative, you can Copy Database functionality in SSMS, although it may present itself unstable in some situations, specially if you are distributing across multiple subnets and/or domains. It will also require you to purge data if/when applicable.
    Another option is to detach your database, copy its files, and then attach them in both the source and destination instances. It will generate downtime for your detached databases, so there are better methods for distribution available.
    And then there is the previously mentioned method of generating scripts for schema, and then using an INSERT statement or the import data wizard available in SSMS (which is very practical and implements a SSIS package internally that can be saved for repeated
    executions). Works fine, not as practical as the other options, but is the best way for distributing databases when their version is being downgraded.
    With all this said, there is no "best practice" for this. There are multiple features, each offering their own advantages and downfalls which allow them to align to different business requirements.

  • What are best practice for packaging and deploying j2EE apps to iAS?

    We've been running a set of J2EE applications on a pair of iAS SP1b for about a year and it has been quite stable.
    Recently however we have had a number of LDAP issues, particularly when registering and unregistering applications (registering ear files sometimes fails 1st time but may work 2nd time). Also We've noticed very occasionally that old versions of classes sometimes find their way onto our machines.
    What is considered to be best practice in terms of packaging and deployment, specifically:
    1) Packaging - using the deployTool that comes with iAS6 SP1b to package is a big manual task, especially when you have 200+ jsp files. Are people out there using this or are they scripting it with a build tool such as Ant?
    2) Deploying an existing application to multiple iAS's. Are you guys unregistering old application then reregistering new application? Are you shutting down iAS whilst doing the deployment?
    3) Deploying ear files can take 5 to 10 mins, is this normal?
    4) In a clustered scenario where HTTPSession is shared what are the consequences of doing deployments to data stored in session?
    thanks in asvance for your replies
    Owen

    You may want to consider upgrading your application server environment to a newer service pack. There are numerous enhancements involving the deployment tool and run time layout of your application that make clear where you're application is loading its files from.
    If you've at a long running application server environment, with lots of deployments under your belt, you might start to notice slow downs in deployment and kjs start time. Generally this is due to garbage collecting in your iAS registry.
    You can do several things to resolve this. The most complete solution is to reinstall the application server. This will guarantee a clean ldap registry. Of course you've got to restablish your configurations and redeploy your applications. When done, backup your application server install space with the application server and directory server off. You can use this backup to return to a known configuation at some future time.
    For the second method: <B>BE CAREFUL - BACKUP FIRST</B>
    There is a more exhaustive solution that involves examining your deployed components to determine the active GUIDS. You then search the NameTrans section of the registry searching for Applogic Servlet *, and Bean * entries that represent your previously deployed components but are represented in the set of deployed GUIDs. Record these older GUIDs, remove them from ClassImp and ClassDef. Finally remove the older entries from NameTrans.
    Best practices for deployment depend on your particular environmental needs. Many people utilize ANT as a build tool. In later versions of the application server, complete ANT scripts are included that address compiling, assembly and deployment. Ant 1.4 includes iAS specific targets and general J2EE targets. There are iAS specific targets that can be utilized with the 1.3 version. Specialized build targets are not required however to deploy to iAS.
    Newer versions of the deployment tool allow you to specify that JSPs are not to be registered automatically. This can be significant if deployment times lag. Registered JSP's however benefit more fully from the services that iAS offers.
    2) In general it is better to undeploy then redeploy. However, if you know that you're not changing GUIDs, recreating an existing application with new GUIDs, or removing registered components, you may avoid the undeploy phase.
    If you shut down the KJS processes during deployment you can eliminate some addition workload on the LDAP server which really gets pounded during deployment. This is because the KJS processes detect changes and do registry loads to repopulate their caches. This can happen many times during a deployment and does not provide any benefit.
    3) Deploying can be a lengthy process. There have been improvements in that performance from service pack to service pack but unfortunately you wont see dramatic drops in deployment times.
    One thing you can do to reduce deployment times is to understand the type of deployment. If you have not manipulated your deployment descriptors in any way, then there is no need to deploy. Simply drop your newer bits in to the run time space of the application server. In later service packs this means exploding the package (ear,war, or jar) in to the appropriate subdirectory of the APPS directory.
    4) If you've changed the classes of objects that have been placed in HTTPSession, you may find that you can no longer utilize those objects. For that reason, it is suggested that objects placed in session be kept as simple as possible in order to minimize this effect. In general however, is not a good idea to change a web application during the life span of a session.

  • Looking for best practice on J2EE development environment

    Hi,
    We are starting to develope with J2EE. We are looking for best practice on J2EE development environment. Our concern is mainly on code sharing and deployment.
    Thanks, Charles

    To support "code sharing" you need an integrated source code control system. Several options are out there but CVS (https://www.cvshome.org/) is a nice choice, and it's completely free and it runs on Windows, Linux, and most UNIX variants.
    Your next decision is on IDE and application server. These are usually from a single "source". For instance, you can choose Oracle's JDeveloper and Deploy to Oracle Application Server; or go with free NetBeans IDE and Jakarta Tomcat; or IBM's WebSphere and their application server. Selection of IDE and AppServer will likely result in heated debates.

  • Best practice - J2EE or standalone ?

    Hi,
    I'm about to install CF7 and want to know whats the best
    practice for deployment.
    Can anyone point me to a summary of the pros and cons of
    CF7/J2EE versus CF7 standalone.
    Thanx.

    It all depends on your website and traffic load. Usually
    standalone should be good enough if your site is small or of medium
    size. Functionality-wise there are no differences between server
    and multi-server installs. However, with multi-server install you
    will be able to setup multiple instances of ColdFusion with each of
    them having a separate Administrator. You will be able to cluster
    those instances if you wish so. Also if you are using more than one
    server, you will be able to cluster across the servers. Another
    advantage of multi-server install is that you get a full version of
    JRun and therefore will be able to deploy and run other Java
    applications on the same platform and same application server. In
    addition you will be able to apply JRun updaters and hot fixes to
    your server. Just a reminder, if you do want to use
    multi-server/J2EE install you need an Enterprise license. Standard
    license will only give you a standalone installation option.

  • Logging Best Practices in J2EE

    Hi,
    I've been struggling with Apache Commons Logging and Log4J Class Loading problems between module deployments in the Sun App Server. I've also had the same problems with other App servers.
    What is the best practice for Logging in J2EE.
    i.e. I think i may be java.util.logging. But what is the best practise for providing different logging config (i.e. Levels for classes and output) for each deployed module. and how would you structure that in the EAR.
    Thanks in advance.
    Graham

    I find using the java.util.logging works fine. For configuration of the log levels I use a LifeCycle module that sets up all my levels and handlers. That way I can set up the server.policy to allow only the LifeCycle module jar to configure logging (with a codebase grant), but no other normal modules can.
    The LifeCycle module gets its properties as event data with the INIT event and configures the logging on the STARTUP event.
    Hope this helps.

  • Hotfix Management | Best Practices | WCS | J2EE environment

    Hi All,
    Trying to exploit some best practices around hotfix management in a J2EE environment. After some struggle, we managed to handle the tracking of individual hotfixes using one of our home-grown tools. However, the issue remains on how to manage the 'automated' build of these hotfixes, rather than doing the same manually, as we are currently doing.
    Suppose we need to hotfix a particular jar file on a production environment, I would need to understand how to build 'just' that particular jar. I understand we can label the related code (which in this case could be just a few java files). Suppose this jar contains 10 files out of which 2 files need to be hotfixed. The challenge is to come up with a build script which builds -
    - ONLY this jar
    - the jar with 8 old files and 2 new files.
    - the jar using whatever dependent jars are required.
    - the hotfix build script needs to be generic enough to handle the hotfix build of any jar in the system.
    Pointers, more in line with a WCS environment would be very much appreciated!
    Regards,
    Mrinal Mukherjee

    Moderator Action:
    This post has been moved from the SysAdmin Build & Release Engineering forum
    To the Java EE SDK forum, hopefully for closer topic alignment.
    @)O.P.
    I don't think device driver build/release engineering is what you were intending.
    Additionally, your partial post that was accidentally created as a duplicate to this one
    has been removed before it confuses anyone.

Maybe you are looking for

  • To open a new page by appending some values

    Hi, I created a button and on click of the button it should open a new page based on a few flag conditions.There are 4 URL's which are stored in a standard table.Please let me know how i can open the page by using the respective URL and then appendin

  • Lightroom 4 email problem

    Looking for help with problem with trying to email a photo from lightroom 4.  I have validated the email address in the manager.  Testing by trying to send one photo via "export" with a preset as per info on a you tube video from reliable source of p

  • Using Iphone while Charging

    I was using my iphone 4s while plugged into the wall andi noticed the battery was decreasing.  How is this possible if its plugged in?

  • Can I use a 2.0 script in a 3.0 script Flash file?

    The following script is a simple photo gallery, written in Action Script 2.0. When I attempt to apply the same script in a Flash file designated as having Action Script 3.0, it does not work properly (the photos advance from frame to frame in a runaw

  • TS2537 Mail application cancels shutdown and refuses to quit

    I am running OS 10.9 and I still have problems with the mail application. It often does not want to quit and cancels shutdown. Are there any suggestions out there?