Question

I am working on a webapplication + j2me application. .jad/.jar file are already created now i want to download it from my live url(my deployed application) in a nokia-phone. But accessing the .jad file gives me "File format unknown" ERROR !!! .

surprise is that if i download jar file directly it works fine. but i need to download .jad file not the .jar file.

my .jad file works totally fine in simulator. one more surprise is that if i deploy another webapplication and the same jad file i am able to download it successfully from the same mobile.

I think the problem is the configuration of my webapplication. I have created a text file in mywebapplication and tried to access it from phone it given me the same ERROR !! that means configuration treats my .jad file as text file.

can anyone say what could be the problem if you need to see web.xml file i will show the code.

.jad and .jar file works very fine as i have tried it by deploying this in another application and downloaded it properly. I think some filters and listeners or servlete causes problem.

Was it helpful?

Solution

You need your server to set the MIME-type for these files as

JAD: text/vnd.sun.j2me.app-descriptor
JAR: application/java-archive

If you are running java based web server then you could set it in web.xml

<mime-mapping>
 <extension>jad</extension>
 <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
</mime-mapping>

<!--JAR file -->
<mime-mapping>
 <extension>jar</extension>
 <mime-type>application/java-archive</mime-type>
</mime-mapping>

or configure proper filter to do the same

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top