起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1575|回复: 2

[结贴] 在/HR模块下连接数据库出错

[复制链接]

63

主题

552

帖子

763

积分

高级会员

Rank: 4

积分
763
QQ
发表于 2013-12-10 16:43:52 | 显示全部楼层 |阅读模式
用的oracle数据库,数据源是justep_hr,但是报错信息如下:
Caused by: com.justep.model.exception.ModelException: 执行ksql:SELECT HR_OG_Org, HR_OG_Org.fName as fName, HR_OG_Org.fCode as fCode, HR_OG_Org.fShortName as fShortName, HR_OG_Org.fFName as fFName, HR_OG_Org.fFCode as fFCode, HR_OG_Org.fFID as fFID, HR_OG_Org.fOrgKindID as fOrgKindID, HR_OG_Org.fParent as fParent, HR_OG_Org.fLevel as fLevel, HR_OG_Org.fPhone as fPhone, HR_OG_Org.fFax as fFax, HR_OG_Org.fAddress as fAddress, HR_OG_Org.fZip as fZip, HR_OG_Org.fDescription as fDescription, HR_OG_Org.fPersonID as fPersonID, HR_OG_Org.fNodeKind as fNodeKind, HR_OG_Org.fManager as fManager, HR_OG_Org.fIsPayOrg as fIsPayOrg, HR_OG_Org.fUseStatus as fUseStatus, HR_OG_Org.fUseStatusName as fUseStatusName, HR_OG_Org.fUpdatePsnID as fUpdatePsnID, HR_OG_Org.fUpdatePsnName as fUpdatePsnName, HR_OG_Org.fUpdateTime as fUpdateTime, HR_OG_Org.version as version, HR_OG_Org.fLongName as fLongName, HR_OG_Org.fSequence as fSequence,HR_OG_Org.fEmail as fEmail  FROM HR_OG_Org HR_OG_Org WHERE ((fParent IS NULL OR fParent='_is_root_')) ORDER BY fSequence ASC LIMIT 0, -1时出错!
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.ksqlSelect(Unknown Source)
        at com.justep.system.data.BizData.query(Unknown Source)
        at BizProcedure.query(BizProcedure.java:12)
        ... 26 more
Caused by: com.justep.exception.SystemException: 在/HR模块下连接数据库出错!
        at com.justep.system.data.Transaction.getConnection(Unknown Source)
        at com.justep.system.data.Transaction.getConnection(Unknown Source)
        at com.justep.model.ModelUtils.getConnection(Unknown Source)
        ... 31 more
Caused by: javax.naming.NameNotFoundException: Name hr is not bound in this Context
        at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
        at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
        at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
        at javax.naming.InitialContext.lookup(InitialContext.java:351)
        at com.justep.system.data.Transaction.getConnectionWithJndi(Unknown Source)
        ... 34 more








虽然你的表白打动了我,但是我们还是做朋友吧;
尽管很感谢你喜欢上我,但是我们还是做朋友吧。

91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
36067
发表于 2013-12-10 16:51:10 | 显示全部楼层
Caused by: javax.naming.NameNotFoundException: Name hr is not bound in this Context


没有hr这个数据源
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

63

主题

552

帖子

763

积分

高级会员

Rank: 4

积分
763
QQ
 楼主| 发表于 2013-12-10 16:59:08 | 显示全部楼层
已经解决,谢谢songningning,数据源配置不对,应该名字与db.config.m的里面名字一样。如下红色名字
<?xml version="1.0" encoding="utf-8"?>
<model xmlns="http://www.justep.com/model">
        <config name="dataSource" value="java:comp/env/hr"/>
</model>


虽然你的表白打动了我,但是我们还是做朋友吧;
尽管很感谢你喜欢上我,但是我们还是做朋友吧。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-11-23 08:52 , Processed in 0.056798 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表