<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Java EE Application Development using Tomcat, OpenEJB and Hibernate</title>
	<atom:link href="http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/</link>
	<description>IT, Java, Ubuntu, Linux</description>
	<lastBuildDate>Thu, 13 Oct 2011 23:02:45 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1704</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Thu, 31 Mar 2011 05:57:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1704</guid>
		<description>&lt;a href=&quot;http://blog.lckymn.com/2009/11/01/web-service-development-using-tomcat-and-openejb/comment-page-1/#comment-1703&quot; rel=&quot;nofollow&quot;&gt;http://blog.lckymn.com/2009/11/01/web-service-development-using-tomcat-and-openejb/comment-page-1/#comment-1703&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><a href="http://blog.lckymn.com/2009/11/01/web-service-development-using-tomcat-and-openejb/comment-page-1/#comment-1703" rel="nofollow">http://blog.lckymn.com/2009/11/01/web-service-development-using-tomcat-and-openejb/comment-page-1/#comment-1703</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: subba</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1701</link>
		<dc:creator>subba</dc:creator>
		<pubDate>Thu, 31 Mar 2011 03:31:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1701</guid>
		<description>Kevin,
Thanks for your instructions based details on the openejb.
Is it possible to add same type details on deploying openejb project in to Linux ?

We have existing webservice project developed based on axis2 in tomcat 6.0.32 using top to bottom approach.
Now, we want to add asynchronous message processing features. So, exploring to use the JMS + MDB. To add this feature in tomcat, I am working to use the openEJB. 
And, I was trying to find best way to add on this new project  by adding openEJB.war to existing tomcat.
But, trying to simplify the steps to 
how to add the MDBean project in addition to the existing top to bottom up axis2 webservice project?
How to deploy this new addition MDBean/openejb project.jar in to tomcat+openejb in Lunux?
How to deploy the openejb based MDB project.jar in to tomcat+openejb ?
How to send message object to MDBean which would also run in same tomcat having openejb.war?

