using xdoclet error(help)
ejb:
test.ejb.AccountBean;(CMP)
test.ejb.TellerBean(Stateless)
client:
test.client.Test
error:
1.when i use TellerUtil.getHome();
can not get TellerHome;
solution:
modify the TellerUtil.getHome()
from:
java.lang.Object objRef =
initialContext.lookup(test.interfaces.TellerHome.COMP_NAME);
modified to:
java.lang.Object objRef =
initialContext.lookup(test.interfaces.TellerHome.JNDI_NAME);
2.when i call test.client.Test
printStackTrace:
23:27:35,244 INFO [EJBDeployer] Deploying mall/Account
23:27:35,244 INFO [EJBDeployer] Deploying mall/Teller
23:27:35,504 ERROR [XmlFileLoader] XmlFileLoader: File
file:/C:/jboss-3.0.0beta/
tmp/deploy/75.samples-ejb.jar!/META-INF/jbosscmp-jdbc.xml process error.
Line: 5
2. Error message: Element "dependent-value-classes" requires additional
elements
.
23:27:35,764 INFO [mall/Account] Created table 'account' successfully.
23:27:49,895 ERROR [JRMPInvoker] operation failed
java.rmi.ServerException: argument type mismatch; nested exception is:
java.lang.IllegalArgumentException: argument type mismatch
java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
tatelessSessionContainer.java:642)
at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:77)
at
org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:96)
at
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:167)
at
org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
1)
at
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:127)
at
org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
at
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:308)
at org.jboss.ejb.Container.invoke(Container.java:630)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at
com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at
org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
364)
at java.lang.reflect.Method.invoke(Native Method)
at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
65)
at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:706)
at java.lang.Thread.run(Thread.java:484)
source
/*********************************************
* test.ejb.AccountBean
********************************************/
package test.ejb;
import javax.ejb.*;
import test.interfaces.AccountPK;
import test.interfaces.AccountData;
import test.interfaces.Account;
/**
* This is an account bean. It is an example of how to use the XDoclet
tags.
*
* @ejb:bean name="mall/Account" type="CMP" jndi-name="ejb/mall/Account"
* @ejb:finder signature="Collection findAll()" unchecked="true"
transaction-type="NotSupported"
* @ejb:interface remote-class="test.interfaces.Account"
*
* @jboss:table-name "account"
* @jboss:create-table "${jboss.create.table}"
* @jboss:remove-table "${jboss.remove.table}"
* @jboss:tuned-updates "${jboss.tuned.updates}"
*
*/
public abstract class AccountBean
implements EntityBean{
/**
*
* @ejb:pk-field
* @ejb:persistent-field
*
* @jboss:column-name "id"
*/
public abstract String getID();
public abstract void setID(String ID);
/**
* Balance of the account.
*
* @ejb:interface-method
* @ejb:persistent-field
*
* @jboss:column-name "balance
"
*/
public abstract float getBalance();
public abstract void setBalance(float balance);
/**
* Owner of this account.
*
* @ejb:interface-method
* @ejb:persistent-field
*
* @jboss:column-name "owner"
*/
public abstract String getOwner();
/**
* @ejb:interface-method
*/
public abstract void setOwner(String Owner);
/**
* @ejb:create-method
*/
public AccountPK ejbCreate(AccountData data){
return null;
}
public void ejbPostCreate(AccountData data) { }
}
/*********************************************
* test.ejb.TellerBean
********************************************/
package test.ejb;
import javax.ejb.*;
import test.interfaces.Account;
import test.interfaces.AccountData;
import test.interfaces.AccountHome;
import test.interfaces.AccountUtil;
/**
* @ejb:bean type="Stateless" name="mall/Teller"
jndi-name="ejb/mall/Teller"
*
*/
public abstract class TellerBean
implements SessionBean{
/**
* @ejb:interface-method
*/
public void makeAccount(AccountData data){
try{
test.interfaces.AccountHome home = AccountUtil.getHome();
Account account = home.create(data);
}catch(Exception e){
e.printStackTrace();
}
}
}
/*********************************************
* test.ejb.TellerBean
********************************************/
package test.client;
import test.interfaces.*;
public class Test{
public static void main(String[] args){
try{
TellerHome home = TellerUtil.getHome();
Teller teller = home.create();
AccountData data = new AccountData();
data.setID("0");
data.setBalance(100);
data.setOwner("test");
teller.makeAccount(data);
teller.remove();
}catch(Exception e){
e.printStackTrace();
}
}
}
_________________________________________________________________
������� MSN Explorer��http://explorer.msn.com/lccn/intl.asp��
_______________________________________________
Xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user