Inheritance in EJBs

I am trying to find out if Weblogic supports functionality that TOPLink provides to
represent inheritance.
(http://www.webgain.com/products/toplink/mapping_workbench/demos/
check the "Using Advanced Descriptor Functions", "Inheritance").
I want to have a parent class which has multiple children (i.e. an Account class,
subclasses as Checking, Savings, Loan, etc.). These would all be stored in one database
table. A single 'findAccountsForCustomer' method could return a mixed collection
of the specific child objects.
Is this something available in a current version of Weblogic, or something planned
for the future? Or, is this something that requires a 3rd party mapping tool?

How does this differ from the second option I listed?
Thanks,
Bob
"Nick Minutello" <[email protected]> wrote
in message news:[email protected]...
>
>
You can achieve inheritance using Entity Beans. Its not the simplest ofthings -
but its do-able. (Although I will admit I havent done this for aproduction application).
>
You would create an AccountBean - which is the base-class implementation.Your other
Checking, Savings, Loan Beans inherit from it. (Strictly they dont haveto - this
is only so you have implementation inheritance.)
Then, you would also create an AccountLocal - which is the base-classcomponent interface.
Your other CheckingLocal, SavingsLocal, LoanLocal Interfaces inherit fromit. (this
is so you get polymorphism at the client level)
Your PK classes must be the same all. (though, I forget why at the moment)
You need to create a home for each Bean (this makes sense - you have tohave a factory
that knows what its creating/finding).
You need to list all of them in the DDs. (the CMP mapping duplication is apain)
>
Its all a bit dicky doing it by hand. But if you can get your hands onWSAD4, it
will automate this all for you (Sadly, it only supports EJB1.1.... but youcan see
how it does it)
The thing to remember is that if they are in the same table (I wouldreconsider that
decision) then your findByPrimaryKey method will never be able todistinguish between
them.
The finders are a bit tricky - you need to do the aggregation of thesub-types.
>
-Nick
"Bob Lee" <[email protected]> wrote:
EJB does not support inheritance. You are limited to standard Java's
inheritance capabilities.
If you want to use entity beans, you have the following two options:
1) Have a generic Account entity bean with an account type field (rather
than subclassing).
2) Use Java inheritance, set up an entity bean for each type (Savings,
Checking, etc.) and use a session facade. The findAccountsForCustomer()
method in the session facade will hit each entity bean type and combine
the
results.
I would probably go with the first option. You can use the Strategy
pattern
or something comparable to handle the implementation differences between
the
Account types.
Bob
"Howard Webb" <[email protected]> wrote in message
news:[email protected]...
I am trying to find out if Weblogic supports functionality that TOPLinkprovides to
represent inheritance.
(http://www.webgain.com/products/toplink/mapping_workbench/demos/
check the "Using Advanced Descriptor Functions", "Inheritance").
I want to have a parent class which has multiple children (i.e. an
Account
class,
subclasses as Checking, Savings, Loan, etc.). These would all be
stored
in one database
table. A single 'findAccountsForCustomer' method could return a mixedcollection
of the specific child objects.
Is this something available in a current version of Weblogic, or
something
planned
for the future? Or, is this something that requires a 3rd party
mapping
tool?
>

