Printing thru java applet
Hi !
I am trying to print using a java applet using the printable interface.I am using jdk1.3.1 and OS
is windows 2000 or windows NT.
I'm imporing the following packages.
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.net.*;
import java.awt.print.*;
import java.awt.image.*;
import java.awt.geom.*;
public class image_applet extends Applet implements Printable
The problem is that this requires java runtime environment1.4.01 as default plugin in the client
and works only in higher versions of IE(5.5 and above ) and does not work in netscape.
I would really appreciate if anyone tells me how to make this work in all the client browsers,
without having to worry about the plugin.
Bye,
Sudhakap
I too am havin the same problem
Using the print option of the browswer gives results which arent constant with all browsers and
if i dont implement Printable then the Applet hangs wihtout printing
I am sending the code pls let me know if it helps
When i try it out it is not working
public class MyApplet extends Applet
public static void main(String[] args)
MyApplet a = new MyApplet();
a.init();
a.setSize(300,300);
a.setVisible(true);
public void init()
Button b = new Button("Printxx");
b.addActionListener(new MyAL());
add(b);
class MyAL implements ActionListener
public void actionPerformed(ActionEvent arg0)
printComponents(MyApplet.this);
private void printComponents(Component c)
{System.out.println("printint1");
Toolkit tk = Toolkit.getDefaultToolkit();
Frame frame = getFrame(c);
Properties props = new Properties();
props.put("awt.print.printer","HP DeskJet 810C");
props.put("awt.print.numCopies","2");
if(tk!= null)
System.out.println("printint2" frame " " + c.getName());
String name = c.getName()+" print job";
PrintJob pj = tk.getPrintJob(frame, name , props);
if(pj != null)
{System.out.println("printint3");
Graphics pg = pj.getGraphics();
if(pg!= null)
try
System.out.println("printint4");
c.printAll(pg);
}finally
pg.dispose();
pj.end();
System.out.println(props);
static Frame getFrame(Component c)
System.out.println("while 1"+c);
while((c=c.getParent())!= null )
{System.out.println("while 2"+c);
if (c instanceof Frame)
System.out.println("while 3 "+c);
return (Frame)c;
return null;
public void paint(Graphics g)
g.drawString("hello ", 40, 40);
Similar Messages
-
Warning Noob: Sending "Hello World!" in Printer using Java Applet
Hello guys!
im a newbie in java programming... i hope that you can help me with my problem.
how can i print "Hello World!" in printer using java applet. lets pretend that the applet is digitally signed.
i tried window.print in javascript but unfortunately, that is not what i am looking for.
thanks for reading my post and i hope that you help me with my quest in java =)An applet is still part of the Swing package. I assume you're extending JApplet. There isn't anything in the print API that says it can't be done in an applet. Except that you might have to sign your applet Jar file with a digital certificate to get the printing to work.
-
Problem facing when uploadin file thru java applet using WSA
I am facing a issue, when I am trying to upload a pdf file on a website which uses java applet and WSA as proxy. On the java applet window when I select the file a click upload, it gives " Upload failed : java.net.Unknownhostexception ".
On checking the issue in java console getting following error "SEVERE: java.net.UnknownHostException: www.mca.gov.in
java.net.UnknownHostException: www.mca.gov.in
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:86)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:652)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:628)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
at javazoom.transfer.client.http.HTTPTransfer.headInfo(Unknown Source)
at javazoom.transfer.client.http.HTTPUploadTransfer.dbupdate(HTTPUploadTransfer.java:973)
at javazoom.transfer.client.http.HTTPUploadTransfer.run(HTTPUploadTransfer.java:155)
at java.lang.Thread.run(Unknown Source)
network: Connecting http://www.mca.gov.in:80/ with proxy=DIRECT
29-Oct-2009 15:03:58 javazoom.transfer.client.http.HTTPTransfer headInfo
SEVERE: java.net.UnknownHostException: www.mca.gov.in
29-Oct-2009 15:03:58 javazoom.transfer.client.http.HTTPUploadTransfer run
INFO: Upload failed"Done, what next ?
Noah -
Printing a Java applet ?
How can i print out my "house"? When i go in the applet and press print it prints a blank page
"House" not printed...
here is my code:
import javax.swing.JApplet;
import javax.swing.JOptionPane;
import java.awt.Graphics;
import java.awt.Color;
public class AssignmentThreeparttwo extends JApplet
public void paint( Graphics g )
super.paint( g );
g.setColor ( Color.RED);
g.drawString( "My Java House", 600, 50 );
//body of the house
g.setColor ( Color.GREEN );
g.drawRect ( 470, 370 , 400 , 400 );
//door
g.setColor ( Color.RED );
g.drawRect ( 600 , 600 , 170 , 170 );
//window
g.setColor ( Color.BLACK );
g.drawRect ( 520, 460 , 100 , 100 );
g.drawRect ( 720, 460 , 100 , 100 );
//door knob
g.fillOval (630 , 680 , 20 , 10 );
//window Inside part
g.setColor ( Color.ORANGE );
g.drawLine ( 720, 510 , 820 , 510 );
g.drawLine ( 520, 510 , 620 , 510 );
g.drawLine ( 570, 560 , 570 , 460 );
g.drawLine ( 770, 560 , 770 , 460 );
//roof
g.setColor ( Color.BLUE );
g.drawLine ( 470, 370 , 665 , 200 );
g.drawLine ( 870, 370 , 665 , 200 );
g.drawLine ( 470, 370, 870 , 370 );
//use full screen to view the applet
}See http://java.sun.com/docs/books/tutorial/2d/printing/index.html
-
JDK 1.4.2 java applet image printing on mac safari
Hi there,
I'm trying to implement printing inside java applet using javax.print package. I read an article somewhere about the package not working perfectly under mac, and a workaround is to use the old java.awt.print to get the print services, then use the DocPrintJob to print.
The SimpleDoc I use for capturing the image that I need to print works fine, and the printServices are there. The problem I have is it's giving me an 'invalid flavor' exception when clicking 'Print' on popup PrintDialog.
It seems that the mimetype is what's causing the problem, as the printer's supported mime type is "application/x-java-jvm-local-objectref". (note that, on PC the printing works fine, with Doc flavor mimetype as image/png and the image I need to print in png format). I tried switching the flavor to SERVICE_FORMATTED.RENDERABLE_IMAGE, printing an ImageDoc class which implements Doc and RenderableImage, but 'invalid flavor' exception still occurs.
I don't know much about printers on Mac, so I'm not sure what I can do about it, is it something that can be controlled from the Applet or it's something that the user has to set in the system - the Applet can only warn the user and tell the user to do the configuration.
Thanks in advance!SwingUtilities.updateComponentTreeUI() works by first updating the UI of the given component, and then updating the component's children (and their children). So first it will update the JToolBar's UI (which installs the appropriate borders on its buttons), and then it will update each button's UI (which subsequently installs its own default border onto the button, undoing JToolBar's border installation, thanks to the bug mentioned previously).
Another possible work-around for this problem would be to write your own updateComponentTreeUI() method that updates the child components' UI's before updating the parent component's UI:public static void newUpdateComponentTreeUI(Component c)
updateTreeUIs(c);
c.invalidate();
c.validate();
c.repaint();
private static void updateTreeUIs(Component c)
Component[] children = null;
if (c instanceof JMenu) children = ((JMenu)c).getMenuComponents();
else if (c instanceof Container) children = ((Container)c).getComponents();
// Children first...
for (int i=0; children != null && i < children.length; i++)
updateTreeUIs(children);
// Parent last...
if (c instanceof JComponent) ((JComponent)c).updateUI();
}Not sure if this will present any other conflicts though. -
Can I save as pdf when printing from a Java applet on a webpage in Safari?
I am trying to use a webpage that is running a Java applet. A dialog comes up that asks me, "Do you want to run this application?" The dialog also says, "This application will run with limited access that is intended to protect your computer and personal information." I select "Run". The applet generates an image I want to print. There is a "Print" button on the applet. I select "Print". A Security Warning dialog comes up that says, "The applet has requested access to the printer. Do you want to allow this action?" I select "OK". The Print dialog comes up. I choose the PDF button in the lower left corner. I choose "Save as PDF...". A second Print dialog comes up. I input a title in the Save As box. I choose Desktop in the Where box. I do not change anything else and select the "Save" button. A dialog appears that says, "Print Error while printing." There is an icon with paper, a pencil, a ruler and a paintbrush on the dialog.
Is this an issue with Apple and Java security? Does "run with limited access" mean I can't print and save as PDF? Should I upgrade to Mavericks? It seems like others have not been happy with Mavericks and have had problems saving as PDF with Mavericks. How do I let Apple know about this error? The error dialog is useless.
I am on a Mac running OS X 10.8.5 and Safari 6.1.2. My Java version is 7 update 51.
What other information can I provide to help solve the problem (if it can be solved)?
Thank you for your help!Correction I would like to save as PDF/A-1b
for archiving.
http://www.adobe.com/enterprise/standards/pdfa/ -
Printing problem on java applet
Hi, I'm Korean and MacBook air user.
I'm very not good at English, please excuse me .
I use OS X 10.8.3 and jdk 7.
I make a simple java applet program includes printing functionary.
But, only browsers (Safari and FireFox) on Mac OS X not printing font correctly.
I use setFont() function and then drawString() function.
If you cannot understand my question, enter the link below. I think that question is same with my question.
http://stackoverflow.com/questions/15466060/java-app-on-mac-os-x-not-printing-fo nts-correctly
Thank you for reading my question.Points/questions.
It is a lot easier to debug these things if we can see the applet. Is it on the net? Can you give us the URL?
Have you considered launching this applet using web start? (If it turns out to be related to security, the web
start JNLP API has a neat way to sidestep that problem.)
Edit 1: Deleted the entire first two paragraphs when realised you said 'always prints'.
Edited by: AndrewThompson64 on Apr 1, 2008 9:41 AM -
Print- Save as PDF from Java applet on a webpage in Safari
I am on a Mac running OS X version 10.8.5 and Safari version 6.1.2. I am using the website www.wordle.net, which uses a Java applet to create a Wordle. The applet has a print button. The website FAQ says I should be able to save a Wordle as a PDF on a Mac. When I try to do this I get a small dialog that simply says "Error whilte printing."
Here is some of the system.log:
Mar 4 16:57:54 Kroghs-iMac.local sandboxd[602] ([557]): java(557) deny file-write-create /private/var/folders/f0/c8r_ry6d4131x95phl6fv7kr0000gn/T/WebKitPlugin-f12Pu6/53 164c620f81b
Mar 4 16:57:54 Kroghs-iMac.local java[557]: spawn_via_launchd() failed, errno=1 label=[0x0-0x96096].com.apple.ImageCaptureExtension2 path=/System/Library/Image Capture/Support/Image Capture Extension.app/Contents/MacOS/Image Capture Extension flags=0
Mar 4 16:57:54 --- last message repeated 1 time ---
Mar 4 16:57:54 Kroghs-iMac.local java[557]: ERROR: [ICCommandCenter launchAgent] - Failed to launch agent[1], status: -10810, url: 'file://localhost/System/Library/Image%20Capture/Support/Image%20Capture%20Exte nsion.app/'
Mar 4 16:57:54 Kroghs-iMac.local java[557]:
***** Failed to launch Image Capture Extension.
Mar 4 16:57:54 Kroghs-iMac.local java[557]: spawn_via_launchd() failed, errno=1 label=[0x0-0x97097].com.apple.ImageCaptureExtension2 path=/System/Library/Image Capture/Support/Image Capture Extension.app/Contents/MacOS/Image Capture Extension flags=0
Mar 4 16:57:54 --- last message repeated 1 time ---
Mar 4 16:57:54 Kroghs-iMac.local java[557]: ERROR: [ICCommandCenter launchAgent] - Failed to launch agent[1], status: -10810, url: 'file://localhost/System/Library/Image%20Capture/Support/Image%20Capture%20Exte nsion.app/'
Mar 4 16:57:54 Kroghs-iMac.local java[557]:
***** Failed to launch Image Capture Extension.
Mar 4 16:57:54 Kroghs-iMac.local java[557]: spawn_via_launchd() failed, errno=1 label=[0x0-0x98098].com.apple.ImageCaptureExtension2 path=/System/Library/Image Capture/Support/Image Capture Extension.app/Contents/MacOS/Image Capture Extension flags=0
Mar 4 16:57:54 --- last message repeated 1 time ---
Mar 4 16:57:54 Kroghs-iMac.local java[557]: ERROR: [ICCommandCenter launchAgent] - Failed to launch agent[1], status: -10810, url: 'file://localhost/System/Library/Image%20Capture/Support/Image%20Capture%20Exte nsion.app/'
Mar 4 16:57:54 Kroghs-iMac.local java[557]:
***** Failed to launch Image Capture Extension.
Mar 4 16:57:54 Kroghs-iMac.local java[557]: spawn_via_launchd() failed, errno=1 label=[0x0-0x99099].com.apple.ImageCaptureExtension2 path=/System/Library/Image Capture/Support/Image Capture Extension.app/Contents/MacOS/Image Capture Extension flags=0
Mar 4 16:57:54 --- last message repeated 1 time ---
Mar 4 16:57:54 Kroghs-iMac.local java[557]: ERROR: [ICCommandCenter launchAgent] - Failed to launch agent[1], status: -10810, url: 'file://localhost/System/Library/Image%20Capture/Support/Image%20Capture%20Exte nsion.app/'
Mar 4 16:57:54 Kroghs-iMac.local java[557]:
***** Failed to launch Image Capture Extension.
Mar 4 16:57:54 Kroghs-iMac.local java[557]: spawn_via_launchd() failed, errno=1 label=[0x0-0x9a09a].com.apple.ImageCaptureExtension2 path=/System/Library/Image Capture/Support/Image Capture Extension.app/Contents/MacOS/Image Capture Extension flags=0
Mar 4 16:57:54 --- last message repeated 1 time ---
Mar 4 16:57:54 Kroghs-iMac.local java[557]: ERROR: [ICCommandCenter launchAgent] - Failed to launch agent[1], status: -10810, url: 'file://localhost/System/Library/Image%20Capture/Support/Image%20Capture%20Exte nsion.app/'
Mar 4 16:57:54 Kroghs-iMac.local java[557]:
***** Failed to launch Image Capture Extension.
Mar 4 16:57:55 Kroghs-iMac.local java[557]: Printing failed because PMSessionBeginCGDocumentNoDialog() returned -108.
I've removed the Adobe plug-ins from /Library/Plug-Ins
Print->Save to PDF works from Safari when I am on a regular webpage.
Print->Save to PDF works from Pages
Help! I want to make Wordles for the teachers at my kids school for Teacher Appreciation Week.YES!!!!!!!
I was pulling my hair out last night over this. I noticed the Find function was not working properly. I KNEW there was something in the PDF and Preview was not showing it. I spent 2 hours trying to find someone with a similar Find function problem, but could not find much. Also, it could not copy and paste text. I KNOW it worked before because I had taken notes on this particular PDF and had copy and pasted whole paragraphs for myself into Pages. Which is what got me searching online tonight.
I re-downloaded the same PDF. When first opened in Preview, the Find and copy/paste functions worked. Same thing in Acrobat reader and Acrobat Pro. After confirming this, I re-opened it in Preview, highlighted some text and closed. It asked to Save Changes and I did. I immediately re-opened it, and guess what? Find no longer works and neither does copy/paste. Just to be sure, I tried re-opening in Acrobat reader and Pro; same thing. No copy/paste, corrupted Find feature. Well, copy/paste sort of functions, its just that it pastes a square with an alien head in it that says "Private Use 100000 Plane 16".
And finally, on some PDFs that have not even been saved in Preview, the Find function is not working properly also. It happened on the re-downloaded PDF I just talked about. It finds many instances of the word, bit the left and right arrows next to "Found on X# Pages are greyed out and do not move through the document. Once I go to the left pane that displays page thumbnails and click on a few different ones, THEN it starts working.
So yes, Apple, Preview is corrupting PDF files upon save, AND it is not working properly on other files. Please fix this. PLEASE.
And my specs are the same as Gary; iMac 27 inch Late 2009, Yosemite 10.10.1. Is ANYONE else having this issue with a different Mac? -
Bug: Java applet cannot print, even with print permission granted.
I was not able to file this bug report at the official Apple bug report site, so...
Summary:
When a java applet initiates a print job, the user is (correctly) presented with a dialog requesting permission for printing. Once permission is granted, the printing subsystem attempts to communicate with CUPS at localhost:631, and permission is denied. To the naive user, it appears that the applet is broken.
Steps to Reproduce:
Go to
http://www.wordle.net/gallery/wrdl/921427/WordleCore_SourceCode
Once the applet has loaded, click the button labelled "Print...".
Expected Results:
After permitting printing, the user should see the print dialog, and printing should proceed as normal.
Actual Results:
Here is the relevant section of the stack trace generated when this happens:
<pre>java.security.AccessControlException: access denied
(java.net.SocketPermission localhost:631 connect,resolve)
at java.security.AccessControlContext.checkPermission
(AccessControlContext.java:264)
at java.security.AccessController.checkPermission
(AccessController.java:427)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:
532)
at java.lang.SecurityManager.checkConnect(SecurityManager.java:1034)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:521)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
at sun.net.www.http.HttpClient.New(HttpClient.java:304)
at sun.net.www.http.HttpClient.New(HttpClient.java:321)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient
(HttpURLConnection.java:813)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect
(HttpURLConnection.java:765)
at sun.net.www.protocol.http.HttpURLConnection.connect
(HttpURLConnection.java:690)
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream
(HttpURLConnection.java:857)
at sun.print.IPPPrintService.opGetAttributes(IPPPrintService.java:
1419) </pre>
Regression:
This problem was introduced only with the most recent Java update.
Notes:
There is no workaround for the applet author, other than to use a signed applet, which is prohibitively expensive, and which should not be required for printing, anyway. It's difficult to instruct the user in how to grant the appropriate permissions via policy files, since the finder will not allow a user to create a file named ".java.policy" in their home directory, and since the system policy file is write-protected.Jonathan Feinberg wrote:
I was not able to file a bug report
You should file a bug report with Apple at http://bugreport.apple.com if you have a developer account or at http://www.apple.com/feedback/macosx.html if you do not have a developer account.
Good luck w/your issue and please update this thread if you encounter a solution. -
Java Applet not kicking off thru "Self Service"
Cloned New Application Environment using production alike environment, I could login and navigate and view forms for various application users.
But After login thru self service and click on any options under right panel, it hangs with out kicking off Java Applet and next screens.
Any help is highly appreciated.
Regards
Raosorry, I could login and navigate and view forms for various application users using normal login "host:8582/dev60cgi/f60cgi?" But not thru self service.
Thanks -
Hello i was wondering is there a way to have a java applet print to a printer?
Yes.Depending on what the applet is - a GUI or not?, the details are different. There are many, many existing threads about how to print from Java, try looking at some of them (that is, search for them.)
-
Java Applet - Printing Pdf Files
Hi
Can anyone suggest me some libraries to print pdfs using Java Applets. I have tried using the SmartJPrint library but its giving me error when I try printing pdfs using applets.
Thanks
nikhilSmartJPrint web applets have changed recently and works to be fine every time. You might try these links for printing of existing pdf, pdf viewing, pdf print, pdf silent printing from a command line or silently printing a pdf from a browser page.
http://www.activetree.com
Demo that print a PDF from a browser page silently.
[This demo printing control parameters as part of the PDF url. Interestingly this pdf print demo from browser works for a remote PDF URL that dynamically generate a PDF and then prints to the printer. In this demo you have the option to enter your URL that is either a PDF or a PDF generating URL that eventually generates a PDF and then prints.]
http://www.activetree.com/silent_print_from_browser1/start.jsp
[PDF print silently or using user choice dialog from the applet. PDF printing parameters such as printer name, auto page size detection, paper size selection, fit to page etc. are made as choice. This demo too print a PDF or more than one PDF as a batch pdf print. You have chice to submit the pdf print job as a separate print job or as one pdf print job.]
http://www.activetree.com/silent_print_from_browser2/start.jsp
These two links are opening their PDF viewer applet for viewing your local or remote PDF files.
http://www.activetree.com/demo/pdfapplet/pdfviewer.jsp [Open the PDF viewer inside the browser frame itself. When browser resize the applet resize too.]
http://www.activetree.com/demo/pdfapplet/pdf_viewer_no_frame.jsp [Opens the PDF viewer in a new Java frame window]
Edited by: jatima123 on Nov 20, 2007 10:19 AM -
Problem Launching Java Applet with Plug-in: Version 1.4.2_01
Hello out there:
I recently installed j2re-1.4.2_01 on my home computer but have been unable to access Web sites emmploying JAva applets. The following is an email exchange with Jeff Hall of Lowell Observatory, manager of an educational site hosted by Lowell, trying to resolve my problem. The messages are better understood if read in reverse order.
I'm hoping that someone will recognize the source of my problem and can recommmend a solution. I would appreciate any help offered.
Thanks,
Mike Coucke
Hi Jeff:
Well, I guess the problem lies with me somewhere. Here's my answer/status to your questions/suggestions:
1) I'm using MS Windows Me version 4.90.3000
2) I do have the directory C:\Windows\.jpi_cache\jar\, but the only thing in it is an empty folder labeled "1.0". The file LP.jar does not exist anywhere on my hard drive.
3) I tried several game sites that utilized Java applets and got the same results: the Java cup in the upper left corner followed a few seconds later by the red "X". So, evidently the problem is somewhere on my end.
I'm going to post our email exchanges in a Java Users Forum managed by Sun to see if anyone out there can solve my problem. However, if you have any more suggestions, I'll be glad to try them.
Thanks for the help.
Mike Coucke
[email protected]
----- Original Message -----
From: "Jeffrey Hall" <[email protected]>
To: "'Mike Coucke'" <[email protected]>
Sent: Friday, September 05, 2003 1:02 PM
Subject: RE: Registration with Lowell Education Online
Mike,
Rats! What version of Windows are you using? It's a little strange to
see the user directory set to C:\Windows; if you're using XP, I'd expect
it to be something like C:\Documents and Settings\Mike Coucke. In any
event, the output that is of concern is these two lines:
java.lang.ClassNotFoundException: LPRemote.class
Caused by: java.net.UnknownHostException: proxy
It looks like your browser is not finding our server's IP when it comes
time to download the necessary Java code.
LPRemote.class is the fundamental code that runs LOPARC, and your
browser should be downloading it automatically when you click connect.
LPRemote.class is stored along with a bunch of other classes in a file
called "LP.jar" that you download from our server. So, if you go to C:
in Windows Explorer and do a file search for LP.jar, you should find it.
On my machine, it's stored in a directory called ".jpi_cache\jar\" in my
user home directory. Let me know if you have this file, or the
jpi-cache directory.
One other thing you might try is going to a different site that you know
uses Java applets -- I think some of the online game rooms at Yahoo use
Java. See if other sites that use Java load correctly. Then we'll know
if it's our server specifically, or a more general problem on your end.
Jeff Hall
Lowell Observatory
Hello Jeff:
I still have the Java "blues". I followed your instructions, but am still unable to launch a LOPARC session. After an initial failure, I uninstalled all three Java versions I had (1.4.0, 1.4.1, 1.4.2), then reinstalled 1.4.2_01 from the Sun website.
Now, when I try to launch LOPARC, I initially get a blank window with the Java cup in the upper left corner. After about 20 seconds, the cup changes to a red "X". During those 20 seconds, the following appear in the IE message bar at the bottom of the window: "Applet LPRemote notinited" (their spelling) which changes to "Loading Java Applet Failed..." when the red "X" appears.
Following is a copy of the log from my Java Console during all of this:
Java(TM) Plug-in: Version 1.4.2_01
Using JRE version 1.4.2_01 Java HotSpot(TM) Client VM
User home directory = C:\WINDOWS
Proxy Configuration: Manual Configuration
Proxy: http=proxy,https=proxy,ftp=proxy,gopher=proxy
Proxy Overrides:
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
load: class LPRemote.class not found.
java.lang.ClassNotFoundException: LPRemote.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: proxy
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.http.HttpClient.privilegedOpenServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.net.www.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.<init>(Unknown Source)
at sun.plugin.net.protocol.http.HttpClient.New(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.createConnection(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.connect(Unknown Source)
at sun.plugin.net.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 10 more
I followed this up by executing the following three console commands:
"dump system properties"
"dump classholder list"
"dump thread list"
and obtained the following listings:
Dump system properties ...
acl.read = +
acl.read.default =
acl.write = +
acl.write.default =
application.home = C:\PROGRA~1\JAVA\J2RE14~1.2_0
awt.toolkit = sun.awt.windows.WToolkit
browser = sun.plugin
browser.vendor = Sun Microsystems, Inc.
browser.version = 1.1
deployment.javaws.cache.dir = C:\WINDOWS\.javaws\cache
deployment.javaws.jre.0.enabled = true
deployment.javaws.jre.0.location = http://java.sun.com/products/autodl/j2se
deployment.javaws.jre.0.osarch = x86
deployment.javaws.jre.0.osname = Windows
deployment.javaws.jre.0.path = C:\Program Files\Java\j2re1.4.2_01\bin\javaw.exe
deployment.javaws.jre.0.platform = 1.4
deployment.javaws.jre.0.product = 1.4.2_01
deployment.javaws.jre.0.registered = true
deployment.javaws.version = javaws-1.4.2_01
deployment.system.cacerts = C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\security\cacerts
deployment.system.home = C:\WINDOWS\Sun\Java\Deployment
deployment.system.jssecacerts = C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\security\cacerts
deployment.system.profile = C:\WINDOWS
deployment.system.security.policy = file:/C:/WINDOWS/Sun/Java/Deployment/security/java.policy
deployment.user.cachedir = C:\WINDOWS\Application Data\Sun\Java\Deployment\cache
deployment.user.certs = C:\WINDOWS\Application Data\Sun\Java\Deployment\security\deployment.certs
deployment.user.extdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\ext
deployment.user.home = C:\WINDOWS\Application Data\Sun\Java\Deployment
deployment.user.jssecerts = C:\WINDOWS\Application Data\Sun\Java\Deployment\security\deployment.jssecerts
deployment.user.logdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\log
deployment.user.profile = C:\WINDOWS\Application Data
deployment.user.security.policy = file:/C:/WINDOWS/Application%20Data/Sun/Java/Deployment/security/java.policy
deployment.user.tmpdir = C:\WINDOWS\Application Data\Sun\Java\Deployment\cache\tmp
file.encoding = Cp1252
file.encoding.pkg = sun.io
file.separator = \
file.separator.applet = true
http.agent = Mozilla/4.0 (Windows Me 4.90)
http.auth.serializeRequests = true
https.protocols = SSLv3,SSLv2Hello
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = C:\PROGRA~1\JAVA\J2RE14~1.2_0\classes
java.class.version = 48.0
java.class.version.applet = true
java.endorsed.dirs = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\endorsed
java.ext.dirs = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\ext
java.home = C:\PROGRA~1\JAVA\J2RE14~1.2_0
java.io.tmpdir = C:\WINDOWS\TEMP\
java.library.path = D:\PROGRAM FILES\INTERNET EXPLORER 6;.;C:\WINDOWS\SYSTEM;C:\WINDOWS;D:\PROGRA~1\INTERN~1;;C:\WINDOWS;C:\WINDOWS\COMMAND
java.protocol.handler.pkgs = sun.plugin.net.protocol|sun.plugin.net.protocol
java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version = 1.4.2_01-b06
java.specification.name = Java Platform API Specification
java.specification.vendor = Sun Microsystems Inc.
java.specification.version = 1.4
java.util.prefs.PreferencesFactory = java.util.prefs.WindowsPreferencesFactory
java.vendor = Sun Microsystems Inc.
java.vendor.applet = true
java.vendor.url = http://java.sun.com/
java.vendor.url.applet = true
java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.4.2_01
java.version.applet = true
java.vm.info = mixed mode
java.vm.name = Java HotSpot(TM) Client VM
java.vm.specification.name = Java Virtual Machine Specification
java.vm.specification.vendor = Sun Microsystems Inc.
java.vm.specification.version = 1.0
java.vm.vendor = Sun Microsystems Inc.
java.vm.version = 1.4.2_01-b06
javaplugin.maxHeapSize = 96m
javaplugin.nodotversion = 142_01
javaplugin.proxy.config.list = http=proxy,https=proxy,ftp=proxy,gopher=proxy
javaplugin.proxy.config.type = manual
javaplugin.version = 1.4.2_01
javaplugin.vm.options = -Djava.class.path=C:\PROGRA~1\JAVA\J2RE14~1.2_0\classes -Xbootclasspath/a:C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\plugin.jar -Xmx96m -Djavaplugin.maxHeapSize=96m -Xverify:remote -Djavaplugin.version=1.4.2_01 -Djavaplugin.nodotversion=142_01 -Dbrowser=sun.plugin -DtrustProxy=true -Dapplication.home=C:\PROGRA~1\JAVA\J2RE14~1.2_0 -Djava.protocol.handler.pkgs=sun.plugin.net.protocol
line.separator = \r\n
line.separator.applet = true
os.arch = x86
os.arch.applet = true
os.name = Windows Me
os.name.applet = true
os.version = 4.90
os.version.applet = true
package.restrict.access.netscape = false
package.restrict.access.sun = true
package.restrict.definition.java = true
package.restrict.definition.netscape = true
package.restrict.definition.sun = true
path.separator = ;
path.separator.applet = true
sun.arch.data.model = 32
sun.boot.class.path = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\rt.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\i18n.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\sunrsasign.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\jsse.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\jce.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\lib\charsets.jar;C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\classes;C:\PROGRA~1\JAVA\J2RE14~1.2_0\lib\plugin.jar
sun.boot.library.path = C:\PROGRAM FILES\JAVA\J2RE1.4.2_01\bin
sun.cpu.endian = little
sun.cpu.isalist = pentium i486 i386
sun.io.unicode.encoding = UnicodeLittle
sun.java2d.fontpath =
sun.net.client.defaultConnectTimeout = 120000
sun.os.patch.level =
trustProxy = true
user.country = US
user.dir = C:\WINDOWS\Desktop
user.home = C:\WINDOWS
user.language = en
user.name = Michael G. Coucke
user.timezone =
user.variant =
Done.
Dump classloader list ...
codebase=http://kraken.lowell.edu/, key=http://kraken.lowell.edu/,IONJava/classes/ion_16.jar,IONJava/classes/LP.jar, zombie=false, cache=true, refcount=1, info=sun.plugin.ClassLoaderInfo@109de5b
Done.
Dump thread list ...
Group main,ac=11,agc=2,pri=10
main,5,alive
AWT-Windows,6,alive,dameon
AWT-Shutdown,5,alive
Java2D Disposer,10,alive,dameon
AWT-EventQueue-0,6,alive
Group Plugin Thread Group,ac=3,agc=0,pri=10
Main Console Writer,6,alive
AWT-EventQueue-1,6,alive
TimerQueue,5,alive,dameon
Group http://kraken.lowell.edu/-threadGroup,ac=2,agc=0,pri=4
thread applet-LPRemote.class,4,alive
AWT-EventQueue-2,4,alive
Done.
I'm not a Java expert, so this may be more information than you ever wanted to see.
Once again, I hope that you can help. My experience has been that I usually have some obscure option set incorrectly and that causes me great grief.
Thanks fo your help,
Mike Coucke
[email protected]
----- Original Message -----
From: "Jeffrey Hall" <[email protected]>
To: "'Mike Coucke'" <[email protected]>
Sent: Thursday, September 04, 2003 11:48 AM
Subject: RE: Registration with Lowell Education Online
Hi Mike,
Try it now. I think this problem has arisen because Sun just
released a new version of the Plug-in (1.4.2), and when we released the
public beta of LOPARC, only one relevant version (1.4.0) was available
and the LOPARC code was written to look for that by default. I have
just recoded the relevant routines so they should now cause your browser
to simply pick up the latest 1.4 version of the Plug-in you have
installed, whatever it is. I "broke" Java on my machine to replicate
your problem, and the code I inserted today did fix it. Hopefully it
will have the same effect for you. I am running IE 6 and plugin
1.4.2_01 (as accessed via Tools->Sun Java Console).
One broader problem: some (non-LOPARC-specific) users on the Sun
forums have reported the "JRE collision" you are seeing when multiple
versions of the Plug-in are installed on the same machine. So if the
fix I made to our code doesn't work, one option would be to uninstall
all Java components from your computer and do a fresh install of the
latest runtime environment.
Let me know how/if this works. Thanks for the feedback and for your
patience.
Best regards,
Jeff Hall
Lowell Observatory
-----Original Message-----
From: Mike Coucke [mailto:[email protected]]
Sent: Wednesday, September 03, 2003 6:30 PM
To: [email protected]
Subject: Re: Registration with Lowell Education Online
Hello Jeff:
So far, I have been unable to launch a LOPARC session. I repeatedly
get the following error message:
"Exception: java.lang.ClassNotFoundException: LPRemote.class"
My browser is MS Internet Explorer version 6.0.2800.1106 Initially I was
using Java Plug-In version 1.4.1 and received the error message. I went
to the Sun website and downloaded/installed Java Plug-In version 1.4.2
and still get the message.
Before I try to launch LOPARC, I can select Tools->Sun Java Console from
IE's pull down menu to check my Java Plug-In version. When I try to
launch LOPARC, I get the following message:
"Applet(s) in this HTML page requires a version of Java different from
the one the browser is currently using. In order to run the applet(s)
in this HTML page, a new browser session is required, press 'Yes' to
start a new browser session." If I select 'No', I get the following
message: "Java Plug-in detected JRE collission"
If I select 'Yes', a new browser window opens and then I get the first
message above.
Can you help?
Mike Coucke
[email protected]
----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Monday, September 01, 2003 5:30 PM
Subject: Registration with Lowell Education Online
September 1, 2003
Dear Michael Coucke:
Thank you for registering with Lowell Observatory's online education
site. We hope you enjoy using it and visit regularly as we continue to
expand its features and capabilities. This is a one-time welcoming
email.
For your records, your user ID is xxxxx, and your password is #########.
You'll need to supply these each time you log in.
This site gives you access to research-grade equipment including a 16"
telescope, CCD detector, and image processing software. Our online
archive of data is now available 24/7. The telescope will be opening to
our onsite users in May, and on select nights to the Internet at large
in June.
We have designed this site so you don't need a huge monitor or a
supercomputer to use it. All pages are viewable on screens running at
800x600 resolution or higher. To use LOPARC, you'll need a Java-enabled
browser with the Java 1.4 plug-in installed. If you don't have the
plug-in, you'll be prompted to download it the first time you attempt to
connect. This is an admittedly large (9 MB) but one-time-only download.
This site works correctly under Internet Explorer version 5 or higher.
If you use Netscape, you must be running version 6 or higher, and
display or applet behavior anomalies may occur.
If at any time you can't connect to our server, simply try again later.
We do experience several power outages each year, particularly during
Flagstaff's summer thunderstorm season. Our server is fully protected
and backed up, and can be quickly brought back on line, but any active
user sessions will be lost. Thanks for your patience during these
inevitable downtimes.
Your questions, comments, suggestions, and bug reports about this site
are always welcome. On behalf of the LOPARC development team, thanks
for signing up!
Jeffrey Hall
Assistant Research Scientist
Associate Director, Education and Special Programs
Lowell Observatory
Flagstaff, ArizonaHi Mike,
I see this in your logs:
Java(TM) Plug-in: Version 1.4.2_01
Using JRE version 1.4.2_01 Java HotSpot(TM) Client VM
User home directory = C:\WINDOWS
Proxy Configuration: Manual Configuration
Proxy: http=proxy,https=proxy,ftp=proxy,gopher=proxy
Proxy Overrides:
I just helped my Dad set up his computer with a new
cable modem, and had the situation where we couldn't
access any secure Web sites. The cable folks had us
disable the proxy. It looks like the error message is
saying it can't find your proxy server, and the logs
you posted say that you've decided to configure your
proxy manually, rather than using the settings from
IE (which is how mine is set up in the plugin
control panel.)
Could that be the problem?
--Steve -
SeaMonkey v2.0.4's Java applets doesn't work all the time.
Hello. I use Mozilla's SeaMonkey v2.0.4 (using binary from mozilla.org) in Debian/Linux. I can get Java applets to work on https://eetime11.adp.com/c08e/logon but not on http://javatester.org, http://java.com/en/download/installed.jsp, and http://java.com/en/download/help/testvm.xml
Java Plug-in 1.6.0_20
Using JRE version 1.6.0_20-b02 Java HotSpot(TM) Client VM
User home directory = /home/ant
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
load: class testvm2/Main.class not found.
java.lang.ClassNotFoundException: testvm2.Main.class
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
FYI on my setups:
$ pwd
/home/Programs/seamonkey2/plugins
$ ls -all
total 28
drwxr-xr-x 2 ant ant 4096 2010-04-15 15:46 .
drwxr-xr-x 15 ant ant 4096 2010-04-16 08:32 ..
lrwxrwxrwx 1 root root 32 2009-11-27 17:19 libflashplayer.so -> /home/Programs/libflashplayer.so
lrwxrwxrwx 1 root root 63 2010-04-15 15:46 libjavaplugin_oji.so -> /home/Programs/jre1.6.0_20/plugin/i386/ns7/libjavaplugin_oji.so
-rwxr-xr-x 1 ant ant 15824 2009-10-17 09:30 libnullplugin.so
$ ls -all /home/Programs/jre1.6.0_20/plugin/i386/ns7/libjavaplugin_oji.so
-rwxr-xr-x 1 ant ant 137021 2010-04-12 14:39 /home/Programs/jre1.6.0_20/plugin/i386/ns7/libjavaplugin_oji.so
Does anyone know why? Thank you in advance. :)
Edited by: antdude on Apr 16, 2010 8:37 AMMore poking around:
$ java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8pre) (6b18~pre2-1)
OpenJDK Server VM (build 14.0-b16, mixed mode)
# dpkg -l | grep ^ii |grep java
ii ca-certificates-java 20091021 Common CA certificates (JKS keystore)
ii java-common 0.35 Base of all Java packages
ii libaccess-bridge-java 1.26.2-4 Java Access Bridge for GNOME
ii libaccess-bridge-java-jni 1.26.2-4 Java Access Bridge for GNOME (jni bindings)
ii libhsqldb-java 1.8.0.10-6 Java SQL database engine
ii liblucene2-java 2.9.2+ds1-1 Full-text search engine library for Java(TM)
ii libservlet2.4-java 5.0.30-12 Servlet 2.4 and JSP 2.0 Java library
ii openoffice.org-java-common 1:3.2.0-4 full-featured office productivity suite -- arch-independent Java support files
ii tzdata-java 2010h-1 time zone and daylight-saving time data for use by java runtimes
# dpkg -l | grep ^ii |grep jre
# locate bin/java
/home/Programs/jre1.6.0_20/bin/java
/home/Programs/jre1.6.0_20/bin/java_vm
/home/Programs/jre1.6.0_20/bin/javaws
/usr/bin/java
/usr/bin/javaws
/usr/lib/jvm/java-6-openjdk/bin/java
/usr/lib/jvm/java-6-openjdk/bin/java-rmi.cgi
/usr/lib/jvm/java-6-openjdk/bin/javaws
/usr/lib/jvm/java-6-openjdk/jre/bin/java
/usr/lib/jvm/java-6-openjdk/jre/bin/javaws
/usr/lib/jvm/java-6-openjdk/jre/bin/javaws.real
I tried to uninstall all the unneccesary Java packages, but still had some can't be removed because of other programs requiring it like OpenOffice:
# apt-get remove openjdk-6-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
openoffice.org-filter-mobiledev ttf-sil-gentium ttf-sil-gentium-basic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
ca-certificates-java libaccess-bridge-java libaccess-bridge-java-jni libhsqldb-java liblucene2-java libservlet2.4-java
openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib openoffice.org openoffice.org-base openoffice.org-officebean
openoffice.org-report-builder-bin
0 upgraded, 0 newly installed, 13 to remove and 125 not upgraded.
After this operation, 114MB disk space will be freed.
Do you want to continue [Y/n]? n
Abort.
# apt-get remove java-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
openoffice.org-filter-mobiledev ttf-sil-gentium ttf-sil-gentium-basic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
ca-certificates-java java-common libaccess-bridge-java libaccess-bridge-java-jni libhsqldb-java liblucene2-java
libservlet2.4-java openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib openoffice.org openoffice.org-base
openoffice.org-officebean openoffice.org-report-builder-bin
0 upgraded, 0 newly installed, 14 to remove and 125 not upgraded.
After this operation, 115MB disk space will be freed.
Do you want to continue [Y/n]? n
Abort.
Any ideas? :( -
Problem Running a java applet from an HTML page
I can run my applet at the command prompt with:
appletviewer coffee.html
But when I try and open the Coffee.html by opening
the page in Internet Explorer I get the following message:
Can't find Database driver class: java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
Code: createcoffees.java
import java.applet.*;
import java.sql.*;
public class CreateCoffees extends Applet{
public void init() {
Statement stmt;
Connection con;
try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
try {con = DriverManager.getConnection("jdbc:odbc:hq","afm", "afm");
stmt = con.createStatement();
stmt.executeQuery("SELECT * FROM RM");
stmt.close();
con.close();
} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
}Is your jdbc-odbc driver properly loaded? Its very clear that its a class not found exception which is thrown by this:
try {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
Maybe you are looking for
-
Servlets not working in tomcat-4.1.24
Servlets are not working in a new context which I have created in tomcat-4.1.24. if i put the same servlet in examples context it is working. jsps are working in the new context also. any idea???? binny
-
I've seen many posts regarding running a laptop on a solar panel, but none about running a Mac mini that way. Has anybody ever done that? I want to mount a Mac mini and a Canon digital camera in a tight box atop a pole to make a time-lapse movie. Bot
-
IS it possible to place symbol in new positon on the image
I have a Scnerio where in the image a symbol has moved to the new positon. Is it possible to place the symbol to new position.
-
Lockup using Dragon NaturallySpeaking
I used Dragon NaturallySpeaking to operate my computer and from time to time, Firefox will lock up if I click on a link with flash, video or a number of other animations and sometimes those without. When this happens, it too locks of my DNS leaving m
-
How to print from Lightroom 5 to Canon pro-100?
When I go to print from Lightroom, the colors on my screen look exactly as I want them. Then I have the color management set to Canon Pro-100 with the type of paper I am using (pro-luster), but when I get the printer setup on my screen, I get differe