• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hello world ejb3 problem

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

please help
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
am using Jboss 4.5 GA what excatly should be done to make this small program work
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Reading the EJB 3 specifications sometimes helps!
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Change your container like the above post says!
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no sir, i dont know about ejb2.1. please tell me what to do and how to proceed
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jaikiran

Please provide more information about the deployment process.


Regards,
Mihai
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 814
Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ shabarish
Try using NetBeans IDE 6.8
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic