aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Hello world ejb3 problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Hello world ejb3 problem" Watch "Hello world ejb3 problem" New topic
Author

Hello world ejb3 problem

shabarish vai
Ranch Hand

Joined: May 26, 2008
Posts: 79
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

Joined: Jul 20, 2005
Posts: 9343
    
111

java.lang.NullPointerException
servlets.testSer.doGet(testSer.java:71)


You haven't posted your servlets.testSer servlet code.

[My Blog] [JavaRanch Journal]
shabarish vai
Ranch Hand

Joined: May 26, 2008
Posts: 79

please help
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

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
Posts: 79
am using Jboss 4.5 GA what excatly should be done to make this small program work
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9343
    
111

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

Joined: Sep 26, 2006
Posts: 9243
    
    1

Reading the EJB 3 specifications sometimes helps!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Change your container like the above post says!
Arun Rao
Ranch Hand

Joined: Jan 23, 2004
Posts: 41
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
Posts: 79
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

Joined: Sep 26, 2006
Posts: 9243
    
    1

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

Joined: May 26, 2008
Posts: 79
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
Posts: 916

Jaikiran

Please provide more information about the deployment process.


Regards,
Mihai


SCJP, SCJD, SCWCD, OCPJBCD
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9343
    
111

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

Joined: Jan 23, 2004
Posts: 41
Sorry my bad.. I dont know what i was smoking.. It is EJB 3.
shabarish vai
Ranch Hand

Joined: May 26, 2008
Posts: 79
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

Joined: Jul 20, 2005
Posts: 9343
    
111

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

Joined: May 26, 2008
Posts: 79
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
Posts: 784

@ shabarish
Try using NetBeans IDE 6.8


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Roman Mazur
Ranch Hand

Joined: Sep 02, 2008
Posts: 42
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, SCWCD J2EE 5 http://www.compcoding.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hello world ejb3 problem
 
Similar Threads
A tag can call its parent
Help : Servlet can not find EJB using DI in glassfish2
Problem with sessions: Always getting old session id.
ejb3 with javaee client helloworld
Getting java.io.FileNotFoundException:(The system cannot find the file specified) error