aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes error in deploying stateful bean  in weblogic 8.1 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 "error in deploying stateful bean  in weblogic 8.1" Watch "error in deploying stateful bean  in weblogic 8.1" New topic
Author

error in deploying stateful bean in weblogic 8.1

arunij katiliyar
Greenhorn

Joined: Mar 09, 2005
Posts: 26
Hi ,
I am encountering a strange exception while deploying a stateful bean in weblogic using appc .
The following is the error

java.lang.NullPointerException
at weblogic.ejb20.deployer.SessionBeanInfoImpl.assignDefaultTXAttributes
IfNecessary()V(SessionBeanInfoImpl.java:295)
at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.initializeTransaction
Attribute(Lweblogic.management.descriptors.toplevel.EJBDescriptorMBean V(MBeanD
eploymentInfoImpl.java:807)
at weblogic.ejb20.deployer.MBeanDeploymentInfoImpl.<init>(Lweblogic.mana


The following is my ejb-jar.xml


<?xml version="1.0"?>

<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'
'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>

<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Countsfsb</ejb-name>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>CountSFSB</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>


weblogic-ejb-jar.xml


?xml version="1.0"?>

<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'
'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>

<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Countsfsb</ejb-name>
<stateful-session-descriptor>
<allow-remove-during-transaction>true</allow-remove-during-transaction>
</stateful-session-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>CountSFSB</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>

I tried removing the stateful-session-descriptor stanza in weblgic-ejb-jar.xml it didnt work . I also tried switching the allow-remove-during-transaction to false .It didnt work .

Thanks
Murugan
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Arunij,

Below is an example from one of our SLSB deployment descriptors (we don't use much SFSB but they have a lot in common):

And as you can see right from the beginning your document root tag must be <ejb-jar> and not <weblogic-ejb-jar>. Also you notice that the session bean is defined within a <session> tag, entity beans will be defined within an <entity> tag, etc. Point is that I cannot tell you from the top of my head which part of your configuration settings are wrong, because we use XDoclet for generating our deployment descriptors and therefore I don't even know if your example will ever work following this format. You can check BEA's online documentation for more information about deployment descriptors. I only want to point out to you that you might consider other tools, like XDoclet or BEA's ejbgen in order to generate your deployment descriptors automatically and never bother about their format again.
Regards.


I think, therefore I exist -- Rene Descartes
arunij katiliyar
Greenhorn

Joined: Mar 09, 2005
Posts: 26
Apologize for posting wrong ejb-jar.xml . cut& paste error .errrr
Please find below my descriptor xmls

<?xml version="1.0"?>

<!DOCTYPE ejb-jar PUBLIC
'-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN'
'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>

<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>Countsfsb</ejb-name>
<home>com.ejb.sfsb.CountHome</home>
<remote>com.ejb.sfsb.CountRemote</remote>
<ejb-class>com.ejb.sfsb.CountBean</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>

</session>
</enterprise-beans>

<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Countsfsb</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>




--weblogic-ejb-jar.xml




<?xml version="1.0"?>

<!DOCTYPE weblogic-ejb-jar PUBLIC
'-//BEA Systems, Inc.//DTD WebLogic 8.1.0 EJB//EN'
'http://www.bea.com/servers/wls810/dtd/weblogic-ejb-jar.dtd'>

<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>Countsfsb</ejb-name>
<stateful-session-descriptor>
<allow-remove-during-transaction>true</allow-remove-during-transaction>
</stateful-session-descriptor>
<enable-call-by-reference>True</enable-call-by-reference>
<jndi-name>CountSFSB</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
As far as I can tell, your deployment descriptors look fine to me. There is only one more hint that I can give you: try to specify the session attributes for every method rather than using the global asterisk (*) notation. The reason I�m saying this is first because this is how we do with our SLSB and the second is because from what I remember the session beans do not allow specifying transaction attributes with create methods. Who knows, maybe WebLogic got confused, although I doubt. Beside that I�m clueless just like you
Best regards.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in deploying stateful bean in weblogic 8.1