jndi-name problem on deployment of J2EE under Sun Application Server 8.0


M

mflll

I am getting the following error on deployment:

(Sun Platform 8 J2EE)

@toolman#/home/leffstudent >asadmin deploy --user admin Course.ear

password>

CLI171 Command deploy failed : Fatal Error from EJB Compiler --
Invalid jndi name [] found in application [Course]; module
[Course.jar];
ejb [CourseBean]; aborting deployment.
Please populate the jndi element and try again.




ejb-jar.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<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">
<enterprise-beans>
<entity>
<description>Course</description>
<display-name>CourseBean</display-name>
<ejb-name>CourseBean</ejb-name>
<home>RS.CourseHome</home>
<remote>RS.Course</remote>
<ejb-class>RS.CourseBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>RS.CoursePK</prim-key-class>
<reentrant>false</reentrant>
<abstract-schema-name>Course</abstract-schema-name>
<cmp-field><field-name>number</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
</entity>
</enterprise-beans>
<assembly-descriptor>
<security-role>
<description>Everyone</description>
<role-name>everyone</role-name>
</security-role>
<method-permission>
<unchecked/>
<method>
<ejb-name>CourseBean</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>CourseBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>


Sun-ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD
Application Server 8.1 EJB 2.1//EN"
"http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-1.dtd">
<sun-ejb-jar>
<enterprise-beans>
<name>CourseBean</name>
<ejb>
<ejb-name>Course</ejb-name>
<jndi-name>Course</jndi-name>
</ejb>
<cmp-resource>
<jndi-name>jdbc/PointBase</jndi-name>
<create-tables-at-deploy>true</create-tables-at-deploy>
<drop-tables-at-undeploy>true</drop-tables-at-undeploy>
<database-vendor-name>PointBase</database-vendor-name>
</cmp-resource>
</enterprise-beans>
</sun-ejb-jar>

I believe entering the jndi-name in the ejb element of the Sun-ejb
should solve this but it doesn't. I read the Role of JNDI in J2EE by
Kirk Pepperdine and Joseph Ottinger, Naviage the JNDI maze by
Daniel Would, and the Sun J2EE tutorial but I still don't see what to
do here.

Dr. Laurence Leff, Associate Professor of Computer Science, Western
Illinois
University, 1 University Circle, Macomb IL 61455 Pager: 309 367 0787
Fax 309 298 2302
 
Ad

Advertisements

F

Frank Langelage

I am getting the following error on deployment:

(Sun Platform 8 J2EE)

@toolman#/home/leffstudent >asadmin deploy --user admin Course.ear

password>

CLI171 Command deploy failed : Fatal Error from EJB Compiler --
Invalid jndi name [] found in application [Course]; module
[Course.jar];
ejb [CourseBean]; aborting deployment.
Please populate the jndi element and try again.




ejb-jar.xml:

<ejb-name>CourseBean</ejb-name>

Sun-ejb-jar.xml

<ejb>
<ejb-name>Course</ejb-name>
<jndi-name>Course</jndi-name>
</ejb>

I guess using the same ejb-name at both places will help.
 
Ad

Advertisements

M

mflll

Thanks for your advice, and your help on my previous problem on the
missing
Remote tag
..
I tried changing my ejb-name to match in the two files.
I get the same error message:

asadmin deploy --user admin Course.ear

CLI171 Command deploy failed : Fatal Error from EJB Compiler -- Invalid
jndi name [] found in application [Course]; module [Course.jar]; ejb
[CourseBean]; aborting deployment. Please populate the jndi element and
try again.



Sun-ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD
Application Server 8.1 EJB 2.1//EN"
"http://www.sun.com/software/appserver/dtds/sun-ejb-jar_2_1-1.dtd">
<sun-ejb-jar>
<enterprise-beans>
<name>CourseBean</name>
<ejb>
<ejb-name>CourseBean</ejb-name>
<jndi-name>Course</jndi-name>
</ejb>
<cmp-resource>
<jndi-name>jdbc/PointBase</jndi-name>
<create-tables-at-deploy>true</create-tables-at-deploy>
<drop-tables-at-undeploy>true</drop-tables-at-undeploy>
<database-vendor-name>PointBase</database-vendor-name>
</cmp-resource>
</enterprise-beans>
</sun-ejb-jar>

ejb-jar.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<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">
<enterprise-beans>
<entity>
<description>Course</description>
<display-name>CourseBean</display-name>
<ejb-name>CourseBean</ejb-name>
<home>RS.CourseHome</home>
<remote>RS.Course</remote>
<ejb-class>RS.CourseBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>RS.CoursePK</prim-key-class>
<reentrant>false</reentrant>
<abstract-schema-name>Course</abstract-schema-name>
<cmp-field><field-name>number</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
</entity>
</enterprise-beans>
<assembly-descriptor>
<security-role>
<description>Everyone</description>
<role-name>everyone</role-name>
</security-role>
<method-permission>
<unchecked/>
<method>
<ejb-name>CourseBean</ejb-name>
<method-name>*</method-name>
</method>
</method-permission>
<container-transaction>
<method>
<ejb-name>CourseBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top