Similar Messages

  • Inheritance in EJB

    Do EJB's permit inheritance consistently? Suppose I want to write a generic EJB which is subsequently derived by sub EJB's with the same interfaces but with different functionalities (overriding the methods)

    Yes u can do method overriding. yes u can do inheritance in EJB

  • EJB 3.0 Session Bean Inheritence

    Hi all,
    Can one stateless session bean extend another? I get "no" for an answer during deployment of my EJB module. I'm using NetBeans 5.5 with Sun App Server 9.0.
    For example:
    @Stateless
    MySessionBean1 implements ...some remote interface {
    @Stateless
    MySubBean extends MySessionBean1 implements some more interfaces {
    }

    There is no support for "component" inheritance in EJB. You are free to use implementation
    inheritance to implement your bean class, but the fact that a super-class happens to be the
    bean class of a different EJB has no bearing on the processing of the sub-class. So, for example,
    the fact that MySessionBean1 has "some remote interface" will not automatically make
    "some remote interface" one of MySubBean's remote interfaces.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Urgent : Oracle AS 10.1.2.0.2 : Switch OC4J's JDK version to 1.3 ?

    Hi,
    We have inherited an EJB application which was written during the hey days of JDK 1.3.
    We have an Oracle AS 10.1.2.0.2 & we have successfully migrated most of the other Applications / Oracle J PDK Applications which were developed using JDK 1.4. Unfortunately, we now need to migrate the older EJB application to Oracle AS 10.1.2.0.2.
    We tried a few dry runs with our staging Oracle As 10.1.2.0.2 instances - unfortunately, the application's code just won't compile - it looks as if we need to rewrite our application to compile under JDK 1.4. We can do this - but, we are hard pressed for time & we are looking for a solution that can bail us out of this tight corner.
    I would like to know if we can switch the OC4J's JDK version to 1.3 in any supported way ? If yes, we can just install another Oracle AS J2EE instance dedicated to out legacy ( !! ) EJB Application at this time & think about reqwiting & performance tuing at leisure.
    If not, what other options to I have ? Have I provided enough information or do I need to post additional infromation ? Please do let me know if more information is needed.
    Thanks in advance,
    Sandeep

    Hi,
    We also tried to follow Metalink Note:351476.1 which talks about changing the JAVA version used to run a specific OC4J instance. However, after following the steps, when we try to start our OC4J instance, we see this error:-
    D:\OraInfra\opmn\bin>opmnctl startproc process-type=OC4J_JDK13
    opmnctl: starting opmn managed processes...
    =============================================================================
    opmn id=nac014:6200
    0 of 1 processes started.
    ias-instance id=OraInfra.myHost.idc.oracle.com
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ias-component/process-type/process-set:
    OC4J/OC4J_JDK13/default_island
    Error
    --> Process (pid=6240)
    failed to start a managed process after the maximum retry limit
    Log:
    D:\OraInfra\opmn\logs\OC4J~OC4J_JDK13~default_island~1
    Now, when I look into the log file, I see this ( !! ) :-
    06/02/21 18:18:11 Start process
    06/02/21 18:18:13 Start process
    06/02/21 18:18:15 Start process
    I understand that OC4J tried thrice before giving up, but if there are no error, I don't know why OC4J just refuses to start ? Truly, the mystery deepens....
    Regards,
    Sandeep

  • Multiple inheritance in remote interfaces for EJB 3.0 session beans on Webl

    Hi All,
    We started migration from EJB 2.1(WLS 8.1) to EJB 3.0(WLS 10.3.2) and identified few serious problems. One of them is related with multiple business interfaces inheritance. I wrote simple example that presents point of the problem.
    we have session bean AImpl:
    +@Stateless(name="A")+
    +@Remote({A.class})+
    +@TransactionAttribute(TransactionAttributeType.REQUIRED)+
    +public class AImpl implements A {+
    +@Override+
    +public void writeA() {+
    System.out.println("A");
    +}+
    +@Override+
    +public void writeB() {+
    System.out.println("B");
    +}+
    +@Override+
    +public void writeC() {+
    System.out.println("C");
    +}+
    +}+
    with remote interface A:
    +@Remote+
    +@JNDIName(A.JNDI_NAME)+
    +public interface A extends B, C {+
    public static String JNDI_NAME = "A_JNDI_NAME";
    void writeA();
    +}+
    As you can see A extends B, and C. Definition of both interfaces is very simple:
    +public interface B {+
    void writeB();
    +}+
    +public interface C {+
    void writeC();
    +}+
    Everything looks nice until we want to invoke some method on AImpl bean. For above implementation code:
    A a = ctx.lookup(A. JNDI_NAME);
    a.writeA();
    a.writeB();
    a.writeC();
    writes down ”A \n B” and throws exception:
    caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeC()*
    at java.lang.Class.getMethod(Class.java:1605)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
    so.. in stub generated by WLS there is no method from interface C ! What more interesting after small change in interface A rely on change in interface implementation order from B, C to C, B (+public interface A extends C, B {+) server writes down only A and I have stack like below:
    Caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeB()*
    at java.lang.Class.getMethod(Class.java:1605)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
    at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
    After this experience I came up with suspicion that Weblogic 10.3 does not support inheritance from multiple interfaces in one “generation”. Instead of that it takes only the first interface from the list.
    Does anybody have some experience with such a situation? maybe someone have an idea how to work around this problem?

    This is Not Supported in WebLogic that the Remote Interface extends other Interfaces. Because Annotation Processor just looks up inside the implemented interface methods. The actual interface which is Implemented by the Bean Class. So the Methods declared inside the Interface B and Interface C will be ignored and will not be available as part of the generated Stubs. Thats why u are getting NoSuchMethodError.
    You can even contact Oracle Support on this...there are 3-4 Cases on it. And the Solution is Work As Designed.
    Workaround is : edit your interface A as following
    Declare all the Business Methods only in the Remote Interface and not inside it's Super Interfaces.
    Example:
    @Stateless(name="A")
    @Remote({A.class})
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public class AImpl implements A {
    @Override
    public void writeA() {
    System.out.println("A");
    @Override
    public void writeB() {
    System.out.println("B");
    @Override
    public void writeC() {
    System.out.println("C");
    @Remote
    @JNDIName(A.JNDI_NAME)
    public interface A extends B, C {
    public static String JNDI_NAME = "A_JNDI_NAME";
    void writeA();
    void writeB();
    void writeC();
    Thanks
    Jay SenSharma
    http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)

  • Updating a database using EJB Inheritance

    I am new to EJB's, so please forgive my ignorance. I creating the following classes that inherit from each other along with a method to update my database:
    @Entity
    @Inheritance(strategy = InheritanceType.JOINED)
    @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING)
    public abstract class ObjectA implements java.io.Serializable {
         protected String name;
         protected String desc;
         protected String type;
    @Entity
    @DiscriminatorValue("OBJECTB")
    public class ObjectB extends ObjectA implements java.io.Serializable {
         protected String str_b;
         public ObjectB(String name, String desc, String type, String str_b) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
    @Entity
    @DiscriminatorValue("OBJECTC")
    public class ObjectC extends ObjectB implements java.io.Serializable {
         private String str_c;
         public ObjectC(String name, String desc, String type, String str_b, String str_c) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
              this.str_c = str_c;
    public class MyFacade implements ServletContextListener {
         @PersistenceUnit(unitName="Pu")
        private EntityManagerFactory emf;
        @Resource
        private UserTransaction utx;
        public MyFacade() { }
        public void contextDestroyed(ServletContextEvent sce) {
            if (emf.isOpen()) emf.close();
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext context = sce.getServletContext();
            context.setAttribute("MyFacade", this);
         public void updateObject(ObjectA obj) {
            EntityManager em = emf.createEntityManager();
            try{
                utx.begin();
                em.merge(obj);
                utx.commit();
            } catch(Exception exe){
                try {
                    utx.rollback();
                } catch (Exception e) {}
                throw new RuntimeException("Error updating obj", exe);
            } finally {
                em.close();
    }If I do the following:
         String name = "test name";
         String desc = "updating object c";
         String type = "OBJECTC";
         String b = "b";
         String c = "c";
         MyFacade myf = new MyFacade();
         ObjectC objC = new ObjectC(name, desc, type, b, c);
         myf.updateObject(objC);
         .....In my database, only the values associated with ObjectC get updated and nothing from ObjectA or ObjectB get updated in the database. Does the "merge" method not work on inheritance. How do I update my database using inheritance?
    Thanks!
    Message was edited by:
    FourierXForm

    did you only have ISQL for testing it?
    Can you debug the form and look, if someone happens - exceptions, ... ?
    after the update you can use
    message (SQL%ROWCOUNT); pause ;
    to look, how many records were updated

  • EJB 1.1 BMP inheritance

    Hi,
    I have a problem on Weblogic when using Ejb inheritance (with BMP in that
    case). The problem seems to come from the fact that the container do not
    recognize EJB inheritance. When storing (ejbStore), the container calls
    ejbStore on the child ejb with the proper data and then calls the ejbStore
    on a parent ejb (where does it come from ?) with all data null except ID set
    with the child's ID.
    My view is that the inheritance should be declared in deployment descriptors
    but I cannot find how ?
    Regards
    Jacques

    I get many erros. Mainly the ejb method not found. This was not happening in OC4J 0.9.0.0.2. Assuming we are not making any code changes, I assuem all I need to do is copy the ear file in OC4J 10g and it should work but it does not. I am using CMP. Has anyone taken an old ear file from prior version and moved to new OC4J server with success. Will like to hear any experience. Thanks.

  • Ejb ql query language inheritance Select From

    Hi,
    I am using TopLink MySQL ejb 3.0 persistence API.
    My question is:
    How can I write a query that would find only a subclass.?
    I hope this shows what I want.
    @Entity
    class Related{
    Parent parent;
    @Entity (inheritance=InheritanceType.JOINED)
    class Parent{
    String address;
    @Entity
    class Child extends Parent{
    String name;
    }How can I write this query?? I will write in Java style!
    1- Select a from Related a where a.parent (is instanceof (Child))????
    2- Select a from Related a where {
    if(a.parent instanceof Child){
    Child c=(Child) a.parent;
    c.name="criteria";
    }The idea is selecting those records from Related where it has reference to Child with a specific Criteria.
    Thank you.

    I figured it out,
    It was just a plain query with the specific types I needed.
    Thank you.

  • EJB inheritance

    We are in the process of new J2EE development. Our system relies very heavily on inheritance for added flexibility and adaptability. We are inexperienced in EJB, and found that inheritance is not formally supported in the EJB spec.(We are using BMP) We are trying to keep the option of the EJB component layer for purposes of different front-end support (Web/Desktop), but the inheritance flexibility is non-negotiable. Should we rather go client/server, or is there a way in which we can keep the flexibility which inheritance offers and still use EJB?

    "zhebincong" <[email protected]> wrote in
    news:3da62d9d$[email protected]:
    in my ejb tier,i have several session bean,all of them share several
    common method,such as "readEmployee().....",etc.
    in not order to repeatly code them in every session bean,i want to
    wirte a base session bean which have remote,home and iomplementing
    class just same as the normal session bean,then other session beans
    can inherit from the base bean by all of the remote,home interface and
    the ejb implementation,so that the common method can be shared among
    multiple session bean. Yes, you can use standard Java inheritance for this.
    EJBGen (http://beust.com/cedric/ejbgen) also allows you to extend the
    concept of inheritance to elements in the deployment descriptors.
    Cedric

  • EJB 3.0 Entity Bean Inheritance Table Mapping

    What I want to do (I think)...
    In a distilled example form...
    - class A defines field x
    - class B defines field y, extends A, inheriting field x
    - class C defines field z, extends A, inheriting field x
    - I want class B to map to tbl_b which has columns x, y
    - I want class C to map to tbl_c which has columns x, z
    What I **don't** want to do (I think)...
    - make a base table for class A that is joined to tbl_b and tbl_c
    - map class B and class C to a single table that has a discriminator column
    Questions...
    1) Is there a conceptual problem with what I want to do?
    2) Is there a way to do what I want to do? I've tried via annotations. Maybe via the XML mapping alternative to annotations?

    Thanks for the reply Simon.
    Just to re-word what I want to do... I want to use a single table **for each lineage** in the hierarchy. In my original example that would be two tables.
    Table per class is what I tried but couldn't get to work - at least using annotations. I want to map some columns in the single table to base fields and some to derived fields.
    It seems that only 'single table with discriminator', or the 'join table' methods are sanctioned ways to handle an inheritance hierarchy.
    I didn't yet try using the XML method. I might be able to use the single table method by mapping base class properties as if they were derived class properties. This approach would work with a native Hibernate mapping XML.
    Back to the conceptual question. Is there a reason why I shouldn't do what I want here?
    What I'm trying to avoid...
    1) joining tables for performance issues
    2) having one table with columns that only make sense for certain records - ugly and potentially database storage waste.

  • EJB 3.0 Inheritance problem

    I have to persist classes Cat, BullDog and StBernard:
    class Animal {
    private int animalId;
    private String name;
    private String dtype;
    class Dog extends Animal {
    private int dogId;
    private String furColor;
    class BullDog extends Dog {
    private int bullDogId;
    private int fightCount;
    class StBernard extends Dog {
    private int stbernardId;
    private int livesSaved;
    class Cat extends Animal {
    private int catId;
    private String preferredCatFood;
    }Planned inheritance strategy is joined table strategy. There is no problem mapping and persisting Cat and Dog tables into database, but I cannot find a way how to annotate StBernard and BullDog classes to persist them. Is it possible at all?

    do you know any official doc or reference where I can find statement, that such inheritance is not possible? i.e. only one level inheritance is allowed in JPA? Will check @SecondaryTable to see if it is helpful or not.
    @SecondaryTable This annotation is used to specify a secondary table for the annotated entity class. Specifying one or more secondary tables indicates that the data for the entity class is stored across multiple tables.@SecondaryTable is not for me :(
    Edited by: marekst on Feb 7, 2008 6:36 AM

  • JMS publisher inheriting EJB container transaction

              I have trawled through the archives but just need to clarify :-
              How can I have an Session EJB which send messages to a JMS Queue inherit the EJB
              container managed transaction from the session bean, such that if the EJB rollsback
              the message will as well ?
              1) Firstly is this possible with container managed transactions ?
              2) Should I use a transacted (true) or non-transacted (false)
              Session ?
              queueConnection.createQueueSession(true,0); or
              queueConnection.createQueueSession(false,0); or
              3) Unless I call queueSession.commit() the message never seems to get there, but
              if I call commit() it seems to arrive at the MessageDriven bean IMMEDIATELY, i.e
              before the Session bean's transaction has committed. Do I need to commit() ?
              Any help would be appreciated.
              I have tried
              

              Pete wrote:
              > I have trawled through the archives but just need to clarify :-
              >
              > How can I have an Session EJB which send messages to a JMS Queue inherit the EJB
              > container managed transaction from the session bean, such that if the EJB rollsback
              > the message will as well ?
              >
              > 1) Firstly is this possible with container managed transactions ?
              Yes.
              > 2) Should I use a transacted (true) or non-transacted (false)
              > Session ?
              >
              > queueConnection.createQueueSession(true,0); or
              > queueConnection.createQueueSession(false,0); or
              >
              non-transacted, otherwise you will get the behavior in (3)
              ensure that the connection factory used has the
              "UserTransactionsEnabled" flag configured to true
              > 3) Unless I call queueSession.commit() the message never seems to get there, but
              > if I call commit() it seems to arrive at the MessageDriven bean IMMEDIATELY, i.e
              > before the Session bean's transaction has committed. Do I need to commit() ?
              >
              > Any help would be appreciated.
              > I have tried
              This is a frequently-asked question. See the JMS FAQ for details, also
              check out the tranaction chapter of the JMS programmer's guide, and, if
              your interested in performance considerations, check out the WebLogic
              JMS Performance Guide white-paper available on dev2dev.bea.com.
              

  • Problem with building EJB with inheritance

    I've created a EJB project in my workshop 8.1.4 application.
    Since all my tables contains a common subset of columns, I'd like to create a superclass for all CMP entity beans which contains the handful of CMP fields and business methods pertaining to them.
    I tried to do it in Workshop by creating a new superclass (BaseEB.java) which extends GenericEntityBean class.
    When building, the script tries to run ejbgen on BaseEB.java, which obviously fails because BaseEB does not contain all the required @ejbgen tags, as it is not meant to be used by itself.
    I think the solution is a matter of making the build script bypass BaseEB.java, but how can that be done?.

    This is my base EJB. There are some @ejbgen tags defined, but it does not have all required ejbgen tags, especially in the class javadoc. The classes that extends from this are expected to define them.
    package occ;
    import java.util.*;
    import weblogic.ejb.GenericEntityBean;
    public abstract class BaseEB extends GenericEntityBean
          * @ejbgen:local-method
         public void touch(String username){
              java.util.Date currDate = new Date();
              setUpdateDateTime(currDate);
              setUpdateUsername(username);
              setUpdateTimeID(new Long(getUpdateTimeID().longValue() + 1));
          * @ejbgen:local-method
         public void setCreateBy(String username){
              java.util.Date curr = new Date();
              setCreateUsername(username);
              setCreateDateTime(curr);
              setUpdateUsername(username);
              setUpdateDateTime(curr);
              setUpdateTimeID(new Long(1));
          * @ejbgen:cmp-field column = "UPDATEDATETIME"
          * @ejbgen:local-method
         public abstract void setUpdateDateTime(Date val);
          * @ejbgen:local-method
         public abstract Date getUpdateDateTime();
          * @ejbgen:cmp-field column = "UPDATEUSERNAME"
          * @ejbgen:local-method
         public abstract void setUpdateUsername(String val);
          * @ejbgen:local-method
         public abstract String getUpdateUsername();
          * @ejbgen:cmp-field column = "CREATEDATETIME"
          * @ejbgen:local-method
         public abstract void setCreateDateTime(Date val);
          * @ejbgen:local-method
         public abstract Date getCreateDateTime();
          * @ejbgen:cmp-field column = "CREATEUSERNAME"
          * @ejbgen:local-method
         public abstract void setCreateUsername(String val);
          * @ejbgen:local-method
         public abstract String getCreateUsername();
          * @ejbgen:cmp-field column = "UPDATETIMEID"
          * @ejbgen:local-method
         public abstract void setUpdateTimeID(Long val);
          * @ejbgen:local-method
         public abstract Long getUpdateTimeID();
    }Errors while building in workshop.
    EJBGen 2.16
    Error: Couldn't determine the type of the EJB 'occ.BaseEB'.  Please make sure that:
      - It is an Enterprise Java Bean
      - Its superclass is in your classpath or that its type is specified
        with an @ejbgen:entity|session|message-driven attribute.
    1 error.
    ERROR: Java returned: 1
    BUILD FAILED
    ERROR: Java returned: 1

  • Trying to use JDO objects as DTO over EJB???

    I have implemented the implemented the seralize interface in my JDO object
    classes. My JDO classes are only a data framework, I use them on both my
    EJB tier and I would like to use them on the web tier.... My thinking was to
    serialize the object graph and pass it between the EJB and web tier.... This
    seemed like a very good and easy way to painless move my object graph
    around. However, I am getting compile problems trying to compile the EJB
    methods.
    I have tried two variations on the method signature:
    public String testDeal (Deal myDeal) and
    public Deal testDeal (String name)
    where Deal is the root of my JDO object graph. The compile time error that
    results by trying to have a JDO enhanced class in the EJB method signature
    is shown below.
    IS THIS A LIMATION OF JDO or am I doing something wrong?
    Second question
    =============
    If I can't pass a JDO object as my Data Transfer object then I have to use
    my fall back idea.... I am currently sub-classing the JDO with a simple
    wrapper class. I can sucessfully pass these non-JDO classes as DTO's.....
    but I have a simple question.... What is an elegant way of using DTO's to
    populate a inheritance structure? This is not really a Java
    question....but my problem is that I have a list of a base class that I am
    carry around... the list can an one of many subclasses in it... I can easily
    determine the type of the class that I get out... but to then use this DTO
    to create an a JDO ojbect class instance without a case statement has me
    stumped... I hoped this was a common pattern and that someone had an
    elegent way to do this mapping..... I thought of a utility class or a
    logical to physical mapping structure similar to Struts action mapping, but
    I was wondering if there was a better way. Thanks for any suggestions.
    java.lang.ExceptionInInitializerError: java.util.MissingResourceException:
    Can't find bundle for base name javax.jdo.Bundle, locale en_US
    at
    java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:6
    95)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:667)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:547)
    at javax.jdo.I18NHelper.loadBundle(I18NHelper.java:143)
    at javax.jdo.I18NHelper.<init>(I18NHelper.java:49)
    at javax.jdo.I18NHelper.getInstance(I18NHelper.java:61)
    at javax.jdo.spi.JDOImplHelper.<clinit>(JDOImplHelper.java)
    at aqueduct.Customer.<clinit>(Customer.java)
    at java.lang.reflect.Field.getLong(Native Method)
    at com.ibm.rmi.io.ObjectStreamClass.init(ObjectStreamClass.java:495)
    at
    com.ibm.rmi.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:167)
    at com.ibm.rmi.io.ObjectStreamClass.lookup(ObjectStreamClass.java:120)
    at com.ibm.rmi.util.RepositoryId.createHashString(RepositoryId.java:627)
    at com.ibm.rmi.util.RepositoryId.createForJavaType(RepositoryId.java:786)
    at com.ibm.rmi.util.RepositoryId.createForAnyType(RepositoryId.java:871)
    at com.ibm.rmi.util.RepositoryId.createForAnyType(RepositoryId.java:855)
    at com.ibm.tools.rmic.iiop.Type.setRepositoryID(Type.java:990)
    at com.ibm.tools.rmic.iiop.CompoundType.initialize(CompoundType.java:733)
    at com.ibm.tools.rmic.iiop.ValueType.initialize(ValueType.java:241)
    at com.ibm.tools.rmic.iiop.ValueType.forValue(ValueType.java:101)
    at com.ibm.tools.rmic.iiop.CompoundType.makeType(CompoundType.java(Compiled
    Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType$Method.<init>(CompoundType.java(Compile
    d Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType.addAllMethods(CompoundType.java(Compile
    d Code))
    at com.ibm.tools.rmic.iiop.ValueType.initialize(ValueType.java:230)
    at com.ibm.tools.rmic.iiop.ValueType.forValue(ValueType.java:101)
    at com.ibm.tools.rmic.iiop.CompoundType.makeType(CompoundType.java(Compiled
    Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType$Method.<init>(CompoundType.java(Compile
    d Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType.addAllMethods(CompoundType.java:1279)
    at
    com.ibm.tools.rmic.iiop.RemoteType.isConformingRemoteInterface(RemoteType.ja
    va:207)
    at com.ibm.tools.rmic.iiop.RemoteType.initialize(RemoteType.java:156)
    at com.ibm.tools.rmic.iiop.RemoteType.forRemote(RemoteType.java:75)
    at
    com.ibm.tools.rmic.iiop.CompoundType.addRemoteInterfaces(CompoundType.java:1
    411)
    at
    com.ibm.tools.rmic.iiop.ImplementationType.initialize(ImplementationType.jav
    a:151)
    at
    com.ibm.tools.rmic.iiop.ImplementationType.forImplementation(ImplementationT
    ype.java:77)
    at com.ibm.tools.rmic.iiop.StubGenerator.getTopType(StubGenerator.java:128)
    at com.ibm.tools.rmic.iiop.Generator.generate(Generator.java:263)
    at sun.rmi.rmic.Main.doCompile(Main.java:547)
    at sun.rmi.rmic.Main.compile(Main.java:137)
    at sun.rmi.rmic.Main.main(Main.java:786)
    error: An error has occurred in the compiler; Please visit the URL
    http://www.ibm.com/java/jdk/support for information on
    investigating/reporting this problem. 1 error RMIC Command returns RC = 1.
    The problems which stopped RMIC are displayed, and have also been recorded
    in the log file.

    Brian,
    I have used this approach quite successfully with BEA WebLogic Server 7.0.
    The JDO enhanced class can act as both the DAO for persistence, and the DTO
    in its transient form. The client can rely on network class loading, so long
    as you package your EJB-JAR or EAR to contain the JDO jars.
    I think your compile problem is probably just a classpath issue.
    Ben
    "Brian Smith" <[email protected]> wrote in message
    news:[email protected]...
    >
    >
    >
    I have implemented the implemented the seralize interface in my JDO object
    classes. My JDO classes are only a data framework, I use them on both my
    EJB tier and I would like to use them on the web tier.... My thinking wasto
    serialize the object graph and pass it between the EJB and web tier....This
    seemed like a very good and easy way to painless move my object graph
    around. However, I am getting compile problems trying to compile the EJB
    methods.
    I have tried two variations on the method signature:
    public String testDeal (Deal myDeal) and
    public Deal testDeal (String name)
    where Deal is the root of my JDO object graph. The compile time errorthat
    results by trying to have a JDO enhanced class in the EJB method signature
    is shown below.
    IS THIS A LIMATION OF JDO or am I doing something wrong?
    Second question
    =============
    If I can't pass a JDO object as my Data Transfer object then I have to use
    my fall back idea.... I am currently sub-classing the JDO with a simple
    wrapper class. I can sucessfully pass these non-JDO classes as DTO's.....
    but I have a simple question.... What is an elegant way of using DTO's to
    populate a inheritance structure? This is not really a Java
    question....but my problem is that I have a list of a base class that I am
    carry around... the list can an one of many subclasses in it... I caneasily
    determine the type of the class that I get out... but to then use this DTO
    to create an a JDO ojbect class instance without a case statement has me
    stumped... I hoped this was a common pattern and that someone had an
    elegent way to do this mapping..... I thought of a utility class or a
    logical to physical mapping structure similar to Struts action mapping,but
    I was wondering if there was a better way. Thanks for any suggestions.
    java.lang.ExceptionInInitializerError: java.util.MissingResourceException:
    Can't find bundle for base name javax.jdo.Bundle, locale en_US
    at
    java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:6
    95)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:667)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:547)
    at javax.jdo.I18NHelper.loadBundle(I18NHelper.java:143)
    at javax.jdo.I18NHelper.<init>(I18NHelper.java:49)
    at javax.jdo.I18NHelper.getInstance(I18NHelper.java:61)
    at javax.jdo.spi.JDOImplHelper.<clinit>(JDOImplHelper.java)
    at aqueduct.Customer.<clinit>(Customer.java)
    at java.lang.reflect.Field.getLong(Native Method)
    at com.ibm.rmi.io.ObjectStreamClass.init(ObjectStreamClass.java:495)
    at
    com.ibm.rmi.io.ObjectStreamClass.lookupInternal(ObjectStreamClass.java:167)
    >
    at com.ibm.rmi.io.ObjectStreamClass.lookup(ObjectStreamClass.java:120)
    at com.ibm.rmi.util.RepositoryId.createHashString(RepositoryId.java:627)
    at com.ibm.rmi.util.RepositoryId.createForJavaType(RepositoryId.java:786)
    at com.ibm.rmi.util.RepositoryId.createForAnyType(RepositoryId.java:871)
    at com.ibm.rmi.util.RepositoryId.createForAnyType(RepositoryId.java:855)
    at com.ibm.tools.rmic.iiop.Type.setRepositoryID(Type.java:990)
    at com.ibm.tools.rmic.iiop.CompoundType.initialize(CompoundType.java:733)
    at com.ibm.tools.rmic.iiop.ValueType.initialize(ValueType.java:241)
    at com.ibm.tools.rmic.iiop.ValueType.forValue(ValueType.java:101)
    atcom.ibm.tools.rmic.iiop.CompoundType.makeType(CompoundType.java(Compiled
    Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType$Method.<init>(CompoundType.java(Compile
    d Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType.addAllMethods(CompoundType.java(Compile
    d Code))
    at com.ibm.tools.rmic.iiop.ValueType.initialize(ValueType.java:230)
    at com.ibm.tools.rmic.iiop.ValueType.forValue(ValueType.java:101)
    atcom.ibm.tools.rmic.iiop.CompoundType.makeType(CompoundType.java(Compiled
    Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType$Method.<init>(CompoundType.java(Compile
    d Code))
    at
    com.ibm.tools.rmic.iiop.CompoundType.addAllMethods(CompoundType.java:1279)
    at
    com.ibm.tools.rmic.iiop.RemoteType.isConformingRemoteInterface(RemoteType.ja
    va:207)
    at com.ibm.tools.rmic.iiop.RemoteType.initialize(RemoteType.java:156)
    at com.ibm.tools.rmic.iiop.RemoteType.forRemote(RemoteType.java:75)
    at
    com.ibm.tools.rmic.iiop.CompoundType.addRemoteInterfaces(CompoundType.java:1
    411)
    at
    com.ibm.tools.rmic.iiop.ImplementationType.initialize(ImplementationType.jav
    a:151)
    at
    com.ibm.tools.rmic.iiop.ImplementationType.forImplementation(ImplementationT
    ype.java:77)
    atcom.ibm.tools.rmic.iiop.StubGenerator.getTopType(StubGenerator.java:128)
    >
    at com.ibm.tools.rmic.iiop.Generator.generate(Generator.java:263)
    at sun.rmi.rmic.Main.doCompile(Main.java:547)
    at sun.rmi.rmic.Main.compile(Main.java:137)
    at sun.rmi.rmic.Main.main(Main.java:786)
    error: An error has occurred in the compiler; Please visit the URL
    http://www.ibm.com/java/jdk/support for information on
    investigating/reporting this problem. 1 error RMIC Command returns RC = 1.
    The problems which stopped RMIC are displayed, and have also been recorded
    in the log file.

  • Error while migrating orion-ejb-jar.xml from OC4J 9.0.4.1

    I am trying to use Toplink migration tool to take our existing orion-ejb-jar.xml file and toplink-ejb-jar.xml file to new 10.1.3 deployment. While running the migration tool I get the following error
    WARNING: Oc4j native CMP setting optimistic-locking on
    entity(TransactionTypeEntityBean) is not migrated and supported.
    java.lang.IllegalArgumentException: MWDatabaseField[9BE2B5]
    (TAX_RULE.TAX_RULE_ID)
    at
    oracle.toplink.workbench.mappingsmodel.desc.relational.MWRelationalPrima
    ryKeyPolicy.addPrimaryKey(MWRelationalPrimaryKeyPolicy.java:99)
    at
    oracle.toplink.tools.migration.RuntimeCMPProjectToMWProjectConverter.con
    vertDescriptor(RuntimeCMPProjectToMWProjectConverter.java:297)
    at
    oracle.toplink.tools.migration.RuntimeCMPProjectToMWProjectConverter.con
    vertDescriptors(RuntimeCMPProjectToMWProjectConverter.java:265)
    at
    oracle.toplink.tools.migration.RuntimeCMPProjectToMWProjectConverter.con
    vertProject(RuntimeCMPProjectToMWProjectConverter.java:144)
    at
    oracle.toplink.tools.migration.MigrationManagerBase.convertAndWriteoutMW
    Project(MigrationManagerBase.java:369)
    at
    oracle.toplink.tools.migration.MigrationManagerBase.migrate(MigrationMan
    agerBase.java:358)
    at
    oracle.toplink.tools.migration.io.MigrationIOManager.buildMigratedJarFil
    e(MigrationIOManager.java:243)
    at
    oracle.toplink.tools.migration.io.MigrationIOManager.operateEarEntry(Mig
    rationIOManager.java:181)
    at
    oracle.toplink.tools.migration.io.MigrationIOManager.operateEar(Migratio
    nIOManager.java:145)
    at
    oracle.toplink.tools.migration.io.MigrationIOManager.operateIO(Migration
    IOManager.java:88)
    at
    oracle.toplink.tools.migration.MigrationManagerBase.startMigration(Migra
    tionManagerBase.java:280)
    at
    oracle.toplink.tools.migration.MigrationManagerBase.run(MigrationManager
    Base.java:121)
    at
    oracle.toplink.tools.migration.MigrationManagerBase.run(MigrationManager
    Base.java:97)
    at
    oracle.toplink.tools.migration.TopLinkCMPMigrator.main(TopLinkCMPMigrato
    r.java:59)

    Hello,
    The warning message looks to be unrelated to the java.lang.IllegalArgumentException error. The warning states that optimistic locking cannot be migrated to the toplink-ejb-jar.xml file; this is stated in chapter 7 of the TopLink developer's guide at
    http://download-west.oracle.com/otn_hosted_doc/toplink/1013/MAIN/_pdf/b13593_v1_01.pdf
    The exception though seems to indicate that your orion-ejb-jar.xml contains EJBs mapped to the same table that are not related through EJB inheritance. I do it all the time with POJOs so this will work in TopLink, but you will need a support case to help get your project migrated if this is the case.
    Best Regards,
    Chris Delahunt

Maybe you are looking for

  • How to capture an HTML snippet like dashboard widget?

    How do you copy a website html to paste into an iWeb 09 html snippet? Is there a copy command in the Safari browser like when you clip a snippet to make a Dashboard widget? That would be too easy. Do I need some other software for copying the html?

  • Adobe reader really slow on brand new Core-i7 machine

    Opening of a PDFs is very very slow on my brand new Windows 7 64-bit machine. Machine is a new Core-i7  system with 16Gb Memory PDF's which open on other much older pc's within a second take 20-30 seconds on this new machine. The machine has a Radeon

  • [SOLVED] KDE 4.9 Freezes upon Loading a Program

    I've been searching for hours for a solution to this, but can't find any.  Please help! Here is the output from startx: X.Org X Server 1.12.4 Release Date: 2012-08-27 X Protocol Version 11, Release Date: 2012-08-27 X Protocol Version 11, Revision 0 B

  • Ampersand in Title/Caption for Web Galleries

    You probably all know this already, but I didn't... I've been getting to grips with the Sean's tip for formatting captions in web galleries, including Matthew's Slimbox gallery. As you'll see in the thread linked above, I had some trouble initially u

  • Spell checking (iOS4) only available in English?

    I can't seem to get the spell checking feature enabled. My language is Danish. Any knowledge on this topic?