Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory #176

Open
egorovna26 opened this issue Sep 6, 2019 · 5 comments
Open

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory #176

egorovna26 opened this issue Sep 6, 2019 · 5 comments

Comments

@egorovna26
Copy link

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at ru.iss.finance.demand.MainApp.(MainApp.java:9)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at fxlauncher.Launcher$1.lambda$createApplication$1(Launcher.java:55)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$179(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$177(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$178(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$152(WinApplication.java:177)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 15 more

@edvin
Copy link
Owner

edvin commented Sep 6, 2019

So it seems you're running an application that requires slf4j, but it's not on your classpath :)

@egorovna26
Copy link
Author


4.0.0

<groupId>ru.iss.finance</groupId>
<artifactId>demand</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
    <jersey.version>2.28</jersey.version>

    <app.filename>demand</app.filename>
    <app.mainClass>ru.iss.finance.demand.MainApp</app.mainClass>
    <app.url>https://trade.iss-reshetnev.ru/cdn/demand-update/</app.url>
    <app.dir>${project.build.directory}/app</app.dir>
    <app.installerdir>${project.build.directory}/installer</app.installerdir>
    <app.acceptDowngrade>false</app.acceptDowngrade>
    <app.updateText>Идёт обновление! Ждите...</app.updateText>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-client</artifactId>
        <version>${jersey.version}</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.inject</groupId>
        <artifactId>jersey-hk2</artifactId>
        <version>${jersey.version}</version>
    </dependency>

    <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-json-jackson</artifactId>
        <version>${jersey.version}</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-multipart</artifactId>
        <version>${jersey.version}</version>
    </dependency>

    <dependency>
        <groupId>org.controlsfx</groupId>
        <artifactId>controlsfx</artifactId>
        <version>8.40.15</version>
    </dependency>
    <dependency>
        <groupId>de.jensd</groupId>
        <artifactId>fontawesomefx</artifactId>
        <version>8.9</version>
    </dependency>
    <dependency>
        <groupId>com.jfoenix</groupId>
        <artifactId>jfoenix</artifactId>
        <version>8.0.8</version>
    </dependency>
    <dependency>
        <groupId>no.tornado</groupId>
        <artifactId>fxlauncher</artifactId>
        <version>1.0.21</version>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.6</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.28</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.28</version>
    </dependency>
</dependencies>

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>false</filtering>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>3.1.2</version>
            <configuration>
                <outputDirectory>${app.dir}</outputDirectory>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>3.1.1</version>
            <configuration>
                <excludeScope>provided</excludeScope>
                <outputDirectory>${app.dir}</outputDirectory>
                <stripVersion>true</stripVersion>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.6.0</version>
            <executions>
                <execution>
                    <id>create-manifest</id>
                    <phase>package</phase>
                    <goals>
                        <goal>java</goal>
                    </goals>
                    <configuration>
                        <mainClass>fxlauncher.CreateManifest</mainClass>
                        <arguments>
                            <argument>${app.url}</argument>
                            <argument>${app.mainClass}</argument>
                            <argument>${app.dir}</argument>
                            <argument>--accept-downgrade=${app.acceptDowngrade}</argument>
                            <argument>--update-text=${app.updateText}</argument>
                        </arguments>
                    </configuration>
                </execution>
                <execution>
                    <id>embed-manifest-in-launcher</id>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>jar</executable>
                        <workingDirectory>${app.dir}</workingDirectory>
                        <arguments>
                            <argument>uf</argument>
                            <argument>fxlauncher.jar</argument>
                            <argument>app.xml</argument>
                            <argument>-C</argument>
                            <argument>${project.basedir}/target/classes</argument>
                            <argument>.</argument>
                        </arguments>
                    </configuration>
                </execution>
                <execution>
                    <id>installer</id>
                    <phase>install</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>javapackager</executable>
                        <arguments>
                            <argument>-deploy</argument>
                            <argument>-native</argument>
                            <argument>-outdir</argument>
                            <argument>${app.installerdir}</argument>
                            <argument>-outfile</argument>
                            <argument>${app.filename}</argument>
                            <argument>-srcdir</argument>
                            <argument>${app.dir}</argument>
                            <argument>-srcfiles</argument>
                            <argument>fxlauncher.jar</argument>
                            <argument>-appclass</argument>
                            <argument>fxlauncher.Launcher</argument>
                            <argument>-name</argument>
                            <argument>${project.name}</argument>
                            <argument>-title</argument>
                            <argument>${project.name}</argument>
                            <argument>-Bidentifier=${project.groupId}.${project.artifactId}</argument>
                            <argument>-BjvmOptions=-Dprism.order=sw</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

@edvin
Copy link
Owner

edvin commented Sep 6, 2019

Can you post the generated app.xml along with a list of all the files you uploaded to https://trade.iss-reshetnev.ru/cdn/demand-update/?

@egorovna26
Copy link
Author

Снимок

@egorovna26
Copy link
Author

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Application ts="1567756556557" uri="https://trade.iss-reshetnev.ru/cdn/demand-update/" launch="ru.iss.finance.demand.MainApp"> <lib file="aopalliance-repackaged.jar" checksum="2062790797" size="14212"/> <lib file="commons-io.jar" checksum="3503488178" size="214788"/> <lib file="controlsfx.jar" checksum="2602159786" size="1402490"/> <lib file="demand-1.0-SNAPSHOT.jar" checksum="4193806592" size="1250230"/> <lib file="fontawesomefx.jar" checksum="2474977539" size="571068"/> <lib file="hk2-api.jar" checksum="2978953872" size="187228"/> <lib file="hk2-locator.jar" checksum="2524813385" size="188187"/> <lib file="hk2-utils.jar" checksum="1583122343" size="117332"/> <lib file="jackson-annotations.jar" checksum="4286703886" size="66894"/> <lib file="jackson-core.jar" checksum="750994543" size="325619"/> <lib file="jackson-databind.jar" checksum="923901868" size="1347236"/> <lib file="jackson-module-jaxb-annotations.jar" checksum="3064200404" size="32627"/> <lib file="jakarta.annotation-api.jar" checksum="3815204631" size="25150"/> <lib file="jakarta.inject.jar" checksum="4052961802" size="5408"/> <lib file="jakarta.ws.rs-api.jar" checksum="2523759837" size="140262"/> <lib file="javassist.jar" checksum="799895009" size="737884"/> <lib file="jersey-client.jar" checksum="3119894899" size="196494"/> <lib file="jersey-common.jar" checksum="289024527" size="1141593"/> <lib file="jersey-entity-filtering.jar" checksum="3240344810" size="83813"/> <lib file="jersey-hk2.jar" checksum="2357635321" size="76530"/> <lib file="jersey-media-json-jackson.jar" checksum="2439363957" size="75210"/> <lib file="jersey-media-multipart.jar" checksum="2041683833" size="80354"/> <lib file="jfoenix.jar" checksum="1048459027" size="2708772"/> <lib file="log4j.jar" checksum="1818032796" size="489884"/> <lib file="mimepull.jar" checksum="2593365468" size="67125"/> <lib file="osgi-resource-locator.jar" checksum="2810645920" size="20235"/> <lib file="slf4j-api.jar" checksum="3996207238" size="41117"/> <lib file="slf4j-log4j12.jar" checksum="3868781970" size="12212"/> <lib file="slf4j-simple.jar" checksum="2838363773" size="15240"/> <updateText>Идёт обновление! Ждите...</updateText> <updateLabelStyle>-fx-font-weight: bold;</updateLabelStyle> <progressBarStyle>-fx-pref-width: 200;</progressBarStyle> <wrapperStyle>-fx-spacing: 10; -fx-padding: 25;</wrapperStyle> <acceptDowngrade>false</acceptDowngrade> <stopOnUpdateErrors>false</stopOnUpdateErrors> <lingeringUpdateScreen>false</lingeringUpdateScreen> </Application>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants