comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * writeObject and readObject problem - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e6fc9480a3a7f42a * Opening URL's with a query component - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/815afae09d41facb * compiling java source - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9ed74ee3ba9401e9 * JSplitPane. - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ea0ec20fad5f90 * Improving website responsiveness. - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f719ebe188f50463 * Java books - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7f9c000f41c6b160 * Java implementation of crypt() wanted! - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c9d4b7c65f13df2a * A question about practical Java programming books - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d9f92694ab8e3228 * Printing with GSprint Command - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/53b5c5833e01870c * tomcat mit mehreren IP Adressen - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fda6fab03545ec5f * Why can't static methods be overridden? - 5 messages, 4 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f211d387a7676de * may be javac bug "deprecated method" - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ba3d422529efe7e6 * Strange problem with JDOM, Xerces and XML Schemas - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f772ecb11366c88c * Need a method to see how much memory is used/available on a system (f.ex. a pc). - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f195b8ef8e6afbd4 * VM Exception when Printing - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/92573fa4b89fe6e9 * Socket problem -- response slow for host with domain (on SunOS 5.8) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfb84c34caf0c9e9 * Hi , deprecated problem. - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29f429e26a464e8 ========================================================================== TOPIC: writeObject and readObject problem http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e6fc9480a3a7f42a ========================================================================== == 1 of 3 == Date: Wed, Sep 22 2004 1:40 am From: "juicy" <[EMAIL PROTECTED]> I am using Microsoft VM instead of JVM, is the exception because of no certain class in Microsoft VM? == 2 of 3 == Date: Wed, Sep 22 2004 2:12 am From: Michael Borgwardt <[EMAIL PROTECTED]> juicy wrote: > I am using Microsoft VM instead of JVM, is the exception because of no > certain class in Microsoft VM? Probably not, but again: http://www.physci.org/codes/javafaq.jsp#exact == 3 of 3 == Date: Wed, Sep 22 2004 2:34 am From: Andrew Thompson <[EMAIL PROTECTED]> On Wed, 22 Sep 2004 04:40:46 -0400, juicy wrote: > I am using Microsoft VM instead of JVM, is the exception because of no > certain class in Microsoft VM? I think the stacktrace and SSCCE will best determine that. OTOH, if you have a self-contained piece of code <10Kb, you can check it against the 1.1 VM (either 1.1.8[1] or specifically the MSVM[2]) at the Java On-Line Compiler. [1] <http://www.physci.org/javac.jsp?bcp=11> [2] <http://www.physci.org/javac.jsp?bcp=MS> HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane ========================================================================== TOPIC: Opening URL's with a query component http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/815afae09d41facb ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 1:46 am From: Andrew Thompson <[EMAIL PROTECTED]> On 22 Sep 2004 01:20:33 -0700, Hayden wrote: > I've tried: Try this instead.. <sscce> import java.net.*; import java.io.*; public class URLWithQuery { public static void main(String[] args) throws Exception { URL url = new URL("http://www.physci.org/api.jsp?class=java.awt.Frame"); URLConnection connection = url.openConnection(); BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream())); } } </sscce> Works just fine from here. I think your URL is bung. HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane ========================================================================== TOPIC: compiling java source http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9ed74ee3ba9401e9 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 1:52 am From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> Andrew Thompson <[EMAIL PROTECTED]> writes: > String args[] = new String[] { options, directory, fileName }; > com.sun.tools.javac.Main.compile(args); You also need to put tools.jar on the classpath. ========================================================================== TOPIC: JSplitPane. http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3ea0ec20fad5f90 ========================================================================== == 1 of 2 == Date: Wed, Sep 22 2004 1:53 am From: "Kalpesh Modha" <[EMAIL PROTECTED]> Hello. I have a JSplitPane as below. Now currently the right handside is a html area. What I want to do is make the right hand side load a JFrame or a class. So depending on which branch/left the user selected on the left the right class would be loaded on the right hand side. Can I do that, if so how ? JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,new JScrollPane(tree),new JScrollPane(htmlArea)); Many thanks for you help. Thanks Kalpesh Modha == 2 of 2 == Date: Wed, Sep 22 2004 2:43 am From: Babu Kalakrishnan <[EMAIL PROTECTED]> Kalpesh Modha wrote: > Hello. > > I have a JSplitPane as below. Now currently the right handside is a html > area. What I want to do is make the right hand side load a JFrame or a > class. So depending on which branch/left the user selected on the left the > right class would be loaded on the right hand side. > > Can I do that, if so how ? > Your question ( at least one part of it) doesn't make too much sense. How do you load a "class" into one pane of a JSplitPane ?? Do you mean a JPanel or something like that ? As for loading JFrames, I'm afraid it is not possible. The AWT subsystem does not allow any Component descending from java.awt.Window to be added to any other Container. So Windows, Frames and Dialogs must always be only top level containers. BK ========================================================================== TOPIC: Improving website responsiveness. http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f719ebe188f50463 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 1:58 am From: [EMAIL PROTECTED] (ras_nas) "Will Hartung" <[EMAIL PROTECTED]> wrote in message > "Rico" <[EMAIL PROTECTED]> wrote in message > What is shows is what happens when you try to fix a performance problem > without actually knowing what the performance problem is besides "it's > slow". This goes back to the sin of early optimization, which is basically > the same issue. > You need to step back and perform some analysis to get a better idea of > what's really slowing your site down. To quote Apollo 13: "Work the problem. > Don't make it worse by guessing!" Thanks for the input Will. But "It is unreasonable to make a 1000 requests on the db only to get just one string of path each time" is a far cry from "it's slow". A no-brainer really. Further, when one function turns out to run 65 times slower than my new version, I am pretty sure that my guess was a pretty good one. It's just a matter then of locating all the _variants_ of such a function whose sin is duplicated all over the place: for every little piece of info I need, ask the db - Screw computer science classes and all those stuffs about principle of locality and what not. I'll keep you Guys updated how things turn out after I've fixed that mess. Regards, Rico. ========================================================================== TOPIC: Java books http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7f9c000f41c6b160 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 2:03 am From: TechBookReport <[EMAIL PROTECTED]> Jim wrote: > Hello All, > > I am going to buy a few Java books which > covers the following topics in good detail > for intermediate to advanced programmers: > Networking > Multithreading > JDBC > Servlets and JSP > J2EE > Practical tips > GUI > > I know that there many good books in the > market and there some overlap in their > coverage, but I want to buy minimum number > books. > > Thanks for your help ! > > Jim > > Bruce Eckel's 'Thinking In Java' is pretty good for most of your list, but it doesn't really cover GUI at all (I don't really think of it as an introductory title, even though that's what it's intended to be). Although I've not looked at it yet, there's always O'Reilly's 'Java Cookbook' if you want code. Finally, one of the best intermediate/advanced Java books is still Joshua Bloch's 'Effective Java'. Take a look at the TechBookReport Java page (http://www.techbookreport.com/JavaIndex.html) for more detailed reviews. Pan ========================================================================== TOPIC: Java implementation of crypt() wanted! http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c9d4b7c65f13df2a ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 2:09 am From: Andrew Thompson <[EMAIL PROTECTED]> On Wed, 22 Sep 2004 10:00:27 +0200, Zsolt wrote: > As the original author of this thread I would like to add my comments: > > I did search (via google) for java,crypt and unix but didn't find anything > reasonable. An other reason to ask in this news group was that I hoped there > was a solution possible using just the jdk (or jce) or an other defacto > standard library. Welcome back to the thread Zsolt! We were wonderring where you were.. OK. Your answer actually opens up more questions than it answers. For example.. 1) What was your actual search string? [1] 2) If you wanted it from the standard API, why did you not specify that at the outset? I think it is safe to say that everybody here assumed you meant *any* piece of Java code that does what crypt does. (Now I look very closely at your original post I see you wrote "'the' Java implementation", but it was not clear enough that anybody else in the thread picked up on it. ) 3) Do you now have a satisfactory solution (within or beyond the standard API) 4) If so, what is it? 5) Is there anything you might do differently in future? [1] If a poster mentions.. (hypothetical) > Googling 'Java Crypt' did not show any useful hits Might then allow someone else to make the comment.. '"Java implementation" Crypt' seems to give much better hits.. Search engiines are powerful tools, but can be difficult to use, especially if you are searching on the wrong words. [ ..and I am certainly glad to see that 'sidetrack' did not discourage you from posting. ;-) ] -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane ========================================================================== TOPIC: A question about practical Java programming books http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/d9f92694ab8e3228 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 2:11 am From: TechBookReport <[EMAIL PROTECTED]> Jim wrote: > I am new to the Java programming world. I > have learned the basics of the Java language. > I am looking for some 'practical' Java > programming books. There are many excellent > java books, but all of them are about the > syntax of the language and OOP. The problem > that I, and I think many new programmers, > have is in the compiling and running even the > simplest Java programs; setting classpath, > directory structure and other practical > aspects. There are many practical programming > books for C/C++, but I haven't found any > books that covers these topics for Java. > Although setting classpath seems very easy, > but many new programmers have problem with > it. > More specifically I am looking for a book ( > or online resources, I prefer books though !) > which covers the following topics: > The java compiling and running environments, > command line arguments, tips and practical > considerations for setting environmental > variables in different platforms: Unix/Linux, > Windows, proper ways of designing directory > structures and packages, the meaning of > compile and run-time error messages; basics > of IDEs and concepts of work space and > projects, introduction to the popular IDEs, > etc > > I'd appreciate if any body can help me! > > Thanks > > Jim > > I think you're right, very often it's the mechanics that get in the way rather than the syntax. Some of the better intro books do cover this, but never in huge depth. You might want to take a look at Bruce Eckel's Thinking In Java (available for free online). The following page from Sun might also be useful for any immediate problems: http://java.sun.com/docs/books/tutorial/java/interpack/managingfiles.html HTH Pan =================================================== TechBookReport http://www.techbookreport.com/JavaIndex.html ========================================================================== TOPIC: Printing with GSprint Command http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/53b5c5833e01870c ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 2:16 am From: [EMAIL PROTECTED] (Mao) Hi. Is There a way to know if a OS process is running using some JAVA functions???? I need to know if gsprint process is running.... Best Regards ========================================================================== TOPIC: tomcat mit mehreren IP Adressen http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fda6fab03545ec5f ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 2:31 am From: [EMAIL PROTECTED] (Marcel Berneaud) Hallo, in der server.xml kann ich (beim Connector) einstellen, dass bei einem Rechner mit mehreren IP Adressen Tomcat sich nur an eine IP Adresse bindet. Zum "Shutdown" bindet er sich standardmaessig aber an alle verfuegbaren Adressen (auf Port 8005). Den Port kann ich aendern, aber wie kann ich verhindern, dass Tomcat sich an alle Adressen verbindet. Muss ich wirklich den Quellcode in "org.apache.catalina.core" "StandardServer.java" aendern??? Danke Marcel ========================================================================== TOPIC: Why can't static methods be overridden? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1f211d387a7676de ========================================================================== == 1 of 5 == Date: Wed, Sep 22 2004 2:34 am From: [EMAIL PROTECTED] >Currently the rules say that >A.something should be invoked, but if it were possible to override >something in derived classes you can bet people would then want to be able >to call derived static methods through base class references I would like to do that as well.... >which I can >only assume the Sun guys feel is much less straightforward than the >current mechanism. Why ? The method was overridden, so the derived method should be called. regards, Bernd == 2 of 5 == Date: Wed, Sep 22 2004 2:36 am From: [EMAIL PROTECTED] > It would have been clearer if Sun hadn't made the error of letting you > access static members via instance references. The latter can fool > people into thinking that they are more dynamic than they are. I agree that this is broken and should be removed. > The likely reason is that Java doesn't have "class objects" unlike > some other languages; if it had, static methods would be "virtual" > methods in these objects. (The class java.lang.Class is a metaclass.) Yes, I know this from c++ as well. And would find it useful in Java, too. Regards, Bernd == 3 of 5 == Date: Wed, Sep 22 2004 2:52 am From: "Chris Uppal" <[EMAIL PROTECTED]> [EMAIL PROTECTED] wrote: > Quite often I have a hierarchy of classes where > I want a specific accessor method to be > present in all classes. Therefore I specify > it in the base class. But the information > that this function returns only depends on the > actual class, so it should static, shouldn't it? No. The "static" concept in Java is designed to be misleading. Ask yourself these question "is /that specific/ object supposed to be able to supply the information?", and also "is /that specific/ object supposed to be the authoritative source of the information?". If the answer to the first question is yes, and especially if the answer to the second question is yes, then the method should be an instance method. The chances are that one or the other answer is yes. So, even if the method does not directly involve any specific state of any specific object, it should still be an instance method. The way I like to think of it is that the "class" is a separate object from all its instances, and that it's of a different class (one with no name), and that the static methods and fields are "really" instance members of that class object. (Smalltalk programmers will recognise this picture.) Unfortunately, that isn't how Java really works, so the picture is misleading in too many ways, but what it /does/ capture accurately is the split in responsibility between the class and any of its instances. The question is always "whose job is it so supply such-and-such information / such-and-such service?", is it the instance, or is it the class ? Looked at that way there is less confusion in the cases where -- in principle -- either /could/ supply the information/service because it's not actually instance-specific; it will normally be clear /who's/ job it is. > I ran into the neccessity to do so sometimes > during design and started wondering why Java > actually forbids it. > > Is there a specific OO reason? Yes, it's because "static" in Java has nothing to do with -- in fact is antithetical to -- OO concepts and OO programming. -- chris == 4 of 5 == Date: Wed, Sep 22 2004 3:19 am From: Joona I Palaste <[EMAIL PROTECTED]> Chris Uppal <[EMAIL PROTECTED]> scribbled the following: > [EMAIL PROTECTED] wrote: >> I ran into the neccessity to do so sometimes >> during design and started wondering why Java >> actually forbids it. >> >> Is there a specific OO reason? > Yes, it's because "static" in Java has nothing to do with -- in fact is > antithetical to -- OO concepts and OO programming. When I did my Java data structures programming laboratory, the instructor had a simple rule: "as few 'static's as possible". I wrote a Java program with only one 'static': The main() method in the central application class. I got full marks for that laboratory. -- /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/ "Shh! The maestro is decomposing!" - Gary Larson == 5 of 5 == Date: Wed, Sep 22 2004 3:19 am From: "VisionSet" <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Quite often I have a hierarchy of classes where > I want a specific accessor method to be > present in all classes. Therefore I specify > it in the base class. But the information > that this function returns only depends on the > actual class, so it should static, shouldn't it? > > I ran into the neccessity to do so sometimes > during design and started wondering why Java > actually forbids it. > > Is there a specific OO reason? > I find it helpful to think of static as per inheritence hierachy rather than per class. -- Mike W ========================================================================== TOPIC: may be javac bug "deprecated method" http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ba3d422529efe7e6 ========================================================================== == 1 of 3 == Date: Wed, Sep 22 2004 3:05 am From: [EMAIL PROTECTED] (Peter) import javax.swing.*; import javax.swing.border.*; import javax.swing.plaf.basic.*; public class PComboBox_ComboPopup extends javax.swing.plaf.basic.BasicComboPopup { Border border1; public PComboBox_ComboPopup(JComboBox comboBox) { super(comboBox); } public void show() { } } The jdk 1.4.2 said : Note: PComboBox_ComboPopup.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. because i override the "publid void show()" method, but i have checked the manual, the show method is not deprecated. Is it s bug of javac? thanks from Peter ([EMAIL PROTECTED]) == 2 of 3 == Date: Wed, Sep 22 2004 3:15 am From: "VisionSet" <[EMAIL PROTECTED]> "Peter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > The jdk 1.4.2 said : > Note: PComboBox_ComboPopup.java uses or overrides a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > > because i override the "publid void show()" method, but i have checked > the manual, the show method is not deprecated. Is it s bug of javac? Well it override show() in Component which it probably calls. So no, no bug. -- Mike W == 3 of 3 == Date: Wed, Sep 22 2004 3:40 am From: Andrew Thompson <[EMAIL PROTECTED]> On 22 Sep 2004 03:05:56 -0700, Peter wrote: > because i override the "publid void show()" method, but i have checked > the manual, the show method is not deprecated. Wrong manual (or wrong version of manual) <http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Window.html#show()> HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.lensescapes.com/ Images that escape the mundane ========================================================================== TOPIC: Strange problem with JDOM, Xerces and XML Schemas http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f772ecb11366c88c ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 3:17 am From: Waxolunist <[EMAIL PROTECTED]> On Fri, 10 Sep 2004 16:19:32 +0200, Soeren <[EMAIL PROTECTED]> wrote: May a code-sample could help. -- mfg, Christian Using Opera's revolutionary e-mail client: http://www.opera.com/m2/ ========================================================================== TOPIC: Need a method to see how much memory is used/available on a system (f.ex. a pc). http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f195b8ef8e6afbd4 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 3:25 am From: "Kjetil" <[EMAIL PROTECTED]> Hi! I'm trynig to find a method to check how much memory is available or used on the system. Usage is on digital tv set top boxes to check whether all resources are released when an application is terminated. Something like this would be great: System.out.println( getMemory() ); <application starts> <application is destroyed> System.out.println( getMemory() ); :-) Thanks for answers! Regards Kjetil Klove Oslo, Norway ========================================================================== TOPIC: VM Exception when Printing http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/92573fa4b89fe6e9 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 3:31 am From: [EMAIL PROTECTED] (Maureen) Hi, I have 2 clients each using the HP USB printers, and both have the same problem. Please can someone tell me what the problem is, or at least let me know where I can go to get some answers. Operating system: Windows 98 JRE :1.4.2 (downloaded yesterday 2004/09/21) Printer :HP 1110 and HP 1010 - USB Same code works without a problem on Windows 98, Printer HP Deskjet 540, Lexmark and some others. Same code also works on Windows 2000 Printer HP Deskjet 540 The problem: An unexpected exception has been detected in native code outside the VM. Unexpected Signal : EXCEPTION_FLT_INVALID_OPERATION (0xc0000090) occurred at PC=0x80426F1 Function=[Unknown.] Library=(N/A) NOTE: We are unable to locate the function name symbol for the error just occurred. Please refer to release documentation for possible reason and solutions. Current Java thread: at java.awt.font.TextLayout$OptInfo.create(TextLayout.java:331) at java.awt.font.TextLayout.fastInit(TextLayout.java:689) at java.awt.font.TextLayout.<init>(TextLayout.java:476) at sun.print.PeekGraphics.drawString(PeekGraphics.java:850) at MW.framework.print.DefaultPrintableHeader.print(Unknown Source) at MW.framework.print.DefaultPrintable.print(Unknown Source) at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1512) at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1110) at MW.framework.print.WPrintController.reply(Unknown Source) at MW.framework.general.SwitchingService.b(Unknown Source) at MW.framework.general.SwitchingService.c(Unknown Source) at MW.framework.general.d.run(Unknown Source) Dynamic libraries: 0x7CC00000 - 0x7CC1D000 C:\WINDOWS\SYSTEM\IMAGEHLP.DLL Heap at VM Abort: Heap def new generation total 4672K, used 3801K [0x10010000, 0x10520000, 0x109e0000) eden space 4160K, 85% used [0x10010000, 0x10384b78, 0x10420000) from space 512K, 51% used [0x104a0000, 0x104e19f8, 0x10520000) to space 512K, 0% used [0x10420000, 0x10420000, 0x104a0000) tenured generation total 60544K, used 8064K [0x109e0000, 0x14500000, 0x18010000) the space 60544K, 13% used [0x109e0000, 0x111c02c8, 0x111c0400, 0x14500000) compacting perm gen total 10496K, used 10399K [0x18010000, 0x18a50000, 0x1c010000) the space 10496K, 99% used [0x18010000, 0x18a37e58, 0x18a38000, 0x18a50000) Local Time = Wed Sep 22 11:26:54 2004 Elapsed Time = 60 # # The exception above was detected in native code outside the VM # # Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 interpreted mode) # Many thanks Maureen ========================================================================== TOPIC: Socket problem -- response slow for host with domain (on SunOS 5.8) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/bfb84c34caf0c9e9 ========================================================================== == 1 of 1 == Date: Wed, Sep 22 2004 3:44 am From: Nigel Wade <[EMAIL PROTECTED]> Nishi Bhonsle wrote: > > Hi: > > I have a servlet application deployed in OC4J. One of the page of the application takes the value for a smtpServer entered by the user from the client(value is a string), checks whether the value is valid in the following backend code -- > > try > { > //if you can open a socket on the smtp host at port 25, then it is a valid smtp host > Socket smtpSocket = new smtpSocket("smtpServerVal", 25); > ... > ... > } > catch(UnknownHostException uhe) > { > .. > .... > } > catch(IOException ioe) > { > ... > ... > } > where smtpServerVal is the value entered through the client UI(browser). > > I noticed that when I pass > Socket smtpSocket = new smtpSocket("yahoo", 25); > I get the UnknownHostException immediately(response is quick) and the page returns. > > But when I pass > Socket smtpSocket = new smtpSocket("yahoo.com", 25); > The response of IOException takes a rather long time.. i.e. the page takes almost after 30 secs or more to return. > > I observe this slower response only when the backend code is run on a solaris 8 machine, not on windows XP or 2000. > Is this a known issue? How can I resolve this if any? > > Thanks, Nishi. Most likely one of two issues is involved here. The first is DNS. Any time a failure takes "around 30s" I think DNS. This is the usual timeout for the resolver libraries if they get no response from a DNS server. Check whether DNS is working correctly on the Solaris machine. The second issue is firewalls. If there's a firewall in the way which drops rather than rejects packets destined for port 25 then you'll get a timeout delay. But I'd expect that to be considerably longer than 30s. Of course it could be a combination of the two, a firewall which is dropping/rejecting the DNS responses from the DNS server... Without knowing what the constructor for smtpServer(String,int) does I can't say more. -- Nigel Wade, System Administrator, Space Plasma Physics Group, University of Leicester, Leicester, LE1 7RH, UK E-mail : [EMAIL PROTECTED] Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555 ========================================================================== TOPIC: Hi , deprecated problem. http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e29f429e26a464e8 ========================================================================== == 1 of 2 == Date: Wed, Sep 22 2004 3:48 am From: [EMAIL PROTECTED] (Peter) Hi Here is my code: import javax.swing.*; import javax.swing.border.*; import javax.swing.plaf.basic.*; public class PComboBox_ComboPopup extends BasicComboPopup { Border border1; public PComboBox_ComboPopup(JComboBox comboBox) { super(comboBox); BasicComboPopup a=new BasicComboPopup(comboBox); a.show(); } public void show() { } } compiled by: C:\>javac PComboBox_ComboPopup.java Note: PComboBox_ComboPopup.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. The compile warn me because i overrided a deprecated method (but i have checked the manual, show is not a deprecated method in class BasicComboPopup). Why don't the compile warn me i called a deprecated method?? Is it a bug? i am using jdk 1.4.2 thanks from Peter ([EMAIL PROTECTED]) == 2 of 2 == Date: Wed, Sep 22 2004 3:59 am From: JScoobyCed <[EMAIL PROTECTED]> Peter wrote: > Hi Hi, > > The compile warn me because i overrided a deprecated method (but i > have checked the manual, show is not a deprecated method in class > BasicComboPopup). > Yes, but the method show() in Component *is* deprecated. Thus the warning note in the compiler. -- JScoobyCed What about a JScooby snack Shaggy ? ... Shaggy ?! ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
