<HTML><BODY>Thank you for your answer. <br><br>Could anyone give any suggestion about the following?<br><br>I have my named module and weld-se-shaded as unnamed module.<br>In my module I have<br><br>module my.module {<br>&nbsp;&nbsp;&nbsp; requires weld.se.shaded;<br>&nbsp;&nbsp;&nbsp; exports com.foo;<br>}<br><br>#################################<br>package com.foo;<br><br>import javax.enterprise.context.ApplicationScoped;<br>import javax.inject.Inject;<br><br>@ApplicationScoped<br>public class NewClass {<br><br>&nbsp;&nbsp;&nbsp; @Inject<br>&nbsp;&nbsp;&nbsp; private NewBean bean;<br><br>&nbsp;&nbsp;&nbsp; public void doIt() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bean.doIt();<br>&nbsp;&nbsp;&nbsp; }<br><br>}<br><br>#################################<br>package com.foo;<br><br>import javax.enterprise.context.Dependent;<br><br>@Dependent<br>public class NewBean {<br><br>&nbsp;&nbsp;&nbsp; public void doIt() {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("I am doing it);<br>&nbsp;&nbsp;&nbsp; }<br>}<br><br>And this is the result<br><br>Sep 18, 2017 2:33:12 PM org.jboss.weld.bootstrap.WeldStartup &lt;clinit&gt;<br>INFO: WELD-000900: 3.0.2 (2017-09-18 08:49)<br>Sep 18, 2017 2:33:12 PM org.jboss.weld.environment.deployment.discovery.ReflectionDiscoveryStrategy processAnnotatedDiscovery<br>INFO: WELD-ENV-000014: Falling back to Java Reflection for bean-discovery-mode="annotated" discovery. Add org.jboss:jandex to the classpath to speed-up startup.<br>Sep 18, 2017 2:33:12 PM org.jboss.weld.bootstrap.WeldStartup startContainer<br>INFO: WELD-000101: Transactional services not available. Injection of @Inject UserTransaction not available. Transactional observers will be invoked synchronously.<br>Exception in thread "main" java.lang.reflect.InaccessibleObjectException<br>&nbsp;&nbsp; &nbsp;at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)<br>&nbsp;&nbsp; &nbsp;at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)<br>&nbsp;&nbsp; &nbsp;at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)<br>&nbsp;&nbsp; &nbsp;at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488)<br>&nbsp;&nbsp; &nbsp;at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:590)<br>&nbsp;&nbsp; &nbsp;at java.base/java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:996)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.executor.AbstractExecutorServices.checkForExceptions(AbstractExecutorServices.java:72)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:58)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.executor.AbstractExecutorServices.invokeAllAndCheckForExceptions(AbstractExecutorServices.java:66)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.ConcurrentBeanDeployer.createClassBeans(ConcurrentBeanDeployer.java:65)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:256)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.WeldStartup.deployBeans(WeldStartup.java:422)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:83)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.environment.se.Weld.initialize(Weld.java:789)<br>&nbsp;&nbsp; &nbsp;at my.module/com.foo.NewMain.main(NewMain.java:47)<br>Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private com.foo.NewBean com.foo.NewClass.bean accessible: module my.module does not "opens com.foo" to module weld.se.shaded<br>&nbsp;&nbsp; &nbsp;at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)<br>&nbsp;&nbsp; &nbsp;at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)<br>&nbsp;&nbsp; &nbsp;at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:176)<br>&nbsp;&nbsp; &nbsp;at java.base/java.lang.reflect.Field.setAccessible(Field.java:170)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.security.GetAccessibleCopyOfMember.of(GetAccessibleCopyOfMember.java:38)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.security.GetAccessibleCopyOfMember.run(GetAccessibleCopyOfMember.java:44)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.security.GetAccessibleCopyOfMember.run(GetAccessibleCopyOfMember.java:26)<br>&nbsp;&nbsp; &nbsp;at java.base/java.security.AccessController.doPrivileged(Native Method)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.FieldInjectionPoint.&lt;init&gt;(FieldInjectionPoint.java:65)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.InjectionPointFactory.createFieldInjectionPoint(InjectionPointFactory.java:141)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.InjectionPointFactory.addFieldInjectionPoint(InjectionPointFactory.java:226)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.InjectionPointFactory.getFieldInjectionPoints(InjectionPointFactory.java:211)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.producer.DefaultInjector.&lt;init&gt;(DefaultInjector.java:56)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.producer.ResourceInjector.&lt;init&gt;(ResourceInjector.java:57)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.producer.ResourceInjector.of(ResourceInjector.java:48)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.producer.BeanInjectionTarget.&lt;init&gt;(BeanInjectionTarget.java:63)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.injection.producer.BeanInjectionTarget.createDefault(BeanInjectionTarget.java:47)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.manager.InjectionTargetFactoryImpl.chooseInjectionTarget(InjectionTargetFactoryImpl.java:139)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:88)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bean.ManagedBean.&lt;init&gt;(ManagedBean.java:100)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bean.ManagedBean.of(ManagedBean.java:80)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.AbstractBeanDeployer.createManagedBean(AbstractBeanDeployer.java:280)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:221)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:68)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:65)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:62)<br>&nbsp;&nbsp; &nbsp;at weld.se.shaded@3.0.2-SNAPSHOT/org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:55)<br>&nbsp;&nbsp; &nbsp;at java.base/java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1431)<br>&nbsp;&nbsp; &nbsp;at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:283)<br>&nbsp;&nbsp; &nbsp;at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1603)<br>&nbsp;&nbsp; &nbsp;at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175)<br><br><br><br><br><br><blockquote style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">
        Понедельник, 18 сентября 2017, 14:18 +03:00 от Matej Novotny &lt;manovotn@redhat.com&gt;:<br>
        <br>
        <div id="">






















        












