edgent-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale LaBossiere <dml.apa...@gmail.com>
Subject Re: problems using mvn exec:java
Date Tue, 18 Jul 2017 18:26:36 GMT
Hmm… never mind.  Not sure what I changed but it seems fine now (maybe I hadn’t saved the
pom change that included slf4j-jdk14)?
Sorry for the interrupt.
— Dale

> On Jul 18, 2017, at 1:15 PM, Dale LaBossiere <dml.apache@gmail.com> wrote:
> 
> Hi Chris,
> 
> I was trying one workflow of creating / running an Edgent app - in this case trying to
use mvn exec:java
> I’m lead to believe there’s some problem with poms/deps.
> This was using PR-309 content from this am.
> 
> The app itself doesn’t use slf4j.  Edgent has a compile time dependency on slf4j-api.
 At runtime, a single slf4j impl must be present.
> The failure below seems to indicate that slf4j-api isn’t present (that seems to be
where org.slf4j.LoggerFactory is)?
> Related to the top level pom specifying “provided” for slf4j-api?
> 
> Here’s the flow…
> 
> Lacking an Edgent specific archetype template, I faked it:
> 
> mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart
-DinteractiveMode=false
> 
> then added these deps to its pom:
>   <dependency>
>      <groupId>org.apache.edgent.providers</groupId>
>      <artifactId>edgent-providers-direct</artifactId>
>      <version>1.2.0-SNAPSHOT</version>
>    </dependency>
>    <dependency>
>      <groupId>org.slf4j</groupId>
>      <artifactId>slf4j-jdk14</artifactId>
>      <version>1.7.12</version>
>      <scope>runtime</scope>
>    </dependency>
> 
> then I essentially copied the HelloEdgent.java sample into the generated App.java (tweaking
package&classname)
> 
> then
> mvn clean package -DskipTests
> mvn exec:java -Dexec.mainClass=“com.mycompany.app.App”
> java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
> 	at org.apache.edgent.runtime.jsoncontrol.JsonControlService.<clinit>(JsonControlService.java:50)
>        at org.apache.edgent.providers.direct.DirectProvider.<init>(DirectProvider.java:60)
>        at com.mycompany.app.App.main(App.java:20)
> ...
> Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
> ...
> 
> — Dale
> 
> 


Mime
View raw message