Failed to find loader: com.jme3.audio.plugins.OGGLoader

Hi Everyone,



I updated my game to use maven3 - everything works fine except for this Exception I get when I start the game:



[java]

java.lang.ClassNotFoundException: com.jme3.audio.plugins.OGGLoader

at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:169)

at com.jme3.asset.DesktopAssetManager.registerLoader(DesktopAssetManager.java:135)

at com.jme3.asset.AssetConfig.loadText(AssetConfig.java:74)

at com.jme3.asset.DesktopAssetManager.<init>(DesktopAssetManager.java:88)

at com.jme3.system.JmeDesktopSystem.newAssetManager(JmeDesktopSystem.java:56)

at com.jme3.system.JmeSystem.newAssetManager(JmeSystem.java:87)

at com.jme3.app.Application.initAssetManager(Application.java:162)

at com.jme3.app.Application.initialize(Application.java:490)

at de.darkblue.moebius.MoebiusApplication.initialize(MoebiusApplication.java:219)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)

at java.lang.Thread.run(Thread.java:619)

[/java]



In my code at [java]de.darkblue.moebius.MoebiusApplication.initialize()[/java] I just call [java]super.initialize();[/java] (from class com.jme3.app.Application). I think the problem is that the class can’t be found in one of the dependent packages. Here is my pom.xml file:



[xml]

<?xml version=“1.0” encoding=“UTF-8”?>

<project xmlns=“http://maven.apache.org/POM/4.0.0” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance

xsi:schemaLocation=“http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd”>

<modelVersion>4.0.0</modelVersion>



<groupId>de.darkblue</groupId>

<artifactId>moebius</artifactId>

<version>1.0</version>

<packaging>jar</packaging>



<name>moebius engine</name>

<url>http://moebius.darkblue.de</url>



<properties>

<project.build.mainClass>de.darkblue.moebius.MoebiusApplication</project.build.mainClass>

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

<buildNumber>${env.SVN_REVISION}</buildNumber>

<distDirectory></distDirectory>

</properties>



<repositories>

<repository>

<id>sonatype-public</id>

<name>sonatype public</name>

<url>https://oss.sonatype.org/content/groups/public/</url>

</repository>

</repositories>



<profiles>

<!-- if no BUILD_NUMBER is supplied from jenkins we add “testbuild” -->

<profile>

<activation>

<property>

<name>!env.SVN_REVISION</name>

</property>

</activation>

<properties>

<buildNumber>testbuild</buildNumber>

</properties>

</profile>

</profiles>



<build>

<finalName>${project.artifactId}-${project.version}.${buildNumber}</finalName>



<plugins>

<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-compiler-plugin</artifactId>

<version>2.1</version>

<configuration>

<source>1.6</source>

<target>1.6</target>

</configuration>

</plugin>



<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-jar-plugin</artifactId>

<version>2.3.2</version>

<configuration>

<archive>

<manifest>

<mainClass>${project.build.mainClass}</mainClass>

<packageName>de.darkblue.moebius</packageName>

<addClasspath>true</addClasspath>

<addExtensions/>

<classpathLayoutType>custom</classpathLayoutType>

<customClasspathLayout>$${artifact.artifactId}.$${artifact.extension}</customClasspathLayout>

<classpathPrefix>lib</classpathPrefix>

<addDefaultImplementationEntries>true</addDefaultImplementationEntries>

</manifest>

<manifestEntries>

<url>${pproject.url}</url>

<Implementation-Build>${buildNumber} (${scmBranch})</Implementation-Build>

</manifestEntries>

</archive>

</configuration>

</plugin>



<plugin>

<groupId>org.apache.maven.plugins</groupId>

<artifactId>maven-dependency-plugin</artifactId>

<version>2.4</version>

<executions>

<execution>

<id>copy-dependencies</id>

<phase>package</phase>

<goals>

<goal>copy-dependencies</goal>

</goals>

<configuration>

<outputDirectory>${project.build.directory}/lib</outputDirectory>

<overWriteReleases>false</overWriteReleases>

