当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·数据条件选择    »显示摘要«
    摘要: 用query得到一数据集,去回到本地,能不能在本地在对该数据集进行(多次)过滤操作,如何操作,(过滤会不会对数据的完整产生影响) ......
    摘要: 小弟是初学vc,看了一些书,vc7的一本书中提到可以使用windowsxp中的新的通用控件dll,并且提示用户可以创建一个应用程序部件清单,来指导应用程序载入新的dll,这个新的dll6.0在哪里可以找到,怎样导入?望各位高手指点! ......


关于《精通EJB》(第二版)中CMP的问题

在CMP的例子中  
  ejb-jar文件中编写的ejb-ql语句按照书上所给写出,但是在JB8+Weblogic7的情况发布时报错如下:  
   
  "ProductBean.ejbgrpx":   Spaces   in   the   temporary   directory   path   may   cause   WebLogic   EJBC   utility   to   produce   fatal   compile   errors.  
  "ProductBean.ejbgrpx":   D:\bea\jdk131_06\bin\javaw   -classpath   "D:\bea\weblogic700\server\lib\weblogic.jar;D:\bea\weblogic700\server\lib\webservices.jar;F:\MySQLJDBC\mysql.jar;"     weblogic.ejbc   -keepgenerated   -compiler   D:/JBuilder8/bin/bcjW   F:/LeranEJB/ProductBean.jar.jar   F:/LeranEJB/ProductBean.jar  
   
  "ProductBean.ejbgrpx":   ERROR:   Error   from   ejbc:   Error   while   reading   META-INF/weblogic-cmp-rdbms-jar.xml.   The   error   was:  
  "ProductBean.ejbgrpx":      
  "ProductBean.ejbgrpx":   weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:  
  "ProductBean.ejbgrpx":   While   trying   to   process   Query  
  "ProductBean.ejbgrpx":   Method   Name:   findByname  
  "ProductBean.ejbgrpx":   Parameter   Types:   (java.lang.String)  
  "ProductBean.ejbgrpx":   EJB   Query:   SELECT   OBJECT(a)   FROM   ProductBean   AS   a   WHERE   name   =   ?1  
  "ProductBean.ejbgrpx":   )  
  "ProductBean.ejbgrpx":   Invalid   Expression:   Could   not   find   a   Range   Variable   as   defined   in   an   AS   declaration   that   refers   to   the   root   of   the   path   expression:   name.   Please   check   your   Query   and   verify   that   you   have   defined   a   FROM   (abstract_schema_name)   AS   name   in   your   Query.  
  "ProductBean.ejbgrpx":   weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:  
  "ProductBean.ejbgrpx":   While   trying   to   process   Query  
  "ProductBean.ejbgrpx":   Method   Name:   findByDescription  
  "ProductBean.ejbgrpx":   Parameter   Types:   (java.lang.String)  
  "ProductBean.ejbgrpx":   EJB   Query:   SELECT   OBJECT(a)   FROM   ProductBean   AS   a     WHERE   description   =   ?1  
  "ProductBean.ejbgrpx":   )  
  "ProductBean.ejbgrpx":   Invalid   Expression:   Could   not   find   a   Range   Variable   as   defined   in   an   AS   declaration   that   refers   to   the   root   of   the   path   expression:   description.   Please   check   your   Query   and   verify   that   you   have   defined   a   FROM   (abstract_schema_name)   AS   description   in   your   Query.  
  "ProductBean.ejbgrpx":   weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:  
  "ProductBean.ejbgrpx":   While   trying   to   process   Query  
  "ProductBean.ejbgrpx":   Method   Name:   findByBasePrice  
  "ProductBean.ejbgrpx":   Parameter   Types:   (double)  
  "ProductBean.ejbgrpx":   EJB   Query:   SELECT   OBJECT(a)   FROM   ProductBean   AS   a     WHERE   basePrice   =   ?1  
  "ProductBean.ejbgrpx":   )  
  "ProductBean.ejbgrpx":   Invalid   Expression:   Could   not   find   a   Range   Variable   as   defined   in   an   AS   declaration   that   refers   to   the   root   of   the   path   expression:   basePrice.   Please   check   your   Query   and   verify   that   you   have   defined   a   FROM   (abstract_schema_name)   AS   basePrice   in   your   Query.  
  "ProductBean.ejbgrpx":   weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:  
  "ProductBean.ejbgrpx":   While   trying   to   process   Query  
  "ProductBean.ejbgrpx":   Method   Name:   findExpensiveProducts  
  "ProductBean.ejbgrpx":   Parameter   Types:   (double)  
  "ProductBean.ejbgrpx":   EJB   Query:   SELECT   OBJECT(a)   FROM   ProductBean   AS   a     WHERE   basePrice   >   ?1  
  "ProductBean.ejbgrpx":   )  
  "ProductBean.ejbgrpx":   Invalid   Identifier   in   EJB   QL   expression:   Could   not   find   a   Range   Variable   as   defined   in   an   AS   declaration   that   refers   to   the   root   of   the   path   expression:   basePrice.   Please   check   your   Query   and   verify   that   you   have   defined   a   FROM   (abstract_schema_name)   AS   basePrice   in   your   Query.  
  "ProductBean.ejbgrpx":   weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:  
  "ProductBean.ejbgrpx":   While   trying   to   process   Query  
  "ProductBean.ejbgrpx":   Method   Name:   findCheapProducts  
  "ProductBean.ejbgrpx":   Parameter   Types:   (double)  
  "ProductBean.ejbgrpx":   EJB   Query:   SELECT   OBJECT(a)   FROM   ProductBean   AS   a     WHERE   basePrice   <   ?1  
  "ProductBean.ejbgrpx":   )  
  "ProductBean.ejbgrpx":   Invalid   Identifier   in   EJB   QL   expression:   Could   not   find   a   Range   Variable   as   defined   in   an   AS   declaration   that   refers   to   the   root   of   the   path   expression:   basePrice.   Please   check   your   Query   and   verify   that   you   have   defined   a   FROM   (abstract_schema_name)   AS   basePrice   in   your   Query.  
  "ProductBean.ejbgrpx":   weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:  
  "ProductBean.ejbgrpx":   While   trying   to   process   Query  
  "ProductBean.ejbgrpx":   Method   Name:   findAllProducts  
  "ProductBean.ejbgrpx":   Parameter   Types:   ()  
  "ProductBean.ejbgrpx":   EJB   Query:   SELECT   OBJECT(a)   FROM   ProductBean   AS   a     WHERE   productID   IS   NOT   NULL  
  "ProductBean.ejbgrpx":   )  
  "ProductBean.ejbgrpx":   Invalid   Expression:   Could   not   find   a   Range   Variable   as   defined   in   an   AS   declaration   that   refers   to   the   root   of   the   path   expression:   productID.   Please   check   your   Query   and   verify   that   you   have   defined   a   FROM   (abstract_schema_name)   AS   productID   in   your   Query.  
  "ProductBean.ejbgrpx":   ERROR:   ejbc   found   errors  
   
  请问这是什么原因造成的?  
 

NO.1   作者: zez

1   路径有空格,TEMP   TMP   ...  
  2   是a.name   不是name  
  SELECT   OBJECT(a)   FROM   ProductBean   AS   a   WHERE   a.name   =   ?1  
 

NO.2   作者: asdmonster

问题出在这里,下面也是一样:  
  SELECT   OBJECT(a)   FROM   ProductBean   AS   a   WHERE   name   =   ?1  
   
  From   后面跟的不是表名,而是Abstract   schema   name  
  name   也不是表中的字段,而是你的CMP中映射的变量名,  
  注意大小写,   name   =   ?1之间不能有空格。  
   
 


 ·找一个网页设计师,待遇不错    »显示摘要«
    摘要: 我叫jeffrey 我们公司是美国guess的上海代理公司,现要找一个网页设计师,待遇不错! 要有美工基础,有自己的作品,有意者请同我联系。 edgezhao@21cn.com ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE