Purpose of DTO in CMP

what is the purpose of DTOs in N-tire architecture using J2EE?

This is not a technical forum. It is for posting questions, observations about the OTN website itself.
In particular it is not a forum for questions that you could answer for yourself with a few seconds googling.
LALEAGTFOTP.
Cheers, APC

Similar Messages

  • Necessity of DTO in CMP

    can anyone please tell me what is the purpose of using DTOs in CMP for N-tire architecture?

    user482681,
    There are lots of Internet articles that explain the benefits (or not :-) of using a DTO. Perhaps this one will be helpful:
    http://java.sun.com/developer/technicalArticles/ebeans/ejbease/index.html
    Good Luck,
    Avi.

  • Calling stored procedures from CMP entity beans

    Hello all,
    Is it possible to call a stored procedure from a CMP entity bean? if so, what is the purpose of defining the <cmp-fields> in the descriptor file if I can just pass the result set of my query as an arraylist (or something similar), completely bypassing the need for the cmp fields? Am I missing something here?
    Please let me know.
    -Dave

    You can't call a stored procedure to populate your container managed fields. You need to use an updatable view or a table. You can create some other method in a CMP bean that calls a stored procedure however.

  • Custom finders in CMP dealing with BMP Beans as parameters

    Hi all,
    I need to create a custome finder method in a CMP Bean which has a parameter of type EJBLocalHome which is a BMP bean that has been already built. The problem is, I can't understand how to write the EJB-QL part of the finder. I will give some examples of my situation :
    CMP Finder definition :
    findByCustomer(CustomerLocal customer);
    The CMP bean which I want the finder to be implemented has a CMP field for the Customer's primary key which is of type Integer. But, I need to pass a CustomerLocal object to the finder. How can I write a EJB-QL to this situation ?
    Is there any known patterns for CMP-BMP relationships...?
    Thanks.
    Indy.

    Hi,
    Your first point is, I think, is out of the question because, if you call a business method, then the bean will be loaded. That will lose the sole purpose of finders.
    Second Point : There may be situations or projects that have to deal with CMP as well as BMP Beans together in a single project for reasons like the BMP beans coming from an already existing development. So, I can't really agree on your point saying that our design is questionable. We had to do it because, we had no other alternatives like changing all the BMP's into CMP's..
    So, still my question seems to be unanswered....!!!!!!
    Thanks anyway,
    Indy.

  • Business Objects(BOs) & Data Transfer Objects(DTOs)-both needed ?

    In a J2EE system...
    I know that "Business Objects" (BOs) are basically value objects (VOs) ...lots of getters and setters and some business logic. These are basically to model nouns in the system. Eg Student BO.
    I know that "Data Transfer Objects" (DTOs) are value objects (VOs)....with getters and setters... with the purpose of avoiding multiple method calls...to avoid overhead...which effects performance. eg it's better to pass a Student DTO then say...pass the student ID and student name and student age etc etc.
    Main question : Should a system have both ? If yes, why do I need a StudentBO.java and then another StudentDTO.java....when they are so similar ?...when both are basically VOs ? Can't I just use BOs to serve as DTOs ?
    Thanks.

    Hi,
    I've started using BO's and DTO's since 3 months .With my experiece i understand we nned both of them.
    The BusinessObject represents the data client. It is the object that requires access to the data source to obtain and store data.
    DTO
    This represents a Transfer Object used as a data carrier. The DataAccessObject may use a Transfer Object to return data to the client. The DataAccessObject may also receive the data from the client in a Transfer Object to update the data in the data source.
    From this i want to tell you that We are not gonna do any operation on BO's but we do operations on DTO
    Ashwin

  • DTO, Business Objects and architectural layers design

    Hi everybody,
    What would prevent one from using Business objects (properties + getters/setters and bevaviour related to a business entity) thru all tiers of a J2EE Web application ?
    Example : DAO layer populates BO properties, Business layer uses BO behaviour , web layer stores BO in some scope (request,session,...) for view presentation of the BO properties.
    Compared to a DTO/VO (only properties, no behaviour) solution :
    - If the application is distributed the BO solution adds serialization overhead (possibl performance bottlenecks) if BO's are large objects.
    - If there is requirements for clustering , storing large BO's in session adds session replication overhead.
    - BO solution breaks layer isolation , but practically speaking what could be the consequences of it ?
    - Some BO properties need formatting for text deiting by the views and cannot be displayed as is.
    - BO solution is a more OO approach than using only data objects
    What other arguments can you think of ?

    "Session" data applies to the session. Thus when I
    order a book and it is added to my shopping cart the
    session data might be used to store that information.
    But that data in of itself is not a "business
    s object". It is, by definition, session data.Ok conceptually speaking it is session data, but from
    a technical point of view you need an Object instance
    of some sort to hold that data.No actually you don't.
    There are a number of ways to maintain session data. With tradeoffs between each.
    What I was talking about (which does not mean I think
    It is a good idea...) is using the BO properties for
    holding that data and storing the BO instance(s) in
    the session.
    And I still don't see that this is a "Business Object". No more so than a security key is a "Business Object".
    The best term is session data and you might have different groupings (data not behavior) within that.
    Exactly what behavior do you envision?Any computational behaviour that uses the BO
    properties and is needed to implement a use case.
    This behaviour is used to calculate data that is not
    persisted by the DAO as is but rather computed from
    m other persisted data.
    Give me an exact example.
    For example it would be quite reasonable to have a DTO that represents a "rectangle" and that DTO would have a height and width and the DTO would have a method that return the area (multiplying the two data points.)
    Conversely my previous example of the zipcode, the DTO should NOT have a method to validate that the zipcode exists although it could validate that it has the correct form (5/9 digits in the US.)
    The problem is coupling. If the BO needs the
    database layer (see the zipcode example above) then
    the GUI layer is going to need the database layer is
    well. Even though the GUI will never use the
    database layer.I understand that this coupling applies to
    distributed architectures where you package your
    applications in different jars/wars/ears. In this
    case If BO's ared used thru all layers, The GUI
    (web) layer needs the data access layer jars even if
    it will never use it.
    This clearly adds coupling.
    But in the case of a collocated application (a single
    war) it does not change anything.
    No. The point is not how the application is architected.
    The point is that the GUI layer is then dependent on the database layer internals.
    Consider another example, the DTO is produces a formatted xml string using a XML library. Now you need to create the database layer for the system. The database layer does not need the XML at all. And yet just to compile the database layer you are going to have to provide the XML library. This represents coupling that serves no purpose. And although in very small projects it might be convienent in larger projects coupling like that will cause problems and confusion.
    And? Are you suggesting that the BO should do the
    formatting?No I mean that DTO/VO's could have either text
    formatting/editing methods or property types (e.g
    String formatted property for a date) that facilitate
    the work of the presentation layer. And most of the time that is going to be incorrect.
    "Formatting" for a web page is likely to be different than for a printed report. And for a backend system it might need XML which is still a different format. Adding all of that to the DTO is not the way to do it. (In the same way that the database and gui code should not be intermixed.)
    I would not put
    any similar formatting behaviour in the BO. That's
    why I consider this issue while comparing BO and
    DTO's
    - BO solution is a more OO approach than using only
    data objects
    No it isn't.
    An object that prints itself is not more OO than one
    that is printed.
    I thought one of the purpose of OO programming was to
    group behaviour and dataCertainly, but it doesn't mandate that one form of grouping is better than another. After if that was the sole concern then why not have just one object for the entire application - that is one way to "group" it.

  • JDev 1013 BUG? EJB, CMR, DTO and session facade.

    I've created two CMP Entity EJB's, CourseEJB and PupilEJB, and defined a M:N relationship between them. A course has many pupils and vice versa. Each bean has only two attributes, id (Long, part of PK) and name (String) for simplicity.
    1. Generated DTO's for the two beans won't compile
    I get error on:
    public void addcourseEJBLocalDTO(courseEJBLocalDTO courseEJBLocalDTO)
    coursesDTO.add(courseEJBLocalDTO);
    courseEJBLocalDTO.setPupilsDTO(this);
    and:
    public void addPupilEJBLocalDTO(PupilEJBLocalDTO pupilEJBLocalDTO)
    pupilsDTO.add(pupilEJBLocalDTO);
    pupilEJBLocalDTO.setCoursesDTO(this);
    because JDev has created definitions of the setCoursesDTO function like this:
    public void setCoursesDTO(Collection<courseEJBLocalDTO> coursesDTO)
    this.coursesDTO = coursesDTO;
    and ditto for the setPupilsDTO method, taking a Collection as argument too.
    I can fix this code manually, but next step, generating a session Facade with added methods for handling the entity beans isn't exactly any better...
    One M:N relation is pretty basic, am I doing something wrong here?
    Message was edited by:
    jonmarti

    Forgot to add, running on 1013

  • Updating Multiple Rows in a DTO

    I am trying the edit multiple rows. I followed the instruction in the below link.
    http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
    But Instead of using view object i used CMP-DTO-SessionBean for my application.
    I am thro till the form update. but i am not able to update the table .. Could somebody suggest me what is should do in addition to this to update my DTO which will udpate my table.
    I am submitting the code below and also the code in the session bean to update one row which is working for me.
    MultiRowEditAction.java
    package view;
    import oracle.adf.controller.struts.actions.DataForwardAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    import oracle.adf.model.binding.DCUtil;
    import oracle.jbo.uicli.binding.JUCtrlValueBindingRef;
    import org.apache.struts.action.DynaActionForm;
    import model.EjbNmpurenqLocalDTO;
    public class MultiRowEditAction extends DataForwardAction
    //The changes Flag
    private boolean mHasChanges = false;
    EjbNmpurenqLocalDTO nmpurenq = new EjbNmpurenqLocalDTO();
    protected void processUpdateModel(DataActionContext actionContext)
    DynaActionForm updateForm = (DynaActionForm)actionContext.getActionForm();
    UpdateRowBean[] updatedRows = (UpdateRowBean[])updateForm.get("Row");
    java.util.List origRows = (java.util.List)DCUtil.findSpelObject(
    actionContext.getBindingContainer(),
    "showPEbyParty1.rangeSet");
    for (int i=0;i<origRows.size();i++ )
    String theRowKey = updatedRows.getRowKeyStr();
    JUCtrlValueBindingRef oldRow = (JUCtrlValueBindingRef)origRows.get(i);
    if (oldRow.get(JUCtrlValueBindingRef.RANGESET_ROW_KEY_STR).equals(theRowKey))
    this.updateIfRequired(oldRow,"itemrate",updatedRows[i].getitemrate());
    this.updateIfRequired(oldRow,"suprmrks",updatedRows[i].getsuprmrks());
    protected void validateModelUpdates(DataActionContext actionContext)
    if (isDirty())
    actionContext.getBindingContainer().getDataControl().validate();
    setDirty(false);
    private void updateIfRequired(JUCtrlValueBindingRef baseRow, String attr, String newValue)
    Object baseAttrValue = baseRow.get("attr");
    if ((baseAttrValue == null && (newValue == null||newValue.length() == 0))
    ||((baseAttrValue != null && baseAttrValue.equals(newValue))))
    // no need to push the change
    return;
    baseRow.put(attr, newValue);
    setDirty(true);
    private void setDirty(boolean state)
    mHasChanges = state;
    private boolean isDirty()
    return mHasChanges;
    multiRow.jsp
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>untitled</title>
    </head>
    <body>
    <html:errors/>
    <html:form action="multiRow.do">
    <table border="1" width="100%">
    <tr>
    <th> </th>
    <th>
    <c:out value="${bindings.showPEbyParty1.labels['partycde']}"/>
    </th>
    <th>
    <c:out value="${bindings.showPEbyParty1.labels['docnumbr']}"/>
    </th>
    <th>
    <c:out value="${bindings.showPEbyParty1.labels['itemrate']}"/>
    </th>
    <th>
    <c:out value="${bindings.showPEbyParty1.labels['apprqnty']}"/>
    </th>
    <th>
    <c:out value="${bindings.showPEbyParty1.labels['suprmrks']}"/>
    </th>
    </tr>
    <c:forEach var="Row" items="${bindings.showPEbyParty1.rangeSet}"><html:hidden property="rowKeyStr" indexed="true" name="Row" />
    <tr>
    <td>
    <c:out value="${Row.currencyString}"/>
    </td>
    <td>
    <c:out value="${Row['partycde']}"/> 
    </td>
    <td>
    <c:out value="${Row['docnumbr']}"/> 
    </td>
    <td>
    <html:text property="itemrate" indexed="true" name="Row"/></td>
    </td>
    <td>
    <c:out value="${Row['apprqnty']}"/> 
    </td>
    <td>
    <html:text property="suprmrks" indexed="true" name="Row"/></td>
    </tr>
    </c:forEach>
    </table>
    <input type="submit" name="event_PreviousSet" value="PreviousSet" <c:out value="${bindings.PreviousSet.enabledString}" />/>
    <input type="submit" name="event_NextSet" value="NextSet" <c:out value="${bindings.NextSet.enabledString}" />/>
    <input type="submit" name="event_First" value="First" <c:out value="${bindings.First.enabledString}" />/>
    <input type="submit" name="event_Previous" value="Previous" <c:out value="${bindings.Previous.enabledString}" />/>
    <input type="submit" name="event_Next" value="Next" <c:out value="${bindings.Next.enabledString}" />/>
    <input type="submit" name="event_Last" value="Last" <c:out value="${bindings.Last.enabledString}" />/>
    <html:submit/>
    </html:form>
    </body>
    </html>
    update one row method in my session bean
    public void respondPE(EjbNmpurenqLocalDTO nmpurenq)
    try
    EjbNmpurenqLocalHome home = this.getEjbNmpurenqLocalHome();
    EjbNmpurenqLocal nmpurenqLocal = home.findByPartyDoc(nmpurenq.getPartycde(),nmpurenq.getDocnumbr());
    nmpurenqLocal.setItemrate(nmpurenq.getItemrate());
    nmpurenqLocal.setApprqnty(nmpurenq.getApprqnty());
    nmpurenqLocal.setSuprmrks(nmpurenq.getSuprmrks());
    catch (FinderException e)
    System.out.println(e.toString());
    throw new javax.ejb.EJBException(e.toString());
    catch (NamingException e)
    System.out.println(e.toString());
    throw new javax.ejb.EJBException(e.toString());
    UpdateRowBeanBeanInfo.java
    package view;
    import java.beans.SimpleBeanInfo;
    import java.beans.BeanDescriptor;
    import java.beans.PropertyDescriptor;
    public class UpdateRowBeanBeanInfo extends SimpleBeanInfo
    public PropertyDescriptor[] getPropertyDescriptors()
    try
    PropertyDescriptor rowKeyStr = new PropertyDescriptor("rowKeyStr",
    UpdateRowBean.class,
    "getRowKeyStr",
    "setRowKeyStr");
    PropertyDescriptor itemrate = new PropertyDescriptor("itemrate",
    UpdateRowBean.class,
    "getitemrate",
    "setitemrate");
    PropertyDescriptor apprqnty = new PropertyDescriptor("apprqnty",
    UpdateRowBean.class,
    "getapprqnty",
    "setapprqnty");
    PropertyDescriptor suprmrks = new PropertyDescriptor("suprmrks",
    UpdateRowBean.class,
    "getsuprmrks",
    "setsuprmrks");
    PropertyDescriptor partycde = new PropertyDescriptor("partycde",
    UpdateRowBean.class,
    "getpartycde",
    "setpartycde");
    PropertyDescriptor docnumbr = new PropertyDescriptor("docnumbr",
    UpdateRowBean.class,
    "getdocnumbr",
    "setdocnumbr");
    PropertyDescriptor[] pds = new PropertyDescriptor[] {rowKeyStr,itemrate,apprqnty,suprmrks,partycde,docnumbr};
    return pds;
    }catch(Exception ex)
    ex.printStackTrace();
    return null;
    UpdateRowBean.java
    package view;
    public class UpdateRowBean
    String rowKeyStr;
    String itemrate;
    String apprqnty;
    String suprmrks;
    String partycde;
    String docnumbr;
    public UpdateRowBean()
    public String getRowKeyStr()
    return rowKeyStr;
    public void setRowKeyStr(String rowKeyStr)
    this.rowKeyStr = rowKeyStr;
    public String getitemrate()
    return itemrate;
    public void setitemrate(String itemrate)
    this.itemrate = itemrate;
    public String getapprqnty()
    return apprqnty;
    public void setapprqnty(String apprqnty)
    this.apprqnty = apprqnty;
    public String getsuprmrks()
    return suprmrks;
    public void setsuprmrks(String suprmrks)
    this.suprmrks = suprmrks;
    public String getpartycde()
    return partycde;
    public void setpartycde(String partycde)
    this.partycde = partycde;
    public String getdocnumbr()
    return docnumbr;
    public void setdocnumbr(String docnumbr)
    this.docnumbr = docnumbr;
    Any suggestion please

    update pavan set n2=decode(n1,2,2,3,3) where n1 in (2,3);
    Message was edited by:
    Laurent Schneider
    a careful reader would suggest set n2=n1 ;-)

  • CMP Custom Finder Method Problem

    Hi everybody,
    I have a problem about CMP Custom Finder Method.
    I made CMP Entity Bean and deployed.
    Then, I updated finder section in orion-ejb-jar.xml to add my custom finder query.
    Here is updating finder section in my orion-ejb-jar.xml.
    <finder-method query="(($schStartDate &lt;= TO_DATE($1,'MM-DD-YYYY a HH:MI') and $schEndDate &gt;= TO_DATE($1,'MM-DD-YYYY a HH:MI')) or ($schStartDate &lt;= TO_DATE($2,'MM-DD-YYYY a HH:MI') and $schEndDate &gt;= TO_DATE($2,'MM-DD-YYYY a HH:MI'))) and ($schRoom = $3)">
    <!-- Generated SQL: "......" -->
    <method>
    <ejb-name>RoomSchedule</ejb-name>
    <method-name>findBySchDateAndRoom</method-name>
    <method-params>
    <method-param>java.lang.String</method-param>
    <method-param>java.lang.String</method-param>
    <method-param>java.lang.String</method-param>
    </method-params>
    </method>
    </finder-method>
    <resource-ref-mapping name="jdbc/OracleDS" />
    And, i restarted oc4j. so, oc4j redepoyed CMP bean.
    But, when my client program called CMP Bean, lookup() was ok, but calling findBySchDateAndRoom() was bad.
    I couldn't get any result collection.
    Here is my client code.
    Context ctx = new InitialContext();
    Object ref = ctx.lookup("RoomSchedule");
    roomScheduleHome = (RoomScheduleHome) PortableRemoteObject.narrow(ref, RoomScheduleHome.class);
    String startDT = new String("07-30-2002 am 10:30");
    String endDT = new String("07-30-2002 pm 05:20);
    String roomID = "TEST";
    Collection roomAllSch = roomScheduleHome.findBySchDateAndRoom(startDT, endDT, roomID1);
    Iterator roomSchItr = roomAllSch.iterator();
    int schQty = 0;
    while (roomSchItr.hasNext()) {
    roomSchedule = (RoomSchedule) roomSchItr.next();
    if(roomSchedule.getStatus().equals("A"))
    schQty++;
    After excuting above code, schQty was still zero!!
    Because Collection roomAllSch had not any items.
    But, table ROOMSCHEDULE had 30 records which were same query condition in my database.
    I traced SQL statement using P6Spy Class.
    Here is spy.log.
    1028006337814|10|0|statement|select * from RoomSchedule where ((RoomSchedule.schStartDate <= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI')) or (RoomSchedule.schStartDate <= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE(?,'MM-DD-YYYY A.M. HH:MI'))) and (RoomSchedule.schRoom = ?)|select * from RoomSchedule where ((RoomSchedule.schStartDate <= TO_DATE('7-30-2002 ?@@| 01:00','MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE('7-30-2002 ?@@| 01:00','MM-DD-YYYY A.M. HH:MI')) or (RoomSchedule.schStartDate <= TO_DATE('7-30-2002 ?@HD 12:00','MM-DD-YYYY A.M. HH:MI') and RoomSchedule.schEndDate >= TO_DATE('7-30-2002 ?@HD 12:00','MM-DD-YYYY A.M. HH:MI'))) and (RoomSchedule.schRoom = 'Earth')
    1028006337824|10|0|statement|select RoomSchedule.schTitle, RoomSchedule.schStartDate, RoomSchedule.schEndDate, RoomSchedule.schDayAll, RoomSchedule.status, RoomSchedule.schRoom, RoomSchedule.reqUser, RoomSchedule.apprUser, RoomSchedule.purpose, RoomSchedule.relatoinID, RoomSchedule.schDesc, RoomSchedule.reqDate, RoomSchedule.apprDate from RoomSchedule where (RoomSchedule.schID = ?)|select RoomSchedule.schTitle, RoomSchedule.schStartDate, RoomSchedule.schEndDate, RoomSchedule.schDayAll, RoomSchedule.status, RoomSchedule.schRoom, RoomSchedule.reqUser, RoomSchedule.apprUser, RoomSchedule.purpose, RoomSchedule.relatoinID, RoomSchedule.schDesc, RoomSchedule.reqDate, RoomSchedule.apprDate from RoomSchedule where (RoomSchedule.schID = 0)
    As you see it, two query statement were executed.
    First query statement was ok and got some result records.
    But, second query statement was bad so didn't get any result records.
    I didn't understand why second query statement was executed.
    When roomAllSch.iterator() was being excuted in my client program, second query statment was executed.
    I couldn't believe....
    What's wrong? Please help me....
    OC4J : Version 9 Release 2
    Database : Oracle 8i
    OS : Windows 2000 Professional

    I created CMP of EJB 1.1, I wanted to add a finder
    there, but it didn't work.
    the error message is:
    "AccountEJB_vkbo0d_HomeImpl.java":
    AccountEJB_vkbo0d_HomeImpl should be declared
    abstract; it does not define findBySalary(float) in
    AccountEJB_vkbo0d_HomeImpl at line 11, column 1I think I don't remember CMPs having finder methods anything other than abstract. The code goes in the deployment descriptor. I hope you atleast got that right.
    Richard.

  • If DB Column java.sql.Types=CHAR = Workshop autogen EJB CMP Filed=Boolean

    Hi everybody<br>
    <p class="MsoNormal"><span lang="EN-US">When a user automatically
    creates/generates an Entity Bean via BEA Workshop EJB Project option: ‘<b>new
    Entity bean from database table</b>’ and DB Table Column is of type <b>CHAR</b>,
    Workshop creates a <b>@ejbgen:cmp-field</b> of Java type <b>Boolean</b>, NOT of
    <b>Character</b>!</span></p>
    <p class="MsoNormal"><span lang="EN-US">I completely agree that the developer
    must be acquainted with the Data Base and DB Tables as well and he can manually
    correct </span><span lang="EN-US" style="font-size: 10.0pt">SET & GET</span><span lang="EN-US">
    Boolean to Character in EJB source code view or he’ll receive an error if he
    tries to <b>set<i>FieldName</i></b><i>(String/Character) </i>in <b>ejb</b>
    methods.</span></p>
    <p class="MsoNormal"><span lang="EN-US">But suppose that a developer has
    urgently received an order to build an EJB Project for a thousand of DB Tables
    and he hasn’t been acquainted with all of them. He has created the EJBs via <b>
    ‘new -> Entity bean from database table’. </b>He has created some EJB Finders,
    for example a finder:  <b>ejbgen:finder Collection find<i>All</i>()</b>.
    (<i>Suppose he hasn’t used <b>group-name</b> finder property</i>)</span></p>
    <p class="MsoNormal"><span lang="EN-US">He has invoked <b>find<i>All</i>()</b>
    method and depends on the JDBC Driver used, he will receive an </span>
    <span lang="EN-US" style="font-size: 10.0pt">ERROR</span><span lang="EN-US">,
    printed within the Server start console <b>at least</b> OR the result after <b>
    get<i>FieldName</i></b>() will be '<b>false</b>', not an expected <i><b>char</b></i>
    symbol.</span></p>
    <p class="MsoNormal"><b><span lang="EN-US">Anxious conclusion: </span></b></p>
    <p class="MsoNormal"><span lang="EN-US">If<b>  </b>DB Column<b>  java.sql.Types
    = </b></span><span lang="EN-US" style="font-size: 10.0pt"><b>CHAR</b>    </span><span lang="EN-US">then</span><span lang="EN-US" style="font-size: 10.0pt">  
    </span><span lang="EN-US"><b>getJavaObjectType = Boolean </b> then corresponding
    EJB CMP Filed  will always be   <b>Boolean</b>  in BEA Workshop !</span></p>
    <p class="MsoNormal"><i><span lang="EN-US">Following description considers the
    </span><span lang="EN-US" style="font-size: 11.0pt">PROBLEM</span><span lang="EN-US">:</span></i></p>
    <p class="MsoNormal"><span lang="EN-US">Class<b>
    weblogic.jdbc.utils.schema.Column </b>from<b> weblogic.jar </b>and its method<b>
    String getJavaType() </b>has a <b>switch(getType())</b> with <b>case:</b></span></p>
    <p class="MsoNormal"><span lang="en-us"><b> if(this.getSize() == 1)<br>
        return "boolean"; <br>
    else<br>
        return "String";</b></span></p>
    <p class="MsoNormal"><span lang="en-us">and </span>
    <span lang="EN-US" style="font-size: 12.0pt; font-family: Times New Roman">
    another </span><span lang="en-us"> method <b>String getJavaObjectType() </b>
    {</span></p>
    <p class="MsoNormal"><b><span lang="en-us">String s = this.getJavaType();</span></b></p>
    <p class="MsoNormal"><b><span lang="en-us">...</span></b></p>
    <p class="MsoNormal"><b><span lang="en-us">    
    if(s.equals("boolean"))<br>
            return "Boolean";</span></b></p>
    <p class="MsoNormal"><span lang="en-us"><b>    
    if(s.equals("char"))<br>
            return "Character";</b></span></p>
    <p class="MsoNormal"><span lang="en-us"><b>... }<br>
    </b>but according to </span><span lang="EN-US"><b>switch(getType())</b> which
    has NOT  a<b> 'case' return char</b>, </span><span lang="en-us"><b>
    'Character' </b>will never be returned, so:</span></p>
    <p class="MsoNormal"><span lang="EN-US"><b>@ejbgen:cmp-field</b> of Java type <b>
    Character </b></span><span lang="en-us">will never be generated by Workshop.</span></p>
    <p class="MsoNormal" align="left"><span lang="EN-US">More often than not  I’ve
    ran into this little but disturbing problem, so I’ve corrected <b>
    weblogic.jdbc.utils.schema.Column.getJavaType switch case </b>as:</span></p>
    <p class="MsoNormal" style="text-indent:35.4pt"><b><span lang="EN-US">…</span></b></p>
    <p class="MsoNormal" style="text-indent:35.4pt"><b><span lang="EN-US">       
    case 1:     // '\001'  //</span><span lang="EN-US" style="font-size: 10.0pt">CHAR</span></b></p>
    <p class="MsoNormal" style="text-indent:35.4pt"><b><span lang="EN-US">
                if(this.getSize() == 1)</span></b></p>
    <p class="MsoNormal" style="text-indent:35.4pt"><b><span lang="EN-US">          
         return "char";  </span></b></p>
    <p class="MsoNormal" style="text-indent:35.4pt"><b><span lang="EN-US">…</span></b></p>
    <p class="MsoNormal" style="text-indent:35.4pt"><b><span lang="EN-US">private
    static final boolean </span><span lang="EN-US" style="font-size: 10.0pt">
    CHAR_TO_BOOLEAN</span><span lang="EN-US"> = false;     </span></b><span lang="EN-US">//as
    a field variable</span></p>
    <p class="MsoNormal" style="text-indent:35.4pt"><b><span lang="EN-US">…</span></b></p>
    <p class="MsoNormal" style="text-indent:35.4pt"> </p>
    <p class="MsoNormal" style="text-align:justify"><span lang="EN-US">Using this
    correction and precompiled class I’ve built and tested a lot of projects w/o
    problems so far.</span></p>
    <p>Best regards: George Moykin<p>
    P.S. I appologize to site Admins for posting the same topic in EJB forum, but it refers to EJBs too.

    Hi,<br>
    In your database, we have some columns of CHAR type and this is the decision of our DB architects. I understand the case ‘male’ or ‘female’, true or false, either; but only if I must choose between 2 variants. Our DB columns contain char symbols such as ‘:’, ‘;’,’-’ etc. and for some inner purposes our architects decided DB columns to be of type CHAR, not VARCHAR. In this case, the Workshop transformation ‘CHAR to BOOLEAN’ doesn’t do useful work. So, I’ve decided to modify some weblogic.jar classes (as described) and now I’m able to generate Entity EJB from DBMS Tables w/o manual intervention.<br>
    Best Regards

  • Adding a column to a DB table with CMP entities

    Morning all.
    I've been asked whether adding a column to a database table will break the CMP entity bean (EJB2) associated with the table. I suspect that it won't and that the new field will be ignored. Another developer here says that it will no longer compile (I can't see how this could be the case but still...) and I can find no evidence to either refute or corroborate either position.
    Can anyone tell me for definite - if we add a column to a database table mapped to a CMP entity bean, will we HAVE to update the bean, or can we leave it ignorant of the new column?
    (For the purposes of the question, please assume that the column has no constraints i.e. can be null etc.)
    Thanks in advance
    -- kaideejee
    Message was edited by kaideejee : CMB entities? What are they? Typo fix.

    Well alterations(adding / removing a column) to the
    table should be made available to the bean
    irrespective of the persistance(CMP OR BMP) or normal
    bean with your own methods that depicts the
    behaviour.
    reason is simple: probably bean may/may not contain
    the corresponding setter or getter or finder methods
    related to the ALTERED TABLE(NEW COLUMN)The reason for what is simple? Sorry I may have missed your point there. Are you saying that it's correct practice to make it available to the bean, or that it will be made available behind the scenes, subject to getters/setters being created?
    Assuming we choose not to create these getters and setters (we have a horrible hybrid monster which uses stored procedures for some things and EJB for others, so it's feasible that the EJB end may not need to see some fields used by other parts) would the entity beans continue to play nicely with the database rows, or would the additional columns throw it completely?
    Cheers
    -- kaideejee

  • Help: Deploying CMP Entity Bean on Jboss (DB2)

    Hi, I have a problem which I have tried to solve for a couple of days now with now success.
    I have deployed an ordinary Entity CMP Bean which name is Customer.
    This bean has 2 fields, an id field and a customername field.
    I use DB2 where the table is named customer and the fields are named as the fields in the bean, id and customername.
    I have configured the db2-ds.xml file as follows, and put it in %jboss%\server\default\deploy:
    <local-tx-datasource>
    <jndi-name>DB2DS</jndi-name>
    <connection-url>jdbc:db2://192.168.10.220:6789/business</connection-url>
    <driver-class>COM.ibm.db2.jdbc.net.DB2Driver</driver-class>
    <user-name>db2admin</user-name>
    fuck4future
    <min-pool-size>5</min-pool-size>
    <max-pool-size>25</max-pool-size>
    <!-- sql to call when connection is created
    <new-connection-sql>some arbitrary sql</new-connection-sql>
    -->
    <!-- sql to call on an existing pooled connection when it is obtained from pool
    <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
    -->
    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
    <type-mapping>DB2</type-mapping>
    </local-tx-datasource>
    I have created the jbosscmp-jdbc.xml file and put it in the META-INF directory in my ejb-application:
    <jbosscmp-jdbc>
    DB2DS
    <!--<datasource-mapping>DB2</datasource-mapping>-->
    <create-table>false</create-table>
    <enterprise-beans>
    <ejb-name>Customer</ejb-name>
    <table-name>customers</table-name>
    <cmp-field>
    <field-name>id</field-name>
    <column-name>id</column-name>
    </cmp-field>
    <cmp-field>
    <field-name>companyname</field-name>
    <column-name>companyname</column-name>
    </cmp-field>
    </enterprise-beans>
    </jbosscmp-jdbc>
    I have created the standardjaws.xml also in my META-INF directory of the ejb application. This file contains a lot of information (type-mappings), and starts with:
    java:/DB2DS
    <type-mapping>DB2</type-mapping>
    false
    I have the ejb-jar.xml file automaticly generated for me in my developer tool (WSAD).
    When I try to start my server I get the following error:
    ObjectName: jboss.j2ee:jndiName=Customer,service=EJB
    state: FAILED
    Depends On Me: org.jboss.deployment.DeploymentException: type-mapping is not initialized: DB2DS was not deployed or type-mapping was not configured.
    ObjectName: jboss.j2ee:service=EJB,plugin=pool,jndiName=Customer
    etc.......
    Please can someone help me and give me a clue, what am I doing wrong??

    And this is my console :
    ===============================================================================
    JBoss Bootstrap Environment
    JBOSS_HOME: c:\jboss4\bin\\..
    JAVA: c:\program\java\jdk1.5.0_01\bin\java
    JAVA_OPTS: -Dprogram.name=run.bat -Xms128m -Xmx512m
    CLASSPATH: c:\program\java\jdk1.5.0_01\lib\tools.jar;c:\jboss4\bin\\run.jar
    ===============================================================================
    22:36:01,986 INFO [Server] Starting JBoss (MX MicroKernel)...
    22:36:01,986 INFO [Server] Release ID: JBoss [Zion] 4.0.1sp1 (build: CVSTag=JBoss_4_0_1_SP1 date=200502160314)
    22:36:01,986 INFO [Server] Home Dir: C:\jboss4
    22:36:01,986 INFO [Server] Home URL: file:/C:/jboss4/
    22:36:01,996 INFO [Server] Library URL: file:/C:/jboss4/lib/
    22:36:01,996 INFO [Server] Patch URL: null
    22:36:01,996 INFO [Server] Server Name: default
    22:36:01,996 INFO [Server] Server Home Dir: C:\jboss4\server\default
    22:36:01,996 INFO [Server] Server Home URL: file:/C:/jboss4/server/default/
    22:36:01,996 INFO [Server] Server Data Dir: C:\jboss4\server\default\data
    22:36:01,996 INFO [Server] Server Temp Dir: C:\jboss4\server\default\tmp
    22:36:02,006 INFO [Server] Server Config URL: file:/C:/jboss4/server/default/conf/
    22:36:02,006 INFO [Server] Server Library URL: file:/C:/jboss4/server/default/lib/
    22:36:02,006 INFO [Server] Root Deployment Filename: jboss-service.xml
    22:36:02,006 INFO [Server] Starting General Purpose Architecture (GPA)...
    22:36:02,336 INFO [ServerInfo] Java version: 1.5.0_01,Sun Microsystems Inc.
    22:36:02,336 INFO [ServerInfo] Java VM: Java HotSpot(TM) Client VM 1.5.0_01-b08,Sun Microsystems Inc.
    22:36:02,336 INFO [ServerInfo] OS-System: Windows XP 5.1,x86
    22:36:02,827 INFO [Server] Core system initialized
    22:36:04,289 INFO [Log4jService$URLWatchTimerTask] Configuring from URL: resource:log4j.xml
    22:36:04,379 INFO [WebService] Using RMI server codebase: http://CYONARA:8083/
    22:36:04,549 INFO [NamingService] Started jndi bootstrap jnpPort=1099, rmiPort=1098, backlog=50, bindAddress=/0.0.0.0, Client SocketFactory=null, Server SocketFactory=org.jboss.net.sockets.DefaultSocketFactory@ad093076
    22:36:08,625 INFO [Embedded] Catalina naming disabled
    22:36:09,246 INFO [Http11Protocol] Initializing Coyote HTTP/1.1 on http-0.0.0.0-8080
    22:36:09,276 INFO [Catalina] Initialization processed in 571 ms
    22:36:09,276 INFO [StandardService] Starting service jboss.web
    22:36:09,286 INFO [StandardEngine] Starting Servlet Engine: Apache Tomcat/5.0.28
    22:36:09,306 INFO [StandardHost] XML validation disabled
    22:36:09,336 INFO [Catalina] Server startup in 60 ms
    22:36:09,476 INFO [TomcatDeployer] deploy, ctxPath=/invoker, warUrl=file:/C:/jboss4/server/default/deploy/http-invoker.sar/invoker.war/
    22:36:10,187 INFO [TomcatDeployer] deploy, ctxPath=/ws4ee, warUrl=file:/C:/jboss4/server/default/tmp/deploy/tmp43675jboss-ws4ee-exp.war/
    22:36:10,318 INFO [TomcatDeployer] deploy, ctxPath=/, warUrl=file:/C:/jboss4/server/default/deploy/jbossweb-tomcat50.sar/ROOT.war/
    22:36:10,508 INFO [TomcatDeployer] deploy, ctxPath=/jbossmq-httpil, warUrl=file:/C:/jboss4/server/default/deploy/jms/jbossmq-httpil.sar/jbossmq-httpil.war/
    22:36:12,741 INFO [MailService] Mail Service bound to java:/Mail
    22:36:13,272 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss4/server/default/deploy/jboss-local-jdbc.rar
    22:36:13,412 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss4/server/default/deploy/jboss-xa-jdbc.rar
    22:36:13,552 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss4/server/default/deploy/jms/jms-ra.rar
    22:36:13,732 INFO [RARDeployment] Required license terms exist view the META-INF/ra.xml: file:/C:/jboss4/server/default/deploy/mail-ra.rar
    22:36:14,153 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DB2DS to JNDI name 'java:DB2DS'
    22:36:14,834 INFO [WrapperDataSourceService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS to JNDI name 'java:DefaultDS'
    22:36:14,864 WARN [ConfiguredIdentityLoginModule] Creating LoginModule with no configured password!
    22:36:15,145 INFO [A] Bound to JNDI name: queue/A
    22:36:15,145 INFO Bound to JNDI name: queue/B
    22:36:15,155 INFO [C] Bound to JNDI name: queue/C
    22:36:15,155 INFO [D] Bound to JNDI name: queue/D
    22:36:15,155 INFO [ex] Bound to JNDI name: queue/ex
    22:36:15,175 INFO [testTopic] Bound to JNDI name: topic/testTopic
    22:36:15,175 INFO [securedTopic] Bound to JNDI name: topic/securedTopic
    22:36:15,185 INFO [testDurableTopic] Bound to JNDI name: topic/testDurableTopic
    22:36:15,185 INFO [testQueue] Bound to JNDI name: queue/testQueue
    22:36:15,235 INFO [UILServerILService] JBossMQ UIL service available at : /0.0.0.0:8093
    22:36:15,275 INFO [DLQ] Bound to JNDI name: queue/DLQ
    22:36:15,795 INFO [ConnectionFactoryBindingService] Bound connection factory for resource adapter for ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA to JNDI name 'java:JmsXA'
    22:36:15,835 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=file:/C:/jboss4/server/default/deploy/jmx-console.war/
    22:36:15,996 INFO [TomcatDeployer] deploy, ctxPath=/web-console, warUrl=file:/C:/jboss4/server/default/deploy/management/web-console.war/
    22:36:16,526 INFO [EARDeployer] Init J2EE application: file:/C:/jboss4/server/default/deploy/HTC.ear
    22:36:16,787 INFO [EjbModule] Deploying Customer
    22:36:17,047 ERROR [EntityContainer] Starting failed jboss.j2ee:jndiName=Customer,service=EJB
    org.jboss.deployment.DeploymentException: type-mapping is not initialized: java:/DB2DS was not deployed or type-mapping was not configured.
         at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.getTypeMapping(JDBCEntityMetaData.java:1071)
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:412)
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:353)
         at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157)
         at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy47.start(Unknown Source)
         at org.jboss.ejb.EjbModule.startService(EjbModule.java:394)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy22.start(Unknown Source)
         at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:605)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
         at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy8.deploy(Unknown Source)
         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy5.deploy(Unknown Source)
         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:413)
         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:310)
         at org.jboss.Main.boot(Main.java:162)
         at org.jboss.Main$1.run(Main.java:423)
         at java.lang.Thread.run(Thread.java:595)
    22:36:17,047 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=Customer,service=EJB
    org.jboss.deployment.DeploymentException: type-mapping is not initialized: java:/DB2DS was not deployed or type-mapping was not configured.
         at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.getTypeMapping(JDBCEntityMetaData.java:1071)
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:412)
         at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:353)
         at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:157)
         at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:340)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy47.start(Unknown Source)
         at org.jboss.ejb.EjbModule.startService(EjbModule.java:394)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy22.start(Unknown Source)
         at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:605)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:956)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
         at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy8.deploy(Unknown Source)
         at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
         at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
         at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:272)
         at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:222)
         at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891)
         at $Proxy0.start(Unknown Source)
         at org.jboss.system.ServiceController.start(ServiceController.java:416)
         at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy4.start(Unknown Source)
         at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
         at org.jboss.deployment.MainDeployer.start(MainDeployer.java:964)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:775)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
         at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:722)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
         at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
         at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:122)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
         at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
         at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
         at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
         at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:177)
         at $Proxy5.deploy(Unknown Source)
         at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:413)
         at org.jboss.system.server.ServerImpl.start(ServerImpl.java:310)
         at org.jboss.Main.boot(Main.java:162)
         at org.jboss.Main$1.run(Main.java:423)
         at java.lang.Thread.run(Thread.java:595)
    22:36:17,057 INFO [EJBDeployer] Deployed: file:/C:/jboss4/server/default/tmp/deploy/tmp43727HTC.ear-contents/HTC_BM_EJB.jar
    22:36:17,107 INFO [TomcatDeployer] deploy, ctxPath=/HTC BM Web, warUrl=file:/C:/jboss4/server/default/tmp/deploy/tmp43727HTC.ear-contents/HTC_BM_Web-exp.war/
    22:36:17,228 INFO [EARDeployer] Started J2EE application: file:/C:/jboss4/server/default/deploy/HTC.ear
    22:36:17,238 ERROR [URLDeploymentScanner] Incomplete Deployment listing:
    MBeans waiting for other MBeans:
    ObjectName: jboss.j2ee:jndiName=Customer,service=EJB
    state: FAILED
    I Depend On:
    Depends On Me: org.jboss.deployment.DeploymentException: type-mapping is not initialized: java:/DB2DS was not deployed or type-mapping was not configured.
    ObjectName: jboss.j2ee:service=EJB,plugin=pool,jndiName=Customer
    state: CREATED
    I Depend On:
    Depends On Me:
    MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM:
    ObjectName: jboss.j2ee:service=EJB,plugin=pool,jndiName=Customer
    state: CREATED
    I Depend On:
    Depends On Me:
    ObjectName: jboss.j2ee:jndiName=Customer,service=EJB
    state: FAILED
    I Depend On:
    Depends On Me: org.jboss.deployment.DeploymentException: type-mapping is not initialized: java:/DB2DS was not deployed or type-mapping was not configured.

  • URGENT HELP ON BMP CMP!!!

    Hi everybody!!
    I've wrote few CMP EJB's before and now Im trying to write a BMP EJB.
    In the finder methods I�ve to select data from two tables:
    "product_catalog" and "product" (relation One to many)
    The query that matches my needs is:
    SELECT DISTINCT a.product_code, b.product_description
    FROM product a, product_catalog b
    WHERE a.product_code = b.product_code
    AND (a.region_code = '00' OR a.region_code = 'variable argument')
    AND b.product_line <> '08'
    Note that in the FROM clause of the query data is retrieved from two tables and that the WHERE conditions involve both tables.
    �A query like this can be implemented into a finder method of a BMP EJB?
    �What about the descriptor? -Im using Websphere Application Server 4.0-
    �How can I tell the container which fields will be persistent?
    �Which fields should I've to specify as primary key fields? �The ones from the parent table? �What about the ones from the child table? �What about the query in the ejbLod() and the ejbStore() methods that select and update data from the table(s)?
    I've looked at the J2EE tutorial examples but none of the examples uses a query like mine.
    As you can see I need URGENT help on this.
    All the help you can give will be greatfully welcome!!
    THANKS!!!
    Ezequiel Velazquez

    Greetings,
    Note that in the FROM clause of the query data is
    retrieved from two tables and that the WHERE
    conditions involve both tables.IOW: an "inner join"...
    �A query like this can be implemented into a finder
    method of a BMP EJB?BMP differs from CMP in that as the bean coder: you are in control of the query and therefore can be as simple or as complex as required without required to the container's query language support. However, remember the implementation rules of finder methods:
    1. A finder method's purpose is simply to locate entities in the resource; and, therefore...
    2. A finder method returns an instance of the PrimaryKey class (or collection thereof).
    Also...
    a. The container calls a corresponding ejbFind method on an instance in the free pool; and, therefore...
    b. A finder method should not attempt to manipulate bean state.
    Therefore, as long as the data returned by your join query (a.product_code, b.product_description), compose a PrimaryKey class instance, you are fine.
    However, I will add that it should be remembered that an EBs purpose is to provide an OO representation of shareable, persistent, data ("entities") in an enterprise resource. They have a specific purpose and do not merely provide "data access" or act as "resource managers". From your example given, it seems your "entity" may be uniquely identified from 'a.product_code', a common primary(?) key in both tables and that the code is actually trying to act as a report writer. If your SELECTed data (a.product_code, b.product_description) do not together comprise a unique entity representation in your application then this is incorrect usage. In this case you should either generate the query from a Session Bean or create separate Entity Beans for each of your tables 'a' and 'b' and handle your 'joins' in business methods.
    �What about the descriptor? -Im using Websphere
    Application Server 4.0-Your descriptor will identify the bean's <persistence-type> as "Bean". This is all it needs to know about the bean since the Bean is Manag[ing] it's own Persistence (BMP ;).
    �How can I tell the container which fields will be
    persistent?Er, you don't. BMP beans manage their own persistence and, therefore, manage their own fields. Refer again to the above.
    �Which fields should I've to specify as primary key
    fields? �The ones from the parent table? �What about
    the ones from the child table? �What about the query
    in the ejbLod() and the ejbStore() methods that select
    and update data from the table(s)?These are all questions related to how your application requires an "OO representation of its resource data" to be mapped to the backend resource(s). Only "you" can really answer these questions. However, refer back to the above for some implicit pointers. :)
    I've looked at the J2EE tutorial examples but none of
    the examples uses a query like mine.The tutorial is intended for beginners to J2EE development and, therefore, provide only simplistic examples. For a more thorough examination, refer to the J2EE Blueprints.
    As you can see I need URGENT help on this.
    All the help you can give will be greatfully
    welcome!!I hope this helps.
    THANKS!!!
    Ezequiel VelazquezRegards,
    Tony "Vee Schade" Cook

  • Child CMP local object not getting refreshed with parent entity information

    Hi,
    I have a container mnaged relatioships (example) between Emp and Dept entities. I have generated their DTO and using them to tranfer data across layers.
    I am updating deptno CMP field of EMP entity and returning the Entity DTO. When extracting dept information like empLocalDTO.getDept_Deptno().getDname(), it's returning old department name.
    Can anybody help in resolving this problem of DeptLocal object not getting updated when setting deptno on EmpLocal entity?
    Session Bean updateEmp method code:
    EmpLocal local = (EmpLocal) getEmpLocalHome().findByPrimaryKey(dto.getEmpno());
    local.setDeptno(dto.getDeptno());
    local.setSal(dto.getSal());
    local.setJob(dto.getJob());
    EmpLocalDTO eDTO = new EmpLocalDTO(local);
    Servlet Code:
    localDTO = empLocal.updateEmp(localDTO);
    out.println("Dname : " + localDTO.getDept_deptnoDTO().getDname() + " <BR/>");
    Thanks

    I haven't personally seen this but Daniele Grandini in his article states:
    -          The
    ICMP latency between the Management Server and the Domain Controller is above 150 msec (this is no fixed rule)
    - This specific issue manifest itself when the Active Directory lookup takes more than 1000 msec (more or less);
    If the agents have been green (healthy) intermittently then it suggests that it is not a configuration issue as such with the agent but some sort of communication \ authentication issue. And that suggests you are seeing the same issue .. at present there
    isn't a straight forward workaround as you can't force the agents to use certificates to get around the problem. 
    The notes at the bottom of Daniele's article are not promising - http://nocentdocent.wordpress.com/2012/10/26/opsmgr-2012-agents-across-slow-wan-links-are-unable-to-communicate/
    Regards Graham New System Center 2012 Blog! -
    http://www.systemcentersolutions.co.uk
    View OpsMgr tips and tricks at
    http://systemcentersolutions.wordpress.com/

  • Xml vs DTO

    Hi All,
    Why is xml used to pass data between application layers? We can very well use DTO for same purpose.
    Thanks
    Ramesh

    When the httpservices completes isn't the result bound to an arrayCollection (or array) so you could essesntially accomplish anything you want, sort search etc..
    Is the XML result directly bound to a datagrid or is it bound to arrayCollection first and then bind the arrayCollection to the data grid?
    From the network layer comparison, say you have 100 rows with 10 columns, the file size of XML vs CSV makes a big difference.  Do you think this warrants bringing the file as CSV instead of XML?  You also have to consider the server side doing the extra formating.  You will notice a big difference in an enterprise database if its doing extra work and file I/O.
    Being so used to ODBC-RAW data, I'm finding some apps are slow because of the XML format and I'm looking for an alternative similar to the ODBC-RAW data format.  I do agree that you can do more with XML but if it's just use for say in drop down list, data grid and not so much for formatting, I think CSV will do just fine.  I would however, bring in a single row as XML.
    Thanks for replying back so quickly.
    -nobody-

Maybe you are looking for

  • How to Resolve this Error comming in SMP2.3 HWC?

    Hi Experts, 20140605T150459.418|1|MyDynamicChart:1 -- Request: <M><H></H><S>Start</S><A>GetCustomData</A><VS><V k="Port_et_key" t="T">1433</V><V k="User_Name_et_key" t="T">sup</V><V k="Password_et_key" t="T">123</V><V k="Vertical_Column_et_key" t="T"

  • Song wont play in iTunes - computer needs authorization but is already authorized?

    I click to play a song in iTunes (which also purchased from iTunes) but am shown the message "This computer is not authorized to play [song title]. Would you like to authorize it now?". I enter in my username and password to authorize and am told "yo

  • How to export a photo in lightroom using capture date

    I have photos in lightroom 5 i want to know how to have the capture date show in the photo when i export it. I want to see the capture date in safari on mac. I also want the capture date to match when i use metadata edit capture time some times the p

  • Download Reports in CSV or pdf format

    Hi to all, i'm trying to download a report in CSV format that implicate the list of more than 400.000 users and their resource assigned. As i know, Sun IDM before generating this file is going to execute a task that return the list of this 400.000 us

  • Mask the credit card number

    Hi,       The credit card number should be masked .