I know this one has been up before, but since the search function is crap... The rest you know.

I want to deploy my application w/ slick2d as an applet. I followed the nice tutorial on NinjaCave and it all works fine. Except, my game is not signed, and it can therefore not reach my resources, which is in the same jar.So, either I change the way resources are loaded:

or, I sign the thing. After tons of looking around, it seems that signing is not exctly the easest thing in the world. It also seams that I need to register, and all kinds of legal things to do this, and I just can't believe that.

So, what would be the easiest? Is there an easy way to sign my game, to gain acces? Is there an easy way to load resources, that I don't know of?

I've tried to create a keystore, and signing and verifying my game.jar , but I still get the permission-error, even when clicking yes in the permissions box. Even though I typed in all my information when prompted during signing it appears as UNKNOWN, and none of it is showed.

Maybe it's not accessing the right file. Try using a forward slash ('/') at the beginning of the path to signify the root of the jar.Also you do not need to sign a jar to be able to access resources inside it. However you do need to sign the jar to access files on the client's file system AND to be able to load native code (which you must do to use Slick2D/LWJGL).

Maybe it's not accessing the right file. Try using a forward slash ('/') at the beginning of the path to signify the root of the jar.Also you do not need to sign a jar to be able to access resources inside it. However you do need to sign the jar to access files on the client's file system AND to be able to load native code (which you must do to use Slick2D/LWJGL).

But lwjgl applet jar is allready signed and do not need own signing if those all only native files needed.

I agree with pitbuller. Signing your own jars is not required. The LWJGL jars are signed and that's sufficient.It must be a different problem.My "StarCleaner" game runs as an applet and I didn't sign a single jar file. All resources (images, sheets, etc.) are inside my starcleaner.jar and it is a Slick game. And I also followed Kappa's tutorial on ninjacave to create Slick2D applets.

I agree with pitbuller. Signing your own jars is not required. The LWJGL jars are signed and that's sufficient.It must be a different problem.My "StarCleaner" game runs as an applet and I didn't sign a single jar file. All resources (images, sheets, etc.) are inside my starcleaner.jar and it is a Slick game. And I also followed Kappa's tutorial on ninjacave to create Slick2D applets.

How did you access the resources?

Thanks for the replies guys. I will try to use the forward slash, and we will see where that goes.

You are trying to load a resource as a file from the filesystem. Applets are not allowed to do this unless the entire codebase is signed with all permissions granted. You probably actually want to load your resource from one of the applet jars.

I agree with pitbuller. Signing your own jars is not required. The LWJGL jars are signed and that's sufficient.It must be a different problem.My "StarCleaner" game runs as an applet and I didn't sign a single jar file. All resources (images, sheets, etc.) are inside my starcleaner.jar and it is a Slick game. And I also followed Kappa's tutorial on ninjacave to create Slick2D applets.

How did you access the resources?

Thanks for the replies guys. I will try to use the forward slash, and we will see where that goes.

StarCleaner relies on some ResourceManager we built as part of MarteEngine. But inside it uses the standard Slick constructors like new Image("relativeResourcepath").No magic at all except what's happening inside Slick.All resources are part of the jar of course.

If that's the case for you, something like this should work:

1

Imagebackground = newImage("res/background.png");

Feel free to browse our MarteEngine source code, the StarCleaner source code is also part of Marte (test/it/marteEngine/game/StarCleaner).

I agree with pitbuller. Signing your own jars is not required. The LWJGL jars are signed and that's sufficient.It must be a different problem.My "StarCleaner" game runs as an applet and I didn't sign a single jar file. All resources (images, sheets, etc.) are inside my starcleaner.jar and it is a Slick game. And I also followed Kappa's tutorial on ninjacave to create Slick2D applets.

How did you access the resources?

Thanks for the replies guys. I will try to use the forward slash, and we will see where that goes.

StarCleaner relies on some ResourceManager we built as part of MarteEngine. But inside it uses the standard Slick constructors like new Image("relativeResourcepath").No magic at all except what's happening inside Slick.All resources are part of the jar of course.

If that's the case for you, something like this should work:

1

Imagebackground = newImage("res/background.png");

Feel free to browse our MarteEngine source code, the StarCleaner source code is also part of Marte (test/it/marteEngine/game/StarCleaner).

Hope that helps a bit and cheers,Tommy

It looks like you did it with a stream some places, and with a filesystem others. I can't build your game though, so I can't check the "file" instance you initialize Images with.

You are trying to load a resource as a file from the filesystem. Applets are not allowed to do this unless the entire codebase is signed with all permissions granted. You probably actually want to load your resource from one of the applet jars.

Cas

How would this be done?I only see Image can be initialized the following ways, in Slick:

BufferedInputStream will throw an IOException with message "Stream closed" if you pass it null as its constructor argument. Looks like under the covers, Slick is using BufferedInputStream, likely on the stream you pass it, so I'm still betting you're giving the wrong path to your resource and thus getting a null value for the stream.

BufferedInputStream will throw an IOException with message "Stream closed" if you pass it null as its constructor argument. Looks like under the covers, Slick is using BufferedInputStream, likely on the stream you pass it, so I'm still betting you're giving the wrong path to your resource.

Pretty sure I'm not. It works when initializing an image passing the same path. Tried both as applet, and in my environment. Neither works - they both close anything I could try?

If it was null, "null" would be printed. If it wasn't null, you would get java.io.InputStream@<hashcode>.

It did not print anything at all. Im definite that the block is executed, but it doesnt print. Can I show you, in some way? I can upload the applet, and you can look at errors/source for yourself if you would like :-)

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org