You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Adi Schwalb (JIRA)" <ji...@apache.org> on 2016/07/13 05:56:20 UTC

[jira] [Commented] (DELTASPIKE-1182) BeanProvider.getContextualReference

    [ https://issues.apache.org/jira/browse/DELTASPIKE-1182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15374403#comment-15374403 ] 

Adi Schwalb commented on DELTASPIKE-1182:
-----------------------------------------

In my enviromnet (jdk 8, standalone application) automatic loading doesn't work.
I start the Container with

CdiContainer cdiContainer 	= CdiContainerLoader.getCdiContainer();
cdiContainer.boot();
ContextControl contextControl  = cdiContainer.getContextControl();
contextControl.startContext(ApplicationScoped.class);

Now i must explizit loading the classes.
E.G.
BeanProvider.getContextualReference(EntityManagerProducer.class);
(EntityManagerProducer ist annotated with ApplicationScoped)

Then the problem is, loading the classes explizit,
BeanProvider.getContextualReference  does not work with
anonymous classes.


An annotation e.g. 

> BeanProvider.getContextualReference
> -----------------------------------
>
>                 Key: DELTASPIKE-1182
>                 URL: https://issues.apache.org/jira/browse/DELTASPIKE-1182
>             Project: DeltaSpike
>          Issue Type: Bug
>          Components: Examples
>    Affects Versions: 1.7.0
>         Environment: JDK 8, Windows 7 
>            Reporter: Adi Schwalb
>            Priority: Minor
>
> Hello
> I must load classes dynamically.
> (A client deploys its database servlets to the server.)
> On server i can make concrete datatypes, so that 
> integration with  BeanProvider.getContextualReference ... 
> works good. But with dynamic classes i can't do 
> E.G. 
> Class c	= classLoader.loadClass(classPath);  
> BeanProvider.getContextualReference( c );
> always fails with:
> java.lang.IllegalStateException: Could not find beans for Type=class .....
> Is this a bug, or have i overseen something?
> How is it possible the deployed database servlets to integrate? 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)