# Implementing an EJB3 Interceptor without touching the projec



## Haensel (12. Apr 2007)

Hello, 

my name is Hans-Martin and I am a student at the university of Regensburg, Germany. 
I have to hold a lab about EJB3 on JBoss with interceptors. Now I read for about 2 days just to check out how to implement an ejb3 interceptor without touching the project with the business objects (stateless session beans) itself. 
By that annotations are no options...or deployment descriptors (ejb-jar.xml), because I have to add them to the project I want to check with my interceptor. 

I already worked with ejb2 interceptors, but implementing them was just a piece of cake. 
Add you interceptor in the standardjboss.xml file and everything is fine. You don´t have to touch other projects. 

But HOW is this possible with EJB3 interceptors ? I added my interceptor to the ejb3-interceptors-aop.xml. 
Then I got a ClassDefNotFound Exception at the jboss startup. So I added the jar file with my interceptor to the jboss lib (which can´t be the right way anyway). After that I got a ClassCastException on jboss startup. 
But I don´t get the classdefnotfound/classcastexception if I change the scope entry of my interceptor from ?PER_CLASS?/?PER_VM? to ?PER_INSTANCE? within the xml file. 

But then the interceptor does not trigger. 

I have absolutely no more ideas how to implement ejb3 interceptors without touching the projects which shall be wrapped by the interceptors. 

Do you have any ideas ? Or perhaps know a good tutorial or something like this ? I would be more than happy !!!! 


Greetings from Germany, 


Hans 

P.s. I am using Jboss 4.0.5 with JbossIde 2.0.0b. , jre:1.5.0_11, JDK: 1.5.0_09


----------



## Wildcard (12. Apr 2007)

Haensel hat gesagt.:
			
		

> Greetings from Germany


You do know that you're actually on a german board, don't you?  ???:L


----------



## Haensel (12. Apr 2007)

hehehe, ja.
Aber ích weiß ja net, ob nicht vielleicht auch englischsprachige Leute hier sind ;-)


----------



## bronks (12. Apr 2007)

Wildcard hat gesagt.:
			
		

> Haensel hat gesagt.:
> 
> 
> 
> ...


Wenn man eine Suchmaschine frägt, dann wird sie einem verraten, wo der Hans weltweit diesen Post schon überall hinterlassen hat.


----------



## Haensel (12. Apr 2007)

Das ist ja das Problem. Bis jetzt hat weltweit noch KEINER diese Frage beantworten können. Und so schwer kann es ja wohl net sein, da es mit EJB2 ja mal ÜBERHAUPT kein Problem darstellt. Nur mit dem ach so tollen EJB3 anscheinend schon...


----------

