This week's book giveaway is in the Agile forum.
We're giving away four copies of Fixing your Scrum and have Ryan Ripley & Todd Miller on-line!
See this thread for details.
Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

error in deploying stateful bean in weblogic 8.1

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
arunij katiliyar
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 704
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic