一个实体bean问题?

Tomeliujun
06-06-16 5 221

[EJB:011028]The DataSource with the JNDI name: DataSource could not be located. Please ensure that the DataSource has been deployed successfully and that the JNDI name in your EJB Deployment descriptor is correct.


at weblogic.ejb20.deployer.EJBModule.activate(EJBModule.java:412)
at weblogic.application.internal.flow.ModuleListenerInvoker.activate(ModuleListenerInvoker.java:104)
at weblogic.application.internal.flow.DeploymentCallbackFlow$2.next(DeploymentCallbackFlow.java:339)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:26)
at weblogic.application.internal.flow.DeploymentCallbackFlow.activate(DeploymentCallbackFlow.java:68)
Truncated. see log file for complete stacktrace
[EJB:011028]The DataSource with the JNDI name: DataSource could not be located. Please ensure that the DataSource has been deployed successfully and that the JNDI name in your EJB Deployment descriptor is correct.
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.setup(RDBMSPersistenceManager.java:238)
at weblogic.ejb20.manager.BaseEntityManager.setupPM(BaseEntityManager.java:288)
at weblogic.ejb20.manager.BaseEntityManager.setup(BaseEntityManager.java:237)
at weblogic.ejb20.manager.DBManager.setup(DBManager.java:165)
at weblogic.ejb20.deployer.ClientDrivenBeanInfoImpl.activate(ClientDrivenBeanInfoImpl.java:1371)
Truncated. see log file for complete stacktrace
>
我刚刚学EJB,我在做一个练习时出了很多问题?其中上贴出来的就在JB2006+weblogic9.0+sql server 2005报告出来的错误? 我已经搞了三天,搞得精疲力竭了,所以只好求求各位大哥帮忙?这个问题我真得不知道该怎么解决???急呀!!

xuechen0721
2006-06-17 08:04

报错信息中已经写的很明确了,是你的数据源或者是数据源的jndi名有问题啊!
好好查查吧!
就你提供的信息,只能作出这样的回答了!

Tomeliujun
2006-06-17 16:17

我知道这里高手多:
下面是配JB自动生成的配置文件信息,请各位帮忙看下下哪里有问题?

这个是:weblogic-ejb-jar.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<weblogic-enterprise-bean>
<ejb-name>StudentDetail</ejb-name>
<entity-descriptor>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>
</entity-descriptor>
<jndi-name>StudentDetailRemote</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>

这个是:ejb-jar.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
<display-name>StudentInfomationModule</display-name>
<enterprise-beans>
<entity>
<ejb-name>StudentDetail</ejb-name>
<home>studentinfomation.StudentDetailRemoteHome</home>
<remote>studentinfomation.StudentDetailRemote</remote>
<ejb-class>studentinfomation.StudentDetailBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>StudentDetail</abstract-schema-name>
<cmp-field>
<field-name>studentId</field-name>
</cmp-field>
<cmp-field>
<field-name>studentName</field-name>
</cmp-field>
<cmp-field>
<field-name>address</field-name>
</cmp-field>
<cmp-field>
<field-name>course</field-name>
</cmp-field>
<primkey-field>studentId</primkey-field>
<query>
<query-method>
<method-name>findAllStudents</method-name>
<method-params />
</query-method>
<ejb-ql>Select Object(c) from StudentDetail as c</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>StudentDetail</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


Tomeliujun
2006-06-17 16:18

我知道这里高手多:
下面是配JB自动生成的配置文件信息,请各位帮忙看下下哪里有问题?

这个是:weblogic-ejb-jar.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<weblogic-enterprise-bean>
<ejb-name>StudentDetail</ejb-name>
<entity-descriptor>
<persistence>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>6.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-use>
</persistence>
</entity-descriptor>
<jndi-name>StudentDetailRemote</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>

这个是:ejb-jar.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1">
<display-name>StudentInfomationModule</display-name>
<enterprise-beans>
<entity>
<ejb-name>StudentDetail</ejb-name>
<home>studentinfomation.StudentDetailRemoteHome</home>
<remote>studentinfomation.StudentDetailRemote</remote>
<ejb-class>studentinfomation.StudentDetailBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>false</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>StudentDetail</abstract-schema-name>
<cmp-field>
<field-name>studentId</field-name>
</cmp-field>
<cmp-field>
<field-name>studentName</field-name>
</cmp-field>
<cmp-field>
<field-name>address</field-name>
</cmp-field>
<cmp-field>
<field-name>course</field-name>
</cmp-field>
<primkey-field>studentId</primkey-field>
<query>
<query-method>
<method-name>findAllStudents</method-name>
<method-params />
</query-method>
<ejb-ql>Select Object(c) from StudentDetail as c</ejb-ql>
</query>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>StudentDetail</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


Tomeliujun
2006-06-17 16:23

TomeliujunyO033cU6m5.xml
我是一个刚刚开始学习EJB的菜鸟,就请各位大哥多多帮助
我不知道从哪里去查这个问题,JB以没有定位很清楚问题在哪里?

2Go 1 2 下一页