wood burning stoves 2.0*
The moose likes JSF and the fly likes @EJB Annotation with Tomcat and JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "@EJB Annotation with Tomcat and JBoss" Watch "@EJB Annotation with Tomcat and JBoss" New topic
Author

@EJB Annotation with Tomcat and JBoss

hal arres
Ranch Hand

Joined: Jan 10, 2003
Posts: 30
Hi all,

I want to migrate an JSF application to JSF2.
The application is running on a Tomcat 6.0.18 and the backend on a JBoss 4.2.2.GA.

My problem is that I want to use inside the ManagedBeans the "@EJB" Annotation, but it won't work.
Maybe someone of you could help me with this problem

I am using the following artefacts:
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>jboss</groupId>
<artifactId>jbossall-client</artifactId>
<version>4.2.2.GA</version>
</dependency>

This is my first ManagedBean:


And this is the context.xml:


But as soon as I try to access the RemoteBean I get a NullPointerException.

It would be very nice if someone of you could help me to fix my problem.

All the best,
arres
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9243
    
    1

Good that you use the artifacts, but who will provide the implementation for the @EJB annotation? It should be a container that implements the specification and @EJB belongs to the EJB 3.0 specification and JBoss AS 4.2.2.GA does not support EJB 3. Try using JBoss 5.x.x AS.


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!
hal arres
Ranch Hand

Joined: Jan 10, 2003
Posts: 30
Hi Jothi,

thanks for your fast answer.
Luckily I have a JBoss 5.1.0.GA installed, but using this AS I get the same behaviour as in the 4.2.2.GA.

In the Tomcat I switched to the follwoing artefact:
<dependency>
<groupId>org.jboss.client</groupId>
<artifactId>jbossall-client</artifactId>
<version>5.0.0.GA</version>
</dependency>

But I still get a NullPointerException
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @EJB Annotation with Tomcat and JBoss
 
Similar Threads
java.lang.NoClassDefFoundError: oracle/toplink/essentials/ejb/cmp3/EntityManagerFactoryProvider
Incorrect hibernate version or maven ignore and didn't download hibernate jar file.
Horrendous EL problem
Could not resolve dependencies for maven project
rich:tree working now... all the work has finally paid off - THANKS