Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Using jnlp on OS X

Posted on 2011-02-12
7
1,265 Views
Last Modified: 2012-05-11
I'm trying to test jnlp locally on OS X.
In a directory I have an html file, a jnlp file, and a jar file.
The jnlp file cannot find the jar file.
I've tried codebase=".", but this doesn't work:
BadFieldException[ The field <jnlp>codebase has an invalid value: .,.]

The machine's local ip address is 192.168.0.6
codebase="http://192.168.0.6" href="Users/apple/Documents/ccs.jnlp
That gives this error: com.sun.deploy.net.FailedDownloadException: Unable to load resource: http://192.168.0.6/Users/apple/Documents/ccs.jnlp

May there is something required before the "Users" directory in that path?
How can I get this to work?
<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="." href="ccs.jnlp">
  <information>
    <title>Some TItle</title>
    <vendor> - Some Vendor</vendor>
    <homepage href="http://www.somewhere.edu/home.html" />
    <offline-allowed />
  </information>
  <resources>
    <j2se version="1.5+" />
    <jar href="ccs.jar" />
  </resources>
  <application-desc main-class="ccs.MyApplication" />
</jnlp>

Open in new window

0
Comment
Question by:allelopath
  • 4
  • 2
7 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 450 total points
ID: 34880402

If you are trying it locally maybe  should use:

codebase = "file://Users/..."

id you try is his way?

0
 
LVL 47

Expert Comment

by:for_yan
ID: 34880424
In order to use http: I guess you need running web server or some process which would attend to your http request.

file: should work without such process, but I'm not sure how file: will look on Mac,
the absolute path should work - on windos it would be, say, "file:///C:\..."
On Mac it shoul probably be like on Unix, so maybe you need even three slashes,
like file:///Users/... - try both ways-  file://Users and also with three slashes
0
 
LVL 1

Author Comment

by:allelopath
ID: 34880559
That's a good idea. Unfortunately doesn't seem to work yet. but I thinks its closer.

I think 3 slashes is correct because the html file that links to the jnlp file is in the same directory and appears in the browser as:
file:///Users/apple/Documents/ccs.html

The line in ccs.jnlp now looks like this:
<jnlp spec="1.0+" codebase="file:///Users/apple/Documents" href="ccs.jnlp">

Open in new window


This is the error I get now:
BadFieldException[ The field <jnlp>href has an invalid value: ccs.jnlp,ccs.jnlp]
      at com.sun.javaws.jnl.XMLUtils.getAttributeURL(XMLUtils.java:102)
      at com.sun.javaws.jnl.XMLFormat.parse(XMLFormat.java:139) ...

I also tried:
href="/ccs.jnlp"

Open in new window


0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 47

Expert Comment

by:for_yan
ID: 34880687
It is strange, and why would it write it twice in the error message : ccs.jnlp,ccs.jnlp
And in all examples I see the same statement - I believe you do have this file ccs.jnlp
in Users/apple/Documents. Check all syntax for mistprints, say , ccs or maybe css
0
 
LVL 5

Assisted Solution

by:aciuica
aciuica earned 50 total points
ID: 34882411
Try to add a slash at the end of codebase:
<jnlp spec="1.0+" codebase="file:///Users/apple/Documents/" href="ccs.jnlp">
0
 
LVL 47

Expert Comment

by:for_yan
ID: 34882998
Well, certainly try to add the slash, though I thought about it, but checked that in many examples they show it without the last slash in the codebase. Maybe, for Mac OS, there may be some quirk, though. Worth trying.
0
 
LVL 1

Author Comment

by:allelopath
ID: 34946211
I had already tried the slash, even though, as for_yan says, the examples don't show that.
Anyway, it doesn't help.
I guess I'm giving up on this at least for now.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question