File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

stateless session bean

 
srikanth arroju
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i deployed the stateless session bean using ant
at jboss console its giving this exception
java.lang.RuntimeException: No container configured with name 'Stateless Bean'
 
Pavel Kubal
Ranch Hand
Posts: 360
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you could post your ant script, it looks like there's something wrong inside.
 
yugant shah
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider a stateless session bean CodebookManagerBean.java.
In the ejb-jar.xml we need to specify the transaction type of the bean.
For ex:
<session id="Session_CodebookManager">
<description><![CDATA[]]></description>

<ejb-name>CodebookManager</ejb-name>

<home>service.CodebookManagerHome</home>
<remote>service.CodebookManager</remote>
<local-home>service.CodebookManagerLocalHome</local-home>
<local>service.CodebookManagerLocal</local>
<ejb-class>service.CodebookManagerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>

</session>

Hope this might solve the issue.

Thanks.
Yugant Shah
 
srikanth arroju
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
build file

<?xml version="1.0"?>
<!-- ======================================================================= -->
<!-- JBoss build file -->
<!-- ======================================================================= -->

<project name="JBoss" default="ejbjar" basedir=".">

<property file="../local.properties"/> <property environment="env"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="jboss.home" value="${env.JBOSS_HOME}"/>
<property name="jboss.server.config" value="default"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>

<!-- Build classpath -->
<path id="classpath">
<!-- So that we can get jndi.properties for InitialContext -->
<pathelement location="${basedir}"/>
<fileset dir="${jboss.home}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jboss.home}/server/${jboss.server.config}/lib">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/ejb3.deployer">
<include name="*.jar"/>
</fileset>
<fileset dir="${jboss.home}/server/${jboss.server.config}/deploy/jboss-aop-jdk50.deployer">
<include name="*.jar"/>
</fileset>
<pathelement location="${build.classes.dir}"/>
</path>

<property name="build.classpath" refid="classpath"/>

<!-- =================================================================== -->
<!-- Prepares the build directory -->
<!-- =================================================================== -->
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
</target>

<!-- =================================================================== -->
<!-- Compiles the source code -->
<!-- =================================================================== -->
<target name="compile" depends="prepare">
<javac srcdir="${src.dir}"
destdir="${build.classes.dir}"
debug="on"
deprecation="on"
optimize="off"
includes="**">
<classpath refid="classpath"/>
</javac>
</target>

<target name="ejbjar" depends="compile">
<jar jarfile="build/tutorial.jar">
<fileset dir="${build.classes.dir}">
<include name="**/*.class"/>
</fileset>
</jar>
<copy file="build/tutorial.jar" todir="${jboss.home}/server/${jboss.server.config}/deploy"/>
</target>

<target name="run" depends="ejbjar">
<java classname="example1.Client" fork="yes" dir=".">
<classpath refid="classpath"/>
</java>
</target>

<!-- =================================================================== -->
<!-- Cleans up generated stuff -->
<!-- =================================================================== -->
<target name="clean.db">
<delete dir="${jboss.home}/server/${jboss.server.config}/data/hypersonic"/>
</target>

<target name="clean">
<delete dir="${build.dir}"/>
<delete file="${jboss.home}/server/${jboss.server.config}/deploy/tutorial.jar"/>
</target>


</project>
 
srikanth arroju
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to find a ejb-jar.xml
or where to write a ejb-jar.xml
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by srikanth arroju:
how to find a ejb-jar.xml
or where to write a ejb-jar.xml


ejb-jar.xml is a core component in EJB deployment, it defines what ejbs are contained in your application and sets any configuration required. Its probably worth you taking the time to go through the J2EE tutorial to remind yourself of the basics.
 
srikanth arroju
Ranch Hand
Posts: 66
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think in ejb3
ejb-jar.xml is optional
[ September 13, 2007: Message edited by: srikanth arroju ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic