[
https://issues.apache.org/jira/browse/DELTASPIKE-1182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15374598#comment-15374598
]
Gerhard Petracek commented on DELTASPIKE-1182:
----------------------------------------------
as per cdi-specification, you need to provide all classes which might end up as
cdi-beans, during the container-start.
producers are a bit special, because the producer field/method provides all
meta-data for the cdi-container and therefore the produced result can be
dynamic.
however, the cdi-container needs to find the producer itself during the
container-start.
afterwards you can just use manual injection. that means you create an instance
of an unmanaged/dynamic class manually and pass it to BeanProvider#injectFields
which returns the instance with filled injection-points. that means only
@Inject is supported (there is no context-management, no interceptors,...).
however, it just works if the cdi-container "knows" the injection-points.
> 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)