Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hello world ejb3 problem

 
shabarish vai
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
java.lang.NullPointerException
servlets.testSer.doGet(testSer.java:71)


You haven't posted your servlets.testSer servlet code.
 
shabarish vai
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

please help
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So your EJB seems not to be injected. To which container are you trying to deploy your app?
 
shabarish vai
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am using Jboss 4.5 GA what excatly should be done to make this small program work
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reading the EJB 3 specifications sometimes helps!
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Change your container like the above post says!
 
Arun Rao
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
shabarish vai
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no sir, i dont know about ejb2.1. please tell me what to do and how to proceed
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jaikiran

Please provide more information about the deployment process.


Regards,
Mihai
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Arun Rao
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry my bad.. I dont know what i was smoking.. It is EJB 3.
 
shabarish vai
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Jaikiran
am not not able to confugure netbeans with jboss 5,
it says please provide vlid jnoss server 4 or 5
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
shabarish vai
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 802
Java Linux
 
Roman Mazur
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic