aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Cant deploy the entity 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 "Cant deploy the entity bean" Watch "Cant deploy the entity bean" New topic
Author

Cant deploy the entity bean

Pappu Kumar
Ranch Hand

Joined: Oct 01, 2002
Posts: 69
I am using Weblogic 6.0. And cant deploy a simple entity bean.
I am attaching the source for all my files.
Kindly tell me if there is anything wrong in the Java files or the XML files.
----
package com.titan.cabin;
import java.rmi.RemoteException;
public interface CabinRemote extends javax.ejb.EJBObject {
public String getName() throws RemoteException;
public void setName(String str) throws RemoteException;
public int getDeckLevel() throws RemoteException;
public void setDeckLevel(int level) throws RemoteException;
public int getShipId() throws RemoteException;
public void setShipId(int sp) throws RemoteException;
public int getBedCount() throws RemoteException;
public void setBedCount(int bc) throws RemoteException;
}
--------
package com.titan.cabin;
import java.rmi.RemoteException;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
public interface CabinHomeRemote extends javax.ejb.EJBHome {
public CabinRemote create(Integer id)
throws CreateException, RemoteException;
public CabinRemote findByPrimaryKey(Integer pk)
throws FinderException, RemoteException;
}
-------
package com.titan.cabin;
import javax.ejb.EntityContext;
public class CabinBean implements javax.ejb.EntityBean {
public Integer id;
public String name;
public int deckLevel;
public int shipId;
public int bedCount;

public Integer ejbCreate(Integer id) {
this.id = id;
return null;
}
public void ejbPostCreate(Integer id) {
// Do nothing. Required.
}
public String getName() {
return name;
}
public void setName(String str) {
name = str;
}
public int getShipId() {
return shipId;
}
public void setShipId(int sp) {
shipId = sp;
}
public int getBedCount() {
return bedCount;
}
public void setBedCount(int bc) {
bedCount = bc;
}
public int getDeckLevel() {
return deckLevel;
}
public void setDeckLevel(int level ) {
deckLevel = level;
}
public void setEntityContext(EntityContext ctx) {
// Not implemented.
}
public void unsetEntityContext() {
// Not implemented.
}
public void ejbActivate() {
// Not implemented.
}
public void ejbPassivate() {
// Not implemented.
}
public void ejbLoad() {
// Not implemented.
}
public void ejbStore() {
// Not implemented.
}
public void ejbRemove() {
// Not implemented.
}
}
----------
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>CabinEJB</ejb-name>
<caching-descriptor>
<max-beans-in-cache>1000</max-beans-in-cache>
</caching-descriptor>
<persistence-descriptor>
<is-modified-method-name>isModified</is-modified-method-name>
<persistence-type>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>5.1.0</type-version>
<type-storage>META-INF/weblogic-cmp-rdbms-jar.xml</type-storage>
</persistence-type>
<persistence-use>
<type-identifier>WebLogic_CMP_RDBMS</type-identifier>
<type-version>5.1.0</type-version>
</persistence-use>
</persistence-descriptor>
<jndi-name>CabinHomeRemote</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
------------
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN' 'http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd'>
<ejb-jar>
<enterprise-beans>
<entity>
<ejb-name>CabinEJB</ejb-name>
<home>com.titan.cabin.CabinHomeRemote</home>
<remote>com.titan.cabin.CabinRemote</remote>
<ejb-class>com.titan.cabin.CabinBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.Integer</prim-key-class>
<reentrant>False</reentrant>
<cmp-field><field-name>id</field-name></cmp-field>
<cmp-field><field-name>name</field-name></cmp-field>
<cmp-field><field-name>deckLevel</field-name></cmp-field>
<cmp-field><field-name>shipId</field-name></cmp-field>
<cmp-field><field-name>bedCount</field-name></cmp-field>
<primkey-field>id</primkey-field>
</entity>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>CabinEJB</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
---------
<!DOCTYPE weblogic-rdbms-bean PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB RDBMS Persistence//EN'
'http://www.bea.com/servers/wls510/dtd/weblogic-rdbms-persistence.dtd'>

<weblogic-rdbms-bean>
<ejb-name>CabinEJB</ejb-name>
<table-name>CABIN</table-name>
<field-map>
<cmp-field>id</cmp-field>
<dbms-column>ID</dbms-column>
</field-map>
<field-map>
<cmp-field>shipId</cmp-field>
<dbms-column>SHIP_ID</dbms-column>
</field-map>
<field-map>
<cmp-field>bedCount</cmp-field>
<dbms-column>BED_COUNT</dbms-column>
</field-map>
<field-map>
<cmp-field>name</cmp-field>
<dbms-column>NAME</dbms-column>
</field-map>
<field-map>
<cmp-field>deckLevel</cmp-field>
<dbms-column>DECK_LEVEL</dbms-column>
</field-map>
</weblogic-rdbms-bean>
-----------
Please Help
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
Hi there, is there any specific problem that you have, or any error messages you've seen? Moving this to the WebLogic forum since you're having problems with WLS 6...
Also, thanks for joining JavaRanch, but could you just take a quick look at the naming policy and edit your profile accordingly.
Thanks!
Simon
Bartender (moderator) of "J2EE and EJB" forum
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cant deploy the entity bean