tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: Unknown error in Assembler: AppListener could not be found
Date Mon, 28 Jan 2013 12:27:11 GMT
some events are sent before the classloader of the app exists (because you
can modify it for instance) so you have to put the listener in the
common.loader (or shared.loader)

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/1/28 wami <wamrep99@googlemail.com>

> Sorry, the mail had the same subject but is not referred to the previous
> thread.
>
> I took the example from the example-page "server-event" as folllows:
>
> package org.superbiz.event;
>
> import org.apache.openejb.observer.Observes;
>
> import java.util.logging.Logger;
>
> /**
>  * registered as service in openejb.xml, tomee.xml, resources.xml or
> openejb
> system properties:
>  *
>  * listener = new://Service?class-name=org.superbiz.event.MyListener
>  * listener.logAllEvent = true
>  */
> public class MyListener {
>     private static final Logger LOGGER =
> Logger.getLogger(MyListener.class.getName());
>
>     private static boolean logAllEvent = false; // static for testing
>
>     public void global(@Observes final Object event) {
>         LOGGER.info(">>> an event occured -> " + event.toString());
>     }
>
>     // configurable
>     public void setLogAllEvent(boolean logAllEvent) {
>         this.logAllEvent = logAllEvent;
>     }
>
>     public static boolean isLogAllEvent() {
>         return logAllEvent;
>     }
> }
>
> Configuration is done by a line in resources.xml:
> <Service id"myapplistener" class-name="org.superbiz.event.MyListener" />
>
> but it is not recognized.
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Unknown-error-in-Assembler-AppListener-could-not-be-found-tp4660431p4660437.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message