Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1095053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:03:50+00:00 2026-05-17T00:03:50+00:00

I was reading the tutorial on this page: http://edocs.bea.com/docs/cd/E13222_01/wls/docs81/medrec_tutorials/ejbgen.html#858279 And I have the following

  • 0

I was reading the tutorial on this page:
http://edocs.bea.com/docs/cd/E13222_01/wls/docs81/medrec_tutorials/ejbgen.html#858279

And I have the following file BankAccountEJB.java


import javax.ejb.CreateException;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;

public abstract class BankAccountEJB implements EntityBean {

private EntityContext context;

public void setEntityContext(EntityContext aContext) {
    context = aContext;
}

public void ejbActivate() {

}

public void ejbPassivate() {

}

public void ejbRemove() {

}

public void unsetEntityContext() {
    context = null;
}

public void ejbLoad() {

}

public void ejbStore() {

}

public abstract String getName();

public abstract void setName(String name);

public abstract Float getBalance();

public abstract void setBalance(Float balance);

public java.lang.Long ejbCreate(String name, Float balance)  throws CreateException {
    if (name == null) {
        throw new CreateException("The field \"key\" must not be null");
    }

    // TODO add additional validation code, throw CreateException if data is not valid
    setName(name);

setBalance(balance);

    return null;
}

public void ejbPostCreate(java.lang.Long key) {
    // TODO populate relationships here if appropriate
}

}

and I run java weblogic.tools.ejbgen.EJBGen -ddOnlyGen BankAccountEJB.java which produces the following error:

Exception in thread “main” com.bea.wls.ejbgen.EJBGenException: ejbName is a required attribute
at com.bea.wls.ejbgen.Bean.createBeanSpecificTags(Bean.java:202)
at com.bea.wls.ejbgen.Bean.(Bean.java:127)
at com.bea.wls.ejbgen.EntityBean.(EntityBean.java:76)
at com.bea.wls.ejbgen.EJBFactory.createBean(EJBFactory.java:135)
at com.bea.wls.ejbgen.EJBFactory.createBean(EJBFactory.java:99)
at com.bea.wls.ejbgen.EJBGenSGen.initModule(EJBGenSGen.java:106)
at com.bea.sgen.SGen.run(SGen.java:205)
at com.bea.wls.ejbgen.EJBGen.main(EJBGen.java:212)
at com.bea.wls.ejbgen.EJBGen.main(EJBGen.java:238)
at weblogic.tools.ejbgen.EJBGen.main(EJBGen.java:21)

Any input will be greatly appreciated~!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:03:51+00:00Added an answer on May 17, 2026 at 12:03 am

    Note: Are you still running Weblogic 8.1 – it’s already reached end of life. Also ejbgen works with EJB 2.x and over the last 2 years, development has moved on to EJB 3, so i’d advise you to catch up on those.

    Now to your specific problem.

    Your code does not seem to have the required annotations for ejbgen to work.

    Annotations like this which are used in generation of the descriptors.

     * @ejbgen:entity
     *   ejb-name = containerManaged
     *   table-name = ejbAccounts
     *   data-source-name = examples-dataSource-demoPool
     *   prim-key-class =  AccountPK
     *   invalidation-target = ServiceDesignEJB
    

    As your URL says the code in the tutorial has the right data as a sample – make sure you replicate those correctly in your own code.

    EJBGen uses annotations in the bean
    file to generate the deployment
    descriptor files and the EJB Java
    source files. EJB files in the MedRec
    application are already annotated for
    EJBGen.

    For another version of ejbgen, see http://www.beust.com/ejbgen/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.