<overWriteSnapshots>false</overWriteSnapshots>

<overWriteIfNewer>true</overWriteIfNewer>

<stripVersion>true</stripVersion>

</configuration>

</execution>

</executions>

</plugin>



<plugin>

<artifactId>maven-assembly-plugin</artifactId>

<version>2.2.2</version>

<configuration>

<finalName>${project.artifactId}</finalName>

<appendAssemblyId>false</appendAssemblyId>

<descriptors>

<descriptor>src/main/assembly/bin.xml</descriptor>

</descriptors>

</configuration>

<executions>

<execution>

<id>make-assembly</id> <!-- this is used for inheritance merges -->

<phase>package</phase> <!-- bind to the packaging phase -->

<goals>

<goal>single</goal>

</goals>

</execution>

</executions>

</plugin>



</plugins>



<resources>

<resource>

<directory>src/main/resources</directory>

<filtering>true</filtering>

</resource>

<resource>

<directory>src/main/assets</directory>

<filtering>false</filtering>

</resource>

</resources>



</build>



<dependencies>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-core</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-jbullet</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jbullet</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-lwjgl</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-lwjgl-natives</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>lwjgl</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-blender</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-desktop</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-plugins</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-terrain</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>j-ogg-oggd</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>j-ogg-vorbisd</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jinput</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>eventbus</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>stack-alloc</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>vecmath</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>jME3-niftygui</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>nifty</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>



<dependency>

<groupId>com.jme3</groupId>

<artifactId>nifty-default-controls</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>nifty-examples</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>nifty-style-black</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>xmlpull</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>com.jme3</groupId>

<artifactId>noise</artifactId>

<version>3.0.0-SNAPSHOT</version>

</dependency>

<dependency>

<groupId>rhino</groupId>

<artifactId>js</artifactId>

<version>1.7R2</version>

</dependency>

<dependency>

<groupId>junit</groupId>

<artifactId>junit</artifactId>

<version>4.0</version>

<scope>test</scope>

</dependency>

</dependencies>

</project>

[/xml]



Maybe I’m missing some dependency - although I already included two for ogg support but no one of them contains the missing class file. Anyone has a solution for that? Thanks in advance.



entrusC

This class is in JME3-jogg.jar. It is with the other dist libs

@nehon said:
This class is in JME3-jogg.jar. It is with the other dist libs

Thanks for the input. Still I can't find it in the JME-Repository at https://oss.sonatype.org/content/groups/public/com/jme3/

I used the dependencies from this file http://subversion.assembla.com/svn/friendularity/trunk/maven/org.friendularity.demo.jme3.maven/pom.xml as discribed in the wiki at https://wiki.jmonkeyengine.org/legacy/doku.php/jme3_maven_repo?s[]=maven

Maybe it is an error that it is missing at the repository server?

mhh there has been a change in the structure of the distribution recently maybe the maven repo is not up to date.

I’m sorry, i’m afraid i can’t help you, my maven knowledge is really close to zero.

@nehon said:
mhh there has been a change in the structure of the distribution recently maybe the maven repo is not up to date.
I'm sorry, i'm afraid i can't help you, my maven knowledge is really close to zero.

No problem - thank you anyway.

Who then is responsible for the maven repository? It would be really nice for continous integration if the maven repository would be maintained properly.

I don’t know, the only thing i know is that we don’t (the core team), because we don’t use it.

There is no official responsible, just some users initiatives.



you can check this thread : (skip to the end i think there are useful info, the rest is just some sort of flame war)

http://hub.jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/maven-hosting/?topic_page=5&num=15



and this one

http://hub.jmonkeyengine.org/groups/general-2/forum/topic/successes-and-challenges-using-jme3-with-osgi-classpaths-and-native-libraries

@entrusc said:
It would be really nice for continous integration if the maven repository would be maintained properly.

Imo it would be better if it wasn't there so you don't waste time and set up your project like you would without right away. At any instance we will not maintain it.
@normen said:
Imo it would be better if it wasn't there so you don't waste time and set up your project like you would without right away. At any instance we will not maintain it.

