求助各位老大
本人刚学习J2EE,做了一个小测试,部署EJB时发现错误,当数据库主键类型是int时,没有问题,但是改成varchar类型就出错,求助!!!,谢谢。
public static void main(String[] args) {
Film1TestClient1 client = new Film1TestClient1();
// Use the getHome() method of the client object to call Home interface
// methods that will return a Remote interface reference. Then
// use that Remote interface reference to access the EJB.
Film1RemoteHome home=client.getHome();
try {
Film1Remote filmObj = home.findByPrimaryKey("03");
System.out.println("姓名:" + fomat(filmObj.getFilmName()));
} catch (Exception ex) {
ex.printStackTrace();
}
错误提示:
"EJBModule1.jar": C:\bea\jdk142_08\bin\javaw -classpath "C:\bea\weblogic81\server\lib\weblogic_sp.jar;C:\bea\weblogic81\server\lib\weblogic.jar;C:\bea\weblogic81\server\lib\webservices.jar;" weblogic.appc -keepgenerated -forceGeneration -compiler C:/bea/jdk142_08/bin/javac D:/entiBean/EJBModule1.jar.jar -output D:/entiBean/EJBModule1.jar
"EJBModule1.jar": [J2EE:160119]Appc is unable to process the file 'D:\entiBean\EJBModule1.jar.jar'. The following error occurred:
"EJBModule1.jar": [EJB:011017]Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:
"EJBModule1.jar":
"EJBModule1.jar": In the RDBMS CMP bean 'Film1', when Automatic Key Generation is enabled, the Primary Key class must be java.lang.Integer or java.lang.Long.
"EJBModule1.jar": .
"EJBModule1.jar": at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:255)
"EJBModule1.jar": at weblogic.ejb20.ejbc.(EJBCompiler.java:476)
"EJBModule1.jar": at weblogic.ejb20.ejbc.(EJBCompiler.java:387)
"EJBModule1.jar": at weblogic.(appc.java:809)
"EJBModule1.jar": at weblogic.(appc.java:778)
"EJBModule1.jar": at weblogic.(appc.java:465)
"EJBModule1.jar": at weblogic.appc.runBody(appc.java:186)
"EJBModule1.jar": at weblogic.(Tool.java:192)
"EJBModule1.jar": at weblogic.(Tool.java:147)
"EJBModule1.jar": at weblogic.appc.main(appc.java:1037)
"EJBModule1.jar": [EJB:011017]Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:。。。。。。。。。