How to configure web application in JProfiler? - java

I want to configure web application to JProfiler 7.1.2. Below are details which I carried out while configuring the session.
Web Server: Tomcat 5.0
Operating System: Windows XP
We have selected session type as "Web Start".
In Web Start settings section, How to select URL of JNLP file?
(we could not find out JNLP file).
Also we have selected Java VM as a "Oracle JRE 1.6.0_22".
We have configured Class Path.
After clicking OK after some time it shows application error as "Unable to launch application".
It shows error details as follows
CouldNotLoadArgumentException[ Could not load file/URL specified: D:\jakarta-tomcat-5.0.19\conf]
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
One more question, How can I add my project classes? I can not see project class file in Memory Views --> Agreegation Level --> Classes
Please guide me.
Awaiting reply

"Java Web start" has nothing to do with web applications. To profile Tomcat, invoke
Session->Integration Wizards->New Server Integration
and follow the steps in the wizard.

Related

Unable to Load Library 'virt': libvirt.so

I'm working on Ubuntu and using Netbeans. My code is trying to connect to the libvirt host "qemu+ssh://IPaddress/system". The development environment and the service environment is different. The output-jar file I put on the service environment but apparently I hit below error when rebooting the service. I already added the jna-3.2.5.jar and the libvirt-0.5.1.jar on to the path folder of my service environment.
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to
load library 'virt': libvirt.so: cannot open shared object file: No
such file or directory
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:164)
at com.sun.jna.Native.loadLibrary(Native.java:375)
at com.sun.jna.Native.loadLibrary(Native.java:360)
at org.libvirt.jna.Libvirt.<clinit>(Unknown Source)
at org.libvirt.Library.<clinit>(Unknown Source)
at org.libvirt.Connect.<init>(Unknown Source)
What else I have missed?
thanks for the response.
Apparently, I have to install libvirt package on to my service environment, and the error will be gone. I hope it will help other's problem as well.

WebStart of Java EAR application failing from Glassfish 3.1.2.2

I built a small test Java EE Entreprise Application using NetBeans. Everything works fine in NetBeans (version 7.3) when I run/debug it.
I'm now trying to deploy the test app using WebStart. To do so, I have setup a GlassFish server of the same version that is in NetBeans (GF 3.1.2.2) and I have the JDK Version 7 U 51 installed on the machine. For right now, I'm trying to run the WebStart app on the same machine that GlassFish is on so I'm guessing it's using JRE 7U51 also.
However, when I launch the client application from within GlassFish admin page (app deployed fine), I get a NullPointerException.
Here's the full exception trace:
java.lang.NullPointerException
at java.io.StringReader.<init>(Unknown Source)
at org.glassfish.appclient.client.JWSAppClientContainerMain.insertMaskingLoader(JWSAppClientContainerMain.java:186)
at org.glassfish.appclient.client.JWSAppClientContainerMain.main(JWSAppClientContainerMain.java:132)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Here's the JNPL file I get from GlassFish when I want to WebStart the application:
http://pastebin.com/HPddJA3a
Please note that the JNPL file is autogenerated by GlassFish... my EAR doesn't contain one.
This is my first deployment and I've tried many things.... please help! :)
EDIT: More details on how I deploy and access the client app:
I uploaded the EAR file to Glassfish using the admin console (port 4848) and that deployment is successful (no error messages). Then, in the admin console, I see all my EE components (EJB, app jar, etc) and I can launch the client app. This just links to the following URL: http://server-test.com:8080/EEAppTest/EEAppTestEEClient (not a real URL). When I access it, I get the NullPointerException described above.

unable to access java web start using desktop link while it is accessible using web url