<div class="js-helper js-readmsg-msg">
        <style type="text/css"></style>
         <div>
                <base target="_self" href="https://e.mail.ru/">
                
            <div id="style_15057335130000000279_BODY">Hi,<br>
<br>
if you are in SE, you should only need 'weld-se-shaded' artifact (as a JAR).<br>
As it is "shaded", it brings along all the other parts of Weld you might need.<br>
<br>
Matej<br>
<br>
<br>
----- Original Message -----<br>
&gt; From: "Alex Sviridov" &lt;<a href="mailto:ooo_saturn7@mail.ru">ooo_saturn7@mail.ru</a>&gt;<br>
&gt; To: "weld-dev" &lt;<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a>&gt;<br>
&gt; Sent: Monday, September 18, 2017 12:17:28 PM<br>
&gt; Subject: Re: [weld-dev] Weld and Java 9 JPMS<br>
&gt; <br>
&gt; Hi Matej<br>
&gt; <br>
&gt; I am just trying to make Weld work in Java 9 (JavaSE + JPMS).<br>
&gt; <br>
&gt; I use the following jars as automatic modules:<br>
&gt; <br>
&gt; weld-environment-common-3.0.2-SNAPSHOT.jar<br>
&gt; weld-se-core-3.0.2-SNAPSHOT.jar<br>
&gt; weld-se-shaded-3.0.2-SNAPSHOT.jar<br>
&gt; weld-spi-3.0.SP1.jar<br>
&gt; weld-core-impl-3.0.2-SNAPSHOT.jar<br>
&gt; <br>
&gt; Is this right configuration? Or should I add/remove something.<br>
&gt; <br>
&gt; Best regards, Alex<br>
&gt; <br>
&gt; <br>
&gt; <br>
&gt; Понедельник, 18 сентября 2017, 12:41 +03:00 от Matej Novotny<br>
&gt; &lt;<a href="mailto:manovotn@redhat.com">manovotn@redhat.com</a>&gt;:<br>
&gt; <br>
&gt; Uhm, is there anything blocking you from placing it where you would in Java<br>
&gt; 8?<br>
&gt; E.g. src/main/resources/META-INF?<br>
&gt; <br>
&gt; I don't think I have tried this combination (or I do not recall).<br>
&gt; From the top of my head I don't know any JDK 9 limitation which would forbid<br>
&gt; to use XML descriptors in this way.<br>
&gt; I might be a bit rusty though; been a while since I played with Java 9.<br>
&gt; <br>
&gt; Please do report back with how this works for you :)<br>
&gt; Matej<br>
&gt; <br>
&gt; ----- Original Message -----<br>
&gt; &gt; From: "Alex Sviridov" &lt; <a href="mailto:ooo_saturn7@mail.ru">ooo_saturn7@mail.ru</a> &gt;<br>
&gt; &gt; To: "Matej Novotny" &lt; <a href="mailto:manovotn@redhat.com">manovotn@redhat.com</a> &gt;<br>
&gt; &gt; Sent: Monday, September 18, 2017 10:28:11 AM<br>
&gt; &gt; Subject: Re[2]: [weld-dev] Weld and Java 9 JPMS<br>
&gt; &gt; <br>
&gt; &gt; Thank you for your answer. I will try. But where should I place beans.xml<br>
&gt; &gt; to make Weld read it if I use Java SE+ JPMS?<br>
&gt; &gt; <br>
&gt; &gt; Best regards, Alex<br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; &gt;Понедельник, 18 сентября 2017, 8:10 +03:00 от Matej Novotny<br>
&gt; &gt; &gt;&lt; <a href="mailto:manovotn@redhat.com">manovotn@redhat.com</a> &gt;:<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt;Hi Alex<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt;Back there we did some tests with earlier versions of Java 9 and<br>
&gt; &gt; &gt;eliminated<br>
&gt; &gt; &gt;some crucial problems.<br>
&gt; &gt; &gt;I think it should be possible to take *existing* app and run it on Java 9.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt;However, creating a whole new modular project might present some<br>
&gt; &gt; &gt;additional<br>
&gt; &gt; &gt;challenges.<br>
&gt; &gt; &gt;Weld itself is not modularized (since it needs to run on Java 8),<br>
&gt; &gt; &gt;therefore<br>
&gt; &gt; &gt;you would need to list some extra "requires" in module-info.java for Weld.<br>
&gt; &gt; &gt;You also need to have reflection access allowed (we need to instantiate<br>
&gt; &gt; &gt;proxies etc) but last time I checked, it was by default enabled in JDK 9<br>
&gt; &gt; &gt;wi<br>
&gt; &gt; &gt;th just warning showing up.<br>
&gt; &gt; &gt;Other than that, it might just work.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt;To answer your other question - no, there is no tutorial, for there is no<br>
&gt; &gt; &gt;special difference between Weld and many other projects in regard to JDK<br>
&gt; &gt; &gt;9.<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt;Matej<br>
&gt; &gt; &gt; <br>
&gt; &gt; &gt;----- Original Message -----<br>
&gt; &gt; &gt;&gt; From: "Alex Sviridov" &lt; <a href="mailto:ooo_saturn7@mail.ru">ooo_saturn7@mail.ru</a> &gt;<br>
&gt; &gt; &gt;&gt; To: "weld-dev" &lt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> &gt;<br>
&gt; &gt; &gt;&gt; Sent: Sunday, September 17, 2017 3:25:49 PM<br>
&gt; &gt; &gt;&gt; Subject: [weld-dev] Weld and Java 9 JPMS<br>
&gt; &gt; &gt;&gt; <br>
&gt; &gt; &gt;&gt; Hi all<br>
&gt; &gt; &gt;&gt; <br>
&gt; &gt; &gt;&gt; Could anyone provide information how weld works (if works) with Java 9<br>
&gt; &gt; &gt;&gt; JPMS?<br>
&gt; &gt; &gt;&gt; Is there any tutorial?<br>
&gt; &gt; &gt;&gt; <br>
&gt; &gt; &gt;&gt; Best regards, Alex<br>
&gt; &gt; &gt;&gt; <br>
&gt; &gt; &gt;&gt; _______________________________________________<br>
&gt; &gt; &gt;&gt; weld-dev mailing list<br>
&gt; &gt; &gt;&gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
&gt; &gt; &gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt; &gt; <br>
&gt; &gt; <br>
&gt; &gt; --<br>
&gt; &gt; Alex Sviridov<br>
&gt; &gt; <br>
&gt; <br>
&gt; <br>
&gt; --<br>
&gt; Alex Sviridov<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; weld-dev mailing list<br>
&gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</div>
            
        
                <base target="_self" href="https://e.mail.ru/">
        </div>

        
</div>


</div>
</blockquote>
<br>
<br>-- <br>Alex Sviridov<br></BODY></HTML>