Topic: [求助]用JBuilder创建实体Bean遇到问题!!!!

  Print this page

1.[求助]用JBuilder创建实体Bean遇到问题!!!! Copy to clipboard
Posted by: greennba99
Posted on: 2004-02-03 16:10

我在创建这个EJB时所定的Primary Key Class为java.lang.String,创建后JBuilder会自动产生远程接口,本地接口和Bean类这三个文件,其中本地接口中的Find方法为:

public RemoteInterface findByPrimaryKey(String primKey) throws ObjectNotFoundException, RemoteException, FinderException;

这样整个工程能够成功编译,但我把Find方法改成:

public RemoteInterface findByPrimaryKey(String primKey,String primKey1) throws ObjectNotFoundException, RemoteException, FinderException;
再把Bean类文件中的Find方法做相应的修改后整个工程就不能成功编译了,出现以下错误信息:

"MusicEJB.jar": F:\bea\jdk141_02\bin\javaw -classpath "E:\Objects\MusicServer\classes;F:\bea\weblogic81\server\lib\weblogic_sp.jar;F:\bea\weblogic81\server\lib\weblogic.jar;F:\bea\weblogic81\server\lib\webservices.jar;" weblogic.appc -keepgenerated -forceGeneration -compiler F:/bea/jdk141_02/bin/javac E:/Objects/MusicServer/MusicEJB.jar.jar -output E:/Objects/MusicServer/MusicEJB.jar

"MusicEJB.jar": <2004-2-3 下午15时31分27秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: LoginEJB has a class ejb.EJBClass that is in the classpath. This class should only be located in the ejb-jar file.>

"MusicEJB.jar": <2004-2-3 下午15时31分27秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: LoginEJB has a class ejb.HomeInterface that is in the classpath. This class should only be located in the ejb-jar file.>

"MusicEJB.jar": <2004-2-3 下午15时31分27秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: LoginEJB has a class ejb.RemoteInterface that is in the classpath. This class should only be located in the ejb-jar file.>

"MusicEJB.jar": [J2EE:160121]Errors encountered while compiling module 'E:\Objects\MusicServer\MusicEJB.jar.jar':

"MusicEJB.jar": In EJB LoginEJB, the home interface findByPrimaryKey method parameter must be the primary key type or java.lang.Object: findByPrimaryKey(java.lang.String,java.lang.String)

也就是说我的主键是一个复合键,请问这个问题改这么解决,由于我是初学者,所以请详细解答,非常感谢!!!!

2.Re:[求助]用JBuilder创建实体Bean遇到问题!!!! [Re: greennba99] Copy to clipboard
Posted by: java8110
Posted on: 2004-02-13 14:39

建议使用主键类


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923