JNLP Problems: FileOpenService uninitialized

N

Novice

I'm getting an UnavailableServiceException with the message"uninitialized"
when I try to invoke the JNLP FileOpenService.

At the suggestion of the Java Tutorial section on File Choosers, I'm trying
to play with the JNLP file choosers for an application that will run in
Java Web Start. I'm using Eclipse 3.7 and have the jnlp.jar as an external
jar accessible to the project. The code compiles fine but the exception
occurs when I execute this code:

try {
fos = (FileOpenService)ServiceManager.lookup
("javax.jnlp.FileOpenService");
} catch (UnavailableServiceException exc) {
System.err.println("FileOpenService failed. Message: " +
exc.getMessage());
exc.printStackTrace();
}

As far as I can tell from the JNLP guides I've found, there's nothing wrong
with the code itself. I've googled and found other people who have asked
about the same problem but there are no solutions posted for any of them.

I've never worked with JNLP so I'm guessing that I haven't got something
set up correctly but I'm darned if I can figure out what I've done wrong.

Does anyone with JNLP/JWS experience have any suggestions on what I can do
to resolve this problem?
 
J

Jeff Higgins

I'm getting an UnavailableServiceException with the message"uninitialized"
when I try to invoke the JNLP FileOpenService.

At the suggestion of the Java Tutorial section on File Choosers, I'm trying
to play with the JNLP file choosers for an application that will run in
Java Web Start. I'm using Eclipse 3.7 and have the jnlp.jar as an external
jar accessible to the project. The code compiles fine but the exception
occurs when I execute this code:
 
N

Novice


I really appreciate your help with this Jeff. You must be better at
googling than I am ;-)

Maybe I'm having a stupid day but I can't figure out for the life of me
how to actually install this plug-in in Eclipse. I've spent the last hour
searching Eclipse help screens and googling for some insight into how to
install WS4E but I keep coming up with fragmentary information that makes
a lot of unwarranted assumptions about what I already know.

I downloaded WS4E from Sourceforge easily enough and unzipped it into a
directory. But that's where I'm stuck. According to a website I found,
http://www.venukb.com/2006/08/20/install-eclipse-plugins-the-easy-
way/,the normal thing to do is to copy the plugins and features
directories from the downloaded directory to their counterparts in
Eclipse. The downloaded directory only has a plugins directory but I
copied that in my Eclipse plugins directory and restarted Eclipse but I
can't see one iota of difference in my Eclipse. I don't see any "Start
JWS" option anywhere (although I may simply have failed to look in the
right place because they don't tell you where to expect things to change)
and my program still crashes on the "uninitialized" error.

I tried using the Update Manager approach but I don't see WS4E anywhere.
Again, though, they don't specify what update site to search to find it.
I've tried http://sourceforge.net and http://webstart.sourceforge.net but
I just get a "could not find" error for both.

I tried using the "easy" method advocated at the link I cited but I still
see nothing that looks like a Java Web Start option anywhere.

Any suggestions you or anyone could offer here would be greatly
appreciated. I fully expect that installing this plugin would solve my
problem with the FileOpenService initialization error; I just can't
figure out HOW to install it.
 
J

Jeff Higgins

I really appreciate your help with this Jeff. You must be better at
googling than I am ;-)

That a web search is cheap and easy is the whole point of most of my
posts.:)
....
I downloaded WS4E from Sourceforge easily enough and unzipped it into a
directory. But that's where I'm stuck.

I extracted the zip such that my
{eclipse-home}/plugins/net.sourceforge.webstart_1.2.1

{eclipse-home}/dropins/net.sourceforge.webstart_1.2.1 would probably
work just as well - and is now recommended.

Restart Eclipse.
Now when I go to File>Export>Other I see Webstart.
 
N

Novice

That a web search is cheap and easy is the whole point of most of my
posts.:)
...

I extracted the zip such that my
{eclipse-home}/plugins/net.sourceforge.webstart_1.2.1

{eclipse-home}/dropins/net.sourceforge.webstart_1.2.1 would probably
work just as well - and is now recommended.

Restart Eclipse.
Now when I go to File>Export>Other I see Webstart.

Sorry for the delay in getting back to you; I've been fighting other fires.
;-)

Your last line was the key: I hadn't seen anything in the documentation
about how to actually FIND Webstart when it is actually installed. It turns
out that whatever I did worked just fine; I simply went to
File/Export/Other and Webstart was right there.

The only documentation I could find said how you'd find it in NetBeans,
which I'm not using.

With a bit of luck, the Webstart documentation will tell me the rest of
what I need to know to work with this tool.

Ironically, I posted to Oracle's JNLP forum several days ago about my
"uninitialized" problem and finally got a reply yesterday. The responder
basically said you can't test your Java Web Start stuff in Eclipse!
Apparently, he didn't know about the Webstart plugin....
 
J

Jeff Higgins

Sorry for the delay in getting back to you; I've been fighting other fires.
;-)

Your last line was the key: I hadn't seen anything in the documentation
about how to actually FIND Webstart when it is actually installed. It turns
out that whatever I did worked just fine; I simply went to
File/Export/Other and Webstart was right there.

The only documentation I could find said how you'd find it in NetBeans,
which I'm not using.

With a bit of luck, the Webstart documentation will tell me the rest of
what I need to know to work with this tool.

Did you read the tutorial?
Ironically, I posted to Oracle's JNLP forum several days ago about my
"uninitialized" problem and finally got a reply yesterday. The responder
basically said you can't test your Java Web Start stuff in Eclipse!
Apparently, he didn't know about the Webstart plugin....
I don't know that you can. I've not tried the tool.
 
J

Jeff Higgins

I don't know that you can. I've not tried the tool.
I've only made a couple half-hearted jabs at JWS and haven't attempted
to use any of the services. I have read a good bit of documentation.

Concerning another thread where class loaders were discussed, the source
file for com.sun.javaws.Main.java makes interesting reading.
 
J

Jeff Higgins

On 02/01/2012 01:19 PM, Novice wrote:
snip
snip
Ironically, I posted to Oracle's JNLP forum several days ago about my
"uninitialized" problem and finally got a reply yesterday. The responder
basically said you can't test your Java Web Start stuff in Eclipse!
Apparently, he didn't know about the Webstart plugin....
A later post provides additional insight and a wonderful link.
The Oracle forum post is here:
<https://forums.oracle.com/forums/message.jspa?messageID=10121675#10121675>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top