[JBoss-user] [EJB/JBoss] - Re: ClassCastException invoking LocalHome finder methods on
Hi all, Since NOBODY reply my question, I'll answer it myself... the problem was caused by wrong use of (Home/Remote) interface pairs. If you're using LocalHome you MUST use the EJB's Local interface! I hope this could help somebody... View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3874518#3874518 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3874518 --- This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728 ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - ClassCastException invoking LocalHome finder methods on BMPs
Hi all (again...), I'm having problems on invoking BMPs finder-methods (only those that returns various Value Objects within a Collection) through their local home interface. If I call them from the home interface it works pretty fine, but when I call from the local home I get a ClassCastException... I'm using a Stateless Session Bean to encapsulate the business logic, so they're in the same VM. PS: I also tried to call a testing method in the (Facade) Session Bean that referenciates the local home interface of the EJBs, but I got the same error. I didn't find any reason for this... Any help is very welcome! Thankx. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3874145#3874145 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3874145 --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] [EJB/JBoss] - Re: Can you please give me a sample Entity Bean Source code
Ok, I'll send you an example of a CMP-EJB Produto. It uses the HyperSonic JBoss-native database. Bean class: -- package br.cefetrn.leilao.beans; import javax.ejb.EntityBean; import javax.ejb.EntityContext; /** http://java.sun.com/xml/ns/j2ee"; xmlns:lomboz="http://lomboz.objectlearn.com/xml/lomboz";> Produto Produto br.cefetrn.leilao.beans.ProdutoBean Container java.lang.Integer 2.x schProduto codigo codigo java.lang.Integer CODIGO VARCHAR INTEGER false true codusuario java.lang.Integer CODUSUARIO VARCHAR INTEGER false false codcategoria java.lang.Integer CODCATEGORIA VARCHAR INTEGER false false codsituacao java.lang.Integer CODSITUACAO VARCHAR INTEGER false false produto java.lang.String PRODUTO VARCHAR VARCHAR false false descricao java.lang.String DESCRICAO VARCHAR VARCHAR false false lancemin java.lang.Double LANCEMIN VARCHAR MONEY false false datainicial java.util.Date DATAINI VARCHAR DATE false false datafinal java.util.Date DATAFIM VARCHAR DATE false false Produto * * * * @ejb.bean name="Produto" * jndi-name="ProdutoBean" * type="CMP" * primkey-field="codigo" * schema="schProduto" * cmp-version="2.x" * * * @ejb.persistence * table-name="Produto" * * @ejb.finder *query="SELECT OBJECT(a) FROM schProduto as a WHERE (a.codSituacao = 1)" *signature="java.util.Collection findAll()" * * @ejb.finder *query="SELECT OBJECT(a) FROM schProduto as a WHERE (a.codUsuario=?1) AND (a.codSituacao = 1)" *signature="java.util.Collection findProdutosByUserID(java.lang.Integer codigousuario)" * * @ejb.finder *query="SELECT OBJECT(a) FROM schProduto as a WHERE (a.codCategoria=?1) AND (a.codSituacao = 1)" *signature="java.util.Collection findProdutosByCategoria(java.lang.Integer codcategoria)" * * **/ public abstract class ProdutoBean implements EntityBean { protected EntityContext eContext; public static final Integer SITUA_ANDAMENTO = new Integer(1); public static final Integer SITUA_FINALIZADO = new Integer(2); /** * The ejbCreate method. * @ejb.create-method */ public java.lang.Integer ejbCreate(java.lang.Integer codigo, java.lang.Integer codusuario, java.lang.Integer codcategoria, java.lang.Integer codsituacao, java.lang.String produto, java.lang.String descricao, java.lang.Double lancemin, java.util.Date datainicial, java.util.Date datafinal) throws javax.ejb.CreateException { this.setCodigo(codigo); this.setCodUsuario(codusuario); this.setCodCategoria(codcategoria); this.setCodSituacao(codsituacao); this.setProduto(produto); this.setDescricao(descricao); this.setLancemin(lancemin); return null; } /** * The container invokes this method immediately after it calls ejbCreate. * */ public void ejbPostCreate() throws javax.ejb.CreateException { } /** * Returns the codigo * @return the codigo * * @ejb.persistent-field * @ejb.persistence *column-name="CODIGO" * sql-type="INTEGER" * @ejb.pk-field * @ejb.interface-method * */ public abstract java.lang.Integer getCodigo(); /** * Sets the codigo * * @param java.lang.Integer the new codusuario value * * @ejb.interface-method */ public abstract void setCodigo(java.lang.Integer codigo); /** * Returns the codusuario * @return the codusuario * * @ejb.persistent-field * @ejb.persistence *column-name="CODUSUARIO" * sql-type="INTEGER" * @ejb.interface-method * */ public abstract java.lang.Integer getCodUsuario(); /** * Sets the codusuario * * @param java.lang.Integer the new codigo value * * @ejb.interface-method */ public abstract void setCodUsuario(java.lang.Integer codigo); /**
[JBoss-user] [EJB/JBoss] - Problems invoking local home finder methods of BMP-EJBs that
Hi all, I'm having problems to invoke finder methods (only those that returns various Value Objects within a Collection) of my BMP-EJBs through their local home interface. If I call them from the home interface it works pretty fine, but when I call from the local home I get a ClassCastException... I'm using a Stateless Session Bean to encapsulate the business logic, so they're in the same VM. PS: I also tried to call a testing method in the (Facade) Session Bean that referenciates the local home interface of the EJBs, but I got the same error. I didn't find any reason for this... Thankx. View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3874025#3874025 Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3874025 --- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click ___ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user