You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Manupriya <ma...@gmail.com> on 2009/02/18 10:40:17 UTC
[users@httpd] Problem with accessing jar file on Apache server (jnlp)
Hi,
I have a jar that contains some js files that I want to refer. I am using
Apache HTTP Server 2.0.x
I understand, I will have to configure a jnlp file for using the jar file on
the Apache Server. I carried out the following steps:
1. I have a test.jar that contains a test.js which has a simple java script
function.
2. Created a folder as jnlp under htdocs
3. Put the test.jar in htdocs/jnlp folder
4. edit conf/mime.types file added the following entry -
application/x-java-jnlp-file jnlp
5. Created test.jnlp and added the following content -
--------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<!-- JNLP File for jar Demo Application -->
<jnlp
spec="1.0+"
codebase="http://localhost/"
href="test.jnlp">
<information>
<title>Test Application</title>
<vendor>Basis International Ltd.</vendor>
<description>Test Application</description>
<description kind="short">A test to basis.</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<jar href="/jnlp/test.jar"/>
</resources>
</jnlp>
--------------------------------------------------------------
6. I have put the test.jnlp file in htdocs/jnlp folder
7. Then I created test.jar.var file with following content -
-----------------------------------------------------------------
URI: jnlp/test.jar
Content-Type: x-java-archive
-----------------------------------------------------------------
8. I have put test.jar.var file in the htdocs folder
9. Then I created a .htaccess file with following content and put in the
htdocs folder -
-------------------------------------------------------------------
# Return the right mime type for JARs
AddType application/x-java-archive .jar
# Enable type maps
AddHandler application/x-type-map .var
Options +MultiViews
# Tweak MultiViews - this line is for
# APACHE 2.0 ONLY!
MultiViewsMatch Any
---------------------------------------------------------------------
My directory structure is as follows -
http://www.nabble.com/file/p22075303/1.gif
http://www.nabble.com/file/p22075303/2.gif
10. After doing all this I restarted the Apache server and tried hitting the
following using Firefox 3.0.1 -
jar:http://localhost/jnlp/test.jar!/test.js
But I get Page Load error -
Unsafe File Type
The page you are trying to view cannot be shown because it is contained in a
file type that may not be safe to open. Please contact the website owners to
inform them of this problem.
I think I am doing something wrong with the configuration. Please let me
know if there is any resource that I can refer for this.
NOTE- I am able to access this jar on Tomcat Server.
Thanks,
Manu
--
View this message in context: http://www.nabble.com/Problem-with-accessing-jar-file-on-Apache-server-%28jnlp%29-tp22075303p22075303.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org