Weld 2.x is NOT to be executed with Java 9+.
Use Weld 3, please. Best use latest release of course (3.0.4.Final).
If you can share the test project on GH, that would be neat as well.
Then we could see how you use weld as auto module (as well as many other configurations)
and go from there.
As for starting SE container, you shouldn't manually call
`bootstrap.startContainer(Environments.SE, deployment);`
Please see the docs on how to bootstrap Weld in SE, you shouldn't need to deal with
any of the methods you listed below.
Here is a doc link -
http://docs.jboss.org/weld/reference/latest-master/en-US/html_single/#_bo...
Regards
Matej
----- Original Message -----
From: "Alex Sviridov" <ooo_saturn7(a)mail.ru>
To: "weld-dev" <weld-dev(a)lists.jboss.org>
Sent: Wednesday, May 16, 2018 1:51:20 PM
Subject: [weld-dev] Staring weld container for SE environment makes me load java ee
classes.
Hi all
I am trying to start weld container (2.3.5) as auto module in JPMS. This is
my code
Deployment deployment = new Deployment() {
@Override
public Collection<BeanDeploymentArchive> getBeanDeploymentArchives() {
List<BeanDeploymentArchive> list = new ArrayList<>();
list.add(archive);
return list;
}
@Override
public BeanDeploymentArchive loadBeanDeploymentArchive(Class<?> beanClass) {
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public ServiceRegistry getServices() {
SimpleServiceRegistry simpleServiceRegistry = new SimpleServiceRegistry();
simpleServiceRegistry.add(ResourceLoader.class, new ResourceLoaderImpl());
return simpleServiceRegistry;
}
@Override
public Iterable getExtensions() {
return new ArrayList<>();
}
};
bootstrap.startContainer(Environments.SE, deployment);
The problem is that in BeanDeployment constructor all services are loaded
here
https://github.com/weld/core/blob/d0019511ea776e9c35eab68c4d493c2df882a12...
and if I in my resource loader service return instead of all java-ee classes
null, I get null pointer exception, for example here
https://github.com/weld/core/blob/d0019511ea776e9c35eab68c4d493c2df882a12...
I can't understand why all these classes are requested from me, as I am in
SE. Or I am doing something wrong. Could anyone help me?
--
Best regards, Alex Sviridov
_______________________________________________
weld-dev mailing list
weld-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/weld-dev