Applet and assetManager (RC2) not working [SOLVED]

Hello,



I’ve previously been able to successfully deploy my game as applet by using the inbuilt applet generator in the JME Sdk.

However after updating to RC2, the assetManager fails to find any assets.



The data jar contains all the assets and it all seem dandy.

I’ve been trying to remember if I had the same issue prior to RC2 and if I had changed any code that would affect it,

but I cant recall anything like that.



Anyhow, this is the log I get when loading the applet.

*(com.jme3.asset.AssetNotFoundException: SoundEnvironmentstrings.ogg) ← Backslashes are trimmed in the forums.

Code:
null null Nov 28, 2012 6:18:18 PM com.jme3.system.JmeDesktopSystem initialize INFO: Running on jMonkeyEngine 3.0.0 Beta Nov 28, 2012 6:18:18 PM com.jme3.system.lwjgl.LwjglCanvas$GLCanvas addNotify INFO: EDT: Creating OGL thread. Nov 28, 2012 6:18:18 PM com.jme3.system.lwjgl.LwjglCanvas$GLCanvas addNotify INFO: EDT: Telling OGL to create display .. applet:init applet:start Nov 28, 2012 6:18:18 PM com.jme3.system.lwjgl.LwjglAbstractDisplay run INFO: Using LWJGL 2.8.2 Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglCanvas makePbufferAvailable INFO: OGL: Pbuffer has been created Nov 28, 2012 6:18:19 PM com.jme3.renderer.lwjgl.LwjglRenderer initialize INFO: Caps: [FrameBuffer, FrameBufferMRT, FrameBufferMultisample, TextureMultisample, OpenGL20, OpenGL21, OpenGL30, OpenGL31, OpenGL32, ARBprogram, GLSL100, GLSL110, GLSL120, GLSL130, GLSL140, GLSL150, VertexTextureFetch, TextureArray, TextureBuffer, FloatTexture, FloatColorBuffer, FloatDepthBuffer, PackedFloatTexture, SharedExponentTexture, PackedFloatColorBuffer, TextureCompressionLATC, NonPowerOfTwoTextures, MeshInstancing, VertexBufferArray, Multisample, PackedDepthStencilBuffer] Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo INFO: Adapter: nvd3dumx,nvwgf2umx,nvwgf2umx Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo INFO: Driver Version: null Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo INFO: Vendor: NVIDIA Corporation Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo INFO: OpenGL Version: 4.2.0 Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo INFO: Renderer: GeForce GTX 580/PCIe/SSE2 Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo INFO: GLSL Ver: 4.20 NVIDIA via Cg compiler Nov 28, 2012 6:18:19 PM com.jme3.system.lwjgl.LwjglTimer <init> INFO: Timer resolution: 1,000 ticks per second Nov 28, 2012 6:18:19 PM com.jme3.asset.DesktopAssetManager <init> INFO: DesktopAssetManager created. Nov 28, 2012 6:18:19 PM com.jme3.renderer.Camera <init> INFO: Camera created (W: 1,024, H: 768) Nov 28, 2012 6:18:19 PM com.jme3.renderer.Camera <init> INFO: Camera created (W: 1,024, H: 768) Nov 28, 2012 6:18:19 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread INFO: AudioRenderer supports 64 channels Nov 28, 2012 6:18:19 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread INFO: Audio effect extension version: 1.0 Nov 28, 2012 6:18:19 PM com.jme3.audio.lwjgl.LwjglAudioRenderer initInThread INFO: Audio max auxilary sends: 4 Nov 28, 2012 6:18:19 PM com.jme3.material.MaterialDef <init> INFO: Loaded material definition: Unshaded Nov 28, 2012 6:18:19 PM com.jme3.scene.Node attachChild INFO: Child (BitmapFont) attached to this node (null) Being ran as applet Nov 28, 2012 6:18:24 PM com.divicus.client.scene.world.WorldManager <init> SEVERE: Initiated WorldManager Exception in thread "LWJGL Renderer Thread" com.jme3.asset.AssetNotFoundException: SoundEnvironmentstrings.ogg (Buffer) at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:278) at com.jme3.audio.AudioNode.<init>(AudioNode.java:141) at com.jme3.audio.AudioNode.<init>(AudioNode.java:153) at com.jme3.audio.AudioNode.<init>(AudioNode.java:176) at com.divicus.client.scene.sound.SoundFactory.createSound(SoundFactory.java:41) at com.divicus.client.scene.sound.SoundFactory.createSound(SoundFactory.java:51) at com.divicus.client.scene.sound.SoundManager.init(SoundManager.java:30) at com.divicus.client.scene.sound.SoundManager.<init>(SoundManager.java:18) at com.divicus.client.GameClient.simpleInitApp(GameClient.java:141) at com.divicus.client.GameClientLocal.simpleInitApp(GameClientLocal.java:16) at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225) at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130) at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207) at java.lang.Thread.run(Unknown Source)

Furthermore I do not change the locator when loading as applet.

[java]
@Override
public void simpleInitApp() {
setLogging();

Applet a = AppletHarness.getApplet(this);
if (a == null) {
System.out.println("Not being ran as applet");
assetManager.registerLocator("assets", FileLocator.class);
} else {
System.out.println("Being ran as applet");
a.setBackground(Color.BLACK);
}

instance.setDisplayFps(false);
instance.setDisplayStatView(false);
instance.getInputManager().setCursorVisible(true);
instance.getFlyByCamera().setEnabled(false);
instance.setPauseOnLostFocus(false);

NetworkConstants.registerClasses();

TempCache.init(assetManager);

loadNifty();
loginState = new LoginState();
inGameState = new InGameState();
soundManager = new SoundManager();
viewPort.setBackgroundColor(ColorRGBA.Black);
stateManager.attach(devMode ? inGameState : loginState);
}
[/java]

Here is the data.jar of the file that the exception in the log is trying to locate.

http://puu.sh/1vhQL.png

When not using the soundmanager, the same problem occurs for various other assets, such as images and models,
why I believe its some lower level error.

Anyone have a clue why this might be happening and are you guys able to run applets using assets in rc2?

Try using forward slashes for the path.

@normen said:
Try using forward slashes for the path.


That did work.

Is the proper way of doing paths using a forward slash at all times?

I've been using File.separator thoughout the project to be platform independant considering windows per default is backslash while ma&unix is forward slash.

Were changes regarding the file separator done from rc1 to rc2?
The game used to work fine with a previous JME version when running as applet, why I find this pretty strange.
@perfecticus said:
That did work.

Is the proper way of doing paths using a forward slash at all times?

I've been using File.separator thoughout the project to be platform independant considering windows per default is backslash while ma&unix is forward slash.

Were changes regarding the file separator done from rc1 to rc2?
The game used to work fine with a previous JME version when running as applet, why I find this pretty strange.


In Java, forward slash always works on every platform. You only need to worry about the OS-specific separator if you are trying to interpret system paths.

For resources (like in the case of assets), it should _always_ be forward slash because that interface is already platform independent and uses URLs internally.
1 Like

Mentioned in “Hello Assets” afaik, thats why we suggest going though them even if you’re experienced in programming :wink:

1 Like
@pspeed said:
In Java, forward slash always works on every platform. You only need to worry about the OS-specific separator if you are trying to interpret system paths.

For resources (like in the case of assets), it should _always_ be forward slash because that interface is already platform independent and uses URLs internally.


@normen said:
Mentioned in "Hello Assets" afaik, thats why we suggest going though them even if you're experienced in programming ;)


Very well, thanks for the help :)