File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Deploying Session Bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Deploying Session Bean" Watch "Deploying Session Bean" New topic

Deploying Session Bean

Sanjay U Bahrani

Joined: Mar 16, 2005
Posts: 2
Hi All,

I am deploying a simple Hello Session Bean. I created an jar archive that contains the ejb-jar.xml in metainf folder. The below shows the ejb-jar.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "">


When i am deploying the jar archive i am getting the following error:

[Deployer:149034]An exception occurred for task [Deployer:149026]Deploy application HelloWorld on b2bsys1.: Prepare failed. Task Id = 3 Module: HelloWorld Error: [EJB:011024]The XML parser encountered an error in your deployment descriptor. Please ensure that your deployment descriptor corresponds to the format in the DTD. The error was: Error parsing file 'META-INF/ejb-jar.xml' at line: 32 column: 13. The content of element type "session" must match "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,ejb-class,session-type,transaction-type,env-entry*,ejb-ref*,ejb-local-ref*,security-role-ref*,security-identity?,resource-ref*,resource-env-ref*)".. .

It seems there is a problem in ejb-jar.xml. Can you tell IS there anything that i am doing wrong.

Thanks in advance.

Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33118

Welcome to JavaRanch!

The XML tags need to be in the same order as those specified in the DTD. So remote, local-home and local need to be before ejb-class. (There may be others at of order, but you get the idea.)

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Christian Jacob Mencias

Joined: Feb 11, 2011
Posts: 2

Good day,

I'm also encountering problem with my Stateless Session Bean (EJB 2.0) I developed using Eclipse.
From Eclipse IDE, I've used Web Logic 10.3.5 as my target runtime.

It seems there's no problem with the class files, but there is below error which is related to the ejb-jar.xml deployment descriptor.

Is there something missing in the DD?

Thanks in advance.

The ejb-jar.xml:

The error reported by IDE when I publish:

Christian Jacob Mencias
Christian Jacob Mencias

Joined: Feb 11, 2011
Posts: 2


I was able to correct the problem with below fix.

Basically, I made sure the DD is following below ordering of elements:

New ejb-jar.xml
I agree. Here's the link:
subject: Deploying Session Bean
It's not a secret anymore!