Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2445 > unrolled thread

[follow] issue with jws

Started by"Pseudo Silk Kimono" <pseudo.silk.kimono@THRWHITE.remove-dii-this>
First post2011-04-27 15:39 +0000
Last post2011-04-27 15:39 +0000
Articles 8 — 6 participants

Back to article view | Back to comp.lang.java.gui


Contents

  [follow] issue with jws "Pseudo Silk Kimono" <pseudo.silk.kimono@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
    Re: [follow] issue with j "Steve W. Jackson" <steve.w..jackson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
      Re: [follow] issue with j "Pseudo Silk Kimono" <pseudo.silk.kimono@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
        Re: [follow] issue with j "Steve W. Jackson" <steve.w..jackson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
        Re: [follow] issue with j "tar" <tar@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
          Re: [follow] issue with j "Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
        Re: [follow] issue with j "Thomas Fritsch" <thomas.fritsch@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000
    Re: [follow] issue with j "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:39 +0000

#2445 — [follow] issue with jws

From"Pseudo Silk Kimono" <pseudo.silk.kimono@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
Subject[follow] issue with jws
Message-ID<fcedg0$fn3$1@registered.motzarella.org>
  To: comp.lang.java.gui
I have deployed my Java GUI to our local intranet and it does start up
as expected by kicking off Java Web Start.  However, when I press a
button on the GUI, I expect to see a webpage, but nothing happens.
The same GUI runs fine, with the expected results when I run it from the
command line using java -jar.

What should I start looking at to determine why my buttons are not
opening up web pages.



-- 
PSK - RLU 452647 http://improve-usenet.org
Killing GG and Supernews now on Ubuntu, Vista and XP 
http://www.grc.com/stevegibson.htm

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [next] | [standalone]


#2446 — Re: [follow] issue with j

From"Steve W. Jackson" <steve.w..jackson@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
SubjectRe: [follow] issue with j
Message-ID<stevewjackson-3B6928.12274114092007@individual.net>
In reply to#2445
  To: comp.lang.java.gui
In article <fcedg0$fn3$1@registered.motzarella.org>,
 Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote:

> I have deployed my Java GUI to our local intranet and it does start up
> as expected by kicking off Java Web Start.  However, when I press a
> button on the GUI, I expect to see a webpage, but nothing happens.
> The same GUI runs fine, with the expected results when I run it from the
> command line using java -jar.
> 
> What should I start looking at to determine why my buttons are not
> opening up web pages.

Um...the code behind their action listeners?
-- 
Steve W. Jackson
Montgomery, Alabama

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2447 — Re: [follow] issue with j

From"Pseudo Silk Kimono" <pseudo.silk.kimono@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
SubjectRe: [follow] issue with j
Message-ID<fcehhs$tmh$1@registered.motzarella.org>
In reply to#2446
  To: comp.lang.java.gui
On 2007-09-14, Steve W. Jackson <stevewjackson@knology.net> wrote:
> In article <fcedg0$fn3$1@registered.motzarella.org>,
>  Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote:
>
>> I have deployed my Java GUI to our local intranet and it does start up
>> as expected by kicking off Java Web Start.  However, when I press a
>> button on the GUI, I expect to see a webpage, but nothing happens.
>> The same GUI runs fine, with the expected results when I run it from the
>> command line using java -jar.
>> 
>> What should I start looking at to determine why my buttons are not
>> opening up web pages.
>
> Um...the code behind their action listeners?

private void JButtonActionPerformed(java.awt.event.ActionEvent evt) {                                               
// TODO add your handling code here:
         invokeBrowser("cmd /C start http://www.google.ca/");
    } 


private void invokeBrowser(String commandString) {
   try {
         Runtime.getRuntime().exec(commandString);
     } catch (IOException ex) {
         ex.printStackTrace();
     }
 } 
-- 
PSK - RLU 452647 http://improve-usenet.org
Killing GG and Supernews now on Ubuntu, Vista and XP 
http://www.grc.com/stevegibson.htm

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2448 — Re: [follow] issue with j

From"Steve W. Jackson" <steve.w..jackson@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
SubjectRe: [follow] issue with j
Message-ID<stevewjackson-CEBC81.13352914092007@individual.net>
In reply to#2447
  To: comp.lang.java.gui
In article <fcehhs$tmh$1@registered.motzarella.org>,
 Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote:

> On 2007-09-14, Steve W. Jackson <stevewjackson@knology.net> wrote:
> > In article <fcedg0$fn3$1@registered.motzarella.org>,
> >  Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote:
> >
> >> I have deployed my Java GUI to our local intranet and it does start up
> >> as expected by kicking off Java Web Start.  However, when I press a
> >> button on the GUI, I expect to see a webpage, but nothing happens.
> >> The same GUI runs fine, with the expected results when I run it from the
> >> command line using java -jar.
> >> 
> >> What should I start looking at to determine why my buttons are not
> >> opening up web pages.
> >
> > Um...the code behind their action listeners?
> 
> private void JButtonActionPerformed(java.awt.event.ActionEvent evt) {         
>                                       
> // TODO add your handling code here:
>          invokeBrowser("cmd /C start http://www.google.ca/");
>     } 
> 
> 
> private void invokeBrowser(String commandString) {
>    try {
>          Runtime.getRuntime().exec(commandString);
>      } catch (IOException ex) {
>          ex.printStackTrace();
>      }
>  }

I've learned never to use the single string version of the exec() method 
since it will parse those strings and may not always produce what you 
expect.

