First jnlp application -not running-please help-beginner
All,
I have a simple application where I do a System.out.println statement in the main method. When I run the application through Tomcat 5.0 why I am not seeing the println statement getting printed in the console ? How can I say whether its running ?
Here are my files: please help.
public class TheTime {
public static void main(String args[]) {
System.out.println("I am here, show me");
}
}
I created a jar file with this class /signed it and here is my jnlp file:
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.5+" codebase="http://localhost:8080/ href="time.jnlp">
<information>
<title>JDIC Example</title>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+"/>
<jar href="TheTime.jar"/>
</resources>
<application-desc main-class="TheTime" />
</jnlp>
I put Time.jar under "webcontent" folder in eclipse. I use eclipse and Tomcat 5.0.
Do I need to do anything else ? Please help
[1211 byte] By [
mayajavaa] at [2007-11-26 18:35:55]

# 1
Does the application start up when you access it? Have you changed your the setting on the Java control panel to always show a console? Does the console appear but nothing gets printed?
# 2
For your questions:
1. Does the application start up when you access it?
I used Java application cached viewer and found that - the application is there. But how can I find out whether it [my simple app] is started ? I didnt get any out statements on my console.
2. Have you changed your the setting on the Java control panel to always show a console? - NO. How to do that. My IDE is eclipse with tomcat as the server.
3.Does the console appear but nothing gets printed? - In eclipse, I am checking the "console" tab. Nothing gets printed there after server startup.
Thanks again!!
# 3
I think you have a misunderstanding about Webstart. You deploy it in Tomcat and you access it through a browser.The IDE is never used and nothing is going to print on eclipse's console because it is not running in eclipse.
As far as always showing the console. If you are running windows then under the control panel should be a link to the java control panle. Under the advanced tab is an option for always showing the console.
# 4
True.
I did that, I went to Control Panel-Java and set "show java console".
Then I went to my browser window and ran .jnlp again. What is it supposed to do ? When I run .jnlp
I see "java Vm loading" for some time. I keep the java console open from interent explorer but didnt see my system out statements printing out there.
# 5
> True.
>
> I did that, I went to Control Panel-Java and set
> "show java console".
>
> Then I went to my browser window and ran .jnlp again.
> What is it supposed to do ? When I run .jnlp
> I see "java Vm loading" for some time. I keep the
> java console open from interent explorer but didnt
> see my system out statements printing out there.
Sounds like you are close and that it is running.
Try displaying a gui instead of a println and see if that appears:
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "It works", "Yes!", JOptionPane.INFORMATION_MESSAGE);
}
# 6
So again my answer is,
yes: I enabled : Show console from Java-control panel
But when I run my .jnlp file, the console doesnt appear automatically[ should it happen ?]. Also, if I manually open Java console from internt explorer it doesnt have any statements other than the default entries.
thanks!!
# 7
> So again my answer is,
> yes: I enabled : Show console from Java-control
> panel
>
> But when I run my .jnlp file, the console doesnt
> appear automatically[ should it happen ?]. Also, if I
> manually open Java console from internt explorer it
> doesnt have any statements other than the default
> entries.
It should appear automatically. Look at the tomcat logs for error and double check that your jnlp looks good.
# 8
Ok tried your code.No, NO GUI appears. No o/p in console either..
# 9
> Ok tried your code.
>
> No, NO GUI appears. No o/p in console either..
I just noticed this in your jnlp:
<all-permissions/>
If you need all permissions you have to make sure your jar is signed. But for what you are doing you don't need this so remove it from the jnlp for now.
# 10
Have you tried creating the JNLP on your home directory first, instead of the tomcat server, so you can be sure it works? The codebase would be the folder that both your jar and your jnlp are in.Make sure you can do that before doing stuff on tomcat.
# 11
I removed that line and tried, no luck, same thing...PS: I was signing my jar using keystore jarsigner.. So yes, thetime.jar which I am using is a signed jar file..I am looking where I can see the log files for tomcat. this is a tomcat embedded with eclipse..
# 12
> I removed that line and tried, no luck, same
> thing...
>
> PS: I was signing my jar using keystore jarsigner..
> So yes, thetime.jar which I am using is a signed jar
> file..
>
> I am looking where I can see the log files for
> tomcat. this is a tomcat embedded with eclipse..
Sorry, I am out of ideas. I have never heard of tomcat being embedded in eclipse, I would look for a log file.
How are you deploying the app? Tomcat application manager? Ant file?
# 13
Asbestos,
Yes: I put everything in my C:, my java file, my class file, my jar file, signed it and my jnlp file is like this now: Still no luck, GUI doesnt appear, console doesnt appear and if I open console, no outputs..
Whats happening ?
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.5+" codebase="file:///C:/" href="time.jnlp">
<information>
<title>JDIC Example</title>
<vendor>Your website</vendor>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.5+" />
<jar href="TheTime.jar"/>
</resources>
<application-desc main-class="TheTime"/>
</jnlp>
# 14
zadok, Eclipse wtp enables us to use eclipse with tomcat. its like websphere embedded in wsad/rad. You can put your web applications in tomcat and run it..
Bt see, I put everything in C: and tried to run C:/time.jnlp from an internet explorere window, still no luck...
so, waht could be,
# 15
and here is my system's JRE setting: Java Plug-in 1.5.0_10Using JRE version 1.5.0_10 Java HotSpot(TM) Client VMIf anyone has any ideas, please help..
# 16
All,
I found this exception in C:\Documents and Settings\user name\Application Data\Sun\Java\Deployment\log
any idea why ?
Exception in thread "javawsApplicationMain" java.lang.NullPointerException
at java.io.File.<init>(Unknown Source)
at com.sun.javaws.LaunchSelection.isPlatformMatch(Unknown Source)
at com.sun.javaws.LaunchSelection.matchJRE(Unknown Source)
at com.sun.javaws.LaunchSelection.handleJREDesc(Unknown Source)
at com.sun.javaws.LaunchSelection.access$000(Unknown Source)
at com.sun.javaws.LaunchSelection$1.visitJREDesc(Unknown Source)
at com.sun.javaws.jnl.JREDesc.visit(Unknown Source)
at com.sun.javaws.jnl.ResourcesDesc.visit(Unknown Source)
at com.sun.javaws.LaunchSelection.selectJRE(Unknown Source)
at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
# 17
I am trying something: I believe I have a JRE mismatch. Will let everyone know if my trial is success