Nevermind... I saw Jonathan's changes.
tkx,
Thiago.

On Wed, Mar 23, 2011 at 9:47 PM, Thiago Veronezi <thi...@veronezi.org>wrote:

> Hi Devs,
> It seems that the problem with the methods return type is fixed, but now we
> have a couple of new methods to implement on our "CdiPlugin.java". Please
> check if following changes are ok:
> * OpenEJBLifecycle.java: WebBeansContext.getInstance() is deprecated. Use
> WebBeansFinder.getSingletonInstance() instead.
> * CdiPlugin.java: implementing the new SecurityService methods (use the
> org.apache.webbeans.corespi.security.SimpleSecurityService impl as default
> implementation of these methods)
> * BeansDeployer.java: the ClassUtil.newInstance method has a new signature.
>
> ******************************************************************************************************************************************
>
> Index:
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
> ===================================================================
> ---
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
>  (revision
> 1080105)
> +++
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/CdiPlugin.java
>  (revision
> )
> @@ -28,6 +28,7 @@
>  import org.apache.webbeans.config.WebBeansContext;
>  import org.apache.webbeans.config.WebBeansFinder;
>  import org.apache.webbeans.container.InjectionResolver;
> +import org.apache.webbeans.corespi.security.SimpleSecurityService;
>  import org.apache.webbeans.ee.event.TransactionalEventNotifier;
>  import org.apache.webbeans.portable.events.discovery.BeforeShutdownImpl;
>  import org.apache.webbeans.spi.ResourceInjectionService;
> @@ -49,8 +50,14 @@
>  import javax.transaction.TransactionManager;
>  import javax.transaction.UserTransaction;
>  import java.lang.annotation.Annotation;
> +import java.lang.reflect.AccessibleObject;
> +import java.lang.reflect.Constructor;
> +import java.lang.reflect.Field;
> +import java.lang.reflect.Method;
>  import java.security.Principal;
> +import java.security.PrivilegedActionException;
>  import java.util.List;
> +import java.util.Properties;
>  import java.util.Set;
>  import java.util.WeakHashMap;
>
> @@ -61,6 +68,8 @@
>      private Set<Class<?>> beans;
>
>      private WebBeansContext webBeansContext;
> +    private SecurityService defaultImpl = new SimpleSecurityService();
> +
>      private CdiAppContextsService contexsServices;
>
>      @Override
> @@ -271,4 +280,65 @@
>
>          return null;
>      }
> +
> +    @Override
> +    public <T> Constructor<T> doPrivilegedGetDeclaredConstructor(Class<T>
> clazz, Class<?>... parameterTypes) {
> +        return defaultImpl.doPrivilegedGetDeclaredConstructor(clazz,
> parameterTypes);
> -}
> +    }
> +
> +    @Override
> +    public <T> Constructor<?>[]
> doPrivilegedGetDeclaredConstructors(Class<T> clazz) {
> +        return defaultImpl.doPrivilegedGetDeclaredConstructors(clazz);
> +    }
> +
> +    @Override
> +    public <T> Method doPrivilegedGetDeclaredMethod(Class<T> clazz, String
> name, Class<?>... parameterTypes) {
> +        return defaultImpl.doPrivilegedGetDeclaredMethod(clazz, name,
> parameterTypes);
> +    }
> +
> +    @Override
> +    public <T> Method[] doPrivilegedGetDeclaredMethods(Class<T> clazz) {
> +        return defaultImpl.doPrivilegedGetDeclaredMethods(clazz);
> +    }
> +
> +    @Override
> +    public <T> Field doPrivilegedGetDeclaredField(Class<T> clazz, String
> name) {
> +        return defaultImpl.doPrivilegedGetDeclaredField(clazz, name);
> +    }
> +
> +    @Override
> +    public <T> Field[] doPrivilegedGetDeclaredFields(Class<T> clazz) {
> +        return defaultImpl.doPrivilegedGetDeclaredFields(clazz);
> +    }
> +
> +    @Override
> +    public void doPrivilegedSetAccessible(AccessibleObject obj, boolean
> flag) {
> +        defaultImpl.doPrivilegedSetAccessible(obj, flag);
> +    }
> +
> +    @Override
> +    public boolean doPrivilegedIsAccessible(AccessibleObject obj) {
> +        return defaultImpl.doPrivilegedIsAccessible(obj);
> +    }
> +
> +    @Override
> +    public <T> T doPrivilegedObjectCreate(Class<T> clazz) throws
> PrivilegedActionException, IllegalAccessException, InstantiationException {
> +        return defaultImpl.doPrivilegedObjectCreate(clazz);
> +    }
> +
> +    @Override
> +    public void doPrivilegedSetSystemProperty(String propertyName, String
> value) {
> +        defaultImpl.doPrivilegedSetSystemProperty(propertyName, value);
> +    }
> +
> +    @Override
> +    public String doPrivilegedGetSystemProperty(String propertyName,
> String defaultValue) {
> +        return defaultImpl.doPrivilegedGetSystemProperty(propertyName,
> defaultValue);
> +    }
> +
> +    @Override
> +    public Properties doPrivilegedGetSystemProperties() {
> +        return defaultImpl.doPrivilegedGetSystemProperties();
> +    }
> +
> +}
> Index:
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java
> ===================================================================
> ---
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java
>  (revision
> 1080105)
> +++
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/OpenEJBLifecycle.java
>  (revision
> )
> @@ -86,7 +86,7 @@
>      {
>          beforeInitApplication(properties);
>
> -        webBeansContext = WebBeansContext.getInstance();
> +        webBeansContext = WebBeansFinder.getSingletonInstance();
>          this.beanManager = webBeansContext.getBeanManagerImpl();
>          this.xmlDeployer = new WebBeansXMLConfigurator();
>          this.deployer = new BeansDeployer(this.xmlDeployer,
> webBeansContext);
> Index:
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
> ===================================================================
> ---
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
>  (revision
> 1080889)
> +++
> openejb3/container/openejb-core/src/main/java/org/apache/openejb/cdi/BeansDeployer.java
>  (revision
> )
> @@ -133,7 +133,7 @@
>
>          Class<?> beanClass = ClassUtil.getClassFromName(className);
>          if (beanClass != null) {
> -            bean = (Bean) ClassUtil.newInstance(beanClass);
> +            bean = (Bean) ClassUtil.newInstance(webBeansContext,
> beanClass);
>          }
>
>          if (bean != null) {
> @@ -240,16 +240,17 @@
>
>
>                  if (bean instanceof InjectionTargetBean) {
> +                    DefinitionUtil dutil = new
> DefinitionUtil(webBeansContext);
>                      //Decorators not applied to
> interceptors/decorators/@NewBean
>                      if (!(bean instanceof Decorator) &&
>                              !(bean instanceof
> javax.enterprise.inject.spi.Interceptor) &&
>                              !(bean instanceof NewBean)) {
> -
>  DefinitionUtil.defineDecoratorStack((AbstractInjectionTargetBean<Object>)
> bean);
> +
>  dutil.defineDecoratorStack((AbstractInjectionTargetBean<Object>) bean);
>                      }
>
>                      //If intercepted marker
>                      if (bean instanceof InterceptedMarker) {
> -
>  
> DefinitionUtil.defineBeanInterceptorStack((AbstractInjectionTargetBean<Object>)
> bean);
> +
>  dutil.defineBeanInterceptorStack((AbstractInjectionTargetBean<Object>)
> bean);
>                      }
>                  }
>
>
>
>
>
> *******************************************************************************************************************************
> []s,
> Thiago.
>
> ---------- Forwarded message ----------
> From: Jean-Louis MONTEIRO <jeano...@gmail.com>
> Date: Wed, Mar 23, 2011 at 10:16 AM
> Subject: Re: org.apache.openejb.OpenEJBException: Creating application
> failed (....target/classpath.ea)
> To: us...@openejb.apache.org
>
>
> No worries.
>
> @Thiago, if you can dig into, that'd be great but get in touch with David
> and Mark.
> There have been discussion (also in Geronimo) regarding that problem.
>
> Jean-Louis
>
> 2011/3/23 Viggo Navarsete <viggo.navars...@gmail.com>
>
> > Hi Thiago,
> >
> > I created an issue for this:)
> >
> > And I've already got input, which makes it unnecessary for you to do
> > anything but wait:)..https://issues.apache.org/jira/browse/OPENEJB-1450
> > <https://issues.apache.org/jira/browse/OPENEJB-1450>
> >
> > On Wed, Mar 23, 2011 at 12:58 PM, Thiago Veronezi <thi...@veronezi.org
> > >wrote:
> >
> > > Hi,
> > > I've got the same problem yesterday. I saw the openwebbeans code this
> > > morning and I saw that this method return type has been changed from
> > "Set"
> > > to "List" atfer the revision 1080727 (
> > > http://svn.apache.org/viewvc?view=revision&revision=1080727).
> > >
> > > Ill investigate how to fix it on our side latter this evening. Please
> let
> > > me
> > > know if you have any luck before that.
> > > thanks,
> > > Thiago.
> > >
> > > On Tue, Mar 22, 2011 at 9:06 AM, Viggo Navarsete
> > > <viggo.navars...@gmail.com>wrote:
> > >
> > > > HI,
> > > >
> > > > I've had some tests running OpenEJB 3.2-SNAPSHOT which has worked for
> a
> > > > while, but suddenly they start to fail with a stacktrace like this:
> > > >
> > > > Running com.tracetracker.mds.adm.business.MasterDataQueryBeanTest
> > > > Mar 22, 2011 3:01:37 PM org.apache.openejb.cdi.CdiBuilder
> initializeOWB
> > > > INFO: Created new singletonService
> > > > org.apache.openejb.cdi.ThreadSingletonServiceImpl@1b64e6a
> > > > Mar 22, 2011 3:01:37 PM org.apache.openejb.cdi.CdiBuilder
> initializeOWB
> > > > INFO: succeeded in installing singleton service
> > > > Apache OpenEJB 3.2-SNAPSHOT    build: 20110317-07:11
> > > > http://openejb.apache.org/
> > > > Mar 22, 2011 3:01:41 PM org.apache.openejb.cdi.CdiBuilder build
> > > > INFO: existing thread singleton service in SystemInstance()
> > > > org.apache.openejb.cdi.ThreadSingletonServiceImpl@1b64e6a
> > > > Mar 22, 2011 3:01:41 PM org.apache.openejb.cdi.OpenEJBLifecycle
> > > > startApplication
> > > > INFO: OpenWebBeans Container is starting...
> > > > Mar 22, 2011 3:01:41 PM org.apache.webbeans.plugins.PluginLoader
> > startUp
> > > > INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
> > > > ERROR - Application could not be deployed:
> > > >
> > > >
> > >
> >
>  
> /home/viggo/workspace/MDS_TRUNK_JBOSS_6/mds-main/mds-biz-ejb/target/classpath.ear
> > > > org.apache.openejb.OpenEJBException: Creating application failed:
> > > >
> > > >
> > >
> >
> /home/viggo/workspace/MDS_TRUNK_JBOSS_6/mds-main/mds-biz-ejb/target/classpath.ear:
> > > >
> > > >
> > >
> >
> org.apache.webbeans.container.BeanManagerImpl.getInterceptors()Ljava/util/Set;
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:753)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:462)
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.buildContainerSystem(Assembler.java:372)
> > > > at
> > >
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:284)
> > > >  at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:130)
> > > > at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:63)
> > > >  at org.apache.openejb.OpenEJB.init(OpenEJB.java:276)
> > > > at org.apache.openejb.OpenEJB.init(OpenEJB.java:255)
> > > >  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > > at
> > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > > >  at
> > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > > > at java.lang.reflect.Method.invoke(Method.java:597)
> > > >  at
> > > org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
> > > >  at
> > > >
> > javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
> > > > at
> > javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
> > > >  at javax.naming.InitialContext.init(InitialContext.java:223)
> > > > at javax.naming.InitialContext.<init>(InitialContext.java:197)
> > > >  at
> > > >
> > > >
> > >
> >
> com.tracetracker.mds.adm.business.MasterDataQueryBeanTest.setUp(MasterDataQueryBeanTest.java:68)
> > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >  at
> > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > > > at
> > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > > >  at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at
> > > >
> > > >
> > >
> >
> org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> > > >  at
> > > >
> > > >
> > >
> >
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> > > > at
> > > >
> > > >
> > >
> >
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> > > >  at
> > > >
> > > >
> > >
> >
> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> > > > at
> > > >
> > >
> >
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
> > > >  at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:59)
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:140)
> > > >  at org.apache.maven.surefire.Surefire.run(Surefire.java:109)
> > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > > >  at
> > > >
> > > >
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > > > at
> > > >
> > > >
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > > >  at java.lang.reflect.Method.invoke(Method.java:597)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1017)
> > > > Caused by: java.lang.NoSuchMethodError:
> > > >
> > > >
> > >
> >
> org.apache.webbeans.container.BeanManagerImpl.getInterceptors()Ljava/util/Set;
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.openejb.cdi.BeansDeployer.validateInjectionPoints(BeansDeployer.java:204)
> > > > at
> > > >
> > > >
> > >
> >
> org.apache.openejb.cdi.OpenEJBLifecycle.startApplication(OpenEJBLifecycle.java:210)
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.openejb.cdi.ThreadSingletonServiceImpl.initialize(ThreadSingletonServiceImpl.java:52)
> > > > at org.apache.openejb.cdi.CdiBuilder.build(CdiBuilder.java:46)
> > > >  at
> > > >
> > > >
> > >
> >
> org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:650)
> > > > ... 40 more
> > > > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.524
> > sec
> > > > <<< FAILURE!
> > > >
> > > >
> > > > Any clue why?
> > > >
> > >
> >
>
>

Reply via email to