I really thankfull for your kind response.
--
Subba</description>
		<content:encoded><![CDATA[<p>Kevin,<br />
Thanks for your instructions based details on the openejb.<br />
Is it possible to add same type details on deploying openejb project in to Linux ?</p>
<p>We have existing webservice project developed based on axis2 in tomcat 6.0.32 using top to bottom approach.<br />
Now, we want to add asynchronous message processing features. So, exploring to use the JMS + MDB. To add this feature in tomcat, I am working to use the openEJB.<br />
And, I was trying to find best way to add on this new project  by adding openEJB.war to existing tomcat.<br />
But, trying to simplify the steps to<br />
how to add the MDBean project in addition to the existing top to bottom up axis2 webservice project?<br />
How to deploy this new addition MDBean/openejb project.jar in to tomcat+openejb in Lunux?<br />
How to deploy the openejb based MDB project.jar in to tomcat+openejb ?<br />
How to send message object to MDBean which would also run in same tomcat having openejb.war?</p>
<p>I really thankfull for your kind response.<br />
&#8211;<br />
Subba</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1606</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Fri, 24 Sep 2010 10:44:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1606</guid>
		<description>Prafull, if you click the link to the OpenEJB download page, you can see &#039;OpenEJB for Tomcat&#039; which is the &#039;openejb.war&#039; file. Please check out the page again.</description>
		<content:encoded><![CDATA[<p>Prafull, if you click the link to the OpenEJB download page, you can see &#8216;OpenEJB for Tomcat&#8217; which is the &#8216;openejb.war&#8217; file. Please check out the page again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Prafull</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1605</link>
		<dc:creator>Prafull</dc:creator>
		<pubDate>Fri, 24 Sep 2010 07:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1605</guid>
		<description>When i download openejb.war it downloads openejb.zip file
how di i convert it
Thanks</description>
		<content:encoded><![CDATA[<p>When i download openejb.war it downloads openejb.zip file<br />
how di i convert it<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1566</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Tue, 29 Jun 2010 16:16:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1566</guid>
		<description>Hello, caijc

Can you try again with commenting out &lt;code&gt;@PersistenceContext(unitName = “oe”)&lt;/code&gt;?

[code lang=&quot;java&quot; highlight=&quot;3&quot;]
@Stateless
public class UserServiceBean implements UserService {
//@PersistenceContext(unitName = “oe”)
private EntityManager em;
……
[/code]

For your information, you can use &#091;code lang=&quot;java&quot;]&#091;/code] to put Java source code here.
&#091;code lang=&quot;java&quot;]
some java code here
&#091;/code]
</description>
		<content:encoded><![CDATA[<p>Hello, caijc</p>
<p>Can you try again with commenting out <code>@PersistenceContext(unitName = “oe”)</code>?</p>
<pre class="brush: java; highlight: [3]; title: ; notranslate">
@Stateless
public class UserServiceBean implements UserService {
//@PersistenceContext(unitName = “oe”)
private EntityManager em;
……
</pre>
<p>For your information, you can use &#91;code lang=&#8221;java&#8221;]&#91;/code] to put Java source code here.<br />
&#91;code lang=&#8221;java&#8221;]<br />
some java code here<br />
&#91;/code]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: caijc</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1565</link>
		<dc:creator>caijc</dc:creator>
		<pubDate>Tue, 29 Jun 2010 02:55:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1565</guid>
		<description>Hello,Kevin,
   I modified your code a bit,and encountered a problem,differing from the above ones.It says:
fatal:Allocate exception for servlet OeServlet
javax.naming.NameNotFoundException: Name &quot;Deployment/UserServiceBean/com.caijc.oe.UserService!Local&quot; not found.
	at org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:193)
	at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:150)
	at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:121)
	at org.apache.openejb.tomcat.common.AbstractObjectFactory.lookup(AbstractObjectFactory.java:60)
	at org.apache.openejb.tomcat.common.AbstractObjectFactory.getObjectInstance(AbstractObjectFactory.java:47)
	at org.apache.openejb.tomcat.common.EjbFactory.getObjectInstance(EjbFactory.java:50)
	at org.apache.naming.factory.EjbFactory.getObjectInstance(EjbFactory.java:161)
	at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
	at org.apache.catalina.util.DefaultAnnotationProcessor.lookupFieldResource(DefaultAnnotationProcessor.java:278)
	at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:192)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1120)
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.openejb.tomcat.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Unknown Source)
But I almost COPIED your code and configuration,the &quot;Local&quot; interface should be there:

      @Local
      public interface UserService {
	public String	show();
      }

      @Stateless
      public class UserServiceBean implements UserService {
	   @PersistenceContext(unitName = &quot;oe&quot;)
	   private EntityManager	em;
          ......

      public class OeServlet extends HttpServlet {
	 private static final long serialVersionUID = 1L;
	 @EJB
	 private UserService	uss;
       ......
Simple code,but failed.Can you help me?</description>
		<content:encoded><![CDATA[<p>Hello,Kevin,<br />
   I modified your code a bit,and encountered a problem,differing from the above ones.It says:<br />
fatal:Allocate exception for servlet OeServlet<br />
javax.naming.NameNotFoundException: Name &#8220;Deployment/UserServiceBean/com.caijc.oe.UserService!Local&#8221; not found.<br />
	at org.apache.openejb.core.ivm.naming.IvmContext.federate(IvmContext.java:193)<br />
	at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:150)<br />
	at org.apache.openejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:121)<br />
	at org.apache.openejb.tomcat.common.AbstractObjectFactory.lookup(AbstractObjectFactory.java:60)<br />
	at org.apache.openejb.tomcat.common.AbstractObjectFactory.getObjectInstance(AbstractObjectFactory.java:47)<br />
	at org.apache.openejb.tomcat.common.EjbFactory.getObjectInstance(EjbFactory.java:50)<br />
	at org.apache.naming.factory.EjbFactory.getObjectInstance(EjbFactory.java:161)<br />
	at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)<br />
	at org.apache.naming.NamingContext.lookup(NamingContext.java:793)<br />
	at org.apache.naming.NamingContext.lookup(NamingContext.java:140)<br />
	at org.apache.naming.NamingContext.lookup(NamingContext.java:781)<br />
	at org.apache.naming.NamingContext.lookup(NamingContext.java:153)<br />
	at org.apache.catalina.util.DefaultAnnotationProcessor.lookupFieldResource(DefaultAnnotationProcessor.java:278)<br />
	at org.apache.catalina.util.DefaultAnnotationProcessor.processAnnotations(DefaultAnnotationProcessor.java:192)<br />
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1120)<br />
	at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)<br />
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)<br />
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br />
	at org.apache.openejb.tomcat.catalina.OpenEJBValve.invoke(OpenEJBValve.java:45)<br />
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<br />
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br />
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br />
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)<br />
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)<br />
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)<br />
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)<br />
	at java.lang.Thread.run(Unknown Source)<br />