I am unable to access Java web start application using desktop shortcut while I can access it using the web URL.
com.sun.deploy.net.FailedDownloadException: Cannot download resource. System is offline.
at com.sun.deploy.cache.ResourceProviderImpl.checkUpdateAvailable(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.isUpdateAvailable(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResourceCacheEntry(Unknown Source)
at com.sun.deploy.cache.ResourceProviderImpl.getResourceCacheEntry(Unknown Source)
and
network: Connecting socket://127.0.0.1:4063 with proxy=DIRECT
#### Java Web Start Error:
#### Could not load file/URL specified: http://sample.com/sample.jnlp
I do not know how to configure the proxy for my java web start. I have checked the permission of all jar files and jnlp file and everything seems to be perfect Any suggestion.

Can not start java web start

I have typed javaws url_of_jnlp in my CMD under windows 7, but i got the following error:-
CouldNotLoadArgumentException[ Could not load file/URL specified: url_of_jnlp]
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main.access$000(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Thread.java:722)
I have noticed this problem since i need java web start to be able to run an application, but when i tired to run this application , i will be asked to save a file named webstart.jnlp , instead of automatically lunching the java web start.
So what might be the problem?
You need to replace url_of_jnlp with the actual url of the jnlp file of the application.
This will not work: javaws url_of_jnlp
This will work: javaws "C:\..[Path to folder]..\My_Application.jnlp"
You should really have found this info yourself, it is available at the bottom of this page:
http://www.java.com/en/download/faq/java_webstart.xml
See this page for info on command line options for javaws: http://docs.oracle.com/javase/1.5.0/docs/guide/javaws/developersguide/javaws.html
Check the following links to make sure everything is perfect in your setup.
Common Java Web Start Problems
Deploying Java Web Start Applications
Hope it helps.

FileNotFoundException starting 1.4.2 webstart application with java webstart 1.6 over HTTPS

And many thanks to all who will take time for reading.
I'm struggling to make a webstart Swing 1.4.2_12 application to launch with java webstart 1.6.0_29.
Here is the scenario :
All traffic is done over HTTPS
User clics a link on a web page to launch the application : servlet
generated jnlp file
Java webstart client (1.6.0_29) starts and loads the application in
a breath
Because the j2se version is set to 1.4.2_12 in jnlp descriptor java
webstart 1.4.2_12 is used to launch the application (loaded by
1.6.0_29)
Java webstart 1.4.2_12 fails on startup claiming that it cannot find some ghost "javaws2" file
The following message is reported:
CouldNotLoadArgumentException[ Could not load specified file/URL : C:\DOCUME~1\BENOIT~1.VAT\LOCALS~1\Temp\javaws2]
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Full stacktrace is:
java.io.FileNotFoundException: C:\DOCUME~1\BENOIT~1.VAT\LOCALS~1\Temp\javaws2 (File not found)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The same error occurs when HTTPS is disabled.
Both the following HTTP headers are sent to the client by JNLP servlet :
Cache-Control : empty
Pragma : empty
These headers are necessary to prevent IE to disable caching in HTTPS mode wich prevents java webstart to find the loaded jnlp file (because it is not cached).
Mime-type is set to : application/x-java-jnlp-file
What I do not understand is why java 1.4.2_12 cannot find the jnlp file loaded by JWS 1.6.0_29 ?
Thanks for reading.
#Andrew : Thank you for your interest.
Here comes my conclusions on that issue.
In a nutshell : Always set the href attribute in the the jnlp tag !
<jnlp spec="1.0+" codebase="htt://myhost/codebase" href="mustSetThisAbsolutelyForJWS-1.4.2_12.jnlp">
...
</jnlp>
Multiple HTTP debug sessions have shown that :
Scenario 1: href attribute is left empty and JNLP files are associated with JWS 1.6 on the client
User clicks a jnlp link, JNLP file is downloaded and cached by
browser.
JWS 1.6.0_29 starts up then read the downloaded JNLP file.
JWS 1.6.0_29 downloads all JAR files and then switches to JWS 1.4.2_12.
JWS 1.4.2_12 starts up and then obviously read the JNLP file in its turn.
JWS 1.4.2_12 tries to retrieve the JNLP file pointed by the href
attribute.
Since href is empty, JWS reports "Could not load specified file/URL
: C:\DOCUME~1\BENOIT~1.VAT\LOCALS~1\Temp\javaws2". (As a side note, ghost javaws2 is sometimes named javaws10 or similar)
Please note : When using JWS 1.4 or 1.5 with this scenario, the
application WILL start. The issue only appears when JWS 1.6 is used
to run a 1.4.2_12 application. JWS 1.5 and 1.6 do not fail when no
href attribute is set. Instead they simply use the JNLP as is, check the
JAR updates and then launch the application.
Scenario 2: href attribute is set with a proper value and JNLP files are associated with JWS 1.6 on the client
User clicks a jnlp link, JNLP file is downloaded and cached by
browser.
JWS 1.6.0_29 starts up then read the downloaded JNLP file.
JWS 1.6.0_29 downloads all JAR files and then switches to JWS 1.4.2_12.
JWS 1.4.2_12 starts up and then obviously read the JNLP file in its turn.
JWS 1.4.2_12 tries to retrieve the JNLP file pointed by the href
attribute.
JWS 1.4.2_12 downloads the JNLP pointed by the href attribute.
JWS 1.4.2_12 downloads all JNLP JAR files referenced in the freshly downloaded JNLP file.
JWS 1.4.2_12 launches the application correctly.
It's been a major pain in the neck for me and took me days to figures this out. Hope this will help someone one day.

Categories

Resources