[
https://issues.apache.org/jira/browse/DELTASPIKE-1182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15374526#comment-15374526
]
Adi Schwalb edited comment on DELTASPIKE-1182 at 7/13/16 8:01 AM:
------------------------------------------------------------------
No, that doesn't work. (Use jdk-8, standalone application)
The injected classes are loaded, somewhere, i have tested that, but injection
doesn't work.
So the classes must be loaded manually.
The Producer works correct. It seems, he is correct discovered.
The problem is also a bit complexer.
First i must give the cdi-container the injected class manually, e.g.
com.lib.MyHandler,with
MyHandler handlerClass = BeanProvider.getContextualReference(MyHandler.class);
then i must call
....addHandler(handlerClass, "/mywebcontext");
That does work correct, MyHandler.class injection point is filled correct.
Problem is, if i 'BeanProvider.getContextualReference...' cannot give it a
concrete class type, but only a loaded class from a third party library.
That doesn't work.
was (Author: adis):
No, that doesn't work. (Use jdk-8, standalone application)
The injected classes are loaded, somewhere, i have tested that, but injection
doesn't work.
So the classes must be loaded manually.
The Producer works correct. It seems, he is correct discovered.
The problem is also a bit complexer.
First i must give the cdi-container the injected class manually, e.g.
com.lib.MyHandler,with
MyHandler handlerClass = BeanProvider.getContextualReference(MyHandler.class);
then i must call
....addHandler(handlerClass, "/mywebcontext");
That does work correct, MyHandler.class injection point is filled correct.
Problem is, if BeanProvider.getContextualReference.... must use loaded classes.
That doesn't work.
> 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)