Weblogic Server.在JBuilder里建立一个实体Bean的一个Finder出现的问题,大家帮我看看怎么回事

b3b4s3d4 2003-10-20 10:40:09
make的时候出现的问题

"CmpModule.jar": [EJB:011017]Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:
"CmpModule.jar":
"CmpModule.jar": Query:
"CmpModule.jar": EJB Name: SysUser
"CmpModule.jar": Method Name: findByName
"CmpModule.jar": Parameter Types: (java.lang.String)
"CmpModule.jar": select =>> userName <<= From SysUser as t where =>> t.userName <<= = ?1
"CmpModule.jar": EJB QL compilation encountered error: [EJB:013060]
"CmpModule.jar": Problem, in EJB QL in the clause SELECT userName, 'userName' was expected to be a single_valued_path_expression. The single_valued_path_expression must consist of at least 2 elements separated by periods. 'userName' contains only one element.
"CmpModule.jar": Action, rewrite the SELECT clause of the query. See EJB2.0 Specification for more details.
"CmpModule.jar": EJB QL compilation encountered error: [EJB:013042]The Identifier 'userName' is neither a cmp-field nor a cmr-field. Re-examine your query.
"CmpModule.jar": .
...全文
32 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
b3b4s3d4 2003-10-20
  • 打赏
  • 举报
回复
谢谢
虽然还在报错
"CmpModule.jar": Spaces in the temporary directory path may cause WebLogic APPC utility to produce fatal compile errors.
"CmpModule.jar": D:\BEA\jdk141_03\bin\javaw -classpath "D:\BEA\user_projects\domains\porenDomain\poren\Cmp\classes;D:\BEA\weblogic81\server\lib\weblogic_sp.jar;D:\BEA\weblogic81\server\lib\weblogic.jar;D:\BEA\weblogic81\server\lib\webservices.jar;" weblogic.appc -keepgenerated -forceGeneration -compiler D:/BEA/jdk141_03/bin/javac D:/BEA/user_projects/domains/porenDomain/poren/Cmp/CmpModule.jar.jar -output D:/BEA/user_projects/domains/porenDomain/poren/Cmp/CmpModule.jar

"CmpModule.jar": <2003-10-20 下午12时23分13秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: SysUser has a class cmp.SysUserBean that is in the classpath. This class should only be located in the ejb-jar file.>
"CmpModule.jar": <2003-10-20 下午12时23分14秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: SysUser has a class cmp.SysUserRemoteHome that is in the classpath. This class should only be located in the ejb-jar file.>
"CmpModule.jar": <2003-10-20 下午12时23分14秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: SysUser has a class cmp.SysUserRemote that is in the classpath. This class should only be located in the ejb-jar file.>
"CmpModule.jar": <2003-10-20 下午12时23分14秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: SysUser has a class cmp.SysUserHome that is in the classpath. This class should only be located in the ejb-jar file.>
"CmpModule.jar": <2003-10-20 下午12时23分14秒 CST> <Warning> <EJB> <BEA-010054> <EJB Deployment: SysUser has a class cmp.SysUser that is in the classpath. This class should only be located in the ejb-jar file.>
"CmpModule.jar": [J2EE:160121]Errors encountered while compiling module 'D:\BEA\user_projects\domains\porenDomain\poren\Cmp\CmpModule.jar.jar':
"CmpModule.jar": [EJB:011017]Error while reading 'META-INF/weblogic-cmp-rdbms-jar.xml'. The error was:
"CmpModule.jar":
"CmpModule.jar": Query:
"CmpModule.jar": EJB Name: SysUser
"CmpModule.jar": Method Name: findByName
"CmpModule.jar": Parameter Types: (java.lang.String)
"CmpModule.jar": SELECT =>> t.userName <<= FROM SysUser as t WHERE =>> t.userName <<= = ?1
"CmpModule.jar": EJB QL compilation encountered error: [EJB:013042]The Identifier 'userName' is neither a cmp-field nor a cmr-field. Re-examine your query.
"CmpModule.jar": EJB QL compilation encountered error: [EJB:013042]The Identifier 'userName' is neither a cmp-field nor a cmr-field. Re-examine your query.
"CmpModule.jar": .
cootme2002 2003-10-20
  • 打赏
  • 举报
回复
in EJB QL in the clause SELECT userName, 'userName' was expected to be a single_valued_path_expression. The single_valued_path_expression must consist of at least 2 elements separated by periods. 'userName' contains only one element.
"CmpModule.jar": Action, rewrite the SELECT clause of the query. See EJB2.0 Specification for more details.
以上这一段说明你的ejb ql由违背EJB规范的地方。
因为 单值导航表达式 需要知道是哪个表或 IN(tableName.field) asName的形式进行导航。

而你的QL中SELECT部分没有导航,应如下:
SELECT t.userName FROM SysUser AS t WHERE t.userName = ?1

就OK.

加油啊!
要是再有问题,我们一起来讨论吧。

有空可以去我的网站留言 http://www.redrival.com/cootme
lzl123 2003-10-20
  • 打赏
  • 举报
回复
select t.userName From SysUser as t where t.userName = ?1

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