Then there's also the fact that that code only works on Windows, and not 
necessarily reliably on older ones.

But that looks as if it should work -- except for a possibility which 
occurs.  I'm thinking that JWS may have security or access restrictions 
similar to those of an applet.  If so, it may not be allowed to execute 
that command unless there's some signing done.

= Steve =
-- 
Steve W. Jackson
Montgomery, Alabama

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2455 — Re: [follow] issue with j

From"tar" <tar@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
SubjectRe: [follow] issue with j
Message-ID<ymi1wd0ao8d.fsf@blackcat.isi.edu>
In reply to#2447
  To: comp.lang.java.gui
Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> writes:

> On 2007-09-14, Steve W. Jackson <stevewjackson@knology.net> wrote:
> > In article <fcedg0$fn3$1@registered.motzarella.org>,
> >  Pseudo Silk Kimono <Pseudo_Silk_Kimono@marillion.com> wrote:
> >
> >> I have deployed my Java GUI to our local intranet and it does start up
> >> as expected by kicking off Java Web Start.  However, when I press a
> >> button on the GUI, I expect to see a webpage, but nothing happens.
> >> The same GUI runs fine, with the expected results when I run it from the
> >> command line using java -jar.
> >> 
> >> What should I start looking at to determine why my buttons are not
> >> opening up web pages.
> >
> > Um...the code behind their action listeners?
> 
> private void JButtonActionPerformed(java.awt.event.ActionEvent evt) {                                               
> // TODO add your handling code here:
>          invokeBrowser("cmd /C start http://www.google.ca/");
>     } 
> 
> 
> private void invokeBrowser(String commandString) {
>    try {
>          Runtime.getRuntime().exec(commandString);
>      } catch (IOException ex) {
>          ex.printStackTrace();
>      }
>  } 

Does the web start application need to be signed in order to be able to
run commands on the local machine?

Do you get a security exception when you look at the console for the
stack trace?  Perhaps it would help if you put in a dialog call with the
error message instead of (or in addition to) writing it to standard
output.  Perhaps something like  (Java 1.5+)

    StringBuffer msg = new StringBuffer(ex.getMessage() + "\n");
    msg.append(ex.toString() + "\n");
    for (StacktraceElement e: ex.getStrackTrace()) {
       msg.append(e.toString() + "\n");
    }
    JOptionPane.showMessageDialog(null, msg.toString(), "Error", JOptionPane.ERROR_MESSAGE);


-- 
Thomas A. Russ,  USC/Information Sciences Institute

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2457 — Re: [follow] issue with j

From"Andrew Thompson" <andrew.thompson@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
SubjectRe: [follow] issue with j
Message-ID<783a88c57f0d7@uwe>
In reply to#2455
  To: comp.lang.java.gui
Thomas A. Russ wrote:
..
>Do you get a security exception when you look at the console for the
>stack trace?  

I am guessing you would (unless the app. is signed and trusted).

But then, carrying over from earlier converstations. I 
am not sure why the OP is not using the (very) more
rigourous approach to launching the local browser,
as outlined in BrowserLauncher2 (in the end it comes 
down to 'exec', but there is a lot of code used to 
determine the correct arguments).

Or more importantly, why the JWS app. is not taking
the strategy of checking first for the existence/availability
of the java.jnlp.BasicService, and if it exists, simply 
calling BS.showDocument().

-- 
Andrew Thompson
http://www.athompson.info/andrew/

Message posted via JavaKB.com
http://www.javakb.com/Uwe/Forums.aspx/java-gui/200709/1

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2458 — Re: [follow] issue with j

From"Thomas Fritsch" <thomas.fritsch@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
SubjectRe: [follow] issue with j
Message-ID<fcf8u6$kkc$00$1@news.t-online.com>
In reply to#2447
  To: comp.lang.java.gui
Pseudo Silk Kimono wrote:
> private void JButtonActionPerformed(java.awt.event.ActionEvent evt) {                                               
> // TODO add your handling code here:
>          invokeBrowser("cmd /C start http://www.google.ca/");
>     } 
> 
> 
> private void invokeBrowser(String commandString) {
>    try {
>          Runtime.getRuntime().exec(commandString);
>      } catch (IOException ex) {
>          ex.printStackTrace();
>      }
>  } 
Since you use JavaWebStart anyway, why not use JavaWebStart's API for 
starting the browser (instead of by Runtime.exec) ?
There is an example at 
<http://java.sun.com/j2se/1.4.2/docs/guide/jws/developersguide/examples.html#BasicService>

-- 
Thomas

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [next] | [standalone]


#2450 — Re: [follow] issue with j

From"Roedy Green" <roedy.green@THRWHITE.remove-dii-this>
Date2011-04-27 15:39 +0000
SubjectRe: [follow] issue with j
Message-ID<3dple35f12eh5f674s7blt774k5qmn3b7n@4ax.com>
In reply to#2445
  To: comp.lang.java.gui
On Fri, 14 Sep 2007 16:39:28 +0000 (UTC), Pseudo Silk Kimono
<Pseudo_Silk_Kimono@marillion.com> wrote, quoted or indirectly quoted
someone who said :

>What should I start looking at to determine why my buttons are not
>opening up web pages.

Is your button supposed to open a web page or supposed to launch a JWS
app?

If a web page, use Opera, right click and copy the URL to the clip
board.  Paste it to the command line.  See if you can get to the page
manually.  Watch for case sensitivity.

If a JAWS app, see http://mindprod.com/jgloss/installingjaws.html
-- 
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.gui


csiph-web