Author
Hello world ejb3 problem
shabarish vai
Ranch Hand
Joined: May 26, 2008
Messages: 67
posted Jan 28, 2010 10:01:01
please help,
index.jsp
am getting
java.lang.NullPointerException
servlets.testSer.doGet(testSer.java:71)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
my project name in netbeans are
ejbPro is ear file
ejbPro-ejb Executable jar file
ejbPro-war
This message was edited 1 time. Last update was at Jan 29, 2010 04:23:33 by Christophe Verré
Jaikiran Pai
Bartender
Joined: Jul 20, 2005
Messages: 4693
posted Jan 29, 2010 23:44:35
You haven't posted your servlets.testSer servlet code.
My Blog
shabarish vai
Ranch Hand
Joined: May 26, 2008
Messages: 67
posted Jan 30, 2010 02:37:00
please help
Jothi Shankar Kumar
Ranch Hand
Joined: Sep 26, 2006
Messages: 7101
posted Jan 31, 2010 07:03:01
So your EJB seems not to be injected. To which container are you trying to deploy your app?
SCJP 1.4, SCWCD 1.4 - Hints for you , SCBCD Hints - Demnachst , SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
shabarish vai
Ranch Hand
Joined: May 26, 2008
Messages: 67
posted Jan 31, 2010 09:55:29
am using Jboss 4.5 GA what excatly should be done to make this small program work
Jaikiran Pai
Bartender
Joined: Jul 20, 2005
Messages: 4693
posted Jan 31, 2010 10:45:02
There's no JBoss AS 4.5 GA. Anyway, the 4.x version of JBoss AS did not have complete support for EJB3, especially for injection of beans in servlets. So you might want to try JBoss AS 5.1.0 version.
My Blog
Jothi Shankar Kumar
Ranch Hand
Joined: Sep 26, 2006
Messages: 7101
posted Jan 31, 2010 10:51:12
Reading the EJB 3 specifications sometimes helps!
SCJP 1.4, SCWCD 1.4 - Hints for you , SCBCD Hints - Demnachst , SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Jothi Shankar Kumar
Ranch Hand
Joined: Sep 26, 2006
Messages: 7101
posted Jan 31, 2010 10:51:57
Change your container like the above post says!
SCJP 1.4, SCWCD 1.4 - Hints for you , SCBCD Hints - Demnachst , SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Arun Rao
Ranch Hand
Joined: Jan 23, 2004
Messages: 40
posted Jan 31, 2010 19:51:20
Your Stateless SB is still as per EJB 2.1 spec. To get this to work, you will have to inject the Home interface of the EJB into the servlet code and then access the local/remote interface of the bean that way.
shabarish vai
Ranch Hand
Joined: May 26, 2008
Messages: 67
posted Jan 31, 2010 21:04:45
oh! how is it ejb2.1? !!!! can you please see the below link hello world ejb3
i refered the above link i have done the same thing as he has done, can you correct me if am wrong?
Jothi Shankar Kumar
Ranch Hand
Joined: Sep 26, 2006
Messages: 7101
posted Feb 01, 2010 01:53:12
Arun Rao wrote: Your Stateless SB is still as per EJB 2.1 spec. To get this to work, you will have to inject the Home interface of the EJB into the servlet code and then access the local/remote interface of the bean that way.
Are you aware of how a Session bean is declared as per EJB 2.1 specification?
SCJP 1.4, SCWCD 1.4 - Hints for you , SCBCD Hints - Demnachst , SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
shabarish vai
Ranch Hand
Joined: May 26, 2008
Messages: 67
posted Feb 01, 2010 03:15:49
no sir, i dont know about ejb2.1. please tell me what to do and how to proceed
Mihai Radulescu
Ranch Hand
Joined: Sep 18, 2003
Messages: 894
posted Feb 01, 2010 04:10:11
Jaikiran
Please provide more information about the deployment process.
Regards,
Mihai
SCJP, SCJD, SCWCD
Jaikiran Pai
Bartender
Joined: Jul 20, 2005
Messages: 4693
posted Feb 01, 2010 05:05:52
Mihai Radulescu wrote: Jaikiran
Please provide more information about the deployment process.
You mean, the process to deploy EJB3 applications on JBoss AS-5? These are the EJB3 tutorials for JBoss AS-5 . Let us know, if you are looking for something else.
shabarish vai wrote: please tell me what to do and how to proceed
Please read my earlier reply about using JBoss AS-5. Your first step, should be to download JBoss AS 5.1.0.
Arun Rao wrote: Your Stateless SB is still as per EJB 2.1 spec
Actually, that's not true. The code that shabarish posted is EJB3.0.
My Blog
Arun Rao
Ranch Hand
Joined: Jan 23, 2004
Messages: 40
posted Feb 01, 2010 06:58:56
Sorry my bad.. I dont know what i was smoking.. It is EJB 3.
shabarish vai
Ranch Hand
Joined: May 26, 2008
Messages: 67
posted Feb 01, 2010 10:07:00
hi Jaikiran
am not not able to confugure netbeans with jboss 5,
it says please provide vlid jnoss server 4 or 5
Jaikiran Pai
Bartender
Joined: Jul 20, 2005
Messages: 4693
posted Feb 02, 2010 00:23:05
shabarish vai wrote:
am not not able to confugure netbeans with jboss 5,
it says please provide vlid jnoss server 4 or 5
I'm sorry, i don't use any IDEs for integrating with JBoss AS. So i won't be able to help much on that part. Someone else who knows better might help.
My Blog
shabarish vai
Ranch Hand
Joined: May 26, 2008
Messages: 67
posted Feb 02, 2010 00:29:23
i found there is bug in netbeans and some people have reported ,this is what i read from some forums, can you please tell me how to run this program?
Ninad Kulkarni
Ranch Hand
Joined: Aug 31, 2007
Messages: 651
posted Feb 02, 2010 03:34:42
@ shabarish
Try using NetBeans IDE 6.8
SCJP 5.0 97% JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - API - Generics FAQ - JLS - JVM Spec - Java FAQs
Roman Mazur
Greenhorn
Joined: Sep 02, 2008
Messages: 11
posted Feb 02, 2010 06:42:00
Hi,
I just run the code on GlassFish v3 using NetBeans 6.8
I had to remove "static" modifier from " private static localStatelessLocal local;"
With the "static" modifier I got an error:
Regards,
SCJP 6, Hunting SCWCD http://www.compcoding.com/