0 Replies Latest reply on Apr 10, 2003 4:41 AM by freiburg

    CMP problem - Error in the deployment fase

    freiburg Newbie

      I have this problem. When I make the deploy I have an error message as

      "java.lang.StringIndexOutOfBoundsException: String index out of range: 0"

      I think that the mistake is in the descriptor when I use the tag <method param> and put inside that java.lang.String.
      But I don't know why. What do you think about?
      Thank you very much for helping me!

      This is the local interface:

      package com.sdb.stage.ejb;

      import java.rmi.RemoteException;
      import javax.ejb.EJBLocalObject;

      public interface Cliente extends EJBLocalObject {

      public Integer getCodice();

      public void setCodice(Integer codice);

      public String getNome();

      public void setNome(String nome);

      public String getPiva();

      public void setPiva(String piva);


      This is the LocalHome Interface

      package com.sdb.stage.ejb;

      import javax.ejb.EJBLocalHome;
      import javax.ejb.CreateException;
      import javax.ejb.FinderException;
      import java.util.Collection;

      public interface ClienteHome extends EJBLocalHome {

      public Cliente create(Integer codice, String nome, String piva) throws CreateException;

      public Cliente findByPrimaryKey(Integer codice)
      throws FinderException;

      public Collection findByName(String nome)
      throws FinderException;

      public Collection findByPiva(String piva)
      throws FinderException;

      public Collection findAll()
      throws FinderException;


      This is the Bean:

      package com.sdb.stage.ejb;

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

      public abstract class ClienteBean implements EntityBean {

      private EntityContext context;

      // Metodi di accesso per la persistenza

      public abstract Integer getCodice();
      public abstract void setCodice(Integer codice);

      public abstract String getNome();
      public abstract void setNome(String nome);

      public abstract String getPiva();
      public abstract void setPiva(String piva);

      // Metodi specifici dell'entity bean

      public Integer ejbCreate (Integer codice, String nome, String piva)
      throws CreateException {

      return null;

      public void ejbPostCreate (Integer codice, String nome, String piva)
      throws CreateException {}

      // EJB callbacks
      public void setEntityContext(EntityContext ctx) {
      context = ctx;

      public void unsetEntityContext() {
      context = null;

      public void ejbActivate() { }
      public void ejbPassivate() { }
      public void ejbLoad() { }
      public void ejbStore() { }
      public void ejbRemove() { }


      This is the Deployment Descriptor

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar >

      <display-name>Generated by Freiburg</display-name>


      <!-- Entity Beans -->

      <display-name>Cliente entity bean</display-name>



      <cmp-field >
      <cmp-field >
      <cmp-field >


      FROM cli AS g
      WHERE g.nome = ?1

      FROM cli AS g
      WHERE g.piva = ?1

      FROM ClienteEJB g