• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

@EJB Annotation with Tomcat and JBoss

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
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
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.
 
hal arres
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic