[weld-dev] Staring weld container for SE environment makes me load java ee classes.

Alex Sviridov ooo_saturn7 at mail.ru
Wed May 16 07:51:20 EDT 2018


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/d0019511ea776e9c35eab68c4d493c2df882a121/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployment.java#L117 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/d0019511ea776e9c35eab68c4d493c2df882a121/impl/src/main/java/org/jboss/weld/ejb/EJBApiAbstraction.java#L44

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20180516/449ef1e6/attachment.html 


More information about the weld-dev mailing list