Someone (namely erlend_sh, pflanzenmoerder and obviously you according to this thread: http://hub.jmonkeyengine.org/groups/development-discussion-jme3/forum/topic/maven-hosting/?topic_page=5&num=15#post-156662) were involved in deploying the latest artifacts. I'm just asking if an artifact maybe is missing. And no I'm not here to argue about the usefullness of a centralized dependency management system (may it be maven, gradle or whatever).

Again, its not ours, we don’t maintain it and we provide official information on how to use the jME3 libraries with any java build process.

Then I obviously have to wait either for the other two named persons who most certainly have a clue what they did to upload the missing artifact or setup my own private nexus and deploy the file there with no advantage to the commuinty (your community!) whatsoever …

No, you should simply embed the jmonkeyengine jar files into your maven project instead of wasting time with this.

lol - sorry but you obviously have never worked with maven. The fun with maven is that you don’t include jar files directly - you rather add artifacts as dependencies and maven loads the corresponding jar files from a repository server. That way you just check out your software - type mvn package and maven downloads the dependencies, compiles the code and packages it.



The advantage of this is that you can for example give someone access to your svn repository and the other person can work on the code and compile it without the need to know where the dependencies lie.

I am very well aware of what maven is, how it works and I am also aware that all maven users run around OSS projects asking for pom files cause this whole thing only works as intended when everything’s supplied as a maven artifact. Most maven users (as yourself) don’t even know how to embed jar files in their projects, thats why we outline that in the wiki. At any instance, we do not provide eclipse projects, maven pom files, gradle projects, makefile build scripts or anything like that as it would mean too much work to maintain. Instead we use the java-default ant build system and normal jar files.

And btw I hated using maven and having it pull some library for my projects, regularly breaking compatibility. If I have to specify a version for each jar I can just as well download that and add it to my project.

The jME3-jogg jar was unintentionally omitted from our upload script (sorry). I fixed that, and uploaded the jar into sonatype-snapshots. I also rechecked the list of jars to make sure that no other ones were missing. You can see that the jar is now here:



Index of /repositories/public/com/jme3/jME3-jogg



I also added the dependency in our sample client project, rebuilt and ran it, and verified that the jogg errors do not occur. I also ran the TestOgg demo from that program, and it worked.



friendularity - Revision 1163: /trunk/maven/org.friendularity.demo.jme3.maven



I never meant to imply that anyone else had committed to support these maven binaries. When I thanked Normen et. al. earlier, I was doing just that: Thanking them for their time in helping me get set up with something that did not benefit them directly.



@Entrusc, thank you for pointing out the missing jME3-jogg jar. Everything should be fixed now.



As far as “maintaining the repository properly”, I am willing to do the upload to Sonatype about once a month, for now.



Perhaps we should have a separate forum for “Maven issues” somewhere, so that the core jMonkey team is not pestered with questions about something they are not interested in?

@entrusc said:
lol - sorry but you obviously have never worked with maven.


never doubt @normen he has done everything :)

@stub22: Thank you for uploading the artifact! That’s all I wanted. I was sure that it was not forgotten intentionally :slight_smile: And thanks that you are committing yourself to upgrade the artifacts on a monthly basis (if you should every decide to change that I’m willing to take over) - I’m relieved to know that it was the right decision to switch the build process from ancient “ant” to modern “maven” :slight_smile:



@wezrule: I see - at least he always has an optionion on everything :wink: I hope he will see the advantages of maven some day.



@norman: there is a version range syntax - so you don’t have to specify the version explicitly: http://maven.apache.org/plugins/maven-enforcer-plugin/rules/versionRanges.html. And yes I really hope you will see the advantages of maven one day. Thanks anyway.

I see the “advantages” of maven, its just that we do not benefit much from them as our build process depends largely on stuff that needs to be done in ant anyway so we simply don’t use maven and hence do not want the additional work with it. Also, if I was to choose a similar system nowadays I would certainly choose gradle over maven.