Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004406 [Resin] major always 02-24-11 10:51 04-29-11 14:48
Reporter rickHigh View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version
Summary 0004406: Decorator from Weld Sample App does not work in CANDI
Description FloodingDecorator does not work from WELD pastbin example.
Additional Information Note that...


public interface CodeFragmentManager

FloodingDecorator decorates CodeFragmentManager which is a local interface (EJB @Local) not an actual implementation.

It seems to me that somehow our EJB engine is not recognizing the EJBs in this project as EJBs.

It could be that this sample app is non-standard wrt to EJB, but further investigation is in order.

After disabling the decorator, the app seems to run.

The exact error message is:

[23:54:59.328] {http://*:8080-2} [^] javax.enterprise.inject.InjectionException: DownloadServlet.codeFragmentManager: Exception while creating public org.jboss.weld.examples.pastecode.session.FloodingDecorator()

Here is the code for FloodingDecorator

package org.jboss.weld.examples.pastecode.session;


import javax.decorator.Decorator;

import javax.decorator.Delegate;

import javax.inject.Inject;

import org.jboss.weld.examples.pastecode.model.CodeFragment;


 * Prohibit posting more than 2 fragments a minute


 * @author Pete Muir




public abstract class FloodingDecorator implements CodeFragmentManager, Serializable


   private static final long serialVersionUID = -4615837206290420112L;

   @Inject @Delegate

   private CodeFragmentManager codeFragmentManager;



   private PostTracker postTracker;


   public String addCodeFragment(CodeFragment code, boolean privateFragment)


      // Check if we are allowed to post

      if (postTracker.isNewPostAllowed())



         return codeFragmentManager.addCodeFragment(code, privateFragment);




         throw new IllegalStateException("You've posted more than 2 fragments in the last 20s. No flooding allowed!");





Note that...


public interface CodeFragmentManager
Attached Files

- Relationships

- Notes
02-25-11 12:15

I was able to reproduce this

decorator ejb: decorate local ejb interface not impl.

I believe the issue is the fact they they are decorating the local interface instead of the impl.

Just a guess.

BTW I created a new category for this as well as I believe the issue is with EJB/CDI support.

  <section start="0i00" name="@Decorator">
    <section start="0i70" name="ejb"/>
03-03-11 15:51

The issue is the abstract Decorator - CanDI needs to build an extension class which implements the abstract methods.
04-29-11 14:48


- Issue History
Date Modified Username Field Change
02-24-11 10:51 rickHigh New Issue
02-24-11 10:52 rickHigh Severity minor => major
02-25-11 12:15 rickHigh Note Added: 0005084
03-03-11 15:51 ferg Note Added: 0005114
04-29-11 14:48 ferg Note Added: 0005223
04-29-11 14:48 ferg Assigned To  => ferg
04-29-11 14:48 ferg Status new => closed
04-29-11 14:48 ferg Resolution open => fixed
04-29-11 14:48 ferg Fixed in Version  => 4.0.18

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
33 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker