You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "James Smith (JIRA)" <ji...@apache.org> on 2018/11/29 16:33:00 UTC

[jira] [Commented] (OWB-1267) SeContainer Fails with NPE when starting from Exec Maven Plugin

    [ https://issues.apache.org/jira/browse/OWB-1267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16703452#comment-16703452 ] 

James Smith commented on OWB-1267:
----------------------------------

Hey [~romain.manni-bucau], thanks for the quick response. Also, I apologize for my late response. I have tried the shaded approach, but I'm very new to it, so I'm not sure if I am doing it correctly. I have used the example that you provided, but an SPI resource seems to not be included into the Uber JAR. I am provided with the below exception:


{code:java}
Exception in thread "main" java.lang.ExceptionInInitializerError
...
Caused by: javax.el.ELException: Provider com.sun.el.ExpressionFactoryImpl not found
...
Caused by: java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl
...{code}

Can you offer advice on what I may be missing, or provide a bare-bones example of OWB used with the *Exec Maven Plugin*? Appreciate your time. Thanks!

> SeContainer Fails with NPE when starting from Exec Maven Plugin
> ---------------------------------------------------------------
>
>                 Key: OWB-1267
>                 URL: https://issues.apache.org/jira/browse/OWB-1267
>             Project: OpenWebBeans
>          Issue Type: Question
>          Components: Samples &amp; Documentation
>    Affects Versions: 2.0.7
>            Reporter: James Smith
>            Priority: Minor
>
>  
> I am using OWB and the CDI 2.0 spec, starting my injection with the following code:
> {noformat}
> SeContainer container = SeContainerInitializer.newInstance().initialize(){noformat}
>  
> When I run the program via *main*, the program runs fine. But, when I run the program with the *Exec Maven Plugin*, using the following command:
> {noformat}
> mvn clean package exec:exec{noformat}
> I get the following error:
>  
> {code:java}
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.openwebbeans.se.OWBInitializer.newContainer(OWBInitializer.java:107)
> at org.apache.openwebbeans.se.OWBInitializer.initialize(OWBInitializer.java:91)
> at org.apache.openwebbeans.se.SeInitializerFacade.initialize(SeInitializerFacade.java:137)
> at com.my.package.core.Main.main(Main.java:11)
> {code}
> Also, I am packaging all of the dependencies into a single jar using the *Apache Maven Assembly Plugin*. Running the jar with the following command produces the same output mentioned above:
> {noformat}
> java -jar target/my-jar-with-dependencies.jar{noformat}
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)