But I almost COPIED your code and configuration,the &#8220;Local&#8221; interface should be there:</p>
<p>      @Local<br />
      public interface UserService {<br />
	public String	show();<br />
      }</p>
<p>      @Stateless<br />
      public class UserServiceBean implements UserService {<br />
	   @PersistenceContext(unitName = &#8220;oe&#8221;)<br />
	   private EntityManager	em;<br />
          &#8230;&#8230;</p>
<p>      public class OeServlet extends HttpServlet {<br />
	 private static final long serialVersionUID = 1L;<br />
	 @EJB<br />
	 private UserService	uss;<br />
       &#8230;&#8230;<br />
Simple code,but failed.Can you help me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1495</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Thu, 18 Feb 2010 16:07:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1495</guid>
		<description>Thank you so much Ariel.  You&#039;re very generous with your compliments.
And it&#039;s really good to hear that you got it working. :)</description>
		<content:encoded><![CDATA[<p>Thank you so much Ariel.  You&#8217;re very generous with your compliments.<br />
And it&#8217;s really good to hear that you got it working. <img src='http://blog.lckymn.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ariel Jakobovits</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1493</link>
		<dc:creator>Ariel Jakobovits</dc:creator>
		<pubDate>Thu, 18 Feb 2010 08:23:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1493</guid>
		<description>Seriously, G-d bless you. You have a talent for writing tutorials and it is so nice to be able to finally follow a tutorial from beginning to end and have something running that I can examine. You the man.</description>
		<content:encoded><![CDATA[<p>Seriously, G-d bless you. You have a talent for writing tutorials and it is so nice to be able to finally follow a tutorial from beginning to end and have something running that I can examine. You the man.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1468</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Fri, 08 Jan 2010 07:33:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1468</guid>
		<description>Hello, Jeff

It seems the EntityManager injection has failed due to some problem in the DAO.
Since I don&#039;t have your source code, can&#039;t tell exactly what causes the problem. If it&#039;s OK with you and if you want me to have a look, could you put your code of AbstractGenericDao and CommuneDaoImpl?

You can use &#091;code lang=&quot;java&quot;&#093;Put your code here&#091;/code&#093; to get the code syntax highlighted.

Regards,
Kevin</description>
		<content:encoded><![CDATA[<p>Hello, Jeff</p>
<p>It seems the EntityManager injection has failed due to some problem in the DAO.<br />
Since I don&#8217;t have your source code, can&#8217;t tell exactly what causes the problem. If it&#8217;s OK with you and if you want me to have a look, could you put your code of AbstractGenericDao and CommuneDaoImpl?</p>
<p>You can use &#91;code lang=&#8221;java&#8221;&#93;Put your code here&#91;/code&#93; to get the code syntax highlighted.</p>
<p>Regards,<br />
Kevin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1466</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Wed, 06 Jan 2010 10:13:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1466</guid>
		<description>Thanks for the documentation.

But i have a problem I get java.lang.IllegalStateException: EntityManager is not injected.
WARN - Injection: No such property &#039;ejbtest.AbstractGenericDao/entityManager&#039; in class ejbtest.CommuneDaoImpl

Jeff</description>
		<content:encoded><![CDATA[<p>Thanks for the documentation.</p>
<p>But i have a problem I get java.lang.IllegalStateException: EntityManager is not injected.<br />
WARN &#8211; Injection: No such property &#8216;ejbtest.AbstractGenericDao/entityManager&#8217; in class ejbtest.CommuneDaoImpl</p>
<p>Jeff</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1458</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Sun, 15 Nov 2009 11:32:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1458</guid>
		<description>You&#039;re welcome, and it&#039;s good to hear that your problem is solved.
So you are using an MS SQL server, aren&#039;t you?
</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome, and it&#8217;s good to hear that your problem is solved.<br />
So you are using an MS SQL server, aren&#8217;t you?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mami</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1457</link>
		<dc:creator>mami</dc:creator>
		<pubDate>Sun, 15 Nov 2009 11:16:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1457</guid>
		<description>Thanks for quick answer!
I found the problem, in persistence.xml I had to add following (have removed &#039;&#039; in this post because they will be automaticly removed 

properties
property name=&quot;hibernate.dialect&quot; value=&quot;org.hibernate.dialect.SQLServerDialect&quot; /
/properties

Thanks again!</description>
		<content:encoded><![CDATA[<p>Thanks for quick answer!<br />
I found the problem, in persistence.xml I had to add following (have removed &#8221; in this post because they will be automaticly removed </p>
<p>properties<br />
property name=&#8221;hibernate.dialect&#8221; value=&#8221;org.hibernate.dialect.SQLServerDialect&#8221; /<br />
/properties</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1456</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Sat, 14 Nov 2009 12:21:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1456</guid>
		<description>Hello, mami

If you have an error like ‘Name MyServlet is not bound in this Context’, you normally need to check if the servlet is correctly set in the web.xml, the deployment descriptor.

Yet your case seems different. That error may also be caused by the failure in EJB injection if you use EJB. So the problem is not in the servlet yet in the EJB you try to inject in the servlet.

Let me explain with an example.

You have an EJB, named TestService and your servlet that is MyServlet has TestService as a member field.

So it would be like:
@EJB
private TestService testService;

When the application is deployed, the EJB container that is in this post, OpenEJB instantiates the TestService EJB then tries to inject it into the TestService field in the servlet. However, if the TestService EJB has any problem so OpenEJB fails to instantiate it then the TestService EJB cannot be injected into the member field in the servlet.  So it also causes the problem in instantiation of the servlet.  Thus after all, you can get that error message saying &#039;Servlet is not bound in this Context&#039; yet the actual problem lies in the EJB.  That&#039;s why your servlet has no problem when you comment out the @EJB annotation.  Although the servlet is fine without the @EJB annotation, as you said, you don&#039;t have EJBs without it.  Therefore you need to check your EJBs to solve the problem. If the EJBs injected in the servlet use other EJBs then you should make sure all the EJBs have no problems.

For instance, let&#039;s assume that your stateless EJBs use a DAO which is also a stateless EJB and the DAO has the EntityManager field which is annotated with the @PersistenceContext annotation. When the application is deployed, the OpenEJB tries to inject the EntityManager object into the field.  In this step, if your persistence.xml has any problems or any other problems occur, the OpenEJB fails to inject EntityManager in the DAO and therefore, the DAO cannot be instantiated which consecutively causes the failures in the EJB injections of other EJBs which use the DAO.

So as I already mentioned, you need to carefully check the EJBs.
I hope it might help you.

Regards,
Kevin</description>
		<content:encoded><![CDATA[<p>Hello, mami</p>
<p>If you have an error like ‘Name MyServlet is not bound in this Context’, you normally need to check if the servlet is correctly set in the web.xml, the deployment descriptor.</p>
<p>Yet your case seems different. That error may also be caused by the failure in EJB injection if you use EJB. So the problem is not in the servlet yet in the EJB you try to inject in the servlet.</p>
<p>Let me explain with an example.</p>
<p>You have an EJB, named TestService and your servlet that is MyServlet has TestService as a member field.</p>
<p>So it would be like:<br />
@EJB<br />
private TestService testService;</p>
<p>When the application is deployed, the EJB container that is in this post, OpenEJB instantiates the TestService EJB then tries to inject it into the TestService field in the servlet. However, if the TestService EJB has any problem so OpenEJB fails to instantiate it then the TestService EJB cannot be injected into the member field in the servlet.  So it also causes the problem in instantiation of the servlet.  Thus after all, you can get that error message saying &#8216;Servlet is not bound in this Context&#8217; yet the actual problem lies in the EJB.  That&#8217;s why your servlet has no problem when you comment out the @EJB annotation.  Although the servlet is fine without the @EJB annotation, as you said, you don&#8217;t have EJBs without it.  Therefore you need to check your EJBs to solve the problem. If the EJBs injected in the servlet use other EJBs then you should make sure all the EJBs have no problems.</p>
<p>For instance, let&#8217;s assume that your stateless EJBs use a DAO which is also a stateless EJB and the DAO has the EntityManager field which is annotated with the @PersistenceContext annotation. When the application is deployed, the OpenEJB tries to inject the EntityManager object into the field.  In this step, if your persistence.xml has any problems or any other problems occur, the OpenEJB fails to inject EntityManager in the DAO and therefore, the DAO cannot be instantiated which consecutively causes the failures in the EJB injections of other EJBs which use the DAO.</p>
<p>So as I already mentioned, you need to carefully check the EJBs.<br />
I hope it might help you.</p>
<p>Regards,<br />
Kevin</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mami</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1455</link>
		<dc:creator>mami</dc:creator>
		<pubDate>Sat, 14 Nov 2009 09:50:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1455</guid>
		<description>If i comment: @EJB  like //@EJB and corresponding User code in my MyServlet everything works and I get dispatched to index.jsp but then I dont have an EJB application I guess :)</description>
		<content:encoded><![CDATA[<p>If i comment: @EJB  like //@EJB and corresponding User code in my MyServlet everything works and I get dispatched to index.jsp but then I dont have an EJB application I guess <img src='http://blog.lckymn.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mami</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1454</link>
		<dc:creator>mami</dc:creator>
		<pubDate>Sat, 14 Nov 2009 09:40:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1454</guid>
		<description>Some tags where erased so here is the post again....

Thanks for a good &quot;how-to&quot;!
I have followed your instructions but when I try to go to the Servlet I get this error : 
1) Error instantiating servlet class MyServlet
2) &#039;Name MyServlet is not bound in this Context&#039; 

where MyServlet is like your TestServlet in current example.... I realy cant figure it out and would be very glad if anyone could point me in right direction.

Thanks in advance!</description>
		<content:encoded><![CDATA[<p>Some tags where erased so here is the post again&#8230;.</p>
<p>Thanks for a good &#8220;how-to&#8221;!<br />
I have followed your instructions but when I try to go to the Servlet I get this error :<br />
1) Error instantiating servlet class MyServlet<br />
2) &#8216;Name MyServlet is not bound in this Context&#8217; </p>
<p>where MyServlet is like your TestServlet in current example&#8230;. I realy cant figure it out and would be very glad if anyone could point me in right direction.</p>
<p>Thanks in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mami</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1453</link>
		<dc:creator>mami</dc:creator>
		<pubDate>Sat, 14 Nov 2009 09:36:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1453</guid>
		<description>Thanks for a good &quot;how-to&quot;!
I have followed your instructions but when I try to go the Servlet I get this error : 
1) Error instantiating servlet class 
2) &#039;Name  is not bound in this Context&#039; 

where  is like your TestServlet in current example.... I realy cant figure it out and would be very glad if anyone could point me in right direction.

Thansk in advance!</description>
		<content:encoded><![CDATA[<p>Thanks for a good &#8220;how-to&#8221;!<br />
I have followed your instructions but when I try to go the Servlet I get this error :<br />
1) Error instantiating servlet class<br />
2) &#8216;Name  is not bound in this Context&#8217; </p>
<p>where  is like your TestServlet in current example&#8230;. I realy cant figure it out and would be very glad if anyone could point me in right direction.</p>
<p>Thansk in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Web Service Development using Tomcat and OpenEJB &#171; Kevin&#8217;s Life</title>
		<link>http://blog.lckymn.com/2009/10/17/java-ee-application-development-using-tomcat-openejb-and-hibernate/comment-page-1/#comment-1451</link>
		<dc:creator>Web Service Development using Tomcat and OpenEJB &#171; Kevin&#8217;s Life</dc:creator>
		<pubDate>Sun, 01 Nov 2009 05:42:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.lckymn.com/?p=380#comment-1451</guid>
		<description>[...] Java EE Application Development using Tomcat, OpenEJB and Hibernate [...]</description>
		<content:encoded><![CDATA[<p>[...] Java EE Application Development using Tomcat, OpenEJB and Hibernate [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

