wood burning stoves*
The moose likes EJB and other Java EE Technologies and the fly likes CMP bean does not deploy -- need your advice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "CMP bean does not deploy -- need your advice" Watch "CMP bean does not deploy -- need your advice" New topic
Author

CMP bean does not deploy -- need your advice

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Hello Friends,

I am trying to deploy a very simple CMP bean on JBoss with Hypersonic SQL database.

But it does not deploy. JBoss does not even give error messages, simply nothing. What am I missing?

Here is the jar file that I am trying to deploy.

Here is a zip file of the code.

Here is the code:

Catalog.java




CatalogHome.java




CatalogBean.java



ejb-jar.xml




jboss.xml




jbosscmp-jdbc.xml


[ July 02, 2007: Message edited by: Joseph Sweet ]

We must know, we will know. -- David Hilbert
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9960
    
163

That jar does not have the correct packaging. This is what the jar contains:

META-INF/
META-INF/MANIFEST.MF
production/com/
production/com/ejb/
production/com/ejb/Catalog.class
production/com/ejb/CatalogBean.class
production/com/ejb/CatalogHome.class
production/META-INF/
production/META-INF/ejb-jar.xml
production/META-INF/jboss.xml
production/META-INF/jbosscmp-jdbc.xml


Notice that a META-INF folder has been created *inside* the "production" folder and all the xml files (which are necessary for recognizing the jar as an ejb jar) are placed here.

The correct packaging should look like:



This will help JBoss to identify this as an ejb jar and then process it for deploying.
[ July 02, 2007: Message edited by: Jaikiran Pai ]

[My Blog] [JavaRanch Journal]
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
Yes Jaikiran is right.

Also your jar has a production folder, but your package name is "com.ejb" so I doubt if Jboss can find the classes

Why don't you create an EAR and have proper packaging as specified in the specs. Have APP-INF/Class and all your classes inside it.


Amit Tank
Linked In
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Thank you guys, you were right.

JBoss did not identify the ejb-jar.xml thus did not start the deployment. I also had a little mistake with the Home interface's create() method signature but I could see it by the error output once the deployment occurred.

BTW, what is APP-INF directory? I have never heard of something like that.

Is it vendor-specific?


[ July 02, 2007: Message edited by: Joseph Sweet ]
Amit M Tank
Ranch Hand

Joined: Mar 28, 2004
Posts: 257
Yes. My bad, this is specific to weblogic server.
 
wood burning stoves
 
subject: CMP bean does not deploy -- need your advice
 
Similar Threads
CMP 2.0 problem with MySQL server
CMP beans not entering data in database
Could not Create entity error.
ejbql-jboss problem
Entity Bean on JBoss4.0.2