5 Replies Latest reply on Jan 9, 2004 1:35 PM by David Lilley

    Create exception

    arnaud Newbie


      I can't create my EJB 1.1 with JBoss 2.4.1 / Tomcat
      i just have a simple Entity:

      when i call the create method, i still have

      " javax.ejb.CreateException: Could not create entity:java.lang.NullPointerException
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCreateEntityCommand.execute(JDBCCreateEntityCommand.java:139)"

      i try different create method (with parameters ect..)
      but each time i have the same error.

      My Datasource is ok, and the tables are automatically created by JBoss, so it is "JUST" an entity creation problem,

      please help.

      <<<<<<<<< >>>>>>>>>>>>>>
      -- jaws.xml --
      <?xml version="1.0" encoding="US-ASCII"?>


      <<<<<<<<< >>>>>>>>>>>>>>
      --- ejbjar.xml ---
      <?xml version="1.0"?>
      <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>


      this is the bean code:
      public class InternautesBean implements EntityBean {
      private EntityContext ctx;

      public int internaute_id;
      public String email;

      public String firstname;

      public String lastname;
      public String login;
      public String password;

      public String locale;
      public int friend_id;

      public void setEntityContext(EntityContext context) throws RemoteException, EJBException {
      ctx = context;

      public void unsetEntityContext() throws RemoteException, EJBException {
      ctx = null;

      public void ejbActivate() throws RemoteException, EJBException {

      public void ejbPassivate() throws RemoteException, EJBException {

      public void ejbRemove() throws RemoteException, EJBException {

      public void ejbStore() throws RemoteException, EJBException {

      public void ejbLoad() throws RemoteException, EJBException {

      public InternautesPK ejbCreate() throws CreateException, EJBException, RemoteException, SQLException {
      // Write your code here
      return null;

      public void ejbPostCreate() throws CreateException, EJBException, RemoteException, SQLException {
      // Write your code here

      public int getInternaute_id(){ return internaute_id; }

      public void setInternaute_id(int param){ this.internaute_id = param; }

      public String getEmail(){ return email; }

      public void setEmail(String param){ this.email = param; }

      public String getFirstname(){ return firstname; }

      public void setFirstname(String param){ this.firstname = param; }

      public String getLastname(){ return lastname; }

      public void setLastname(String param){ this.lastname = param; }

      public String getLogin(){ return login; }

      public void setLogin(String param){ this.login = param; }

      public String getPassword(){ return password; }

      public void setPassword(String param){ this.password = param; }

      public String getLocale(){ return locale; }

      public void setLocale(String param){ this.locale = param; }

      public int getFriend_id(){ return friend_id; }

      public void setFriend_id(int param){ this.friend_id = param; }

      private InternauteVO createInternauteVO(){
      com.seariver.vo.InternauteVO valueObj = new com.seariver.vo.InternauteVO();
      valueObj.internaute_id = internaute_id;
      valueObj.email = email;
      valueObj.firstname = firstname;
      valueObj.lastname = lastname;
      valueObj.login = login;
      valueObj.password = password;
      valueObj.locale = locale;
      valueObj.friend_id = friend_id;
      return valueObj;

      public InternauteVO getInternauteVO(){
      return createInternauteVO();

      private void mergeInternauteVO(InternauteVO valueObj){
      internaute_id = valueObj.internaute_id;
      email = valueObj.email;
      firstname = valueObj.firstname;
      lastname = valueObj.lastname;
      login = valueObj.login;
      password = valueObj.password;
      locale = valueObj.locale;
      friend_id = valueObj.friend_id;

      public void setInternauteVO(InternauteVO param){